From 77c8f18d6cf54ac0c0b1e426ac79842e7f593c80 Mon Sep 17 00:00:00 2001 From: Samual Lenks Date: Sun, 2 Dec 2012 14:15:32 -0500 Subject: [PATCH] Make the strings translatable, plus add a cvar for controlling the decimal places to display (2 was too many, and just simply unnecessary) --- defaultXonotic.cfg | 1 + qcsrc/client/autocvars.qh | 1 + qcsrc/client/scoreboard.qc | 8 ++++---- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/defaultXonotic.cfg b/defaultXonotic.cfg index 88a0d0ca5..9796e6002 100644 --- a/defaultXonotic.cfg +++ b/defaultXonotic.cfg @@ -963,6 +963,7 @@ seta scoreboard_offset_left 0.15 "how far (by percent) the scoreboard is offset seta scoreboard_offset_right 0.15 "how far (by percent) the scoreboard is offset from the right screen edge" seta scoreboard_offset_vertical 0.05 "how far (by percent) the scoreboard is offset from the top and bottom of the screen" seta scoreboard_bg_scale 0.25 "scale for the tiled scoreboard background" +seta scoreboard_respawntime_decimals 1 "decimal places to show for the respawntime countdown display on the scoreboard" seta accuracy_color_levels "0 20 100" "accuracy values at which a specified color (accuracy_color) will be used. If your accuracy is between 2 of these values then a mix of the Xth and X+1th colors will be used. You can specify up to 10 values, in increasing order" seta accuracy_color0 "1 0 0" diff --git a/qcsrc/client/autocvars.qh b/qcsrc/client/autocvars.qh index 0d4513f92..5d5637473 100644 --- a/qcsrc/client/autocvars.qh +++ b/qcsrc/client/autocvars.qh @@ -367,6 +367,7 @@ var float autocvar_scoreboard_highlight_alpha_self = 0.25; float autocvar_scoreboard_offset_left; float autocvar_scoreboard_offset_right; float autocvar_scoreboard_offset_vertical; +float autocvar_scoreboard_respawntime_decimals; float autocvar_v_flipped; float autocvar_vid_conheight; float autocvar_vid_conwidth; diff --git a/qcsrc/client/scoreboard.qc b/qcsrc/client/scoreboard.qc index 913a0bfb3..364f9e969 100644 --- a/qcsrc/client/scoreboard.qc +++ b/qcsrc/client/scoreboard.qc @@ -1386,14 +1386,14 @@ void HUD_DrawScoreboard() // a negative number means we are awaiting respawn, time value is still the same respawn_time *= -1; // remove mark now that we checked it if(time >= respawn_time) // don't show a negative value while the server is respawning the player (lag) - str = strcat("^1Respawning..."); + str = _("^1Respawning..."); else - str = strcat("^1Respawning in ^3", ftos_decimals(respawn_time - time, 2), "^1 seconds..."); + str = sprintf(_("^1Respawning in ^3%s^1 seconds..."), ftos_decimals(respawn_time - time, autocvar_scoreboard_respawntime_decimals)); } else if(time < respawn_time) - str = strcat("You are dead, wait ^3", ftos_decimals(respawn_time - time, 2), "^7 seconds before respawning"); + str = sprintf(_("You are dead, wait ^3%s^7 seconds before respawning"), ftos_decimals(respawn_time - time, autocvar_scoreboard_respawntime_decimals)); else if(time >= respawn_time) - str = strcat("You are dead, press ^2", getcommandkey("primary fire", "+fire"), "^7 to respawn"); + str = sprintf(_("You are dead, press ^2%s^7 to respawn"), getcommandkey("jump", "+jump")); pos_y += 1.2 * hud_fontsize_y; drawcolorcodedstring(pos + '0.5 0 0' * (sbwidth - stringwidth(str, TRUE, hud_fontsize)), str, hud_fontsize, scoreboard_alpha_fg, DRAWFLAG_NORMAL); -- 2.39.2