]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Show hostname on scoreboard
authorz411 <z411@omaera.org>
Sat, 5 Sep 2020 18:48:30 +0000 (14:48 -0400)
committerz411 <z411@omaera.org>
Sat, 5 Sep 2020 18:48:30 +0000 (14:48 -0400)
qcsrc/client/hud/panel/scoreboard.qc
qcsrc/client/main.qc
qcsrc/client/main.qh
qcsrc/server/client.qc

index 4910699b43968268292117ee4e365bf38aa7a6a1..a0c5a337e53e2d42c836dabb4482058f50f9cce5 100644 (file)
@@ -1624,6 +1624,7 @@ void Scoreboard_Draw()
        draw_beginBoldFont();
        //drawcolorcodedstring(pos + '0.5 0 0' * (panel_size.x - stringwidth(str, true, sb_gameinfo_type_fontsize)), str, sb_gameinfo_type_fontsize, panel_fg_alpha, DRAWFLAG_NORMAL);
        drawcolorcodedstring(pos, str, sb_gameinfo_type_fontsize, panel_fg_alpha, DRAWFLAG_NORMAL);
+       draw_endBoldFont();
        
        vector tmp_old_sz = draw_getimagesize("gfx/bai_logo");
        float tmp_aspect = tmp_old_sz.x/tmp_old_sz.y;
@@ -1631,8 +1632,13 @@ void Scoreboard_Draw()
 
        drawpic(pos + '1 0 0' * (panel_size.x - tmp_new_sz.x), "gfx/bai_logo", tmp_new_sz, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
        
-       draw_endBoldFont();
-
+       pos.y += sb_gameinfo_type_fontsize.y;
+       
+       // z411 servername
+       drawcolorcodedstring(pos + '0.5 0 0' * (panel_size.x - stringwidth(hostname, true, sb_gameinfo_detail_fontsize)), hostname, sb_gameinfo_detail_fontsize, panel_fg_alpha, DRAWFLAG_NORMAL);
+       
+       pos.y += sb_gameinfo_detail_fontsize.y;
+       
        // Game Info: Game Detail
        float tl = STAT(TIMELIMIT);
        float fl = STAT(FRAGLIMIT);
@@ -1690,7 +1696,6 @@ void Scoreboard_Draw()
                }
        }
 
-       pos.y += sb_gameinfo_type_fontsize.y + 10;
        drawcolorcodedstring(pos + '1 0 0' * (panel_size.x - stringwidth(str, true, sb_gameinfo_detail_fontsize)), str, sb_gameinfo_detail_fontsize, panel_fg_alpha, DRAWFLAG_NORMAL); // align right
        // map name
        str = sprintf(_("^7Map: ^2%s"), shortmapname);
index ad11dbd296254b5bdbf580109d0b9b3276278d2e..8ac1a067cc5e9ae1a63d52fef7485aafd901fbd5 100644 (file)
@@ -920,6 +920,8 @@ NET_HANDLE(ENT_CLIENT_INIT, bool isnew)
        serverflags = ReadByte();
 
        g_trueaim_minrange = ReadCoord();
+       
+       strcpy(hostname, ReadString());
 
        return = true;
 
index 784ecb9c99edf37d308a6e3aa14e8a9cc74d2e3b..95df48074042ae387c58727c52e0afbfb3da0163 100644 (file)
@@ -3,6 +3,9 @@
 #include <common/constants.qh>
 #include <common/weapons/_all.qh>
 
+// z411
+string hostname;
+
 // Map coordinate base calculations need these
 vector mi_center;
 vector mi_scale;
index 08cfd1e98e974ff00555913dd4e591573ae950d8..33df8ab98d8841c21b4db07e45ec4a875855ab33 100644 (file)
@@ -874,6 +874,9 @@ void ClientInit_misc(entity this)
        WriteByte(channel, this.cnt * 255.0); // g_balance_damagepush_speedfactor
        WriteByte(channel, serverflags);
        WriteCoord(channel, autocvar_g_trueaim_minrange);
+       
+       // z411 send hostname
+       WriteString(channel, autocvar_hostname);
 }
 
 void ClientInit_CheckUpdate(entity this)