1 #include "dialog_settings_input_userbind.qh"
3 #include "keybinder.qh"
4 #include "textlabel.qh"
8 void XonoticUserbindEditDialog_Save(entity btn, entity me)
10 me.keybindBox.editUserbind(me.keybindBox, me.nameBox.text, me.commandPressBox.text, me.commandReleaseBox.text);
11 Dialog_Close(btn, me);
14 void XonoticUserbindEditDialog_loadUserBind(entity me, string theName, string theCommandPress, string theCommandRelease)
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);
24 void XonoticUserbindEditDialog_fill(entity 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));
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));
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));
37 me.TD(me, 1, me.columns / 2, e = makeXonoticButton(_("Save"), '0 0 0'));
38 e.onClick = XonoticUserbindEditDialog_Save;
40 me.TD(me, 1, me.columns / 2, e = makeXonoticButton(_("Cancel"), '0 0 0'));
41 e.onClick = Dialog_Close;