2 CLASS(XonoticUserbindEditDialog) EXTENDS(XonoticDialog)
3 METHOD(XonoticUserbindEditDialog, loadUserBind, void(entity, string, string, string))
4 METHOD(XonoticUserbindEditDialog, fill, void(entity))
5 ATTRIB(XonoticUserbindEditDialog, title, string, _("User defined key bind"))
6 ATTRIB(XonoticUserbindEditDialog, color, vector, SKINCOLOR_DIALOG_USERBIND)
7 ATTRIB(XonoticUserbindEditDialog, intendedWidth, float, 0.7)
8 ATTRIB(XonoticUserbindEditDialog, rows, float, 4)
9 ATTRIB(XonoticUserbindEditDialog, columns, float, 3)
10 ATTRIB(XonoticUserbindEditDialog, keybindBox, entity, NULL)
12 ATTRIB(XonoticUserbindEditDialog, nameBox, entity, NULL)
13 ATTRIB(XonoticUserbindEditDialog, commandPressBox, entity, NULL)
14 ATTRIB(XonoticUserbindEditDialog, commandReleaseBox, entity, NULL)
15 ENDCLASS(XonoticUserbindEditDialog)
19 void XonoticUserbindEditDialog_Save(entity btn, entity me)
21 me.keybindBox.editUserbind(me.keybindBox, me.nameBox.text, me.commandPressBox.text, me.commandReleaseBox.text);
22 Dialog_Close(btn, me);
25 void XonoticUserbindEditDialog_loadUserBind(entity me, string theName, string theCommandPress, string theCommandRelease)
27 me.nameBox.setText(me.nameBox, theName);
28 me.nameBox.keyDown(me.nameBox, K_END, 0, 0);
29 me.commandPressBox.setText(me.commandPressBox, theCommandPress);
30 me.nameBox.keyDown(me.commandPressBox, K_END, 0, 0);
31 me.commandReleaseBox.setText(me.commandReleaseBox, theCommandRelease);
32 me.nameBox.keyDown(me.commandReleaseBox, K_END, 0, 0);
35 void XonoticUserbindEditDialog_fill(entity me)
39 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Name:")));
40 me.TD(me, 1, me.columns - 1, me.nameBox = makeXonoticInputBox(0, string_null));
42 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Command when pressed:")));
43 me.TD(me, 1, me.columns - 1, me.commandPressBox = makeXonoticInputBox(0, string_null));
45 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Command when released:")));
46 me.TD(me, 1, me.columns - 1, me.commandReleaseBox = makeXonoticInputBox(0, string_null));
48 me.TD(me, 1, me.columns / 2, e = makeXonoticButton(_("Save"), '0 0 0'));
49 e.onClick = XonoticUserbindEditDialog_Save;
51 me.TD(me, 1, me.columns / 2, e = makeXonoticButton(_("Cancel"), '0 0 0'));
52 e.onClick = Dialog_Close;