1 #include "dialog_settings_misc_cvars.qh"
5 #include "textlabel.qh"
9 void XonoticCvarsDialog_showNotify(entity me)
11 SUPER(XonoticCvarsDialog).showNotify(me);
14 void XonoticCvarsDialog_fill(entity me) // in this dialog, use SKINCOLOR_CVARLIST_CONTROLS to color ALL controls
19 cvarlist = makeXonoticCvarList();
25 SKINCOLOR_CVARLIST_CONTROLS;
28 // add button which does cvar_resettodefaults_saveonly
31 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Cvar filter:")));
32 me.TD(me, 1, 3, e = makeXonoticInputBox(0, string_null));
33 e.color = e.colorF = SKINCOLOR_CVARLIST_CONTROLS;
34 e.cb_color = e.cb_colorC = e.cb_colorF = SKINCOLOR_CVARLIST_CONTROLS;
35 e.onChange = CvarList_Filter_Change;
36 e.onChangeEntity = cvarlist;
37 cvarlist.controlledTextbox = e; // this COULD also be the Value box, but this leads to accidentally editing stuff
38 me.TD(me, 1, 2, e = makeXonoticCheckBox(0, "menu_cvarlist_onlymodified", _("Modified cvars only")));
39 e.color = e.colorC = e.colorF = e.colorD = SKINCOLOR_CVARLIST_CONTROLS;
40 e.onClickEntity = cvarlist;
41 e.onClick = CvarList_Filter_ModifiedCvars;
43 me.TD(me, me.rows - me.currentRow - 9, me.columns, cvarlist);
44 me.gotoRC(me, me.rows - 8, 0);
45 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Setting:")));
46 me.TD(me, 1, me.columns - 1, e = makeXonoticTextLabel(0, string_null));
47 cvarlist.cvarNameBox = e;
49 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Type:")));
50 me.TD(me, 1, me.columns - 1, e = makeXonoticTextLabel(0, string_null));
51 cvarlist.cvarTypeBox = e;
53 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Value:")));
54 me.TD(me, 1, me.columns - 2, e = makeXonoticInputBox(0, string_null));
55 cvarlist.cvarValueBox = e;
56 e.color = e.colorF = SKINCOLOR_CVARLIST_CONTROLS;
57 e.cb_color = e.cb_colorC = e.cb_colorF = SKINCOLOR_CVARLIST_CONTROLS;
58 e.onChange = CvarList_Value_Change;
59 e.onChangeEntity = cvarlist;
60 e.onEnter = CvarList_End_Editing;
61 e.onEnterEntity = cvarlist;
62 me.TD(me, 1, 1, e = makeXonoticButton(string_null, SKINCOLOR_CVARLIST_CONTROLS));
63 cvarlist.cvarDefaultBox = e;
64 e.onClick = CvarList_Revert_Click;
65 e.onClickEntity = cvarlist;
67 e.marginLeft = e.marginRight = 0.5;
70 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Description:")));
71 me.TD(me, 1, me.columns - 1, e = makeXonoticTextLabel(0, string_null));
72 cvarlist.cvarDescriptionBox = e;
74 me.gotoRC(me, me.rows - 1, 0);
75 me.TD(me, 1, me.columns, e = makeXonoticButton(_("OK"), SKINCOLOR_CVARLIST_CONTROLS));
76 e.onClick = Dialog_Close;