]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add country flags for spectators/other players
authorz411 <z411@omaera.org>
Thu, 15 Apr 2021 17:17:27 +0000 (13:17 -0400)
committerz411 <z411@omaera.org>
Thu, 15 Apr 2021 17:17:27 +0000 (13:17 -0400)
qcsrc/client/hud/panel/scoreboard.qc

index 1dd00cc66639088108c05b1029f7677bad87e104..8100e0f8b4c39e8628a990a9c8817ba6ee07ff71 100644 (file)
@@ -1061,6 +1061,7 @@ vector Scoreboard_DrawOthers(vector item_pos, vector rgb, int this_team, entity
        int i = 0;
        vector h_pos = item_pos;
        vector h_size = vec2(panel_size.x, hud_fontsize.y * 1.25);
+       vector sz, f_size;
 
        bool complete = (this_team == NUM_SPECTATOR);
 
@@ -1136,9 +1137,19 @@ vector Scoreboard_DrawOthers(vector item_pos, vector rgb, int this_team, entity
                        }
                }
 
+               Scoreboard_GetField(pl, SP_COUNTRY);
+               if(sbt_field_icon3 != "") {
+                       sz = draw_getimagesize(sbt_field_icon3);
+                       f_size = vec2(hud_fontsize.x * (sz.x / sz.y), hud_fontsize.y);
+
+                       drawpic(pos, sbt_field_icon3, f_size, sbt_field_icon1_rgb, sbt_fg_alpha, DRAWFLAG_NORMAL);
+                       pos.x += f_size.x + hud_fontsize.x * 0.5;
+               }
+
                vector name_pos = pos;
                if((this_team == NUM_SPECTATOR) && autocvar_hud_panel_scoreboard_spectators_aligned)
                        name_pos.x += max(fieldsize, min_fieldsize) + 2 * fieldpadding + hud_fontsize.x * 0.25;
+
                drawcolorcodedstring(name_pos, str, hud_fontsize, sbt_fg_alpha, DRAWFLAG_NORMAL);
                if(field != "")
                {