]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Reduce spam of "x minutes" and "x fps" strings of a few sliders
authorterencehill <piuntn@gmail.com>
Fri, 25 Sep 2015 22:31:53 +0000 (00:31 +0200)
committerterencehill <piuntn@gmail.com>
Fri, 25 Sep 2015 22:31:53 +0000 (00:31 +0200)
qcsrc/menu/xonotic/dialog_multiplayer_create.qc
qcsrc/menu/xonotic/dialog_settings_misc.qc

index 2c7611757744077aac95949cec47e95d2e290da0..eeab84e363b4cf4098b9635f2c972c3edeee71fb 100644 (file)
@@ -77,26 +77,28 @@ void XonoticServerCreateTab_fill(entity me)
                me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Time limit:")));
                me.TD(me, 1, 2, e = makeXonoticTextSlider_T("timelimit_override",
                        _("Timelimit in minutes that when hit, will end the match")));
+                       #define ADDVALUE_MINUTES(i) e.addValue(e, strzone(sprintf(_("%d minutes"), i)), #i)
                        e.addValue(e, ZCTX(_("TIMLIM^Default")), "-1");
-                       e.addValue(e, ZCTX(_("TIMLIM^1 minute")), "1");
-                       e.addValue(e, ZCTX(_("TIMLIM^2 minutes")), "2");
-                       e.addValue(e, ZCTX(_("TIMLIM^3 minutes")), "3");
-                       e.addValue(e, ZCTX(_("TIMLIM^4 minutes")), "4");
-                       e.addValue(e, ZCTX(_("TIMLIM^5 minutes")), "5");
-                       e.addValue(e, ZCTX(_("TIMLIM^6 minutes")), "6");
-                       e.addValue(e, ZCTX(_("TIMLIM^7 minutes")), "7");
-                       e.addValue(e, ZCTX(_("TIMLIM^8 minutes")), "8");
-                       e.addValue(e, ZCTX(_("TIMLIM^9 minutes")), "9");
-                       e.addValue(e, ZCTX(_("TIMLIM^10 minutes")), "10");
-                       e.addValue(e, ZCTX(_("TIMLIM^15 minutes")), "15");
-                       e.addValue(e, ZCTX(_("TIMLIM^20 minutes")), "20");
-                       e.addValue(e, ZCTX(_("TIMLIM^25 minutes")), "25");
-                       e.addValue(e, ZCTX(_("TIMLIM^30 minutes")), "30");
-                       e.addValue(e, ZCTX(_("TIMLIM^40 minutes")), "40");
-                       e.addValue(e, ZCTX(_("TIMLIM^50 minutes")), "50");
-                       e.addValue(e, ZCTX(_("TIMLIM^60 minutes")), "60");
+                       e.addValue(e, _("1 minute"), "1");
+                       ADDVALUE_MINUTES(2);
+                       ADDVALUE_MINUTES(3);
+                       ADDVALUE_MINUTES(4);
+                       ADDVALUE_MINUTES(5);
+                       ADDVALUE_MINUTES(6);
+                       ADDVALUE_MINUTES(7);
+                       ADDVALUE_MINUTES(8);
+                       ADDVALUE_MINUTES(9);
+                       ADDVALUE_MINUTES(10);
+                       ADDVALUE_MINUTES(15);
+                       ADDVALUE_MINUTES(20);
+                       ADDVALUE_MINUTES(25);
+                       ADDVALUE_MINUTES(30);
+                       ADDVALUE_MINUTES(40);
+                       ADDVALUE_MINUTES(50);
+                       ADDVALUE_MINUTES(60);
                        e.addValue(e, ZCTX(_("TIMLIM^Infinite")), "0");
                        e.configureXonoticTextSliderValues(e);
+                       #undef ADDVALUE_MINUTES
        me.TR(me);
                me.TD(me, 1, 1, me.labelFraglimit = makeXonoticTextLabel(0, _("Frag limit:")));
                me.TD(me, 1, 2, e = me.sliderFraglimit = makeXonoticTextSlider("fraglimit_override"));
index 895a554e4757f8aa30ccd5363ab8545b331292f9..f46ada0f1c311ef4f5b451a8e59b13ced7dc07b1 100644 (file)
@@ -11,6 +11,7 @@ entity makeXonoticMiscSettingsTab();
 #endif
 
 #ifdef IMPLEMENTATION
+#define ADDVALUE_FPS(i) e.addValue(e, strzone(sprintf(_("%d fps"), i)), #i)
 entity makeXonoticMiscSettingsTab()
 {
        entity me;
@@ -80,38 +81,38 @@ void XonoticMiscSettingsTab_fill(entity me)
        me.TR(me);
                me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Maximum:")));
                me.TD(me, 1, 2, e = makeXonoticTextSlider("cl_maxfps"));
-                       e.addValue(e, ZCTX(_("MAXFPS^5 fps")), "5");
-                       e.addValue(e, ZCTX(_("MAXFPS^10 fps")), "10");
-                       e.addValue(e, ZCTX(_("MAXFPS^20 fps")), "20");
-                       e.addValue(e, ZCTX(_("MAXFPS^30 fps")), "30");
-                       e.addValue(e, ZCTX(_("MAXFPS^40 fps")), "40");
-                       e.addValue(e, ZCTX(_("MAXFPS^50 fps")), "50");
-                       e.addValue(e, ZCTX(_("MAXFPS^60 fps")), "60");
-                       e.addValue(e, ZCTX(_("MAXFPS^70 fps")), "70");
-                       e.addValue(e, ZCTX(_("MAXFPS^100 fps")), "100");
-                       e.addValue(e, ZCTX(_("MAXFPS^125 fps")), "125");
-                       e.addValue(e, ZCTX(_("MAXFPS^200 fps")), "200");
+                       ADDVALUE_FPS(5);
+                       ADDVALUE_FPS(10);
+                       ADDVALUE_FPS(20);
+                       ADDVALUE_FPS(30);
+                       ADDVALUE_FPS(40);
+                       ADDVALUE_FPS(50);
+                       ADDVALUE_FPS(60);
+                       ADDVALUE_FPS(70);
+                       ADDVALUE_FPS(100);
+                       ADDVALUE_FPS(125);
+                       ADDVALUE_FPS(200);
                        e.addValue(e, ZCTX(_("MAXFPS^Unlimited")), "0");
                        e.configureXonoticTextSliderValues(e);
        me.TR(me);
                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");
-                       e.addValue(e, ZCTX(_("TRGT^30 fps")), "30");
-                       e.addValue(e, ZCTX(_("TRGT^40 fps")), "40");
-                       e.addValue(e, ZCTX(_("TRGT^50 fps")), "50");
-                       e.addValue(e, ZCTX(_("TRGT^60 fps")), "60");
-                       e.addValue(e, ZCTX(_("TRGT^100 fps")), "100");
-                       e.addValue(e, ZCTX(_("TRGT^125 fps")), "125");
-                       e.addValue(e, ZCTX(_("TRGT^200 fps")), "200");
+                       ADDVALUE_FPS(30);
+                       ADDVALUE_FPS(40);
+                       ADDVALUE_FPS(50);
+                       ADDVALUE_FPS(60);
+                       ADDVALUE_FPS(100);
+                       ADDVALUE_FPS(125);
+                       ADDVALUE_FPS(200);
                        e.configureXonoticTextSliderValues(e);
        me.TR(me);
                me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Idle limit:")));
                me.TD(me, 1, 2, e = makeXonoticTextSlider("cl_maxidlefps"));
-                       e.addValue(e, ZCTX(_("IDLFPS^10 fps")), "10");
-                       e.addValue(e, ZCTX(_("IDLFPS^20 fps")), "20");
-                       e.addValue(e, ZCTX(_("IDLFPS^30 fps")), "30");
-                       e.addValue(e, ZCTX(_("IDLFPS^60 fps")), "60");
+                       ADDVALUE_FPS(10);
+                       ADDVALUE_FPS(20);
+                       ADDVALUE_FPS(30);
+                       ADDVALUE_FPS(60);
                        e.addValue(e, ZCTX(_("IDLFPS^Unlimited")), "0");
                        e.configureXonoticTextSliderValues(e);
        me.TR(me);
@@ -151,4 +152,5 @@ void XonoticMiscSettingsTab_fill(entity me)
                        e.onClick = DialogOpenButton_Click;
                        e.onClickEntity = main.resetDialog;
 }
+#undef ADDVALUE_FPS
 #endif