if (gametype.m_1v1)
Announcer_Duel();
else
- centerprint_SetTitle(strcat("^BG", MapInfo_Type_ToText(gametype))); // Show game type as title
+ centerprint_SetTitle(strcat(CCR_BG, MapInfo_Type_ToText(gametype))); // Show game type as title
if(time + 5.0 < startTime) // if connecting to server while restart was active don't always play prepareforbattle
Local_Notification(MSG_ANNCE, ANNCE_PREPARE);
void centerprint_SetTitle(string title)
{
if(title != centerprint_title)
- strcpy(centerprint_title, CCR(title));
+ strcpy(centerprint_title, title);
}
void centerprint_ClearTitle()
else
max_rl_width = right_width;
- width = max_rl_width * 2 + padding * 6 + stringwidth(_("vs"), false, fontsize);
+ string str_vs = strcat(CCR_BG, _("vs"));
+ width = max_rl_width * 2 + padding * 6 + stringwidth(str_vs, true, fontsize);
pos.x += (panel_size.x - width) * align;
duel_title_pos = pos;
drawcolorcodedstring(pos, centerprint_title_left, fontsize, panel_fg_alpha, DRAWFLAG_NORMAL);
pos.x = duel_title_pos.x + max_rl_width + padding * 3;
- drawcolorcodedstring(pos, strcat(CCR_BG, _("vs")), fontsize, panel_fg_alpha, DRAWFLAG_NORMAL);
+ drawcolorcodedstring(pos, str_vs, fontsize, panel_fg_alpha, DRAWFLAG_NORMAL);
pos.x = duel_title_pos.x + width - padding - max_rl_width;
if (left_width >= right_width)
if(spectatee_status == -1)
s = _("Observing");
else
- s = sprintf(CCR(_("Spectating: ^BG%s")), entcs_GetName(current_player));
+ s = sprintf(_("Spectating: %s"), strcat(CCR_BG, entcs_GetName(current_player)));
s = strcat(CCR_F4, s);
InfoMessage(s);
default:
case 0:
if(spectatee_status == -1)
- s = sprintf(CCR(_("Press ^F2%s^F4 to spectate")), getcommandkey(_("primary fire"), "+fire"));
+ s = sprintf(_("Press %s to spectate"), strcat(CCR_F2, getcommandkey(_("primary fire"), "+fire"), CCR_F4));
else
- s = sprintf(CCR(_("Press ^F2%s^F4 or ^F2%s^F4 for next or previous player")), getcommandkey(_("next weapon"), "weapnext"), getcommandkey(_("previous weapon"), "weapprev"));
+ s = sprintf(_("Press %s or %s for next or previous player"), strcat(CCR_F2, getcommandkey(_("next weapon"), "weapnext"), CCR_F4), strcat(CCR_F2, getcommandkey(_("previous weapon"), "weapprev"), CCR_F4));
break;
case 1:
if(spectatee_status == -1)
- s = sprintf(CCR(_("Use ^F2%s^F4 or ^F2%s^F4 to change the speed")), getcommandkey(_("next weapon"), "weapnext"), getcommandkey(_("previous weapon"), "weapprev"));
+ s = sprintf(_("Use %s or %s to change the speed"), strcat(CCR_F2, getcommandkey(_("next weapon"), "weapnext"), CCR_F4), strcat(CCR_F2, getcommandkey(_("previous weapon"), "weapprev"), CCR_F4));
else if(!observe_blocked)
- s = sprintf(CCR(_("Press ^F2%s^F4 to observe, ^F2%s^F4 to change camera mode")), getcommandkey(_("secondary fire"), "+fire2"), getcommandkey(_("drop weapon"), "dropweapon"));
+ s = sprintf(_("Press %s to observe, %s to change camera mode"), strcat(CCR_F2, getcommandkey(_("secondary fire"), "+fire2"), CCR_F4), strcat(CCR_F2, getcommandkey(_("drop weapon"), "dropweapon"), CCR_F4));
else
- s = sprintf(CCR(_("Press ^F2%s^F4 to change camera mode")), getcommandkey(_("drop weapon"), "dropweapon"));
+ s = sprintf(_("Press %s to change camera mode"), strcat(CCR_F2, getcommandkey(_("drop weapon"), "dropweapon"), CCR_F4));
break;
case 2:
- s = sprintf(CCR(_("Press ^F2%s^F4 for gamemode info")), getcommandkey(_("server info"), "+show_info"));
+ s = sprintf(_("Press %s for gamemode info"), strcat(CCR_F2, getcommandkey(_("server info"), "+show_info"), CCR_F4));
break;
}
s = strcat(CCR_F4, s);
if(tm > 0)
{
tm = Team_IndexToTeam(tm);
- s = strcat(CCR_F1, sprintf(CCR(_("You're queued to join the %s%s^F1 team")), Team_ColorCode(tm), Team_ColorName(tm)));
+ s = strcat(CCR_F1, sprintf(_("You're queued to join the %s team"), strcat(Team_ColorCode(tm), Team_ColorName(tm), CCR_F1)));
}
else if (tm < 0)
s = strcat(CCR_F1, sprintf(_("You're queued to join any available team")));
else
- s = strcat(CCR_F4, sprintf(CCR(_("Press ^F2%s^F4 to join")), getcommandkey(_("jump"), "+jump")));
+ s = strcat(CCR_F4, sprintf(_("Press %s to join"), strcat(CCR_F2, getcommandkey(_("jump"), "+jump"), CCR_F4)));
InfoMessage(s);
}
}
{
//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(CCR(_("Game starts in ^F2%d^F4 seconds")), countdown));
+ s = strcat(CCR_F4, sprintf(_("Game starts in %s seconds"), strcat(CCR_F2, ftos_decimals(countdown, 0), CCR_F4)));
InfoMessage(s);
}
if(warmup_stage)
{
- InfoMessage(strcat(CCR_F1, CCR(_("Currently in ^F4warmup^F1 stage!"))));
+ InfoMessage(strcat(CCR_F1, sprintf(_("Currently in %s stage!"), strcat(CCR_F4, _("warmup"), CCR_F1))));
int players_needed = 0;
Scoreboard_UpdatePlayerTeams(); // ensure numplayers, ts_min, ts_max are current
if(players_needed > 0)
{
if(players_needed == 1)
- s = CCR(_("1^F1 more player is needed for the match to start."));
+ s = sprintf(_("%s more player is needed for the match to start."), strcat(CCR_F2, "1", CCR_F1));
else
- s = sprintf(CCR(_("%d^F1 more players are needed for the match to start.")), players_needed);
- s = strcat(CCR_F2, s);
+ s = sprintf(_("%s more players are needed for the match to start."), strcat(CCR_F2, ftos_decimals(players_needed, 0), CCR_F1));
InfoMessage(s);
}
else if(teamnagger && (ts_max - ts_min) >= teamnagger)
if(ready_waiting)
{
if(ready_waiting_for_me)
- s = sprintf(CCR(_("%sPress ^F2%s%s to end warmup")), blinkcolor, getcommandkey(_("ready"), "ready"), blinkcolor);
+ s = strcat(blinkcolor, sprintf(_("Press %s to end warmup"), strcat(CCR_F2, getcommandkey(_("ready"), "ready"), blinkcolor)));
else
s = strcat(CCR_F1, _("Waiting for others to ready up to end warmup..."));
}
else
- s = strcat(CCR_F1, sprintf(CCR(_("Press ^F2%s^F1 to end warmup")), getcommandkey(_("ready"), "ready")));
+ s = strcat(CCR_F1, sprintf(_("Press %s to end warmup"), strcat(CCR_F2, getcommandkey(_("ready"), "ready"), CCR_F1)));
InfoMessage(s);
}
}
s = strcat(blinkcolor, _("Teams are unbalanced!"));
entity tm = GetTeam(myteam, false);
if (tm && tm.team != NUM_SPECTATOR && tm.team_size == ts_max)
- s = strcat(s, sprintf(CCR(_(" Press ^F2%s%s to adjust")), getcommandkey(_("team selection"), "team_selection_show"), blinkcolor));
+ s = strcat(s, sprintf(_(" Press %s to adjust"), strcat(CCR_F2, getcommandkey(_("team selection"), "team_selection_show"), blinkcolor)));
fontsize *= 1.125; // perfect float
draw_beginBoldFont();
InfoMessage(s);
}
else
{
- InfoMessage(strcat(CCR_BG, CCR(_("Press ^F2ESC ^BGto show HUD options."))));
- InfoMessage(strcat(CCR_F2, CCR(_("Doubleclick ^BGa panel for panel-specific options."))));
- InfoMessage(strcat(CCR_F2, CCR(_("CTRL ^BGto disable collision testing, ^F2SHIFT ^BGand"))));
- InfoMessage(strcat(CCR_F2, CCR(_("ALT ^BG+ ^F2ARROW KEYS ^BGfor fine adjustments."))));
+ 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)));
}
}
if (scoreboard_ui_enabled == 2)
{
if (scoreboard_selected_team)
- str = strcat(CCR_BG, sprintf(CCR(_("Press ^F2%s^BG to join the selected team")), translate_key("SPACE")));
+ str = strcat(CCR_BG, sprintf(_("Press %s to join the selected team"), strcat(CCR_F2, translate_key("SPACE"), CCR_BG)));
else
- str = strcat(CCR_BG, sprintf(CCR(_("Press ^F2%s^BG to auto-select a team and join")), translate_key("SPACE")));
+ str = strcat(CCR_BG, sprintf(_("Press %s to auto-select a team and join"), strcat(CCR_F2, translate_key("SPACE"), CCR_BG)));
drawcolorcodedstring(pos + '0.5 0 0' * (panel_size.x - stringwidth(str, true, sb_gameinfo_detail_fontsize)), str, sb_gameinfo_detail_fontsize, panel_fg_alpha, DRAWFLAG_NORMAL);
pos.y += sb_gameinfo_detail_fontsize.y + hud_fontsize.y * 0.3;
- str = strcat(CCR_BG, sprintf(CCR(_("Press ^F2%s ^BGto select a specific team")), translate_key("TAB")));
+ str = strcat(CCR_BG, sprintf(_("Press %s to select a specific team"), strcat(CCR_F2, translate_key("TAB"), CCR_BG)));
drawcolorcodedstring(pos + '0.5 0 0' * (panel_size.x - stringwidth(str, true, sb_gameinfo_detail_fontsize)), str, sb_gameinfo_detail_fontsize, panel_fg_alpha, DRAWFLAG_NORMAL);
}
else
if (campaign)
str = "";
else
- str = sprintf(CCR(_("^F5%d^BG/^F5%d ^BGplayers")), numplayers, srv_maxplayers ? srv_maxplayers : maxclients);
+ 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 = 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
}
if(race_speedaward)
{
name = textShortenToWidth(ColorTranslateRGB(race_speedaward_holder), namesize, hud_fontsize, stringwidth_colors);
- str = sprintf(CCR(_("Speed award: %d%s ^BG(%s^BG)")), race_speedaward * conversion_factor, unit, name);
- str = strcat(str, " / ");
+ str = sprintf(_("Speed award: %d%s %s"), race_speedaward * conversion_factor, unit, strcat(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, sprintf(CCR(_("All-time fastest: %d%s ^BG(%s^BG)")), race_speedaward_alltimebest * conversion_factor, unit, name));
+ str = strcat(str, CCR_BG, sprintf(_("All-time fastest: %d%s %s"), race_speedaward_alltimebest * conversion_factor, unit, strcat(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
}
if(respawn_time < time) // it happens for a few frames when server is respawning the player
str = ""; // draw an empty string to not change suddenly scoreboard_bottom
else
- str = strcat(CCR_F4, sprintf(CCR(_("Respawning in ^F2%s^F4...")),
+ str = strcat(CCR_F4, sprintf(_("Respawning in %s..."), strcat(CCR_F2,
(autocvar_hud_panel_scoreboard_respawntime_decimals ?
count_seconds_decs(respawn_time - time, autocvar_hud_panel_scoreboard_respawntime_decimals)
:
count_seconds(ceil(respawn_time - time))
- )
+ ), CCR_F4)
));
}
else if(time < respawn_time)
{
- str = sprintf(CCR(_("You are dead, wait ^F2%s^BG before respawning")),
+ str = strcat(CCR_BG, sprintf(_("You are dead, wait %s before respawning"), strcat(CCR_F2,
(autocvar_hud_panel_scoreboard_respawntime_decimals ?
count_seconds_decs(respawn_time - time, autocvar_hud_panel_scoreboard_respawntime_decimals)
:
count_seconds(ceil(respawn_time - time))
- )
- );
+ ), CCR_BG)
+ ));
}
else if(time >= respawn_time)
- str = sprintf(CCR(_("You are dead, press ^F1%s^BG to respawn")), getcommandkey("jump", "+jump"));
+ str = strcat(CCR_BG, sprintf(_("You are dead, press %s to respawn"), strcat(CCR_F1, getcommandkey("jump", "+jump"), CCR_BG)));
pos.y += 1.2 * hud_fontsize.y;
drawcolorcodedstring(pos + '0.5 0 0' * (panel_size.x - stringwidth(str, true, hud_fontsize)), str, hud_fontsize, panel_fg_alpha, DRAWFLAG_NORMAL);
LOG_INFO(_("^1You must answer before entering hud configure mode"));
cvar_set("_hud_configure", "0");
}
- strcpy(vote_called_vote, strcat(CCR_F1, CCR(_("Name ^BGinstead of \"^F4Anonymous player^BG\" in stats"))));
+ strcpy(vote_called_vote, strcat(CCR_F1, sprintf(_("Name%s instead of \"%sAnonymous player%s\" in stats"), CCR_BG, CCR_F4, CCR_BG)));
uid2name_dialog = 1;
}
}
mySize = newSize;
- s = strcat(CCR_BG, _("A vote has been called for:"));
if(uid2name_dialog)
s = strcat(CCR_BG, _("Allow servers to store and display your name?"));
+ else
+ s = strcat(CCR_BG, _("A vote has been called for:"));
drawcolorcodedstring_aspect(pos, s, vec2(mySize.x, (2/8) * mySize.y), panel_fg_alpha, DRAWFLAG_NORMAL);
s = textShortenToWidth(ColorTranslateRGB(vote_called_vote), mySize.x, '1 1 0' * mySize.y * (1/8), stringwidth_colors);
if(autocvar__hud_configure)
drawcolorcodedstring_aspect(pos + eY * (2/8) * mySize.y, s, vec2(mySize.x, (1.75/8) * mySize.y), panel_fg_alpha, DRAWFLAG_NORMAL);
// print the yes/no counts
- s = strcat(CCR_C3, sprintf(CCR("%s ^BG(%d)"), getcommandkey_forcename(_("Yes"), "vyes"), vote_yescount));
+ s = sprintf("%s%s %s(%d)", CCR_C3, getcommandkey_forcename(_("Yes"), "vyes"), CCR_BG, vote_yescount);
drawcolorcodedstring_aspect(pos + eY * (4/8) * mySize.y, s, vec2(0.5 * mySize.x, (1.5/8) * mySize.y), panel_fg_alpha, DRAWFLAG_NORMAL);
- s = strcat(CCR_C1, sprintf(CCR("%s ^BG(%d)"), getcommandkey_forcename(_("No"), "vno"), vote_nocount));
+ s = sprintf("%s%s %s(%d)", CCR_C1, getcommandkey_forcename(_("No"), "vno"), CCR_BG, vote_nocount);
drawcolorcodedstring_aspect(pos + vec2(0.5 * mySize.x, (4/8) * mySize.y), s, vec2(0.5 * mySize.x, (1.5/8) * mySize.y), panel_fg_alpha, DRAWFLAG_NORMAL);
pos.y += (5/8) * mySize.y;
switch(autocvar_hud_panel_weapons_label)
{
case 1: // weapon number
- label_str = strcat(CCR_BG, ftos(weapon_id));
+ label_str = ftos(weapon_id);
break;
case 2: // bind
- label_str = strcat(CCR_BG, getcommandkey(ftos(weapon_id), strcat("weapon_group_", ftos(weapon_id))));
+ label_str = getcommandkey(ftos(weapon_id), strcat("weapon_group_", ftos(weapon_id)));
break;
case 3: // weapon name
- label_str = strcat(CCR_BG, strtolower(it.m_name));
+ label_str = strtolower(it.m_name);
break;
default: // nothing
break;
}
if(label_str != "")
+ {
+ label_str = strcat(CCR_BG, label_str);
drawcolorcodedstring(weapon_pos, label_str, label_size, panel_fg_alpha, DRAWFLAG_NORMAL);
+ }
// draw ammo status bar
if(!infinite_ammo && autocvar_hud_panel_weapons_ammo && (it.ammo_type != RES_NONE))
string msg = strcat(
CCR_F1, sprintf(_("Level %d:"), campaign_level), " ",
CCR_BG, sprintf("%s\n\n", "_LEVEL_DESC"),
- CCR_BG, sprintf(CCR(_("Press ^F2%s^BG to enter the game")), key));
+ CCR_BG, sprintf(_("Press %s to enter the game"), strcat(CCR_F2, key, CCR_BG)));
msg = MakeConsoleSafe(strreplace("\n", "\\n", msg));
string welcomedialog_args = strcat("CAMPAIGN ", itos(campaign_level), " \"", msg, "\"");