1 #ifndef DIALOG_SETTINGS_MISC_CVARS_H
2 #define DIALOG_SETTINGS_MISC_CVARS_H
4 CLASS(XonoticCvarsDialog, XonoticDialog)
5 METHOD(XonoticCvarsDialog, fill, void(entity))
6 METHOD(XonoticCvarsDialog, showNotify, void(entity))
7 ATTRIB(XonoticCvarsDialog, title, string, _("Advanced settings"))
8 ATTRIB(XonoticCvarsDialog, color, vector, SKINCOLOR_DIALOG_CVARS)
9 ATTRIB(XonoticCvarsDialog, intendedWidth, float, 0.8)
10 ATTRIB(XonoticCvarsDialog, rows, float, 24)
11 ATTRIB(XonoticCvarsDialog, columns, float, 6)
12 ENDCLASS(XonoticCvarsDialog)
16 void XonoticCvarsDialog_showNotify(entity me)
20 void XonoticCvarsDialog_fill(entity me) // in this dialog, use SKINCOLOR_CVARLIST_CONTROLS to color ALL controls
25 cvarlist = makeXonoticCvarList();
31 SKINCOLOR_CVARLIST_CONTROLS;
34 // add button which does cvar_resettodefaults_saveonly
37 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Cvar filter:")));
38 me.TD(me, 1, me.columns - 1, e = makeXonoticInputBox(0, string_null));
39 e.color = SKINCOLOR_CVARLIST_CONTROLS;
40 e.colorF = SKINCOLOR_CVARLIST_CONTROLS;
41 e.cb_color = SKINCOLOR_CVARLIST_CONTROLS;
42 e.cb_colorC = SKINCOLOR_CVARLIST_CONTROLS;
43 e.cb_colorF = SKINCOLOR_CVARLIST_CONTROLS;
44 e.onChange = CvarList_Filter_Change;
45 e.onChangeEntity = cvarlist;
46 cvarlist.controlledTextbox = e; // this COULD also be the Value box, but this leads to accidentally editing stuff
48 me.TD(me, me.rows - me.currentRow - 9, me.columns, cvarlist);
49 me.gotoRC(me, me.rows - 8, 0);
50 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Setting:")));
51 me.TD(me, 1, me.columns - 1, e = makeXonoticTextLabel(0, string_null));
52 cvarlist.cvarNameBox = e;
54 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Type:")));
55 me.TD(me, 1, me.columns - 1, e = makeXonoticTextLabel(0, string_null));
56 cvarlist.cvarTypeBox = e;
58 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Value:")));
59 me.TD(me, 1, me.columns - 2, e = makeXonoticInputBox(0, string_null));
60 cvarlist.cvarValueBox = e;
61 e.color = SKINCOLOR_CVARLIST_CONTROLS;
62 e.colorF = SKINCOLOR_CVARLIST_CONTROLS;
63 e.cb_color = SKINCOLOR_CVARLIST_CONTROLS;
64 e.cb_colorC = SKINCOLOR_CVARLIST_CONTROLS;
65 e.cb_colorF = SKINCOLOR_CVARLIST_CONTROLS;
66 e.onChange = CvarList_Value_Change;
67 e.onChangeEntity = cvarlist;
68 e.onEnter = CvarList_End_Editing;
69 e.onEnterEntity = cvarlist;
70 me.TD(me, 1, 1, e = makeXonoticButton(string_null, SKINCOLOR_CVARLIST_CONTROLS));
71 cvarlist.cvarDefaultBox = e;
72 e.onClick = CvarList_Revert_Click;
73 e.onClickEntity = cvarlist;
75 e.marginLeft = e.marginRight = 0.5;
78 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Description:")));
79 me.TD(me, 1, me.columns - 1, e = makeXonoticTextLabel(0, string_null));
80 cvarlist.cvarDescriptionBox = e;
82 me.gotoRC(me, me.rows - 1, 0);
83 me.TD(me, 1, me.columns, e = makeXonoticButton(_("OK"), SKINCOLOR_CVARLIST_CONTROLS));
84 e.onClick = Dialog_Close;