]> icculus.org git repositories - divverent/nexuiz.git/blob - data/source/msys.qc
give menu source its own directory
[divverent/nexuiz.git] / data / source / msys.qc
1 //////////////////////////////////////////////////////////
2 // sys globals
3
4 entity self;
5
6 /////////////////////////////////////////////////////////
7 void            end_sys_globals;
8 /////////////////////////////////////////////////////////
9 // sys fields
10
11 /////////////////////////////////////////////////////////
12 void            end_sys_fields;
13 /////////////////////////////////////////////////////////
14 // sys functions
15
16 void() m_init;
17 void(float keynr, float ascii) m_keydown;
18 void() m_draw;
19 void() m_display;       // old NG Menu
20 void() m_toggle;
21 void() m_hide;          // old NG Menu
22 void() m_shutdown;
23
24 /////////////////////////////////////////////////////////
25 // sys constants
26 ///////////////////////////
27 // key constants
28
29 //
30 // these are the key numbers that should be passed to Key_Event
31 //
32 float K_TAB                     =       9;
33 float K_ENTER           =       13;
34 float K_ESCAPE          =       27;
35 float K_SPACE           =       32;
36
37 // normal keys should be passed as lowercased ascii
38
39 float K_BACKSPACE       =       127;
40 float K_UPARROW         =       128;
41 float K_DOWNARROW       =       129;
42 float K_LEFTARROW       =       130;
43 float K_RIGHTARROW      =       131;
44
45 float K_ALT             =       132;
46 float K_CTRL    =       133;
47 float K_SHIFT   =       134;
48 float K_F1              =       135;
49 float K_F2              =       136;
50 float K_F3              =       137;
51 float K_F4              =       138;
52 float K_F5              =       139;
53 float K_F6              =       140;
54 float K_F7              =       141;
55 float K_F8              =       142;
56 float K_F9              =       143;
57 float K_F10             =       144;
58 float K_F11             =       145;
59 float K_F12             =       146;
60 float K_INS             =       147;
61 float K_DEL             =       148;
62 float K_PGDN    =       149;
63 float K_PGUP    =       150;
64 float K_HOME    =       151;
65 float K_END             =       152;
66
67 float K_KP_HOME                 =       160;
68 float K_KP_UPARROW              =       161;
69 float K_KP_PGUP                 =       162;
70 float K_KP_LEFTARROW    =       163;
71 float K_KP_5                    =       164;
72 float K_KP_RIGHTARROW   =       165;
73 float K_KP_END                  =       166;
74 float K_KP_DOWNARROW    =       167;
75 float K_KP_PGDN                 =       168;
76 float K_KP_ENTER                =       169;
77 float K_KP_INS                  =       170;
78 float K_KP_DEL                  =       171;
79 float K_KP_SLASH                =       172;
80 float K_KP_MINUS                =       173;
81 float K_KP_PLUS                 =       174;
82
83 float K_PAUSE           =       255;
84
85 //
86 // joystick buttons
87 //
88 float K_JOY1            =       768;
89 float K_JOY2            =       769;
90 float K_JOY3            =       770;
91 float K_JOY4            =       771;
92
93 //
94 // aux keys are for multi-buttoned joysticks to generate so they can use
95 // the normal binding process
96 //
97 float K_AUX1            =       772;
98 float K_AUX2            =       773;
99 float K_AUX3            =       774;
100 float K_AUX4            =       775;
101 float K_AUX5            =       776;
102 float K_AUX6            =       777;
103 float K_AUX7            =       778;
104 float K_AUX8            =       779;
105 float K_AUX9            =       780;
106 float K_AUX10           =       781;
107 float K_AUX11           =       782;
108 float K_AUX12           =       783;
109 float K_AUX13           =       784;
110 float K_AUX14           =       785;
111 float K_AUX15           =       786;
112 float K_AUX16           =       787;
113 float K_AUX17           =       788;
114 float K_AUX18           =       789;
115 float K_AUX19           =       790;
116 float K_AUX20           =       791;
117 float K_AUX21           =       792;
118 float K_AUX22           =       793;
119 float K_AUX23           =       794;
120 float K_AUX24           =       795;
121 float K_AUX25           =       796;
122 float K_AUX26           =       797;
123 float K_AUX27           =       798;
124 float K_AUX28           =       799;
125 float K_AUX29           =       800;
126 float K_AUX30           =       801;
127 float K_AUX31           =       802;
128 float K_AUX32           =       803;
129
130 //
131 // mouse buttons generate virtual keys
132 //
133 float K_MOUSE1          =       512;
134 float K_MOUSE2          =       513;
135 float K_MOUSE3          =       514;
136 float K_MOUSE4          =       515;
137 float K_MOUSE5          =       516;
138 float K_MOUSE6          =       517;
139 float K_MOUSE7          =       518;
140 float K_MOUSE8          =       519;
141 float K_MOUSE9          =       520;
142 float K_MOUSE10         =       521;
143
144 float K_MWHEELDOWN      =       K_MOUSE4;
145 float K_MWHEELUP        =       K_MOUSE5;
146
147 ///////////////////////////
148 // key dest constants
149
150 float KEY_GAME          =       0;
151 float KEY_MENU          =       2;
152 float KEY_UNKNOWN       =       3;
153
154 ///////////////////////////
155 // file constants
156
157 float FILE_READ = 0;
158 float FILE_APPEND = 1;
159 float FILE_WRITE = 2;
160
161 ///////////////////////////
162 // logical constants (just for completeness)
163
164 float TRUE      = 1;
165 float FALSE = 0;
166
167 ///////////////////////////
168 // boolean constants
169
170 float true  = 1;
171 float false = 0;
172
173 ///////////////////////////
174 // msg constants
175
176 float MSG_BROADCAST             = 0;            // unreliable to all
177 float MSG_ONE                   = 1;            // reliable to one (msg_entity)
178 float MSG_ALL                   = 2;            // reliable to all
179 float MSG_INIT                  = 3;            // write to the init string
180
181 /////////////////////////////
182 // mouse target constants
183
184 float MT_MENU = 1;
185 float MT_CLIENT = 2;
186
187 /////////////////////////
188 // client state constants
189
190 float CS_DEDICATED              = 0;
191 float CS_DISCONNECTED   = 1;
192 float CS_CONNECTED              = 2;
193
194 ///////////////////////////
195 // blend flags
196
197 float DRAWFLAG_NORMAL           = 0;
198 float DRAWFLAG_ADDITIVE         = 1;
199 float DRAWFLAG_MODULATE         = 2;
200 float DRAWFLAG_2XMODULATE   = 3;
201
202
203 ///////////////////////////
204 // cvar constants
205
206 float CVAR_SAVE         = 1;
207 float CVAR_NOTIFY       = 2;
208 float CVAR_READONLY     = 4;
209
210 ///////////////////////////
211 // server list constants
212
213 float SLIST_HOSTCACHEVIEWCOUNT  = 0;
214 float SLIST_HOSTCACHETOTALCOUNT = 1;
215 float SLIST_MASTERQUERYCOUNT    = 2;
216 float SLIST_MASTERREPLYCOUNT    = 3;
217 float SLIST_SERVERQUERYCOUNT    = 4;
218 float SLIST_SERVERREPLYCOUNT    = 5;
219 float SLIST_SORTFIELD           = 6;
220 float SLIST_SORTDESCENDING      = 7;
221
222 float SLIST_LEGACY_LINE1        = 1024;
223 float SLIST_LEGACY_LINE2        = 1025;
224
225 float SLIST_TEST_CONTAINS       = 0;
226 float SLIST_TEST_NOTCONTAIN     = 1;
227 float SLIST_TEST_LESSEQUAL      = 2;
228 float SLIST_TEST_LESS           = 3;
229 float SLIST_TEST_EQUAL          = 4;
230 float SLIST_TEST_GREATER        = 5;
231 float SLIST_TEST_GREATEREQUAL   = 6;
232 float SLIST_TEST_NOTEQUAL       = 7;
233
234 float SLIST_MASK_AND = 0;
235 float SLIST_MASK_OR  = 512;
236
237 float NET_CURRENTPROTOCOL = 3;
238
239 ////////////////////////////////
240 // cinematic action constants
241
242 float CINE_PLAY         = 1;
243 float CINE_LOOP         = 2;
244 float CINE_PAUSE        = 3;
245 float CINE_FIRSTFRAME   = 4;
246 float CINE_RESETONWAKEUP= 5;
247
248 ///////////////////////////
249 // null entity (actually it is the same like the world entity)
250
251 entity null_entity;
252
253 ///////////////////////////
254 // error constants
255
256 // file handling
257 float ERR_CANNOTOPEN                    = -1; // fopen
258 float ERR_NOTENOUGHFILEHANDLES  = -2; // fopen
259 float ERR_INVALIDMODE                   = -3; // fopen
260 float ERR_BADFILENAME                   = -4; // fopen
261
262 // drawing functions
263
264 float ERR_NULLSTRING                    = -1;
265 float ERR_BADDRAWFLAG                   = -2;
266 float ERR_BADSCALE                      = -3;
267 float ERR_BADSIZE                       = ERR_BADSCALE;
268 float ERR_NOTCACHED                     = -4;
269
270 /* not supported at the moment
271 ///////////////////////////
272 // os constants
273
274 float OS_WINDOWS        = 0;
275 float OS_LINUX          = 1;
276 float OS_MAC            = 2;
277 */
278