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
23 cvarlist = makeXonoticCvarList();
29 SKINCOLOR_CVARLIST_CONTROLS;
32 // add button which does cvar_resettodefaults_saveonly
35 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Cvar filter:")));
36 me.TD(me, 1, me.columns - 1, e = makeXonoticInputBox(0, string_null));
37 e.color = SKINCOLOR_CVARLIST_CONTROLS;
38 e.colorF = SKINCOLOR_CVARLIST_CONTROLS;
39 e.cb_color = SKINCOLOR_CVARLIST_CONTROLS;
40 e.cb_colorC = SKINCOLOR_CVARLIST_CONTROLS;
41 e.cb_colorF = SKINCOLOR_CVARLIST_CONTROLS;
42 e.onChange = CvarList_Filter_Change;
43 e.onChangeEntity = cvarlist;
44 cvarlist.controlledTextbox = e; // this COULD also be the Value box, but this leads to accidentally editing stuff
46 me.TD(me, me.rows - me.currentRow - 9, me.columns, cvarlist);
47 me.gotoRC(me, me.rows - 8, 0);
48 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Setting:")));
49 me.TD(me, 1, me.columns - 1, e = makeXonoticTextLabel(0, string_null));
50 cvarlist.cvarNameBox = e;
52 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Type:")));
53 me.TD(me, 1, me.columns - 1, e = makeXonoticTextLabel(0, string_null));
54 cvarlist.cvarTypeBox = e;
56 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Value:")));
57 me.TD(me, 1, me.columns - 2, e = makeXonoticInputBox(0, string_null));
58 cvarlist.cvarValueBox = e;
59 e.color = SKINCOLOR_CVARLIST_CONTROLS;
60 e.colorF = SKINCOLOR_CVARLIST_CONTROLS;
61 e.cb_color = SKINCOLOR_CVARLIST_CONTROLS;
62 e.cb_colorC = SKINCOLOR_CVARLIST_CONTROLS;
63 e.cb_colorF = SKINCOLOR_CVARLIST_CONTROLS;
64 e.onChange = CvarList_Value_Change;
65 e.onChangeEntity = cvarlist;
66 e.onEnter = CvarList_End_Editing;
67 e.onEnterEntity = cvarlist;
68 me.TD(me, 1, 1, e = makeXonoticButton(string_null, SKINCOLOR_CVARLIST_CONTROLS));
69 cvarlist.cvarDefaultBox = e;
70 e.onClick = CvarList_Revert_Click;
71 e.onClickEntity = cvarlist;
73 e.marginLeft = e.marginRight = 0.5;
76 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Description:")));
77 me.TD(me, 1, me.columns - 1, e = makeXonoticTextLabel(0, string_null));
78 cvarlist.cvarDescriptionBox = e;
80 me.gotoRC(me, me.rows - 1, 0);
81 me.TD(me, 1, me.columns, e = makeXonoticButton(_("OK"), SKINCOLOR_CVARLIST_CONTROLS));
82 e.onClick = Dialog_Close;