2 CLASS(NexuizUserbindEditDialog) EXTENDS(NexuizDialog)
3 METHOD(NexuizUserbindEditDialog, loadUserBind, void(entity, string, string, string))
4 METHOD(NexuizUserbindEditDialog, fill, void(entity))
5 ATTRIB(NexuizUserbindEditDialog, title, string, "User defined key bind")
6 ATTRIB(NexuizUserbindEditDialog, color, vector, SKINCOLOR_DIALOG_USERBIND)
7 ATTRIB(NexuizUserbindEditDialog, intendedWidth, float, 0.7)
8 ATTRIB(NexuizUserbindEditDialog, rows, float, 4)
9 ATTRIB(NexuizUserbindEditDialog, columns, float, 3)
10 ATTRIB(NexuizUserbindEditDialog, keybindBox, entity, NULL)
12 ATTRIB(NexuizUserbindEditDialog, nameBox, entity, NULL)
13 ATTRIB(NexuizUserbindEditDialog, commandPressBox, entity, NULL)
14 ATTRIB(NexuizUserbindEditDialog, commandReleaseBox, entity, NULL)
15 ENDCLASS(NexuizUserbindEditDialog)
19 void NexuizUserbindEditDialog_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 loadUserBindNexuizUserbindEditDialog(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 fillNexuizUserbindEditDialog(entity me)
39 me.TD(me, 1, 1, e = makeNexuizTextLabel(0, "Name:"));
40 me.TD(me, 1, me.columns - 1, me.nameBox = makeNexuizInputBox(0, string_null));
42 me.TD(me, 1, 1, e = makeNexuizTextLabel(0, "Command when pressed:"));
43 me.TD(me, 1, me.columns - 1, me.commandPressBox = makeNexuizInputBox(0, string_null));
45 me.TD(me, 1, 1, e = makeNexuizTextLabel(0, "Command when released:"));
46 me.TD(me, 1, me.columns - 1, me.commandReleaseBox = makeNexuizInputBox(0, string_null));
48 me.TD(me, 1, me.columns / 2, e = makeNexuizButton("Save", '0 0 0'));
49 e.onClick = NexuizUserbindEditDialog_Save;
51 me.TD(me, 1, me.columns / 2, e = makeNexuizButton("Cancel", '0 0 0'));
52 e.onClick = Dialog_Close;