]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix incorrect usage of ftos_decimals, colorset in some transifex strings k9er/colorset-in-hud
authorotta8634 <k9wolf@pm.me>
Sun, 15 Sep 2024 15:17:53 +0000 (23:17 +0800)
committerotta8634 <k9wolf@pm.me>
Sun, 15 Sep 2024 15:17:53 +0000 (23:17 +0800)
Thanks again to terencehill for the review

qcsrc/client/hud/panel/infomessages.qc
qcsrc/client/hud/panel/scoreboard.qc
qcsrc/client/hud/panel/vote.qc

index 12807fb2318b212cc0ce6a116d7e16f21f6bece2..c237c6d773dd110ddfeeeed029c4e44d7d96f492 100644 (file)
@@ -149,7 +149,7 @@ void HUD_InfoMessages()
                {
                        //we need to ceil, otherwise the countdown would be off by .5 when using round()
                        float countdown = ceil(STAT(GAMESTARTTIME) - time);
-                       s = strcat(CCR_F4, sprintf(_("Game starts in %s seconds"), strcat(CCR_F2, ftos_decimals(countdown, 0), CCR_F4)));
+                       s = strcat(CCR_F4, sprintf(_("Game starts in %s seconds"), strcat(CCR_F2, ftos(countdown), CCR_F4)));
                        InfoMessage(s);
                }
 
@@ -171,9 +171,10 @@ void HUD_InfoMessages()
                        if(players_needed > 0)
                        {
                                if(players_needed == 1)
-                                       s = sprintf(_("%s more player is needed for the match to start."), strcat(CCR_F2, "1", CCR_F1));
+                                       s = sprintf(_("%s more player is needed for the match to start."), strcat("1", CCR_F1));
                                else
-                                       s = sprintf(_("%s more players are needed for the match to start."), strcat(CCR_F2, ftos_decimals(players_needed, 0), CCR_F1));
+                                       s = sprintf(_("%s more players are needed for the match to start."), strcat(ftos(players_needed), CCR_F1));
+                               s = strcat(CCR_F2, s);
                                InfoMessage(s);
                        }
                        else if(teamnagger && (ts_max - ts_min) >= teamnagger)
@@ -267,8 +268,8 @@ void HUD_InfoMessages()
        else
        {
                InfoMessage(strcat(CCR_BG, sprintf(_("Press %s to show HUD options."), strcat(CCR_F2, "ESC", CCR_BG))));
-               InfoMessage(sprintf(_("%s a panel for panel-specific options."), strcat(CCR_F2, "Doubleclick", CCR_BG)));
-               InfoMessage(sprintf(_("%s to disable collision testing, %s and"), strcat(CCR_F2, "CTRL", CCR_BG), strcat(CCR_F2, "SHIFT", CCR_BG)));
-               InfoMessage(sprintf(_("%s + %s for fine adjustments."), strcat(CCR_F2, "ALT", CCR_BG), strcat(CCR_F2, "ARROW KEYS", CCR_BG)));
+               InfoMessage(strcat(CCR_F2, sprintf(_("%s a panel for panel-specific options."), strcat("Doubleclick", CCR_BG))));
+               InfoMessage(strcat(CCR_F2, sprintf(_("%s to disable collision testing, %s and"), strcat("CTRL", CCR_BG), strcat(CCR_F2, "SHIFT", CCR_BG))));
+               InfoMessage(strcat(CCR_F2, sprintf(_("%s + %s for fine adjustments."), strcat("ALT", CCR_BG), strcat(CCR_F2, "ARROW KEYS", CCR_BG))));
        }
 }
index 1db63558b1d9ee169ce8baa93eaea5dfca0a4e83..ac913fc408a974ed6a38381dba44eb853fe51965 100644 (file)
@@ -2507,7 +2507,7 @@ void Scoreboard_Draw()
                if (campaign)
                        str = "";
                else
-                       str = sprintf(_("%s/%s players"), strcat(CCR_F5, ftos_decimals(numplayers, 0), CCR_BG), strcat(CCR_F5, ftos_decimals((srv_maxplayers ? srv_maxplayers : maxclients), 0), CCR_BG));
+                       str = sprintf(_("%s/%s players"), strcat(CCR_F5, ftos(numplayers), CCR_BG), strcat(CCR_F5, ftos(srv_maxplayers ? srv_maxplayers : maxclients), CCR_BG));
                str = strcat(CCR_BG, _("Map:"), " ", CCR_F1, mi_shortname, "    ", str); // reusing "Map:" translatable string
                drawcolorcodedstring(pos, str, sb_gameinfo_detail_fontsize, panel_fg_alpha, DRAWFLAG_NORMAL); // align left
        }
@@ -2675,11 +2675,11 @@ void Scoreboard_Draw()
                        if(race_speedaward)
                        {
                                name = textShortenToWidth(ColorTranslateRGB(race_speedaward_holder), namesize, hud_fontsize, stringwidth_colors);
-                               str = sprintf(_("Speed award: %d%s %s"), race_speedaward * conversion_factor, unit, strcat(CCR_BG, "(", name, CCR_BG, ")"));
+                               str = sprintf(_("Speed award: %s"), strcat(ftos(race_speedaward * conversion_factor), unit, " ", CCR_BG, "(", name, CCR_BG, ")"));
                                str = strcat(CCR_BG, str, " / ");
                        }
                        name = textShortenToWidth(ColorTranslateRGB(race_speedaward_alltimebest_holder), namesize, hud_fontsize, stringwidth_colors);
-                       str = strcat(str, CCR_BG, sprintf(_("All-time fastest: %d%s %s"), race_speedaward_alltimebest * conversion_factor, unit, strcat(CCR_BG, "(", name, CCR_BG, ")")));
+                       str = strcat(str, CCR_BG, sprintf(_("All-time fastest: %s"), strcat(ftos(race_speedaward_alltimebest * conversion_factor), unit, " ", CCR_BG, "(", name, CCR_BG, ")")));
                        drawcolorcodedstring(pos, str, hud_fontsize, panel_fg_alpha, DRAWFLAG_NORMAL);
                        pos.y += 1.25 * hud_fontsize.y; // line height + line spacing
                }
index a53013fcc8341afb5902044185876aeb7d3a1387..529c8e764b8a2b2f65fbb055ba05daf22f377a3e 100644 (file)
@@ -30,7 +30,7 @@ void HUD_Vote()
                        LOG_INFO(_("^1You must answer before entering hud configure mode"));
                        cvar_set("_hud_configure", "0");
                }
-               strcpy(vote_called_vote, strcat(CCR_F1, sprintf(_("Name%s instead of \"%sAnonymous player%s\" in stats"), CCR_BG, CCR_F4, CCR_BG)));
+               strcpy(vote_called_vote, _("^2Name ^7instead of \"^1Anonymous player^7\" in stats"));
                uid2name_dialog = 1;
        }