From: z411 Date: Sat, 5 Sep 2020 18:48:30 +0000 (-0400) Subject: Show hostname on scoreboard X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=79aa530d15725f994c2b6150ac52cb25d2e50967;p=xonotic%2Fxonotic-data.pk3dir.git Show hostname on scoreboard --- diff --git a/qcsrc/client/hud/panel/scoreboard.qc b/qcsrc/client/hud/panel/scoreboard.qc index 4910699b4..a0c5a337e 100644 --- a/qcsrc/client/hud/panel/scoreboard.qc +++ b/qcsrc/client/hud/panel/scoreboard.qc @@ -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); diff --git a/qcsrc/client/main.qc b/qcsrc/client/main.qc index ad11dbd29..8ac1a067c 100644 --- a/qcsrc/client/main.qc +++ b/qcsrc/client/main.qc @@ -920,6 +920,8 @@ NET_HANDLE(ENT_CLIENT_INIT, bool isnew) serverflags = ReadByte(); g_trueaim_minrange = ReadCoord(); + + strcpy(hostname, ReadString()); return = true; diff --git a/qcsrc/client/main.qh b/qcsrc/client/main.qh index 784ecb9c9..95df48074 100644 --- a/qcsrc/client/main.qh +++ b/qcsrc/client/main.qh @@ -3,6 +3,9 @@ #include #include +// z411 +string hostname; + // Map coordinate base calculations need these vector mi_center; vector mi_scale; diff --git a/qcsrc/server/client.qc b/qcsrc/server/client.qc index 08cfd1e98..33df8ab98 100644 --- a/qcsrc/server/client.qc +++ b/qcsrc/server/client.qc @@ -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)