]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/menu/xonotic/slider_resolution.c
Fix some silly translated strings
[xonotic/xonotic-data.pk3dir.git] / qcsrc / menu / xonotic / slider_resolution.c
index 5914e9aff068e812d7583ac813aa05a1266e1315..51f15aa32a3c3c4164d9b94d45012695dfbf5f50 100644 (file)
@@ -9,7 +9,7 @@ CLASS(XonoticResolutionSlider) EXTENDS(XonoticTextSlider)
        ATTRIB(XonoticResolutionSlider, vid_fullscreen, float, -1)
 ENDCLASS(XonoticResolutionSlider)
 entity makeXonoticResolutionSlider();
-void updateConwidths(float width, float height, float pixelheight);
+float updateConwidths(float width, float height, float pixelheight);
 #endif
 
 #ifdef IMPLEMENTATION
@@ -17,12 +17,16 @@ void updateConwidths(float width, float height, float pixelheight);
 /* private static */ float XonoticResolutionSlider_DataHasChanged;
 
 // Updates cvars (to be called by menu.qc at startup or on detected res change)
-void updateConwidths(float width, float height, float pixelheight)
+float updateConwidths(float width, float height, float pixelheight)
 {
        vector r, c;
        float minfactor, maxfactor;
        float sz, f;
 
+       sz = cvar("menu_vid_scale");
+       if (sz < -1)
+               return 0;  // No recalculation.
+
        // Save off current settings.
        cvar_set("_menu_vid_width", ftos(width));
        cvar_set("_menu_vid_height", ftos(height));
@@ -32,7 +36,6 @@ void updateConwidths(float width, float height, float pixelheight)
        r_x = width;
        r_y = height;
        r_z = pixelheight;
-       sz = cvar("menu_vid_scale");
 
        // calculate the base resolution
        c_z = 0;
@@ -64,14 +67,16 @@ void updateConwidths(float width, float height, float pixelheight)
        c_x = rint(c_x);
        c_y = rint(c_y);
 
+       // Please reload resolutions list and such stuff.
+       XonoticResolutionSlider_DataHasChanged = TRUE;
+
        if (c_x != cvar("vid_conwidth") || c_y != cvar("vid_conheight"))
        {
                cvar_set("vid_conwidth", ftos(c_x));
                cvar_set("vid_conheight", ftos(c_y));
-               localcmd("\nr_restart\n");
+               return 1;
        }
-
-       XonoticResolutionSlider_DataHasChanged = TRUE;
+       return 0;
 }
 entity makeXonoticResolutionSlider()
 {
@@ -108,10 +113,10 @@ void XonoticResolutionSlider_addResolution(entity me, float w, float h, float pi
                                bestdenom = denom;
                        }
                }
-               me.insertValue(me, i, strzone(sprintf(_("%dx%d (%d:%d)"), w, h, bestnum, bestdenom)), strzone(strcat(ftos(w), " ", ftos(h), " ", ftos(pixelheight))));
+               me.insertValue(me, i, strzone(sprintf("%dx%d (%d:%d)", w, h, bestnum, bestdenom)), strzone(strcat(ftos(w), " ", ftos(h), " ", ftos(pixelheight))));
        }
        else
-               me.insertValue(me, i, strzone(sprintf(_("%dx%d"), w, h)), strzone(strcat(ftos(w), " ", ftos(h), " ", ftos(pixelheight))));
+               me.insertValue(me, i, strzone(sprintf("%dx%d", w, h)), strzone(strcat(ftos(w), " ", ftos(h), " ", ftos(pixelheight))));
 }
 float autocvar_menu_vid_allowdualscreenresolution;
 void XonoticResolutionSlider_configureXonoticResolutionSlider(entity me)