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{
198 entity me;
199 me = NEW(XonoticKeyBinder);
200 me.configureXonoticKeyBinder(me);
201 return me;
202}
203void replace_bind(string from, string to)
204{
205 int n, j;
206 float k; // not sure if float or int
207 n = tokenize(findkeysforcommand(from, 0)); // uses '...' strings
208 for (j = 0; j < n; ++j)
209 {
210 k = stof(argv(j));
211 if (k != -1)
212 localcmd("\nbind \"", keynumtostring(k), "\" \"", to, "\"\n");
213 }
214 if (n)
215 cvar_set("_hud_showbinds_reload", "1");
216}
218{
219 me.configureXonoticListBox(me);
220 me.nItems = 0;
221}
223{
224 bool force_initial_selection = false;
225 if (KeyBinds_Count < 0) // me.handle not loaded yet?
226 force_initial_selection = true;
228 me.nItems = KeyBinds_Count;
229 if (force_initial_selection)
230 me.setSelected(me, 0);
231}
233{
234 me.destroy(me);
235 me.loadKeyBinds(me);
236}
237void XonoticKeyBinder_resizeNotify(entity me, vector relOrigin, vector relSize, vector absOrigin, vector absSize)
238{
239 SUPER(XonoticKeyBinder).resizeNotify(me, relOrigin, relSize, absOrigin, absSize);
240
241 me.itemAbsSize.y = absSize.y * me.itemHeight;
242 me.itemAbsSize.x = absSize.x * (1 - me.controlWidth);
243 me.realFontSize.y = me.fontSize / me.itemAbsSize.y;
244 me.realFontSize.x = me.fontSize / me.itemAbsSize.x;
245 me.realUpperMargin = 0.5 * (1 - me.realFontSize.y);
246
248 e.display(e, XonoticKeyBinder_cb);
250 float aspect_ratio = sz.y ? sz.x / sz.y : 1;
251 me.columnIconSize = me.itemAbsSize.y / me.itemAbsSize.x * aspect_ratio;
252
253 me.columnTreeIconSize = me.itemAbsSize.y / me.itemAbsSize.x; // 1:1 aspect ratio
254 me.columnKeysSize = me.realFontSize.x * 12;
255 me.columnFunctionSize = 1 - me.columnKeysSize - 2 * me.realFontSize.x;
256 // columnFunctionSize will need to be shortened if an icon is drawn
257 me.columnKeysOrigin = me.columnFunctionSize + me.realFontSize.x;
258}
260{
261 string func = KeyBinds_Functions[me.selectedItem];
262 if (func == "" || KEYBIND_IS_SPECIAL(func))
263 return;
264
265 me.setSelected(me, me.selectedItem); // make it visible if it's hidden
266 me.keyGrabButton.forcePressed = true;
267 me.clearButton.disabled = 1;
268 keyGrabber = me;
269}
271{
272 // usage: call tokenize beforehand, then pass in the output
273
274 float k;
275 for (int j = 0; j < n; ++j)
276 {
277 k = stof(argv(j));
278 if (k != -1)
279 {
280 // bind to empty cmd instead of using unbind so it gets saved in config and overrides any default binds
281 localcmd("\nbind \"", keynumtostring(k), "\" \"", KEY_NOT_BOUND_CMD, "\"\n");
282 }
283 }
284}
285void XonoticKeyBinder_keyGrabbed(entity me, int key, bool ascii)
286{
287 int n, j, k, nvalid;
288
289 me.keyGrabButton.forcePressed = false;
290 me.clearButton.disabled = 0;
291
292 if (key == K_ESCAPE)
293 return;
294
295 // forbid these keys from being bound in the menu
296 if (key == K_CAPSLOCK || key == K_NUMLOCK)
297 {
298 KeyBinder_Bind_Change(me, me);
299 return;
300 }
301
302 string func = KeyBinds_Functions[me.selectedItem];
303 if (func == "" || KEYBIND_IS_SPECIAL(func))
304 return;
305 else if (KEYBIND_IS_OVERRIDER(func))
306 {
307 n = tokenizebyseparator(func, ";");
308 if (n <= 1)
309 return;
310 func = argv(1);
311
312 // unset all binds for the functions this key overrides
313 for (j = 2; j < n; ++j)
314 {
315 n = tokenize(findkeysforcommand(argv(j), 0)); // uses '...' strings
317 n = tokenizebyseparator(func, ";"); // reset argv back to the overridden functions
318 }
319 }
320
321 n = tokenize(findkeysforcommand(func, 0)); // uses '...' strings
322 nvalid = 0;
323 for (j = 0; j < n; ++j)
324 {
325 k = stof(argv(j));
326 if (k != -1)
327 ++nvalid;
328 }
329 if (nvalid >= MAX_KEYS_PER_FUNCTION)
332 localcmd("\nbind \"", keynumtostring(key), "\" \"", func, "\"\n");
333 localcmd("-zoom\n"); // to make sure we aren't in togglezoom'd state
334 cvar_set("_hud_showbinds_reload", "1");
335}
337{
338 if (KeyBinds_Count < 0)
339 return;
340
341 for (int i = 0; i < MAX_KEYBINDS; ++i)
342 {
346 }
347 KeyBinds_Count = 0;
348}
349void XonoticKeyBinder_editUserbind(entity me, string theName, string theCommandPress, string theCommandRelease)
350{
351 if (!me.userbindEditDialog)
352 return;
353
354 string func = KeyBinds_Functions[me.selectedItem];
355 if (func == "" || KEYBIND_IS_SPECIAL(func))
356 return;
357
358 string descr = KeyBinds_Descriptions[me.selectedItem];
359 if (!KEYBIND_IS_USERBIND(descr))
360 return;
361 descr = substring(descr, 1, strlen(descr) - 1);
362
363 // Hooray! It IS a user bind!
364 cvar_set(strcat(descr, "_description"), theName);
365 cvar_set(strcat(descr, "_press"), theCommandPress);
366 cvar_set(strcat(descr, "_release"), theCommandRelease);
367}
369{
370 if (!me.userbindEditDialog)
371 return;
372
373 string func = KeyBinds_Functions[me.selectedItem];
374 if (func == "" || KEYBIND_IS_SPECIAL(func))
375 return;
376
377 string descr = KeyBinds_Descriptions[me.selectedItem];
378 if (!KEYBIND_IS_USERBIND(descr))
379 return;
380
381 me.setSelected(me, me.selectedItem); // make it visible if it's hidden
382 descr = substring(descr, 1, strlen(descr) - 1);
383
384 // Hooray! It IS a user bind!
385 me.userbindEditDialog.loadUserBind(me.userbindEditDialog, cvar_string(strcat(descr, "_description")), cvar_string(strcat(descr, "_press")), cvar_string(strcat(descr, "_release")));
386
387 DialogOpenButton_Click(btn, me.userbindEditDialog);
388}
390{
391 int n;
392
393 string func = KeyBinds_Functions[me.selectedItem];
394 if (func == "" || KEYBIND_IS_SPECIAL(func))
395 return;
396 else if (KEYBIND_IS_OVERRIDER(func))
397 {
398 n = tokenizebyseparator(func, ";");
399 if (n <= 1)
400 return;
401 func = argv(1);
402 }
403
404 me.setSelected(me, me.selectedItem); // make it visible if it's hidden
405
406 n = tokenize(findkeysforcommand(func, 0)); // uses '...' strings
408
410 localcmd("-zoom\n"); // to make sure we aren't in togglezoom'd state
411 cvar_set("_hud_showbinds_reload", "1");
412}
414{
415 localcmd("unbindall\n");
416 localcmd("exec binds-xonotic.cfg\n");
417 localcmd("-zoom\n"); // to make sure we aren't in togglezoom'd state
418 cvar_set("_hud_showbinds_reload", "1");
419 me.close(me);
420}
426{
427 // handling of "unselectable" items
428 i = bound(0, i, me.nItems - 1);
429#define KEYBIND_IS_UNSELECTABLE(idx) \
430 (KeyBinds_Functions[idx] == "" || KEYBIND_IS_SPECIAL(KeyBinds_Functions[idx]))
431
432 // skip over unselectables if selected via keyboard, otherwise ignore mouse input
433 if (!me.pressed)
434 {
435 if (i < me.previouslySelected)
436 {
437 while ((i > 0) && KEYBIND_IS_UNSELECTABLE(i))
438 --i;
439 }
440 else
441 {
442 while ((i < me.nItems - 1) && KEYBIND_IS_UNSELECTABLE(i))
443 ++i;
444 }
445 }
447 i = me.previouslySelected;
448 else
449 me.previouslySelected = i;
450
451 if (me.userbindEditButton)
452 me.userbindEditButton.disabled = !KEYBIND_IS_USERBIND(KeyBinds_Descriptions[i]);
453 SUPER(XonoticKeyBinder).setSelected(me, i);
454#undef KEYBIND_IS_UNSELECTABLE
455}
456float XonoticKeyBinder_keyDown(entity me, int key, bool ascii, float shift)
457{
458 float r = 1;
459 switch (key)
460 {
461 case K_ENTER:
462 case K_KP_ENTER:
463 case K_SPACE:
464 KeyBinder_Bind_Change(me, me);
465 break;
466 case K_DEL:
467 case K_KP_DEL:
468 case K_BACKSPACE:
469 KeyBinder_Bind_Clear(me, me);
470 break;
471 case K_MOUSE2:
472 KeyBinder_Bind_Edit(me, me);
473 break;
474 default:
475 r = SUPER(XonoticKeyBinder).keyDown(me, key, ascii, shift);
476 break;
477 }
478 return r;
479}
480
481void XonoticKeyBinder_drawListBoxItem(entity me, int i, vector absSize, bool isSelected, bool isFocused)
482{
483 vector theColor;
484 float theAlpha;
485 float extraMargin;
486 float descrWidth;
487
488 string descr = KeyBinds_Descriptions[i];
489 string func = KeyBinds_Functions[i];
490 string icon = KeyBinds_Icons[i];
491
492 if (func == "")
493 {
494 theColor = SKINCOLOR_KEYGRABBER_TITLES;
495 theAlpha = SKINALPHA_KEYGRABBER_TITLES;
496 extraMargin = 0;
497 }
498 else
499 {
500 if (isSelected)
501 {
502 if (keyGrabber == me)
503 draw_Fill('0 0 0', '1 1 0', SKINCOLOR_LISTBOX_WAITING, SKINALPHA_LISTBOX_WAITING);
504 else
505 draw_Fill('0 0 0', '1 1 0', SKINCOLOR_LISTBOX_SELECTED, SKINALPHA_LISTBOX_SELECTED);
506 }
507 else if (isFocused)
508 {
509 me.focusedItemAlpha = getFadedAlpha(me.focusedItemAlpha, SKINALPHA_LISTBOX_FOCUSED, SKINFADEALPHA_LISTBOX_FOCUSED);
510 draw_Fill('0 0 0', '1 1 0', SKINCOLOR_LISTBOX_FOCUSED, me.focusedItemAlpha);
511 }
512
513 theAlpha = SKINALPHA_KEYGRABBER_KEYS;
514 theColor = SKINCOLOR_KEYGRABBER_KEYS;
515 extraMargin = me.realFontSize.x * 0.5;
516 }
517 descrWidth = me.columnFunctionSize;
518
519 if (KEYBIND_IS_USERBIND(descr))
520 {
521 string s = substring(descr, 1, strlen(descr) - 1);
522 descr = cvar_string(strcat(s, "_description"));
523 if (descr == "")
524 descr = s;
525 if (cvar_string(strcat(s, "_press")) == "")
526 if (cvar_string(strcat(s, "_release")) == "")
527 theAlpha *= SKINALPHA_DISABLED;
528 }
529
530 if (icon != "")
531 {
532 string tree_type = substring(icon, 0, 1);
533 if (tree_type == "+" || tree_type == "T" || tree_type == "L")
534 {
535 string pic = (tree_type == "+" ? "tree_branch" : tree_type == "T" ? "tree_branch_start" : "tree_elbow");
536 draw_Picture(extraMargin * eX, pic, me.columnTreeIconSize * eX + eY, '1 1 1', SKINALPHA_LISTBOX_SELECTED);
537 float addedMargin = me.columnTreeIconSize + 0.25 * me.realFontSize.x;
538 extraMargin += addedMargin;
539 descrWidth -= addedMargin;
540 }
541 if (strlen(icon) > 1) // not just the tree icon
542 {
543 draw_Picture(extraMargin * eX, substring(icon, 1, strlen(icon) - 1), me.columnIconSize * eX + eY, '1 1 1', SKINALPHA_LISTBOX_SELECTED);
544 float addedMargin = me.columnIconSize + 0.25 * me.realFontSize.x;
545 extraMargin += addedMargin;
546 descrWidth -= addedMargin;
547 }
548 }
549
550 string s = draw_TextShortenToWidth(descr, descrWidth, 0, me.realFontSize);
551 draw_Text(me.realUpperMargin * eY + extraMargin * eX, s, me.realFontSize, theColor, theAlpha, 0);
552
553 if (func == "")
554 return;
555
556 int n;
557 s = "";
558 if (KEYBIND_IS_OVERRIDER(func))
559 {
560 n = tokenizebyseparator(func, ";");
561 if (n <= 1)
562 return;
563 func = argv(1);
564 }
565 if (KEYBIND_IS_SPECIAL(func))
566 {
567 s = substring(func, 1, -1);
568 theColor = SKINCOLOR_KEYGRABBER_KEYS_IMMUTABLE;
569 theAlpha = SKINALPHA_KEYGRABBER_KEYS_IMMUTABLE;
570 }
571 else
572 {
573 string key;
574 float k;
575 const bool joy_active = cvar("joy_active");
576 n = tokenize(findkeysforcommand(func, 0)); // uses '...' strings
577 for (int j = 0; j < n; ++j)
578 {
579 k = stof(argv(j));
580 if (k == -1)
581 continue;
582 key = keynumtostring(k);
583 if (!joy_active && startsWith(key, "JOY"))
584 continue;
585
586 s = cons_mid(s, ", ", translate_key(key));
587 }
588 }
589 s = draw_TextShortenToWidth(s, me.columnKeysSize, 0, me.realFontSize);
590 draw_CenterText(me.realUpperMargin * eY + (me.columnKeysOrigin + 0.5 * me.columnKeysSize) * eX, s, me.realFontSize, theColor, theAlpha, 0);
591}
592
593#undef KEYBIND_IS_USERBIND
594#undef KEYBIND_IS_SPECIAL
595#undef KEYBIND_IS_OVERRIDER
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
string translate_key(string key)
Definition util.qc:1512
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:270
void KeyBinder_Bind_Reset_All(entity btn, entity me)
Definition keybinder.qc:413
#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:456
void XonoticKeyBinder_loadKeyBinds(entity me)
Definition keybinder.qc:222
void XonoticKeyBinder_destroy(entity me)
Definition keybinder.qc:336
string XonoticKeyBinder_cb_name
Definition keybinder.qc:33
void KeyBinder_Bind_Edit(entity btn, entity me)
Definition keybinder.qc:368
const string KEY_NOT_BOUND_CMD
Definition keybinder.qc:9
void XonoticKeyBinder_showNotify(entity me)
Definition keybinder.qc:232
#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:259
#define KEYBIND_DEF_WITH_ICON(func, desc, icon)
void XonoticKeyBinder_keyGrabbed(entity me, int key, bool ascii)
Definition keybinder.qc:285
void XonoticKeyBinder_configureXonoticKeyBinder(entity me)
Definition keybinder.qc:217
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:389
void replace_bind(string from, string to)
Definition keybinder.qc:203
void XonoticKeyBinder_doubleClickListBoxItem(entity me, float i, vector where)
Definition keybinder.qc:421
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:481
const int MAX_KEYBINDS
Definition keybinder.qc:12
void XonoticKeyBinder_setSelected(entity me, int i)
Definition keybinder.qc:425
void XonoticKeyBinder_editUserbind(entity me, string theName, string theCommandPress, string theCommandRelease)
Definition keybinder.qc:349
#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:237
#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:377
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:1106
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:326