]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/menu/xonotic/dialog_settings_misc_cvars.qc
Update default video settings
[xonotic/xonotic-data.pk3dir.git] / qcsrc / menu / xonotic / dialog_settings_misc_cvars.qc
1 #include "dialog_settings_misc_cvars.qh"
2
3 #include "checkbox.qh"
4 #include "cvarlist.qh"
5 #include "textlabel.qh"
6 #include "inputbox.qh"
7 #include "button.qh"
8
9 void XonoticCvarsDialog_showNotify(entity me)
10 {
11         SUPER(XonoticCvarsDialog).showNotify(me);
12         loadAllCvars(me);
13 }
14 void XonoticCvarsDialog_fill(entity me) // in this dialog, use SKINCOLOR_CVARLIST_CONTROLS to color ALL controls
15 {
16
17         entity e, cvarlist;
18
19         cvarlist = makeXonoticCvarList();
20
21         cvarlist.color =
22                 cvarlist.colorF =
23                 cvarlist.color2 =
24                 cvarlist.colorC =
25                 SKINCOLOR_CVARLIST_CONTROLS;
26
27         // todo:
28         // add button which does cvar_resettodefaults_saveonly
29
30         me.TR(me);
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;
42         me.TR(me);
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;
48         me.TR(me);
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;
52         me.TR(me);
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;
66                         e.allowCut = 1;
67                         e.marginLeft = e.marginRight = 0.5;
68         me.TR(me);
69         me.TR(me);
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;
73                         e.allowWrap = 1;
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;
77                         e.onClickEntity = me;
78 }