-#ifdef INTERFACE
-CLASS(Nexposee) EXTENDS(Container)
+#ifndef ITEM_NEXPOSEE_H
+#define ITEM_NEXPOSEE_H
+#include "container.qc"
+CLASS(Nexposee, Container)
METHOD(Nexposee, draw, void(entity))
METHOD(Nexposee, keyDown, float(entity, float, float, float))
METHOD(Nexposee, keyUp, float(entity, float, float, float))
ENDCLASS(Nexposee)
void ExposeeCloseButton_Click(entity button, entity other); // un-exposees the current state
-#endif
// animation states:
// 0 = thumbnails seen
// 2 = zoomed in
// 3 = zooming out
// animation factor: 0 = minimum theSize, 1 = maximum theSize
-
-#ifdef IMPLEMENTATION
-
.vector Nexposee_initialSize;
.vector Nexposee_initialFontScale;
.vector Nexposee_initialOrigin;
.vector Nexposee_align;
.float Nexposee_animationFactor;
+#endif
+
+#ifdef IMPLEMENTATION
void Nexposee_close(entity me)
{
// user must override this
{
e.Nexposee_smallOrigin = (e.Nexposee_initialOrigin - e.Nexposee_scaleCenter) * scale + e.Nexposee_scaleCenter;
e.Nexposee_smallSize = e.Nexposee_initialSize * scale;
- if(e.Nexposee_align_x > 0)
- e.Nexposee_smallOrigin_x = 1 - e.Nexposee_align_x * scale;
- if(e.Nexposee_align_x < 0)
- e.Nexposee_smallOrigin_x = -e.Nexposee_smallSize_x + e.Nexposee_align_x * scale;
- if(e.Nexposee_align_y > 0)
- e.Nexposee_smallOrigin_y = 1 - e.Nexposee_align_y * scale;
- if(e.Nexposee_align_y < 0)
- e.Nexposee_smallOrigin_y = -e.Nexposee_smallSize_y + e.Nexposee_align_y * scale;
+ if(e.Nexposee_align.x > 0)
+ e.Nexposee_smallOrigin_x = 1 - e.Nexposee_align.x * scale;
+ if(e.Nexposee_align.x < 0)
+ e.Nexposee_smallOrigin_x = -e.Nexposee_smallSize.x + e.Nexposee_align.x * scale;
+ if(e.Nexposee_align.y > 0)
+ e.Nexposee_smallOrigin_y = 1 - e.Nexposee_align.y * scale;
+ if(e.Nexposee_align.y < 0)
+ e.Nexposee_smallOrigin_y = -e.Nexposee_smallSize.y + e.Nexposee_align.y * scale;
}
}
// for which suffices
// bmins < amaxs
// amins < bmaxs
- if((e2mins_x - emaxs_x) * (emins_x - e2maxs_x) > 0) // x overlap
- if((e2mins_y - emaxs_y) * (emins_y - e2maxs_y) > 0) // y overlap
+ if((e2mins.x - emaxs.x) * (emins.x - e2maxs.x) > 0) // x overlap
+ if((e2mins.y - emaxs.y) * (emins.y - e2maxs.y) > 0) // y overlap
{
goto have_overlap;
}
me.setAlphaOf(me, e, e.Container_alpha * (1 - f) + a * f);
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;
+ e.Container_fontscale_x = fs.x * e.Nexposee_initialFontScale.x;
+ e.Container_fontscale_y = fs.y * e.Nexposee_initialFontScale.y;
}
SUPER(Nexposee).draw(me);
Nexposee_mouseMove(me, pos);
if(me.mouseFocusedChild)
{
+ m_play_click_sound(MENU_SOUND_OPEN);
me.animationState = 1;
SUPER(Nexposee).setFocus(me, NULL);
}
{
if (!(SUPER(Nexposee).mousePress(me, pos)))
{
+ m_play_click_sound(MENU_SOUND_CLOSE);
me.animationState = 3;
SUPER(Nexposee).setFocus(me, NULL);
}
default:
case 0:
case 3:
+ m_play_click_sound(MENU_SOUND_OPEN);
me.animationState = 1;
break;
case 1:
case 2:
+ m_play_click_sound(MENU_SOUND_CLOSE);
me.animationState = 3;
break;
}