]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/menu/item/nexposee.qc
Merge branch 'Mario/monsters' into 'develop'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / menu / item / nexposee.qc
index e35909493c635e08918fbe98b7bc0dba6955b42d..d42fceb533a787a35a340eaa517aa964e1843247 100644 (file)
@@ -1,53 +1,5 @@
-#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));
-               METHOD(Nexposee, mousePress, float(entity, vector));
-               METHOD(Nexposee, mouseMove, float(entity, vector));
-               METHOD(Nexposee, mouseRelease, float(entity, vector));
-               METHOD(Nexposee, mouseDrag, float(entity, vector));
-               METHOD(Nexposee, resizeNotify, void(entity, vector, vector, vector, vector));
-               METHOD(Nexposee, focusEnter, void(entity));
-               METHOD(Nexposee, close, void(entity));
+#include "nexposee.qh"
 
-               ATTRIB(Nexposee, animationState, float, -1)
-               ATTRIB(Nexposee, animationFactor, float, 0)
-               ATTRIB(Nexposee, selectedChild, entity, NULL)
-               ATTRIB(Nexposee, mouseFocusedChild, entity, NULL)
-               METHOD(Nexposee, addItem, void(entity, entity, vector, vector, float));
-               METHOD(Nexposee, calc, void(entity));
-               METHOD(Nexposee, setNexposee, void(entity, entity, vector, float, float));
-               ATTRIB(Nexposee, mousePosition, vector, '0 0 0')
-               METHOD(Nexposee, pullNexposee, void(entity, entity, vector));
-       ENDCLASS(Nexposee)
-
-       void ExposeeCloseButton_Click(entity button, entity other);  // un-exposees the current state
-
-// animation states:
-//   0 = thumbnails seen
-//   1 = zooming in
-//   2 = zoomed in
-//   3 = zooming out
-// animation factor: 0 = minimum theSize, 1 = maximum theSize
-       .vector Nexposee_initialSize;
-       .vector Nexposee_initialFontScale;
-       .vector Nexposee_initialOrigin;
-       .float Nexposee_initialAlpha;
-
-       .vector Nexposee_smallSize;
-       .vector Nexposee_smallOrigin;
-       .float Nexposee_smallAlpha;
-       .float Nexposee_mediumAlpha;
-       .vector Nexposee_scaleCenter;
-       .vector Nexposee_align;
-       .float Nexposee_animationFactor;
-
-#endif
-
-#ifdef IMPLEMENTATION
        void Nexposee_close(entity me)
        {
                // user must override this
                        }
 
                        break;
-                       : have_overlap
+LABEL(have_overlap)
                }
 
                scale *= 0.95;
                SUPER(Nexposee).draw(me);
        }
 
-       float Nexposee_mousePress(entity me, vector pos)
+       METHOD(Nexposee, mousePress, bool(Nexposee this, vector pos))
        {
-               if (me.animationState == 0)
+               if (this.animationState == 0)
                {
-                       me.mouseFocusedChild = NULL;
-                       Nexposee_mouseMove(me, pos);
-                       if (me.mouseFocusedChild)
+                       this.mouseFocusedChild = NULL;
+                       Nexposee_mouseMove(this, pos);
+                       if (this.mouseFocusedChild)
                        {
                                m_play_click_sound(MENU_SOUND_OPEN);
-                               me.animationState = 1;
-                               SUPER(Nexposee).setFocus(me, NULL);
+                               this.animationState = 1;
+                               SUPER(Nexposee).setFocus(this, NULL);
                        }
                        else
                        {
-                               me.close(me);
+                               this.close(this);
                        }
-                       return 1;
+                       return true;
                }
-               else if (me.animationState == 2)
+               else if (this.animationState == 2)
                {
-                       if (!(SUPER(Nexposee).mousePress(me, pos)))
+                       if (!(SUPER(Nexposee).mousePress(this, pos)))
                        {
                                m_play_click_sound(MENU_SOUND_CLOSE);
-                               me.animationState = 3;
-                               SUPER(Nexposee).setFocus(me, NULL);
+                               this.animationState = 3;
+                               SUPER(Nexposee).setFocus(this, NULL);
                        }
-                       return 1;
+                       return true;
                }
-               return 0;
+               return false;
        }
 
        float Nexposee_mouseRelease(entity me, vector pos)
        {
                other.Nexposee_align = theAlign;
        }
-#endif