#ifdef IMPLEMENTATION
.vector Nexposee_initialSize;
+.vector Nexposee_initialFontScale;
.vector Nexposee_initialOrigin;
.float Nexposee_initialAlpha;
void Nexposee_resizeNotify(entity me, vector relOrigin, vector relSize, vector absOrigin, vector absSize)
{
me.calc(me);
- me.resizeNotifyLie(me, relOrigin, relSize, absOrigin, absSize, Nexposee_initialOrigin, Nexposee_initialSize);
+ me.resizeNotifyLie(me, relOrigin, relSize, absOrigin, absSize, Nexposee_initialOrigin, Nexposee_initialSize, Nexposee_initialFontScale);
}
void Nexposee_Calc_Scale(entity me, float scale)
float a0;
entity e;
float f;
+ vector fs;
if(me.animationState == -1)
{
me.animationState = 0;
}
- //print(ftos(me.animationState), "\n");
-
f = min(1, frametime * 5);
switch(me.animationState)
{
}
me.setAlphaOf(me, e, e.Container_alpha * (1 - f) + a * f);
- e.Container_fontscale = globalToBoxSize(e.Container_size, e.Nexposee_initialSize);
+ fs = globalToBoxSize(e.Container_size, e.Nexposee_initialSize);
+ e.Container_fontscale_x = fs_x * e.Nexposee_initialFontScale_x;
+ e.Container_fontscale_y = fs_y * e.Nexposee_initialFontScale_y;
}
SUPER(Nexposee).draw(me);
-};
+}
float Nexposee_mousePress(entity me, vector pos)
{
}
else if(me.animationState == 2)
{
- if not(SUPER(Nexposee).mousePress(me, pos))
+ if (!(SUPER(Nexposee).mousePress(me, pos)))
{
me.animationState = 3;
SUPER(Nexposee).setFocus(me, NULL);
if(me.animationState == 0)
{
if(me.mouseFocusedChild)
- if(me.mouseFocusedChild != e)
+ if(me.mouseFocusedChild != e || me.mouseFocusedChild != me.selectedChild)
me.selectedChild = me.mouseFocusedChild;
return 1;
}
float Nexposee_keyDown(entity me, float scan, float ascii, float shift)
{
- float nexposeeKey;
+ float nexposeeKey = 0;
if(me.animationState == 2)
if(SUPER(Nexposee).keyDown(me, scan, ascii, shift))
return 1;
{
if(me.selectedChild)
me.selectedChild = me.selectedChild.prevSibling;
- if not(me.selectedChild)
+ if (!me.selectedChild)
me.selectedChild = me.lastChild;
}
else
{
if(me.selectedChild)
me.selectedChild = me.selectedChild.nextSibling;
- if not(me.selectedChild)
+ if (!me.selectedChild)
me.selectedChild = me.firstChild;
}
}
}
switch(me.animationState)
{
+ default:
case 0:
case 3:
- nexposeeKey = ((scan == K_SPACE) || (scan == K_ENTER));
+ nexposeeKey = ((scan == K_SPACE) || (scan == K_ENTER) || (scan == K_KP_ENTER));
break;
case 1:
case 2:
{
switch(me.animationState)
{
+ default:
case 0:
case 3:
me.animationState = 1;
}
if(me.focusedChild)
me.selectedChild = me.focusedChild;
- if not(me.selectedChild)
+ if (!me.selectedChild)
me.animationState = 0;
SUPER(Nexposee).setFocus(me, NULL);
return 1;
void Nexposee_addItem(entity me, entity other, vector theOrigin, vector theSize, float theAlpha)
{
SUPER(Nexposee).addItem(me, other, theOrigin, theSize, theAlpha);
+ other.Nexposee_initialFontScale = other.Container_fontscale;
other.Nexposee_initialSize = other.Container_size;
other.Nexposee_initialOrigin = other.Container_origin;
other.Nexposee_initialAlpha = other.Container_alpha;
+ if(other.Nexposee_initialFontScale == '0 0 0')
+ other.Nexposee_initialFontScale = '1 1 0';
}
void Nexposee_focusEnter(entity me)