X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fclient%2Fscoreboard.qc;h=8eafb73339df4ee17d54406725a9d8337e0a6f07;hb=b26f1812d999d544c7762afb3479bf93c4309d6b;hp=913a0bfb34b2eef4d87dc640ae0636b9e199681b;hpb=be48928fb84ee1951c1d5eb2e0c5ed6ef64c0b04;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/client/scoreboard.qc b/qcsrc/client/scoreboard.qc index 913a0bfb3..8eafb7333 100644 --- a/qcsrc/client/scoreboard.qc +++ b/qcsrc/client/scoreboard.qc @@ -136,16 +136,16 @@ float HUD_ComparePlayerScores(entity left, entity right) vr = GetPlayerColor(right.sv_entnum); if(!left.gotscores) - vl = COLOR_SPECTATOR; + vl = FL_SPECTATOR; if(!right.gotscores) - vr = COLOR_SPECTATOR; + vr = FL_SPECTATOR; if(vl > vr) return true; if(vl < vr) return false; - if(vl == COLOR_SPECTATOR) + if(vl == FL_SPECTATOR) { // FIRST the one with scores (spectators), THEN the ones without (downloaders) // no other sorting @@ -201,9 +201,9 @@ float HUD_CompareTeamScores(entity left, entity right) { float vl, vr; - if(left.team == COLOR_SPECTATOR) + if(left.team == FL_SPECTATOR) return 1; - if(right.team == COLOR_SPECTATOR) + if(right.team == FL_SPECTATOR) return 0; vl = left.teamscores[ts_primary]; @@ -311,15 +311,15 @@ void Cmd_HUD_SetFields(float argc) // TODO: re enable with gametype dependant cvars? if(argc < 3) // no arguments provided - argc = tokenizebyseparator(strcat("x ", autocvar_scoreboard_columns), " "); + argc = tokenizebyseparator(strcat("0 1 ", autocvar_scoreboard_columns), " "); if(argc < 3) - argc = tokenizebyseparator(strcat("x ", HUD_DefaultColumnLayout()), " "); + argc = tokenizebyseparator(strcat("0 1 ", HUD_DefaultColumnLayout()), " "); if(argc == 3) { if(argv(2) == "default") - argc = tokenizebyseparator(strcat("x ", HUD_DefaultColumnLayout()), " "); + argc = tokenizebyseparator(strcat("0 1 ", HUD_DefaultColumnLayout()), " "); else if(argv(2) == "all") { string s; @@ -334,17 +334,17 @@ void Cmd_HUD_SetFields(float argc) if(ps_secondary != ps_primary) s = strcat(s, " ", scores_label[ps_secondary]); s = strcat(s, " ", scores_label[ps_primary]); - argc = tokenizebyseparator(strcat("x ", s), " "); + argc = tokenizebyseparator(strcat("0 1 ", s), " "); } } hud_num_fields = 0; - hud_fontsize = HUD_GetFontsize("hud_fontsize"); + hud_fontsize = HUD_GetFontsize("hud_fontsize"); draw_beginBoldFont(); - for(i = 0; i < argc - 1; ++i) + for(i = 1; i < argc - 1; ++i) { float nocomplain; str = argv(i+1); @@ -659,11 +659,11 @@ string HUD_FixScoreboardColumnWidth(float i, string str) void HUD_PrintScoreboardItem(vector pos, entity pl, float is_self, float pl_number) { vector tmp, rgb; - rgb = GetTeamRGB(pl.team); + rgb = Team_ColorRGB(pl.team); string str; float i, field; float is_spec; - is_spec = (GetPlayerColor(pl.sv_entnum) == COLOR_SPECTATOR); + is_spec = (GetPlayerColor(pl.sv_entnum) == FL_SPECTATOR); if((rgb == '1 1 1') && (!is_spec)) { rgb_x = autocvar_scoreboard_color_bg_r + 0.5; @@ -907,7 +907,7 @@ vector HUD_Scoreboard_MakeTable(vector pos, entity tm, vector rgb, vector bg_siz else for(pl = players.sort_next; pl; pl = pl.sort_next) { - if(pl.team == COLOR_SPECTATOR) + if(pl.team == FL_SPECTATOR) continue; HUD_PrintScoreboardItem(pos, pl, (pl.sv_entnum == player_localnum), i); pos_y += 1.25 * hud_fontsize_y; @@ -1124,7 +1124,7 @@ vector HUD_DrawScoreboardRankings(vector pos, entity pl, vector rgb, vector bg_ return pos; float is_spec; - is_spec = (GetPlayerColor(pl.sv_entnum) == COLOR_SPECTATOR); + is_spec = (GetPlayerColor(pl.sv_entnum) == FL_SPECTATOR); vector hl_rgb; hl_rgb_x = autocvar_scoreboard_color_bg_r + 0.5; hl_rgb_y = autocvar_scoreboard_color_bg_g + 0.5; @@ -1241,11 +1241,11 @@ void HUD_DrawScoreboard() team_score_baseoffset = eY * (2 * autocvar_scoreboard_border_thickness + hud_fontsize_y) - eX * (autocvar_scoreboard_border_thickness + hud_fontsize_x * 0.25); for(tm = teams.sort_next; tm; tm = tm.sort_next) { - if(tm.team == COLOR_SPECTATOR) + if(tm.team == FL_SPECTATOR) continue; draw_beginBoldFont(); - rgb = GetTeamRGB(tm.team); + rgb = Team_ColorRGB(tm.team); str = ftos(tm.(teamscores[ts_primary])); drawstring(pos + team_score_baseoffset - eX * stringwidth(str, FALSE, hud_fontsize * 1.5), str, hud_fontsize * 1.5, rgb, scoreboard_alpha_fg, DRAWFLAG_NORMAL); @@ -1267,7 +1267,7 @@ void HUD_DrawScoreboard() for(tm = teams.sort_next; tm; tm = tm.sort_next) { - if(tm.team == COLOR_SPECTATOR) + if(tm.team == FL_SPECTATOR) continue; pos = HUD_Scoreboard_MakeTable(pos, tm, rgb, bg_size); @@ -1287,14 +1287,14 @@ void HUD_DrawScoreboard() } else if(autocvar_scoreboard_accuracy && spectatee_status != -1 && !warmup_stage) { if(teamplay) - pos = HUD_DrawScoreboardAccuracyStats(pos, GetTeamRGB(myteam), bg_size); + pos = HUD_DrawScoreboardAccuracyStats(pos, Team_ColorRGB(myteam), bg_size); else pos = HUD_DrawScoreboardAccuracyStats(pos, rgb, bg_size); } if(teamplay) - pos = HUD_DrawMapStats(pos, GetTeamRGB(myteam), bg_size); + pos = HUD_DrawMapStats(pos, Team_ColorRGB(myteam), bg_size); else pos = HUD_DrawMapStats(pos, rgb, bg_size); @@ -1304,7 +1304,7 @@ void HUD_DrawScoreboard() tmp = pos; for(pl = players.sort_next; pl; pl = pl.sort_next) { - if(pl.team != COLOR_SPECTATOR) + if(pl.team != FL_SPECTATOR) continue; pos_y += 1.25 * hud_fontsize_y; HUD_PrintScoreboardItem(pos, pl, (pl.sv_entnum == player_localnum), specs); @@ -1385,15 +1385,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..."); - else - str = strcat("^1Respawning in ^3", ftos_decimals(respawn_time - time, 2), "^1 seconds..."); + respawn_time = max(time, respawn_time); // don't show a negative value while the server is respawning the player (lag) + + 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);