2 CLASS(XonoticCvarsDialog) EXTENDS(XonoticDialog)
3 METHOD(XonoticCvarsDialog, fill, void(entity))
4 METHOD(XonoticCvarsDialog, showNotify, void(entity))
5 ATTRIB(XonoticCvarsDialog, title, string, _("Advanced settings"))
6 ATTRIB(XonoticCvarsDialog, color, vector, SKINCOLOR_DIALOG_CVARS)
7 ATTRIB(XonoticCvarsDialog, intendedWidth, float, 0.8)
8 ATTRIB(XonoticCvarsDialog, rows, float, 24)
9 ATTRIB(XonoticCvarsDialog, columns, float, 6)
10 ENDCLASS(XonoticCvarsDialog)
14 void XonoticCvarsDialog_showNotify(entity me)
18 void XonoticCvarsDialog_fill(entity me) // in this dialog, use SKINCOLOR_CVARLIST_CONTROLS to color ALL controls
20 entity e, cvarlist, btn;
22 cvarlist = makeXonoticCvarList();
28 SKINCOLOR_CVARLIST_CONTROLS;
31 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Cvar filter:")));
32 me.TD(me, 1, 0.5, btn = makeXonoticButton(_("Clear"), SKINCOLOR_CVARLIST_CONTROLS));
33 me.TD(me, 1, me.columns - 1.5, e = makeXonoticInputBox(0, string_null));
34 e.color = SKINCOLOR_CVARLIST_CONTROLS;
35 e.colorF = SKINCOLOR_CVARLIST_CONTROLS;
36 e.onChange = CvarList_Filter_Change;
37 e.onChangeEntity = cvarlist;
38 btn.onClick = InputBox_Clear_Click;
39 btn.onClickEntity = e;
40 cvarlist.controlledTextbox = e; // this COULD also be the Value box, but this leads to accidentally editing stuff
42 me.TD(me, me.rows - me.currentRow - 7, me.columns, cvarlist);
43 me.gotoRC(me, me.rows - 6, 0);
44 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Setting:")));
45 me.TD(me, 1, me.columns - 1, e = makeXonoticTextLabel(0, string_null));
46 cvarlist.cvarNameBox = e;
48 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Type:")));
49 me.TD(me, 1, me.columns - 1, e = makeXonoticTextLabel(0, string_null));
50 cvarlist.cvarTypeBox = e;
52 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Value:")));
53 me.TD(me, 1, me.columns - 2, e = makeXonoticInputBox(0, string_null));
54 cvarlist.cvarValueBox = e;
55 e.color = SKINCOLOR_CVARLIST_CONTROLS;
56 e.colorF = SKINCOLOR_CVARLIST_CONTROLS;
57 e.onChange = CvarList_Value_Change;
58 e.onChangeEntity = cvarlist;
59 e.onEnter = CvarList_End_Editing;
60 e.onEnterEntity = cvarlist;
61 me.TD(me, 1, 1, e = makeXonoticButton(string_null, SKINCOLOR_CVARLIST_CONTROLS));
62 cvarlist.cvarDefaultBox = e;
63 e.onClick = CvarList_Revert_Click;
64 e.onClickEntity = cvarlist;
66 e.marginLeft = e.marginRight = 0.5;
68 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Description:")));
69 me.TD(me, 1, me.columns - 1, e = makeXonoticTextLabel(0, string_null));
70 cvarlist.cvarDescriptionBox = e;
72 me.gotoRC(me, me.rows - 1, 0);
73 me.TD(me, 1, me.columns, e = makeXonoticButton(_("OK"), SKINCOLOR_CVARLIST_CONTROLS));
74 e.onClick = Dialog_Close;