3 #include "item/container.qh"
4 #include "item/borderimage.qh"
6 METHOD(Item, destroy, void(Item this))
8 // free memory associated with this
11 METHOD(Item, relinquishFocus, void(Item this))
13 entity par = this.parent;
15 if (par.instanceOfContainer) par.setFocus(par, NULL);
18 METHOD(Item, resizeNotify, void(Item this, vector relOrigin, vector relSize, vector absOrigin, vector absSize))
20 this.origin = absOrigin;
24 int autocvar_menu_showboxes;
25 METHOD(Item, draw, void(Item this))
27 if (!autocvar_menu_showboxes) return;
29 float a = fabs(autocvar_menu_showboxes);
31 // don't draw containers and border images
32 if (this.instanceOfContainer || this.instanceOfBorderImage)
39 // hack to detect multi drawing
40 float r = random() * 3;
41 if (r >= 2) rgb = '1 0 0';
42 else if (r >= 1) rgb = '0 1 0';
45 if (autocvar_menu_showboxes < 0)
47 draw_Fill('0 0 0', '0.5 0.5 0', rgb, a);
48 draw_Fill('0.5 0.5 0', '0.5 0.5 0', rgb, a);
50 else if (autocvar_menu_showboxes > 0)
52 draw_Fill('0 0 0', '1 1 0', rgb, a);
56 METHOD(Item, showNotify, void(Item this))
59 METHOD(Item, hideNotify, void(Item this))
62 METHOD(Item, keyDown, float(Item this, float scan, float ascii, float shift))
64 return 0; // unhandled
67 METHOD(Item, keyUp, float(Item this, float scan, float ascii, float shift))
69 return 0; // unhandled
72 METHOD(Item, mouseMove, float(Item this, vector pos))
74 return 0; // unhandled
77 METHOD(Item, mousePress, float(Item this, vector pos))
79 return 0; // unhandled
82 METHOD(Item, mouseDrag, float(Item this, vector pos))
84 return 0; // unhandled
87 METHOD(Item, mouseRelease, float(Item this, vector pos))
89 return 0; // unhandled
92 METHOD(Item, focusEnter, void(Item this))
94 if (this.allowFocusSound) m_play_focus_sound();
97 METHOD(Item, focusLeave, void(Item this))
100 METHOD(Item, toString, string(Item this))