Xonotic
dialog_settings_misc.qc
Go to the documentation of this file.
2 
3 #include "textlabel.qh"
4 #include "inputbox.qh"
5 #include "textslider.qh"
6 #include "slider.qh"
7 #include "checkbox.qh"
8 #include "button.qh"
9 #include "mainwindow.qh"
10 
11 #define ADDVALUE_FPS(i) e.addValue(e, strzone(sprintf(_("%d fps"), i)), #i)
12 #define ADDVALUE_SPEED_KB(i) e.addValue(e, strzone(sprintf(_("%d KB/s"), i)), #i)
13 #define ADDVALUE_SPEED_MB(i, j) e.addValue(e, strzone(sprintf(_("%d MB/s"), i)), #j)
15 {
16  entity me;
18  me.configureDialog(me);
19  return me;
20 }
22 {
23  entity e;
24  //entity sk;
25 
26  me.TR(me);
27  me.TD(me, 1, 3, e = makeXonoticHeaderLabel(_("Network")));
28  me.TR(me);
29  me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Client UDP port:")));
30  me.TD(me, 1, 1.5, e = makeXonoticInputBox_T(0, "cl_port",
31  _("Force client to use chosen port unless it is set to 0")));
32  me.TR(me);
33  me.TR(me);
34  me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Bandwidth:")));
35  me.TD(me, 1, 2, e = makeXonoticTextSlider_T("_cl_rate",
36  _("Specify your network speed")));
37  e.addValue(e, _("56k"), "4000");
38  e.addValue(e, _("ISDN"), "7000");
39  e.addValue(e, _("Slow ADSL"), "20000");
40  e.addValue(e, _("Fast ADSL"), "40000");
41  e.addValue(e, _("Broadband"), "66666");
42  e.configureXonoticTextSliderValues(e);
43  me.TR(me);
44  me.TR(me);
45  me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Downloads:")));
46  me.TD(me, 1, 2, e = makeXonoticSlider_T(1, 5, 1, "cl_curl_maxdownloads",
47  _("Maximum number of concurrent HTTP/FTP downloads")));
48  me.TR(me);
49  me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Download speed:")));
50  me.TD(me, 1, 2, e = makeXonoticTextSlider("cl_curl_maxspeed"));
52  ADDVALUE_SPEED_KB(100);
53  ADDVALUE_SPEED_KB(300);
54  ADDVALUE_SPEED_KB(500);
55  ADDVALUE_SPEED_MB(1, 1000);
56  ADDVALUE_SPEED_MB(2, 2000);
57  e.addValue(e, strzone(_("Unlimited")), "0");
58  e.configureXonoticTextSliderValues(e);
59  me.TR(me);
60  if(cvar("developer") > 0)
61  {
62  me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Local latency:")));
63  me.TD(me, 1, 2, e = makeXonoticSlider(0, 1000, 25, "cl_netlocalping"));
64  }
65  me.TR(me);
66  me.TD(me, 1, 3, e = makeXonoticCheckBox_T(0, "shownetgraph", _("Show netgraph"),
67  _("Show a graph of packet sizes and other information")));
68  me.TR(me);
69  me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "cl_movement", _("Client-side movement prediction")));
70  me.TR(me);
71  me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "cl_movement_errorcompensation", _("Movement error compensation")));
72  setDependent(e, "cl_movement", 1, 1);
73  me.TR(me);
74  if(cvar_type("crypto_aeslevel") & CVAR_TYPEFLAG_ENGINE)
75  me.TD(me, 1, 3, e = makeXonoticCheckBoxEx(2, 1, "crypto_aeslevel", _("Use encryption (AES) when available"))); // TODO: move up
76 
77  me.gotoRC(me, 0, 3.2); me.setFirstColumn(me, me.currentColumn);
78  me.TD(me, 1, 3, e = makeXonoticHeaderLabel(_("Framerate")));
79  me.TR(me);
80  me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Maximum:")));
81  me.TD(me, 1, 2, e = makeXonoticTextSlider("cl_maxfps"));
82  ADDVALUE_FPS(30);
83  ADDVALUE_FPS(60);
84  ADDVALUE_FPS(100);
85  ADDVALUE_FPS(125);
86  ADDVALUE_FPS(150);
87  ADDVALUE_FPS(200);
88  ADDVALUE_FPS(250);
89  ADDVALUE_FPS(400);
90  e.addValue(e, ZCTX(_("MAXFPS^Unlimited")), "0");
91  e.configureXonoticTextSliderValues(e);
92  me.TR(me);
93  me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Target:")));
94  me.TD(me, 1, 2, e = makeXonoticTextSlider("cl_minfps"));
95  e.addValue(e, ZCTX(_("TRGT^Disabled")), "0");
96  ADDVALUE_FPS(30);
97  ADDVALUE_FPS(60);
98  ADDVALUE_FPS(100);
99  ADDVALUE_FPS(125);
100  ADDVALUE_FPS(150);
101  ADDVALUE_FPS(200);
102  ADDVALUE_FPS(250);
103  ADDVALUE_FPS(400);
104  e.configureXonoticTextSliderValues(e);
105  me.TR(me);
106  me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Idle limit:")));
107  me.TD(me, 1, 2, e = makeXonoticTextSlider("cl_maxidlefps"));
108  ADDVALUE_FPS(10);
109  ADDVALUE_FPS(20);
110  ADDVALUE_FPS(30);
111  ADDVALUE_FPS(60);
112  e.addValue(e, ZCTX(_("IDLFPS^Unlimited")), "0");
113  e.configureXonoticTextSliderValues(e);
114  me.TR(me);
115  me.TR(me);
116  me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "cl_maxfps_alwayssleep", _("Save processing time for other apps")));
117  setDependent(e, "cl_maxfps", 1, 1000);
118  me.TR(me);
119  me.TD(me, 1, 3, e = makeXonoticCheckBox_T(0, "showfps", _("Show frames per second"),
120  _("Show your rendered frames per second")));
121  me.TR(me);
122  me.TR(me);
123  me.TD(me, 1, 3, e = makeXonoticHeaderLabel(_("Other")));
124  me.TR(me);
125  me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Menu tooltips:")));
126  me.TD(me, 1, 2, e = makeXonoticTextSlider_T("menu_tooltips",
127  _("Menu tooltips: disabled, standard or advanced (also shows cvar or console command bound to the menu item)")));
128  e.addValue(e, ZCTX(_("TLTIP^Disabled")), "0");
129  e.addValue(e, ZCTX(_("TLTIP^Standard")), "1");
130  e.addValue(e, ZCTX(_("TLTIP^Advanced")), "2");
131  e.configureXonoticTextSliderValues(e);
132  me.TR(me);
133  me.TD(me, 1, 3, e = makeXonoticCheckBox_T(0, "showtime", _("Show current date and time"),
134  _("Show current date and time of day, useful on screenshots")));
135  makeMulti(e, "showdate");
136  me.TR(me);
137  me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "developer", _("Enable developer mode")));
138 
139  me.TR(me);
140  me.TDempty(me, 0.5);
141  me.TD(me, 1, 2, e = makeXonoticButton_T(_("Advanced settings..."), '0 0 0',
142  _("Advanced settings where you can tweak every single variable of the game")));
143  e.onClick = DialogOpenButton_Click;
144  e.onClickEntity = main.cvarsDialog;
145  me.TR(me);
146  me.TDempty(me, 0.5);
147  me.TD(me, 1, 2, e = makeXonoticButton(_("Factory reset"), '0 0 0'));
148  e.onClick = DialogOpenButton_Click;
149  e.onClickEntity = main.resetDialog;
150 }
151 #undef ADDVALUE_FPS
#define NEW(cname,...)
Definition: oo.qh:105
entity makeXonoticCheckBoxEx(float theYesValue, float theNoValue, string theCvar, string theText)
Definition: checkbox.qc:40
entity makeXonoticHeaderLabel(string theText)
Definition: textlabel.qc:10
entity() spawn
void DialogOpenButton_Click(entity button, entity tab)
entity makeXonoticTextLabel(float theAlign, string theText)
Definition: textlabel.qc:3
#define ADDVALUE_SPEED_MB(i, j)
entity makeXonoticTextSlider_T(string theCvar, string theTooltip)
Definition: textslider.qc:3
entity makeXonoticSlider(float theValueMin, float theValueMax, float theValueStep, string theCvar)
Definition: slider.qc:10
#define ADDVALUE_FPS(i)
void XonoticMiscSettingsTab_fill(entity me)
#define ZCTX(s)
Definition: i18n.qh:68
entity makeXonoticSlider_T(float theValueMin, float theValueMax, float theValueStep, string theCvar, string theTooltip)
Definition: slider.qc:3
#define ADDVALUE_SPEED_KB(i)
entity makeXonoticCheckBox_T(float isInverted, string theCvar, string theText, string theTooltip)
Definition: checkbox.qc:3
entity makeXonoticMiscSettingsTab()
float CVAR_TYPEFLAG_ENGINE
entity makeXonoticTextSlider(string theCvar)
Definition: textslider.qc:10
entity makeXonoticCheckBox(float isInverted, string theCvar, string theText)
Definition: checkbox.qc:28
entity makeXonoticInputBox_T(float doEditColorCodes, string theCvar, string theTooltip)
Definition: inputbox.qc:3