]> icculus.org git repositories - divverent/nexuiz.git/blob - menu/mfuncs.qh
added secondary fire zoom on nex
[divverent/nexuiz.git] / menu / mfuncs.qh
1 ///////////////////////////////////////////////
2 // Functions Header File
3 ///////////////////////
4 // This file belongs to dpmod/darkplaces
5 // AK contains all menu controlling stuff (sub-menus)
6 ///////////////////////////////////////////////
7
8 ////////////////
9 // prototypes
10 ///
11
12 // some gfx helper functions
13 float(float tfactor) getflicker;
14
15 void(void)      def_refresh;
16 void(float keynr, float ascii) def_keyevent;
17
18 // default control functions - assign only to the _* event functions
19 // (assigning to the 'normal' event functions will crash the vm !)
20 // are used by ITEM_CUSTOM and can be used to test new ITEMs easily
21 void(void)  defct_reinit;
22 void(void)      defct_destroy;
23 void(float keynr, float ascii)  defct_key;
24 void(void)      defct_draw;
25 void(void)      defct_mouse_enter;
26 void(void)      defct_mouse_leave;
27 void(void)      defct_action;
28 void(void)      defct_refresh;
29
30 // use this to raise an event from another item or function
31 void(entity ent)  raise_reinit;
32 void(entity ent)  raise_destroy;
33 void(entity ent, float keynr, float ascii)  raise_key;
34 void(entity ent)  raise_draw;
35 void(entity ent)  raise_mouse_enter;
36 void(entity ent)  raise_mouse_leave;
37 void(entity ent)  raise_action;
38 void(entity ent)  raise_refresh;
39
40 // safe call the normal control functions (only used by the mcontrols function)
41 void(void)      ctcall_init;
42 void(void)      ctcall_reinit;
43 void(void)      ctcall_destroy;
44 float(float keynr, float ascii)  ctcall_key;
45 void(void)      ctcall_draw;
46 void(void)      ctcall_mouse_enter;
47 void(void)      ctcall_mouse_leave;
48 void(void)      ctcall_action;
49 void(void)      ctcall_refresh;
50
51 // bind stuff
52 void(string key)                 bind_unbindkey;
53 string(float keynr)              bind_getstringforkey;
54 string(string command)           bind_getkeylist; // returns altstring containing keynrs
55 void(float num, string command)  bind_limitbinds;
56 void(string key, string command) bind_bindkey;
57
58 // control event function initializer
59 void(void(void) reinitevent, void(void) destroyevent, void(float key, float ascii) keyevent, void(void) drawevent, void(void) mouse_enterevent, void(void) mouse_leaveevent, void(void) actionevent, void(void) refreshevent)
60         item_init;
61
62 float(vector point, vector r_xy, vector r_size) inrect;
63
64 // clips are rectangle against a clip area
65 // cliprectsize returns '0 0 0' if it is clipped totally
66 vector(vector r_pos, vector r_size, vector c_pos, vector c_size) cliprectpos;
67 vector(vector r_pos, vector r_size, vector c_pos, vector c_size) cliprectsize;
68
69 // used to extract 'string' strings from a normal string
70 float(string s) getaltstringcount;
71 string(float c, string s) getaltstring;