]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/client/mapvoting.qc
Merge remote-tracking branch 'origin/samual/fix_anim_divisionbyzero'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / mapvoting.qc
index 861d1d1d9f8844d5f5dfb9a7b4c4336ddebed712..a9e7ca4a94beee110d55d8b85d3879fa03132eff 100644 (file)
@@ -21,13 +21,13 @@ float mv_selection;
 string MapVote_FormatMapItem(float id, string map, float count, float maxwidth, vector fontsize)
 {
        string pre, post;
-       pre = strcat(ftos(id+1), ". ");
+       pre = sprintf("%d. ", id+1);
        if(mv_detail)
        {
                if(count == 1)
-                       post = strcat(" (1 vote)");
-               else
-                       post = strcat(" (", ftos(count), " votes)");
+                       post = _(" (1 vote)");
+               else if(count >= 0)
+                       post = sprintf(_(" (%d votes)"), count);
        }
        else
                post = "";
@@ -62,7 +62,6 @@ void MapVote_DrawMapItem(vector pos, float isize, float tsize, string map, strin
        img_size_y = isize;
        img_size_x = isize / 0.75; // 4:3 x can be stretched easily, height is defined in isize
 
-       drawfont = hud_font;
        pos_y = pos_y + img_size_y;
        
        label = MapVote_FormatMapItem(id, map, count, tsize, hud_fontsize);
@@ -109,10 +108,9 @@ void MapVote_DrawAbstain(vector pos, float isize, float tsize, float count, floa
        
        rgb = MapVote_RGB(id, count);
 
-       drawfont = hud_font;
        pos_y = pos_y + hud_fontsize_y;
        
-       label = MapVote_FormatMapItem(id, "Don't care", count, tsize, hud_fontsize);
+       label = MapVote_FormatMapItem(id, _("Don't care"), count, tsize, hud_fontsize);
 
        text_size = stringwidth(label, false, hud_fontsize);
        
@@ -188,26 +186,23 @@ void MapVote_Draw()
        if(i >= 0 || ymax < (vid_conheight*0.5))
                ymax = vid_conheight - ymin;
 
-       drawfont = hud_bigfont;
        hud_fontsize = HUD_GetFontsize("hud_fontsize");
 
        pos_y = ymin;
        pos_z = 0;
        //pos_x = center - stringwidth("Vote for a map", false) * 0.5 * 24;
-       pos_x = center - stringwidth("Vote for a map", false, '12 0 0');
+       pos_x = center - stringwidth(_("Vote for a map"), false, '12 0 0');
        drawstring(pos, "Vote for a map", '24 24 0', '1 1 1', 1, DRAWFLAG_NORMAL);
        pos_y += 26;
 
        i = ceil(max(0, mv_timeout - time));
-       map = strcat(ftos(i), " seconds left");
+       map = sprintf(_("%d seconds left"), i);
        //pos_x = center - stringwidth(map, false) * 0.5 * 16;
        pos_x = center - stringwidth(map, false, '8 0 0');
        drawstring(pos, map, '16 16 0', '0 1 0', 1, DRAWFLAG_NORMAL);
        pos_y += 22;
        pos_x = xmin;
 
-       drawfont = hud_font;
-       
        // base for multi-column stuff...
        ymin = pos_y;
        if(mv_abstain)
@@ -265,7 +260,7 @@ void Cmd_MapVote_MapDownload(float argc)
 
        if(argc != 2 || !mv_pk3list)
        {
-               print("mv_mapdownload: ^3You're not supposed to use this command on your own!\n");
+               print(_("mv_mapdownload: ^3You're not supposed to use this command on your own!\n"));
                return;
        }
        
@@ -275,19 +270,16 @@ void Cmd_MapVote_MapDownload(float argc)
                        break;
        
        if(!pak || pak.sv_entnum != id) {
-               print("^1Error:^7 Couldn't find pak index.\n");
+               print(_("^1Error:^7 Couldn't find pak index.\n"));
                return;
        }
 
-       //print(strcat("^3Adding: ", ftos(id), " - ", pak.message, " - "));
-       
        if(PreviewExists(pak.message))
        {
                mv_preview[id] = true;
-               //print("^2Found...\n");
                return;
        } else {
-               print("Requesting preview...\n");
+               print(_("Requesting preview...\n"));
                localcmd(strcat("\ncmd mv_getpic ", ftos(id), "\n"));
        }
 }
@@ -386,7 +378,6 @@ void MapVote_Init()
 
                        mv_preview[i] = false;
 
-                       //print(strcat("RECV: ", map, " in ", pk3, "\n"));
                        MapVote_CheckPic(map, pk3, i);
                }
                else