]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/menu/item/nexposee.qc
Merge branch 'TimePath/qc_updates' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / menu / item / nexposee.qc
index 79a294a3c90df26c618f9656c9888f9c6e65fa50..69d54b7a0733e6d6b766f88b385906237e6a4fb7 100644 (file)
@@ -1,5 +1,7 @@
-#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))
@@ -23,7 +25,6 @@ CLASS(Nexposee) EXTENDS(Container)
 ENDCLASS(Nexposee)
 
 void ExposeeCloseButton_Click(entity button, entity other); // un-exposees the current state
-#endif
 
 // animation states:
 //   0 = thumbnails seen
@@ -31,9 +32,6 @@ void ExposeeCloseButton_Click(entity button, entity other); // un-exposees the c
 //   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;
@@ -47,6 +45,9 @@ void ExposeeCloseButton_Click(entity button, entity other); // un-exposees the c
 .vector Nexposee_align;
 .float Nexposee_animationFactor;
 
+#endif
+
+#ifdef IMPLEMENTATION
 void Nexposee_close(entity me)
 {
        // user must override this
@@ -219,6 +220,7 @@ float Nexposee_mousePress(entity me, vector pos)
                Nexposee_mouseMove(me, pos);
                if(me.mouseFocusedChild)
                {
+                       m_play_click_sound(MENU_SOUND_OPEN);
                        me.animationState = 1;
                        SUPER(Nexposee).setFocus(me, NULL);
                }
@@ -230,6 +232,7 @@ float Nexposee_mousePress(entity me, vector pos)
        {
                if (!(SUPER(Nexposee).mousePress(me, pos)))
                {
+                       m_play_click_sound(MENU_SOUND_CLOSE);
                        me.animationState = 3;
                        SUPER(Nexposee).setFocus(me, NULL);
                }
@@ -322,10 +325,12 @@ float Nexposee_keyDown(entity me, float scan, float ascii, float shift)
                        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;
                }