]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/menu/item.qc
Merge branch 'master' into terencehill/slider_anim_improvements
[xonotic/xonotic-data.pk3dir.git] / qcsrc / menu / item.qc
index d055b1a051d535dbfd18736751eb2357c25003a0..8788f2e84d7ec81bb766d332e0f495b843b25132 100644 (file)
@@ -1,22 +1,26 @@
-#ifdef INTERFACE
-CLASS(Item) EXTENDS(Object)
-       METHOD(Item, draw, void(entity))
-       METHOD(Item, keyDown, float(entity, float, float, float))
-       METHOD(Item, keyUp, float(entity, float, float, float))
-       METHOD(Item, mouseMove, float(entity, vector))
-       METHOD(Item, mousePress, float(entity, vector))
-       METHOD(Item, mouseDrag, float(entity, vector))
-       METHOD(Item, mouseRelease, float(entity, vector))
-       METHOD(Item, focusEnter, void(entity))
-       METHOD(Item, focusLeave, void(entity))
-       METHOD(Item, resizeNotify, void(entity, vector, vector, vector, vector))
-       METHOD(Item, relinquishFocus, void(entity))
-       METHOD(Item, showNotify, void(entity))
-       METHOD(Item, hideNotify, void(entity))
-       METHOD(Item, toString, string(entity))
-       METHOD(Item, destroy, void(entity))
+#ifndef ITEM_H
+#define ITEM_H
+#include "skin.qh"
+#include "oo/base.qh"
+CLASS(Item, Object)
+       METHOD(Item, draw, void(entity));
+       METHOD(Item, keyDown, float(entity, float, float, float));
+       METHOD(Item, keyUp, float(entity, float, float, float));
+       METHOD(Item, mouseMove, float(entity, vector));
+       METHOD(Item, mousePress, float(entity, vector));
+       METHOD(Item, mouseDrag, float(entity, vector));
+       METHOD(Item, mouseRelease, float(entity, vector));
+       METHOD(Item, focusEnter, void(entity));
+       METHOD(Item, focusLeave, void(entity));
+       METHOD(Item, resizeNotify, void(entity, vector, vector, vector, vector));
+       METHOD(Item, relinquishFocus, void(entity));
+       METHOD(Item, showNotify, void(entity));
+       METHOD(Item, hideNotify, void(entity));
+       METHOD(Item, toString, string(entity));
+       METHOD(Item, destroy, void(entity));
        ATTRIB(Item, focused, float, 0)
        ATTRIB(Item, focusable, float, 0)
+       ATTRIB(Item, allowFocusSound, float, 0)
        ATTRIB(Item, parent, entity, NULL)
        ATTRIB(Item, preferredFocusPriority, float, 0)
        ATTRIB(Item, origin, vector, '0 0 0')
@@ -121,6 +125,8 @@ float Item_mouseRelease(entity me, vector pos)
 
 void Item_focusEnter(entity me)
 {
+       if(me.allowFocusSound)
+               m_play_focus_sound();
 }
 
 void Item_focusLeave(entity me)