]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge remote-tracking branch 'origin/master' into samual/notification_rewrite
authorSamual Lenks <samual@xonotic.org>
Fri, 14 Dec 2012 10:14:00 +0000 (05:14 -0500)
committerSamual Lenks <samual@xonotic.org>
Fri, 14 Dec 2012 10:14:00 +0000 (05:14 -0500)
1  2 
qcsrc/client/scoreboard.qc

index 0984f7ce1a512b4b8cd24729a30ddbca24caeae2,303be36205e39c8b9eaa23815eb5bf84aa440649..8eafb73339df4ee17d54406725a9d8337e0a6f07
@@@ -136,16 -136,16 +136,16 @@@ float HUD_ComparePlayerScores(entity le
        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 +201,9 @@@ float HUD_CompareTeamScores(entity left
  {
        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];
@@@ -659,11 -659,11 +659,11 @@@ string HUD_FixScoreboardColumnWidth(flo
  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 +907,7 @@@ vector HUD_Scoreboard_MakeTable(vector 
        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 +1124,7 @@@ vector HUD_DrawScoreboardRankings(vecto
                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 +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);
  
  
                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);
        }
        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);
  
        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);
                {
                        // 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 = _("^1Respawning...");
-                       else
-                               str = sprintf(_("^1Respawning in ^3%s^1 seconds..."), ftos_decimals(respawn_time - time, autocvar_scoreboard_respawntime_decimals));
+                       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 = sprintf(_("You are dead, wait ^3%s^7 seconds before respawning"), ftos_decimals(respawn_time - time, autocvar_scoreboard_respawntime_decimals));