]> icculus.org git repositories - divverent/nexuiz.git/blob - data/oldmenuqc/system/structure.qh
Now overtime also gets initiated by equal frags and reaching the fraglimit.
[divverent/nexuiz.git] / data / oldmenuqc / system / structure.qh
1 // DP/Nex Menu
2 // system/structure.qh
3
4 entity Menu_ActiveWindow;
5
6 // points to the lowest selected menu item (that has no child item selected)
7 entity Menu_ActiveItem;
8
9 ///////////////
10 // prototypes
11 ///
12
13 // help if you need to iterate through embedded items, too
14 entity( entity pItem ) _Menu_GetParent;
15 entity( entity pItem ) _Menu_GetFirst;
16 entity( entity pItem ) _Menu_GetLast;
17 entity( entity pItem ) _Menu_GetNext;
18 entity( entity pItem ) _Menu_GetPrev;
19 bool( entity pItem, entity pParent ) _Menu_IsEmbeddedParentOf;
20
21 // INFO: SelectUp/Down rules:
22 // INFO: Down:
23 // INFO:        1. try to select a selectable item
24 // INFO:        2. try to select a subwindow
25 // INFO: Up:
26 // INFO:        1. try to select the parent
27 // INFO:        2. select down the parent
28 // INFO:        3. select up the parent
29
30 // raw select
31 void() _Menu_SelectNext;
32 void() _Menu_SelectPrev;
33 bool() _Menu_SelectUp;
34 bool() _Menu_SelectDown;
35 void() _Menu_Reselect;
36
37 void( bool pUser ) Menu_SelectNext;
38 void( bool pUser ) Menu_SelectPrev;
39 bool( bool pUser ) Menu_SelectUp;
40 bool( bool pUser ) Menu_SelectDown;
41 void( bool pUser ) Menu_Reselect;
42
43 // INFO:Should only be used inside of _select event functions and only (only!) when
44 //      absolutely necessary since this is more or less a hack
45 void( entity pItem, bool pUser ) Menu_CorrectSelection;
46
47 void( entity pItem, bool pUser ) Menu_Select;
48 void( entity pMenu, bool pMakeActive, bool pUser ) Menu_JumpToWindow;
49
50 bool( entity pEntity ) Menu_HasEvents;
51
52 #ifdef USEFUNCTIONS
53 bool( entity pEntity ) Menu_IsVisible;
54 bool( entity pEntity ) Menu_IsSelectable;
55 bool( entity pEntity ) Menu_IsTemplate;
56 bool( entity pEntity ) Menu_IsEmbedded;
57
58 bool( entity pEntity, float pFlag ) Menu_HasFlag;
59 bool( entity pEntity, float pRunFlag ) Menu_HasRunFlag;
60 #else
61 #define Menu_IsVisible(pEntity)         (!((pEntity)._runFlag & (RUNFLAG_HIDDEN | RUNFLAG_CLIPPED)))
62 #define Menu_IsSelectable(pEntity)      (!((pEntity)._runFlag & RUNFLAG_NOSELECT))
63 #define Menu_IsTemplate(pEntity)        ((pEntity)._runFlag & RUNFLAG_TEMPLATE)
64 #define Menu_IsEmbedded(pEntity)        ((pEntity).flag & FLAG_EMBEDDED)
65
66 #define Menu_HasFlag(pEntity,pFlag)             ((pEntity).flag & (pFlag))
67 #define Menu_HasRunFlag(pEntity,pRunFlag)       ((pEntity)._runFlag & (pRunFlag))
68 #endif
69
70 void( entity pEntity ) Menu_SetRunFlag;
71 void( entity pParent, entity pEntity ) Menu_InheritRunFlag;
72
73 void() Menu_UpdateRunFlags;
74
75 void( entity pWindow ) Menu_EmptyWindow;
76 void( entity pEntity ) Menu_RemoveItem;
77
78 entity( entity pOrigin, string pName, bool pThrow ) Menu_GetItemEx;
79 entity( entity pOrigin, string pName, bool pThrow ) Menu_GetChildEx;
80
81 entity( string pName ) Menu_GetItem; // pOrigin = self
82 entity( string pName ) Menu_GetChild;
83
84 #ifdef USEFUNCTIONS
85 string( entity pItem ) Menu_GetName;    // gets the name without the parent namespace
86 #else
87 #define Menu_GetName(pItem)             (substring( (pItem) .name, strlen( (pItem) .parent ) + 2, 100000 ))
88 #endif