Xonotic
dialog_settings_input_userbind.qc
Go to the documentation of this file.
2 
3 #include "keybinder.qh"
4 #include "textlabel.qh"
5 #include "inputbox.qh"
6 #include "button.qh"
7 
9 {
10  me.keybindBox.editUserbind(me.keybindBox, me.nameBox.text, me.commandPressBox.text, me.commandReleaseBox.text);
11  Dialog_Close(btn, me);
12 }
13 
14 void XonoticUserbindEditDialog_loadUserBind(entity me, string theName, string theCommandPress, string theCommandRelease)
15 {
16  me.nameBox.setText(me.nameBox, theName);
17  me.nameBox.keyDown(me.nameBox, K_END, 0, 0);
18  me.commandPressBox.setText(me.commandPressBox, theCommandPress);
19  me.nameBox.keyDown(me.commandPressBox, K_END, 0, 0);
20  me.commandReleaseBox.setText(me.commandReleaseBox, theCommandRelease);
21  me.nameBox.keyDown(me.commandReleaseBox, K_END, 0, 0);
22 }
23 
25 {
26  entity e;
27  me.TR(me);
28  me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Name:")));
29  me.TD(me, 1, me.columns - 1, me.nameBox = makeXonoticInputBox(0, string_null));
30  me.TR(me);
31  me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Command when pressed:")));
32  me.TD(me, 1, me.columns - 1, me.commandPressBox = makeXonoticInputBox(0, string_null));
33  me.TR(me);
34  me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Command when released:")));
35  me.TD(me, 1, me.columns - 1, me.commandReleaseBox = makeXonoticInputBox(0, string_null));
36  me.TR(me);
37  me.TD(me, 1, me.columns / 2, e = makeXonoticButton(_("Save"), '0 0 0'));
39  e.onClickEntity = me;
40  me.TD(me, 1, me.columns / 2, e = makeXonoticButton(_("Cancel"), '0 0 0'));
41  e.onClick = Dialog_Close;
42  e.onClickEntity = me;
43 }
void XonoticUserbindEditDialog_Save(entity btn, entity me)
string string_null
Definition: nil.qh:9
entity() spawn
entity makeXonoticTextLabel(float theAlign, string theText)
Definition: textlabel.qc:3
float K_END
Definition: keycodes.qc:42
void XonoticUserbindEditDialog_loadUserBind(entity me, string theName, string theCommandPress, string theCommandRelease)
void XonoticUserbindEditDialog_fill(entity me)
entity makeXonoticInputBox(float doEditColorCodes, string theCvar)
Definition: inputbox.qc:10