]> icculus.org git repositories - divverent/nexuiz.git/blob - data/source/system/events.qh
give menu source its own directory
[divverent/nexuiz.git] / data / source / system / events.qh
1 // DP/Nex Menu
2 // system/events.qh
3
4 // menu_processmous states
5 enum {
6         MENU_SELECT_SELECTABLE,
7         MENU_SELECT_ALWAYS,
8         MENU_SELECT_NEVER
9 };
10
11 enum {
12         MENU_EVENT_NORMAL,
13         MENU_EVENT_CONTINUE = 0,
14         MENU_EVENT_RAISEPARENT,
15         MENU_EVENT_PROCESSED
16 };
17
18 enumflags { //enumflags because of the debug filter
19         MENU_PROCESS_RUNFLAG,
20         MENU_PROCESS_UPDATE,
21         MENU_PROCESS_DRAW,
22         MENU_PROCESS_MOUSE,
23         MENU_PROCESS_KEY
24 };
25
26 // used to build up the local coord system
27 vector Menu_Cursor_Position;
28
29 // key hook - only as long as there is no history change or the menu is closed
30 entity Menu_KeyHook_Target;
31 var void( float pKey, float pAscii ) Menu_KeyHook = __NULL__;
32
33 ///////////////
34 // prototypes
35 ///
36
37 void() Menu_Frame;
38 void() Menu_Draw;
39 void(float pKey, float pAscii) Menu_Key;
40
41 // decide whether to toggle the menu
42 bool() Menu_Toggle;
43
44 void() Menu_Process_Setup;
45
46 float( entity pItem, float pMode, float pSelectState, float pKey, float pAscii ) Menu_Process;
47 #define _Menu_Process(item,mode)        Menu_Process( item, mode, 0, 0, 0 )
48 #define Menu_ProcessDraw(item)          _Menu_Process( item, MENU_PROCESS_DRAW )
49 #define Menu_ProcessUpdate(item)        _Menu_Process( item, MENU_PROCESS_UPDATE )
50 #define Menu_ProcessRunFlag(item)       _Menu_Process( item, MENU_PROCESS_RUNFLAG )
51 #define Menu_ProcessMouse(item,select)  Menu_Process( item, MENU_PROCESS_MOUSE, select, 0, 0 )
52 #define Menu_ProcessKey(item,key,ascii) Menu_Process( item, MENU_PROCESS_KEY, 0, key, ascii )
53
54
55
56