#include "checkbox.qh"
#include "button.qh"
#include "mainwindow.qh"
+#include "commandbutton.qh"
#define ADDVALUE_FPS(i) e.addValue(e, strzone(sprintf(_("%d fps"), i)), #i)
-#define ADDVALUE_SPEED_KB(i) e.addValue(e, strzone(sprintf(_("%d KB/s"), i)), #i)
-#define ADDVALUE_SPEED_MB(i, j) e.addValue(e, strzone(sprintf(_("%d MB/s"), i)), #j)
+#define ADDVALUE_SPEED_KB(i) e.addValue(e, strzone(sprintf(_("%d KiB/s"), i)), #i)
+#define ADDVALUE_SPEED_MB(i, j) e.addValue(e, strzone(sprintf(_("%d MiB/s"), i)), #j)
entity makeXonoticMiscSettingsTab()
{
entity me;
entity e;
//entity sk;
+ entity miscApplyButton = makeXonoticCommandButton(_("Apply immediately"), '0 0 0', "menu_restart;", COMMANDBUTTON_APPLY);
+ miscApplyButton.disableOnClick = true;
+
+ me.TR(me);
+ me.TD(me, 1, 3.25, e = makeXonoticHeaderLabel(_("Network")));
+ me.TR(me);
+ me.TD(me, 1, 3, e = makeXonoticCheckBox_T(0, "shownetgraph", _("Show netgraph"),
+ _("Show a graph of packet sizes and other information")));
+ me.TR(me);
+ me.TD(me, 1, 3, e = makeXonoticCheckBox_T(0, "cl_netrepeatinput", _("Packet loss compensation"),
+ _("Each packet includes a copy of the previous message")));
me.TR(me);
- me.TD(me, 1, 3, e = makeXonoticHeaderLabel(_("Network")));
+ me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "cl_movement_errorcompensation", _("Movement prediction error compensation")));
+ setDependent(e, "cl_movement", 1, 1);
me.TR(me);
- me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Client UDP port:")));
- me.TD(me, 1, 1.5, e = makeXonoticInputBox_T(0, "cl_port",
- _("Force client to use chosen port unless it is set to 0")));
+ if(cvar_type("crypto_aeslevel") & CVAR_TYPEFLAG_ENGINE)
+ me.TD(me, 1, 3, e = makeXonoticCheckBoxEx(2, 1, "crypto_aeslevel", _("Use encryption (AES) when available")));
me.TR(me);
me.TR(me);
- me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Bandwidth:")));
+ me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Bandwidth limit:")));
me.TD(me, 1, 2, e = makeXonoticTextSlider_T("_cl_rate",
_("Specify your network speed")));
- e.addValue(e, _("56k"), "4000");
- e.addValue(e, _("ISDN"), "7000");
e.addValue(e, _("Slow ADSL"), "20000");
e.addValue(e, _("Fast ADSL"), "40000");
e.addValue(e, _("Broadband"), "66666");
e.configureXonoticTextSliderValues(e);
+ if(cvar("developer") > 0)
+ {
+ me.TR(me);
+ me.TR(me);
+ me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Local latency:")));
+ me.TD(me, 1, 2, e = makeXonoticSlider(0, 1000, 25, "cl_netlocalping"));
+ }
+ me.TR(me);
me.TR(me);
+ me.TD(me, 1, 3.25, e = makeXonoticHeaderLabel(_("HTTP downloads")));
me.TR(me);
- me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Downloads:")));
+ me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Simultaneous:")));
me.TD(me, 1, 2, e = makeXonoticSlider_T(1, 5, 1, "cl_curl_maxdownloads",
- _("Maximum number of concurrent HTTP/FTP downloads")));
+ _("Maximum number of concurrent HTTP downloads")));
me.TR(me);
- me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Download speed:")));
+ me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Bandwidth limit:")));
me.TD(me, 1, 2, e = makeXonoticTextSlider("cl_curl_maxspeed"));
- ADDVALUE_SPEED_KB(50);
- ADDVALUE_SPEED_KB(100);
- ADDVALUE_SPEED_KB(300);
- ADDVALUE_SPEED_KB(500);
- ADDVALUE_SPEED_MB(1, 1000);
- ADDVALUE_SPEED_MB(2, 2000);
+ ADDVALUE_SPEED_KB(64);
+ ADDVALUE_SPEED_KB(128);
+ ADDVALUE_SPEED_KB(256);
+ ADDVALUE_SPEED_KB(512);
+ ADDVALUE_SPEED_MB(1, 1024);
+ ADDVALUE_SPEED_MB(2, 2048);
+ ADDVALUE_SPEED_MB(4, 4096);
+ ADDVALUE_SPEED_MB(8, 8192);
e.addValue(e, strzone(_("Unlimited")), "0");
e.configureXonoticTextSliderValues(e);
- me.TR(me);
- if(cvar("developer") > 0)
- {
- me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Local latency:")));
- me.TD(me, 1, 2, e = makeXonoticSlider(0, 1000, 25, "cl_netlocalping"));
- }
- me.TR(me);
- me.TD(me, 1, 3, e = makeXonoticCheckBox_T(0, "shownetgraph", _("Show netgraph"),
- _("Show a graph of packet sizes and other information")));
- me.TR(me);
- me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "cl_movement", _("Client-side movement prediction")));
- me.TR(me);
- me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "cl_movement_errorcompensation", _("Movement error compensation")));
- setDependent(e, "cl_movement", 1, 1);
- me.TR(me);
- if(cvar_type("crypto_aeslevel") & CVAR_TYPEFLAG_ENGINE)
- me.TD(me, 1, 3, e = makeXonoticCheckBoxEx(2, 1, "crypto_aeslevel", _("Use encryption (AES) when available"))); // TODO: move up
me.gotoRC(me, 0, 3.2); me.setFirstColumn(me, me.currentColumn);
me.TD(me, 1, 3, e = makeXonoticHeaderLabel(_("Framerate")));
+ me.TR(me);
+ me.TD(me, 1, 3, e = makeXonoticCheckBox_T(0, "showfps", _("Show frames per second"),
+ _("Show your rendered frames per second")));
me.TR(me);
me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Maximum:")));
me.TD(me, 1, 2, e = makeXonoticTextSlider("cl_maxfps"));
- ADDVALUE_FPS(30);
ADDVALUE_FPS(60);
ADDVALUE_FPS(100);
ADDVALUE_FPS(125);
me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Target:")));
me.TD(me, 1, 2, e = makeXonoticTextSlider("cl_minfps"));
e.addValue(e, ZCTX(_("TRGT^Disabled")), "0");
- ADDVALUE_FPS(30);
+ ADDVALUE_FPS(40);
ADDVALUE_FPS(60);
ADDVALUE_FPS(100);
ADDVALUE_FPS(125);
e.addValue(e, ZCTX(_("IDLFPS^Unlimited")), "0");
e.configureXonoticTextSliderValues(e);
me.TR(me);
- me.TR(me);
- me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "cl_maxfps_alwayssleep", _("Save processing time for other apps")));
- setDependent(e, "cl_maxfps", 1, 1000);
- me.TR(me);
- me.TD(me, 1, 3, e = makeXonoticCheckBox_T(0, "showfps", _("Show frames per second"),
- _("Show your rendered frames per second")));
- me.TR(me);
me.TR(me);
me.TD(me, 1, 3, e = makeXonoticHeaderLabel(_("Other")));
me.TR(me);
makeMulti(e, "showdate");
me.TR(me);
me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "developer", _("Enable developer mode")));
+ e.applyButton = miscApplyButton;
me.TR(me);
me.TDempty(me, 0.5);
_("Advanced settings where you can tweak every single variable of the game")));
e.onClick = DialogOpenButton_Click;
e.onClickEntity = main.cvarsDialog;
+ me.TR(me);
me.TR(me);
me.TDempty(me, 0.5);
me.TD(me, 1, 2, e = makeXonoticButton(_("Factory reset"), '0 0 0'));
e.onClick = DialogOpenButton_Click;
e.onClickEntity = main.resetDialog;
+
+ me.gotoRC(me, me.rows - 1, 0);
+ me.TD(me, 1, me.columns, miscApplyButton);
}
#undef ADDVALUE_FPS