2 CLASS(Item) EXTENDS(Object)
3 METHOD(Item, draw, void(entity))
4 METHOD(Item, keyDown, float(entity, float, float, float))
5 METHOD(Item, keyUp, float(entity, float, float, float))
6 METHOD(Item, mouseMove, float(entity, vector))
7 METHOD(Item, mousePress, float(entity, vector))
8 METHOD(Item, mouseDrag, float(entity, vector))
9 METHOD(Item, mouseRelease, float(entity, vector))
10 METHOD(Item, focusEnter, void(entity))
11 METHOD(Item, focusLeave, void(entity))
12 METHOD(Item, resizeNotify, void(entity, vector, vector, vector, vector))
13 METHOD(Item, relinquishFocus, void(entity))
14 METHOD(Item, showNotify, void(entity))
15 METHOD(Item, hideNotify, void(entity))
16 METHOD(Item, toString, string(entity))
17 METHOD(Item, destroy, void(entity))
18 ATTRIB(Item, focused, float, 0)
19 ATTRIB(Item, focusable, float, 0)
20 ATTRIB(Item, allowFocusSound, float, 0)
21 ATTRIB(Item, parent, entity, NULL)
22 ATTRIB(Item, preferredFocusPriority, float, 0)
23 ATTRIB(Item, origin, vector, '0 0 0')
24 ATTRIB(Item, size, vector, '0 0 0')
25 ATTRIB(Item, tooltip, string, string_null)
30 void Item_destroy(entity me)
32 // free memory associated with me
35 void Item_relinquishFocus(entity me)
38 if(me.parent.instanceOfContainer)
39 me.parent.setFocus(me.parent, NULL);
42 void Item_resizeNotify(entity me, vector relOrigin, vector relSize, vector absOrigin, vector absSize)
44 me.origin = absOrigin;
48 float autocvar_menu_showboxes;
49 void Item_draw(entity me)
51 if(autocvar_menu_showboxes)
54 float a = fabs(autocvar_menu_showboxes);
56 // don't draw containers and border images
57 if(me.instanceOfContainer || me.instanceOfBorderImage)
64 // hack to detect multi drawing
65 float r = random() * 3;
73 if(autocvar_menu_showboxes < 0)
75 draw_Fill('0 0 0', '0.5 0.5 0', rgb, a);
76 draw_Fill('0.5 0.5 0', '0.5 0.5 0', rgb, a);
78 if(autocvar_menu_showboxes > 0)
80 draw_Fill('0 0 0', '1 1 0', rgb, a);
85 void Item_showNotify(entity me)
89 void Item_hideNotify(entity me)
93 float Item_keyDown(entity me, float scan, float ascii, float shift)
95 return 0; // unhandled
98 float Item_keyUp(entity me, float scan, float ascii, float shift)
100 return 0; // unhandled
103 float Item_mouseMove(entity me, vector pos)
105 return 0; // unhandled
108 float Item_mousePress(entity me, vector pos)
110 return 0; // unhandled
113 float Item_mouseDrag(entity me, vector pos)
115 return 0; // unhandled
118 float Item_mouseRelease(entity me, vector pos)
120 return 0; // unhandled
123 void Item_focusEnter(entity me)
125 if(me.allowFocusSound)
126 m_play_focus_sound();
129 void Item_focusLeave(entity me)
133 string Item_toString(entity me)