Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
keybinder.qc
Go to the documentation of this file.
1#include "keybinder.qh"
2
4.int flags;
5
6#include "button.qh"
8
9const string KEY_NOT_BOUND_CMD = "// not bound";
10
12const int MAX_KEYBINDS = 256;
15// If the first character of the func is `*` it's a special keybind
16// If the first character of the func is `;` it's an overrider keybind
18// If the first character of the descr is `$` it's a user bind
19string KeyBinds_Icons[MAX_KEYBINDS]; // Allow all keybinds to have an icon, although currently only weapons do
20// The first character of the icon string is either ` ` for no tree-icon, `+` for a branch, `T` for the first branch, `L` for an elbow
21// Remove this character before drawing the icon
22
23#define KEYBIND_IS_USERBIND(descr) (substring(descr, 0, 1) == "$")
24// Special keybinds can't be edited or selected
25// If a special keybind description matches the previous one
26// then it's considered as an alternative keybind of the previous one
27#define KEYBIND_IS_SPECIAL(func) (substring(func, 0 ,1) == "*")
28// Overriding keybinds unset other binds when they're set
29// ... for the purposes of the menu, or for other reasons
30// The other binds that need to be unset are concatenated to func with a ";" separator
31#define KEYBIND_IS_OVERRIDER(func) (substring(func, 0 ,1) == ";")
32
34void XonoticKeyBinder_cb(string _name, string _icon)
35{
38}
39
41{
43
44 #define KEYBIND_DEF_WITH_ICON(func, desc, icon) MACRO_BEGIN \
45 if (KeyBinds_Count < MAX_KEYBINDS) \
46 { \
47 KeyBinds_Functions[KeyBinds_Count] = strzone(func); \
48 KeyBinds_Descriptions[KeyBinds_Count] = strzone(desc); \
49 KeyBinds_Icons[KeyBinds_Count] = strzone(icon); \
50 ++KeyBinds_Count; \
51 } \
52 MACRO_END
53 #define KEYBIND_DEF(func, desc) KEYBIND_DEF_WITH_ICON(func, desc, "")
54 #define KEYBIND_DEF_SPECIAL_WITH_ICON(func, desc, icon) KEYBIND_DEF_WITH_ICON(strcat("*", func), desc, icon)
55 #define KEYBIND_DEF_OVERRIDER_WITH_ICON(func, desc, icon) KEYBIND_DEF_WITH_ICON(strcat(";", func), desc, icon)
56
57 #define KEYBIND_EMPTY_LINE() KEYBIND_DEF("", "")
58 #define KEYBIND_HEADER(str) KEYBIND_DEF("", str)
59
60
61 KEYBIND_HEADER(_("Moving"));
62 KEYBIND_DEF("+forward" , _("move forwards"));
63 KEYBIND_DEF("+back" , _("move backwards"));
64 KEYBIND_DEF("+moveleft" , _("strafe left"));
65 KEYBIND_DEF("+moveright" , _("strafe right"));
66 KEYBIND_DEF("+jump" , _("jump / swim"));
67 KEYBIND_DEF("+crouch" , _("crouch / sink"));
68 KEYBIND_DEF("+hook" , _("offhand hook"));
69 KEYBIND_DEF("+jetpack" , _("jetpack"));
71
72 KEYBIND_HEADER(_("Attacking"));
73 KEYBIND_DEF("+fire" , _("primary fire"));
74 KEYBIND_DEF("+fire2" , _("secondary fire"));
76
77 KEYBIND_HEADER(_("Weapons"));
78 KEYBIND_DEF("weapprev" , CTX(_("WEAPON^previous")));
79 KEYBIND_DEF("weapnext" , CTX(_("WEAPON^next")));
80 KEYBIND_DEF("weaplast" , CTX(_("WEAPON^previously used")));
81 KEYBIND_DEF("weapbest" , CTX(_("WEAPON^best")));
82 KEYBIND_DEF("reload" , _("reload"));
83 KEYBIND_DEF("dropweapon" , _("drop weapon / throw nade"));
84
85 #define SHOWABLE_WEAPON(w) \
86 (!(it.spawnflags & WEP_FLAG_SPECIALATTACK) && \
87 !((it.spawnflags & WEP_FLAG_MUTATORBLOCKED) && (it.spawnflags & WEP_FLAG_HIDDEN)) )
88 // no special attacks, and no hidden mutator-blocked weapons
89
90 for (int imp = 1; imp <= 9; ++imp)
91 {
92 string w_override_list = "";
93 int w_count = 0;
94
95 FOREACH(Weapons, it != WEP_Null, {
96 if (it.impulse != imp || !SHOWABLE_WEAPON(it))
97 continue;
98 it.display(it, XonoticKeyBinder_cb);
99 w_override_list = strcat(w_override_list, ";weapon_", it.netname);
100 ++w_count;
101 });
102 if (w_count)
103 {
104 if (w_count == 1) // group only has 1 weapon (like Blaster's group), use the group bind, and add the icon
105 { // no overrides needed
107 }
108 else // group has multiple weapons, allow binding them separately or together
109 { // setting the group bind overrides the individual binds, and vice versa
110 string w_group = strcat(";weapon_group_", itos(imp));
111 KEYBIND_DEF(strcat(w_group, w_override_list), sprintf(_("weapon group %d"), imp));
112
113 int w_counter = 0;
114 FOREACH(Weapons, it != WEP_Null, {
115 if (it.impulse != imp || !SHOWABLE_WEAPON(it))
116 continue;
117 it.display(it, XonoticKeyBinder_cb);
118 ++w_counter;
119 KEYBIND_DEF_WITH_ICON(strcat(";weapon_", it.netname, w_group), XonoticKeyBinder_cb_name,
120 strcat((w_counter == 1 ? "T" : w_counter == w_count ? "L" : "+"), XonoticKeyBinder_cb_icon));
121 });
122 }
123 }
124 if (imp == 0)
125 break;
126 if (imp == 9)
127 imp = -1;
128 }
129 #undef SHOWABLE_WEAPON
130
132
133 KEYBIND_HEADER(_("View"));
134 KEYBIND_DEF("+zoom" , _("hold zoom"));
135 KEYBIND_DEF("togglezoom" , _("toggle zoom"));
136 KEYBIND_DEF("+showscores" , _("show scores"));
137 KEYBIND_DEF("screenshot" , _("screenshot"));
138 KEYBIND_DEF("+hud_panel_radar_maximized" , _("maximize radar"));
139 KEYBIND_DEF("toggle chase_active" , _("3rd person view"));
140 KEYBIND_DEF("spec" , _("enter spectator mode"));
142
143 KEYBIND_HEADER(_("Communication"));
144 KEYBIND_DEF("messagemode" , _("public chat"));
145 KEYBIND_DEF("messagemode2" , _("team chat"));
146 KEYBIND_DEF("+con_chat_maximize" , _("show chat history"));
147 KEYBIND_DEF("vyes" , _("vote YES"));
148 KEYBIND_DEF("vno" , _("vote NO"));
149 KEYBIND_DEF("ready" , _("ready"));
151
152 KEYBIND_HEADER(_("Client"));
153 KEYBIND_DEF("+show_info" , _("server info"));
154 // display the hardcoded shortcut to open the console as it works for all
155 // non-English keyboard layouts, unlike default keys (` and ~)
156 KEYBIND_DEF("toggleconsole" , _("enter console"));
157 string console_shortcut = strcat(translate_key("SHIFT"), "+", translate_key("ESCAPE"));
158 KEYBIND_DEF_SPECIAL_WITH_ICON(console_shortcut , _("enter console"), "");
159 KEYBIND_DEF("menu_showquitdialog" , _("quit"));
161
162 KEYBIND_HEADER(_("Teamplay"));
163 KEYBIND_DEF("team_auto" , _("auto-join team"));
164 KEYBIND_DEF("team_selection_show" , _("team selection"));
165 KEYBIND_DEF("spec" , _("spectate"));
167
168 KEYBIND_HEADER(_("Misc"));
169 KEYBIND_DEF("+use" , _("drop key/flag, exit vehicle"));
170 KEYBIND_DEF("kill" , _("suicide / respawn"));
171 KEYBIND_DEF("quickmenu" , _("quick menu"));
172 string scoreboard_ui_shortcut = strcat(translate_key("TAB"), "+", translate_key("ESCAPE"));
173 KEYBIND_DEF_SPECIAL_WITH_ICON(scoreboard_ui_shortcut, _("scoreboard user interface"), "");
175
176 KEYBIND_HEADER(_("User defined"));
177
178 for (int i = 1; i <= 32; ++i)
179 KEYBIND_DEF(strcat("+userbind ", itos(i)), strcat("$userbind", itos(i)));
180
182
183 KEYBIND_HEADER(_("Development"));
184 KEYBIND_DEF("menu_showsandboxtools" , _("sandbox menu"));
185 KEYBIND_DEF("+button8" , _("drag object (sandbox)"));
186 KEYBIND_DEF("wpeditor_menu" , _("waypoint editor menu"));
187
188 #undef KEYBIND_DEF_WITH_ICON
189 #undef KEYBIND_DEF
190 #undef KEYBIND_EMPTY_LINE
191 #undef KEYBIND_HEADER
192 #undef KEYBIND_DEF_SPECIAL_WITH_ICON
193 #undef KEYBIND_DEF_OVERRIDER_WITH_ICON
194}
195
197{
199 me.configureXonoticKeyBinder(me);
200 return me;
201}
202void replace_bind(string from, string to)
203{
204 int n, j;
205 float k; // not sure if float or int
206 n = tokenize(findkeysforcommand(from, 0)); // uses '...' strings
207 for (j = 0; j < n; ++j)
208 {
209 k = stof(argv(j));
210 if (k != -1)
211 localcmd("\nbind \"", keynumtostring(k), "\" \"", to, "\"\n");
212 }
213 if (n)
214 cvar_set("_hud_showbinds_reload", "1");
215}
217{
218 me.configureXonoticListBox(me);
219 me.nItems = 0;
220}
222{
223 bool force_initial_selection = false;
224 if (KeyBinds_Count < 0) // me.handle not loaded yet?
225 force_initial_selection = true;
227 me.nItems = KeyBinds_Count;
228 if (force_initial_selection)
229 me.setSelected(me, 0);
230}
232{
233 me.destroy(me);
234 me.loadKeyBinds(me);
235}
236void XonoticKeyBinder_resizeNotify(entity me, vector relOrigin, vector relSize, vector absOrigin, vector absSize)
237{
238 SUPER(XonoticKeyBinder).resizeNotify(me, relOrigin, relSize, absOrigin, absSize);
239
240 me.itemAbsSize.y = absSize.y * me.itemHeight;
241 me.itemAbsSize.x = absSize.x * (1 - me.controlWidth);
242 me.realFontSize.y = me.fontSize / me.itemAbsSize.y;
243 me.realFontSize.x = me.fontSize / me.itemAbsSize.x;
244 me.realUpperMargin = 0.5 * (1 - me.realFontSize.y);
245
247 e.display(e, XonoticKeyBinder_cb);
249 float aspect_ratio = sz.y ? sz.x / sz.y : 1;
250 me.columnIconSize = me.itemAbsSize.y / me.itemAbsSize.x * aspect_ratio;
251
252 me.columnTreeIconSize = me.itemAbsSize.y / me.itemAbsSize.x; // 1:1 aspect ratio
253 me.columnKeysSize = me.realFontSize.x * 12;
254 me.columnFunctionSize = 1 - me.columnKeysSize - 2 * me.realFontSize.x;
255 // columnFunctionSize will need to be shortened if an icon is drawn
256 me.columnKeysOrigin = me.columnFunctionSize + me.realFontSize.x;
257}
259{
260 string func = KeyBinds_Functions[me.selectedItem];
261 if (func == "" || KEYBIND_IS_SPECIAL(func))
262 return;
263
264 me.setSelected(me, me.selectedItem); // make it visible if it's hidden
265 me.keyGrabButton.forcePressed = true;
266 me.clearButton.disabled = 1;
267 keyGrabber = me;
268}
270{
271 // usage: call tokenize beforehand, then pass in the output
272
273 float k;
274 for (int j = 0; j < n; ++j)
275 {
276 k = stof(argv(j));
277 if (k != -1)
278 {
279 // bind to empty cmd instead of using unbind so it gets saved in config and overrides any default binds
280 localcmd("\nbind \"", keynumtostring(k), "\" \"", KEY_NOT_BOUND_CMD, "\"\n");
281 }
282 }
283}
284void XonoticKeyBinder_keyGrabbed(entity me, int key, bool ascii)
285{
286 int n, j, k, nvalid;
287
288 me.keyGrabButton.forcePressed = false;
289 me.clearButton.disabled = 0;
290
291 if (key == K_ESCAPE)
292 return;
293
294 // forbid these keys from being bound in the menu
295 if (key == K_CAPSLOCK || key == K_NUMLOCK)
296 {
297 KeyBinder_Bind_Change(me, me);
298 return;
299 }
300
301 string func = KeyBinds_Functions[me.selectedItem];
302 if (func == "" || KEYBIND_IS_SPECIAL(func))
303 return;
304 else if (KEYBIND_IS_OVERRIDER(func))
305 {
306 n = tokenizebyseparator(func, ";");
307 if (n <= 1)
308 return;
309 func = argv(1);
310
311 // unset all binds for the functions this key overrides
312 for (j = 2; j < n; ++j)
313 {
314 n = tokenize(findkeysforcommand(argv(j), 0)); // uses '...' strings
316 n = tokenizebyseparator(func, ";"); // reset argv back to the overridden functions
317 }
318 }
319
320 n = tokenize(findkeysforcommand(func, 0)); // uses '...' strings
321 nvalid = 0;
322 for (j = 0; j < n; ++j)
323 {
324 k = stof(argv(j));
325 if (k != -1)
326 ++nvalid;
327 }
328 if (nvalid >= MAX_KEYS_PER_FUNCTION)
331 localcmd("\nbind \"", keynumtostring(key), "\" \"", func, "\"\n");
332 localcmd("-zoom\n"); // to make sure we aren't in togglezoom'd state
333 cvar_set("_hud_showbinds_reload", "1");
334}
336{
337 if (KeyBinds_Count < 0)
338 return;
339
340 for (int i = 0; i < MAX_KEYBINDS; ++i)
341 {
345 }
346 KeyBinds_Count = 0;
347}
348void XonoticKeyBinder_editUserbind(entity me, string theName, string theCommandPress, string theCommandRelease)
349{
350 if (!me.userbindEditDialog)
351 return;
352
353 string func = KeyBinds_Functions[me.selectedItem];
354 if (func == "" || KEYBIND_IS_SPECIAL(func))
355 return;
356
357 string descr = KeyBinds_Descriptions[me.selectedItem];
358 if (!KEYBIND_IS_USERBIND(descr))
359 return;
360 descr = substring(descr, 1, strlen(descr) - 1);
361
362 // Hooray! It IS a user bind!
363 cvar_set(strcat(descr, "_description"), theName);
364 cvar_set(strcat(descr, "_press"), theCommandPress);
365 cvar_set(strcat(descr, "_release"), theCommandRelease);
366}
368{
369 if (!me.userbindEditDialog)
370 return;
371
372 string func = KeyBinds_Functions[me.selectedItem];
373 if (func == "" || KEYBIND_IS_SPECIAL(func))
374 return;
375
376 string descr = KeyBinds_Descriptions[me.selectedItem];
377 if (!KEYBIND_IS_USERBIND(descr))
378 return;
379
380 me.setSelected(me, me.selectedItem); // make it visible if it's hidden
381 descr = substring(descr, 1, strlen(descr) - 1);
382
383 // Hooray! It IS a user bind!
384 me.userbindEditDialog.loadUserBind(me.userbindEditDialog, cvar_string(strcat(descr, "_description")), cvar_string(strcat(descr, "_press")), cvar_string(strcat(descr, "_release")));
385
386 DialogOpenButton_Click(btn, me.userbindEditDialog);
387}
389{
390 int n;
391
392 string func = KeyBinds_Functions[me.selectedItem];
393 if (func == "" || KEYBIND_IS_SPECIAL(func))
394 return;
395 else if (KEYBIND_IS_OVERRIDER(func))
396 {
397 n = tokenizebyseparator(func, ";");
398 if (n <= 1)
399 return;
400 func = argv(1);
401 }
402
403 me.setSelected(me, me.selectedItem); // make it visible if it's hidden
404
405 n = tokenize(findkeysforcommand(func, 0)); // uses '...' strings
407
409 localcmd("-zoom\n"); // to make sure we aren't in togglezoom'd state
410 cvar_set("_hud_showbinds_reload", "1");
411}
413{
414 localcmd("unbindall\n");
415 localcmd("exec binds-xonotic.cfg\n");
416 localcmd("-zoom\n"); // to make sure we aren't in togglezoom'd state
417 cvar_set("_hud_showbinds_reload", "1");
418 me.close(me);
419}
425{
426 // handling of "unselectable" items
427 i = bound(0, i, me.nItems - 1);
428#define KEYBIND_IS_UNSELECTABLE(idx) \
429 (KeyBinds_Functions[idx] == "" || KEYBIND_IS_SPECIAL(KeyBinds_Functions[idx]))
430
431 // skip over unselectables if selected via keyboard, otherwise ignore mouse input
432 if (!me.pressed)
433 {
434 if (i < me.previouslySelected)
435 {
436 while ((i > 0) && KEYBIND_IS_UNSELECTABLE(i))
437 --i;
438 }
439 else
440 {
441 while ((i < me.nItems - 1) && KEYBIND_IS_UNSELECTABLE(i))
442 ++i;
443 }
444 }
446 i = me.previouslySelected;
447 else
448 me.previouslySelected = i;
449
450 if (me.userbindEditButton)
451 me.userbindEditButton.disabled = !KEYBIND_IS_USERBIND(KeyBinds_Descriptions[i]);
452 SUPER(XonoticKeyBinder).setSelected(me, i);
453#undef KEYBIND_IS_UNSELECTABLE
454}
455float XonoticKeyBinder_keyDown(entity me, int key, bool ascii, float shift)
456{
457 float r = 1;
458 switch (key)
459 {
460 case K_ENTER:
461 case K_KP_ENTER:
462 case K_SPACE:
463 KeyBinder_Bind_Change(me, me);
464 break;
465 case K_DEL:
466 case K_KP_DEL:
467 case K_BACKSPACE:
468 KeyBinder_Bind_Clear(me, me);
469 break;
470 case K_MOUSE2:
471 KeyBinder_Bind_Edit(me, me);
472 break;
473 default:
474 r = SUPER(XonoticKeyBinder).keyDown(me, key, ascii, shift);
475 break;
476 }
477 return r;
478}
479
480void XonoticKeyBinder_drawListBoxItem(entity me, int i, vector absSize, bool isSelected, bool isFocused)
481{
482 vector theColor;
483 float theAlpha;
484 float extraMargin;
485 float descrWidth;
486
487 string descr = KeyBinds_Descriptions[i];
488 string func = KeyBinds_Functions[i];
489 string icon = KeyBinds_Icons[i];
490
491 if (func == "")
492 {
493 theColor = SKINCOLOR_KEYGRABBER_TITLES;
494 theAlpha = SKINALPHA_KEYGRABBER_TITLES;
495 extraMargin = 0;
496 }
497 else
498 {
499 if (isSelected)
500 {
501 if (keyGrabber == me)
502 draw_Fill('0 0 0', '1 1 0', SKINCOLOR_LISTBOX_WAITING, SKINALPHA_LISTBOX_WAITING);
503 else
504 draw_Fill('0 0 0', '1 1 0', SKINCOLOR_LISTBOX_SELECTED, SKINALPHA_LISTBOX_SELECTED);
505 }
506 else if (isFocused)
507 {
508 me.focusedItemAlpha = getFadedAlpha(me.focusedItemAlpha, SKINALPHA_LISTBOX_FOCUSED, SKINFADEALPHA_LISTBOX_FOCUSED);
509 draw_Fill('0 0 0', '1 1 0', SKINCOLOR_LISTBOX_FOCUSED, me.focusedItemAlpha);
510 }
511
512 theAlpha = SKINALPHA_KEYGRABBER_KEYS;
513 theColor = SKINCOLOR_KEYGRABBER_KEYS;
514 extraMargin = me.realFontSize.x * 0.5;
515 }
516 descrWidth = me.columnFunctionSize;
517
518 if (KEYBIND_IS_USERBIND(descr))
519 {
520 string s = substring(descr, 1, strlen(descr) - 1);
521 descr = cvar_string(strcat(s, "_description"));
522 if (descr == "")
523 descr = s;
524 if (cvar_string(strcat(s, "_press")) == "")
525 if (cvar_string(strcat(s, "_release")) == "")
526 theAlpha *= SKINALPHA_DISABLED;
527 }
528
529 if (icon != "")
530 {
531 string tree_type = substring(icon, 0, 1);
532 if (tree_type == "+" || tree_type == "T" || tree_type == "L")
533 {
534 string pic = (tree_type == "+" ? "tree_branch" : tree_type == "T" ? "tree_branch_start" : "tree_elbow");
535 draw_Picture(extraMargin * eX, pic, me.columnTreeIconSize * eX + eY, '1 1 1', SKINALPHA_LISTBOX_SELECTED);
536 float addedMargin = me.columnTreeIconSize + 0.25 * me.realFontSize.x;
537 extraMargin += addedMargin;
538 descrWidth -= addedMargin;
539 }
540 if (strlen(icon) > 1) // not just the tree icon
541 {
542 draw_Picture(extraMargin * eX, substring(icon, 1, strlen(icon) - 1), me.columnIconSize * eX + eY, '1 1 1', SKINALPHA_LISTBOX_SELECTED);
543 float addedMargin = me.columnIconSize + 0.25 * me.realFontSize.x;
544 extraMargin += addedMargin;
545 descrWidth -= addedMargin;
546 }
547 }
548
549 string s = draw_TextShortenToWidth(descr, descrWidth, 0, me.realFontSize);
550 draw_Text(me.realUpperMargin * eY + extraMargin * eX, s, me.realFontSize, theColor, theAlpha, 0);
551
552 if (func == "")
553 return;
554
555 int n;
556 s = "";
557 if (KEYBIND_IS_OVERRIDER(func))
558 {
559 n = tokenizebyseparator(func, ";");
560 if (n <= 1)
561 return;
562 func = argv(1);
563 }
564 if (KEYBIND_IS_SPECIAL(func))
565 {
566 s = substring(func, 1, -1);
567 theColor = SKINCOLOR_KEYGRABBER_KEYS_IMMUTABLE;
568 theAlpha = SKINALPHA_KEYGRABBER_KEYS_IMMUTABLE;
569 }
570 else
571 {
572 string key;
573 float k;
574 const bool joy_active = cvar("joy_active");
575 n = tokenize(findkeysforcommand(func, 0)); // uses '...' strings
576 for (int j = 0; j < n; ++j)
577 {
578 k = stof(argv(j));
579 if (k == -1)
580 continue;
581 key = keynumtostring(k);
582 if (!joy_active && startsWith(key, "JOY"))
583 continue;
584
585 s = cons_mid(s, ", ", translate_key(key));
586 }
587 }
588 s = draw_TextShortenToWidth(s, me.columnKeysSize, 0, me.realFontSize);
589 draw_CenterText(me.realUpperMargin * eY + (me.columnKeysOrigin + 0.5 * me.columnKeysSize) * eX, s, me.realFontSize, theColor, theAlpha, 0);
590}
591
592#undef KEYBIND_IS_USERBIND
593#undef KEYBIND_IS_SPECIAL
594#undef KEYBIND_IS_OVERRIDER
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
string translate_key(string key)
Definition util.qc:1610
float flags
#define strlen
#define tokenizebyseparator
Weapons
Definition guide.qh:113
ERASEABLE string CTX(string s)
Definition i18n.qh:45
#define itos(i)
Definition int.qh:6
#define FOREACH(list, cond, body)
Definition iter.qh:19
void KeyBinder_Bind_UnbindAllForFunction(int n)
Definition keybinder.qc:269
void KeyBinder_Bind_Reset_All(entity btn, entity me)
Definition keybinder.qc:412
#define SHOWABLE_WEAPON(w)
const int MAX_KEYS_PER_FUNCTION
Definition keybinder.qc:11
float XonoticKeyBinder_keyDown(entity me, int key, bool ascii, float shift)
Definition keybinder.qc:455
void XonoticKeyBinder_loadKeyBinds(entity me)
Definition keybinder.qc:221
void XonoticKeyBinder_destroy(entity me)
Definition keybinder.qc:335
string XonoticKeyBinder_cb_name
Definition keybinder.qc:33
void KeyBinder_Bind_Edit(entity btn, entity me)
Definition keybinder.qc:367
const string KEY_NOT_BOUND_CMD
Definition keybinder.qc:9
void XonoticKeyBinder_showNotify(entity me)
Definition keybinder.qc:231
#define KEYBIND_IS_UNSELECTABLE(idx)
#define KEYBIND_IS_OVERRIDER(func)
Definition keybinder.qc:31
string KeyBinds_Functions[MAX_KEYBINDS]
Definition keybinder.qc:14
void KeyBinder_Bind_Change(entity btn, entity me)
Definition keybinder.qc:258
#define KEYBIND_DEF_WITH_ICON(func, desc, icon)
void XonoticKeyBinder_keyGrabbed(entity me, int key, bool ascii)
Definition keybinder.qc:284
void XonoticKeyBinder_configureXonoticKeyBinder(entity me)
Definition keybinder.qc:216
string KeyBinds_Descriptions[MAX_KEYBINDS]
Definition keybinder.qc:17
#define KEYBIND_IS_SPECIAL(func)
Definition keybinder.qc:27
void KeyBinds_BuildList()
Definition keybinder.qc:40
void KeyBinder_Bind_Clear(entity btn, entity me)
Definition keybinder.qc:388
void replace_bind(string from, string to)
Definition keybinder.qc:202
void XonoticKeyBinder_doubleClickListBoxItem(entity me, float i, vector where)
Definition keybinder.qc:420
string KeyBinds_Icons[MAX_KEYBINDS]
Definition keybinder.qc:19
entity makeXonoticKeyBinder()
Definition keybinder.qc:196
void XonoticKeyBinder_cb(string _name, string _icon)
Definition keybinder.qc:34
#define KEYBIND_HEADER(str)
void XonoticKeyBinder_drawListBoxItem(entity me, int i, vector absSize, bool isSelected, bool isFocused)
Definition keybinder.qc:480
const int MAX_KEYBINDS
Definition keybinder.qc:12
void XonoticKeyBinder_setSelected(entity me, int i)
Definition keybinder.qc:424
void XonoticKeyBinder_editUserbind(entity me, string theName, string theCommandPress, string theCommandRelease)
Definition keybinder.qc:348
#define KEYBIND_DEF_SPECIAL_WITH_ICON(func, desc, icon)
string XonoticKeyBinder_cb_icon
Definition keybinder.qc:33
#define KEYBIND_EMPTY_LINE()
void XonoticKeyBinder_resizeNotify(entity me, vector relOrigin, vector relSize, vector absOrigin, vector absSize)
Definition keybinder.qc:236
#define KEYBIND_DEF(func, desc)
int KeyBinds_Count
Definition keybinder.qc:13
#define KEYBIND_IS_USERBIND(descr)
Definition keybinder.qc:23
float K_BACKSPACE
Definition keycodes.qc:14
float K_CAPSLOCK
Definition keycodes.qc:45
float K_DEL
Definition keycodes.qc:38
float K_SPACE
Definition keycodes.qc:10
float K_ENTER
Definition keycodes.qc:8
float K_KP_DEL
Definition keycodes.qc:68
float K_NUMLOCK
Definition keycodes.qc:44
float K_MOUSE2
Definition keycodes.qc:130
float K_KP_ENTER
Definition keycodes.qc:74
float K_ESCAPE
Definition keycodes.qc:9
string draw_TextShortenToWidth(string theText, float maxWidth, float ICanHasKallerz, vector SizeThxBye)
Definition draw.qc:378
void draw_Picture(vector theOrigin, string pic, vector theSize, vector theColor, float theAlpha)
Definition draw.qc:72
void draw_Text(vector theOrigin, string theText, vector theSize, vector theColor, float theAlpha, float ICanHasKallerz)
Definition draw.qc:282
vector draw_PictureSize(string pic)
Definition draw.qc:80
void draw_CenterText(vector theOrigin, string theText, vector theSize, vector theColor, float theAlpha, float ICanHasKallerz)
Definition draw.qc:298
void draw_Fill(vector theOrigin, vector theSize, vector theColor, float theAlpha)
Definition draw.qc:97
float getFadedAlpha(float currentAlpha, float startAlpha, float targetAlpha)
Definition util.qc:816
void m_play_click_sound(string soundfile)
Definition menu.qc:1111
entity keyGrabber
Definition menu.qh:32
const string MENU_SOUND_SELECT
Definition menu.qh:54
const string MENU_SOUND_CLEAR
Definition menu.qh:49
void localcmd(string command,...)
void cvar_set(string name, string value)
float stof(string val,...)
float bound(float min, float value, float max)
string substring(string s, float start, float length)
float cvar(string name)
string keynumtostring(float keynum)
const string cvar_string(string name)
float tokenize(string s)
string argv(float n)
void DialogOpenButton_Click(entity button, entity tab)
strcat(_("^F4Countdown stopped!"), "\n^BG", _("Teams are too unbalanced."))
#define NEW(cname,...)
Definition oo.qh:117
#define SUPER(cname)
Definition oo.qh:231
#define NULL
Definition post.qh:14
#define REGISTRY_GET(id, i)
Definition registry.qh:43
vector
Definition self.qh:92
int int int imp
Definition impulse.qc:90
#define strfree(this)
Definition string.qh:59
ERASEABLE string cons_mid(string a, string mid, string b)
Definition string.qh:284
#define startsWith(haystack, needle)
Definition string.qh:236
const vector eY
Definition vector.qh:45
const vector eX
Definition vector.qh:44
const int WEP_FIRST
Definition all.qh:342