Add persistent Discord URL to T5 and T6 HUDs

This commit is contained in:
2026-10-12 19:42:39 -04:00
parent 664e8da81b
commit eda2c7e76d
8 changed files with 86 additions and 12 deletions
+10 -1
View File
@@ -11,7 +11,7 @@ Platform quirks and deploy commands: [NOTES.md](NOTES.md).
| File | Role |
|---|---|
| [tws_t5_common.gsc](tws_t5_common.gsc) | Shared config, HUD helpers, `.help`, connect/spawn registries, single `connected` listener + dispatcher |
| [tws_t5_hud.gsc](tws_t5_hud.gsc) | Bottom-left HUD stack: timers, zombie count, health bar |
| [tws_t5_hud.gsc](tws_t5_hud.gsc) | Top-left Discord URL, timers, zombie count, health bar |
| [tws_t5_afk.gsc](tws_t5_afk.gsc) | `.afk` / `.back` chat toggle + `[AFK]` indicator |
| [tws_t5_join.gsc](tws_t5_join.gsc) | `.join` lets newcomers spawn before the current round ends |
| [tws_t5_lock.gsc](tws_t5_lock.gsc) | Lobby `g_password` lock at a milestone round |
@@ -31,6 +31,15 @@ that directory:
Do not leave both common scripts installed: duplicate connection listeners
break T5's connect handshake. Existing dvar names are unchanged.
## Persistent Discord text
The HUD shows `https://discord.thewrightserver.net` in small light-gray text
at the top-left, including for newcomers waiting in spectator mode. The label
is created once per connection and persists across death and respawn. The
gameplay HUD starts one line lower, keeping timers, help and records clear.
Install HUD and common `1.1.0` together, then restart the map; no plugin update
or full server-process restart is required.
## Map record announcements
Copy `tws_t5_leaderboard.gsc` and the updated `tws_t5_common.gsc` to
+2 -2
View File
@@ -20,9 +20,9 @@ common_config()
if (isDefined(level.hud_x))
return;
// anchor: move the whole cluster with these two
// Anchor the gameplay stack below the persistent Discord line.
level.hud_x = 10;
level.hud_y = 10;
level.hud_y = 30;
level.hud_row_match = level.hud_y;
level.hud_row_round = level.hud_y + 15;
+16 -1
View File
@@ -1,4 +1,4 @@
/* tws_t5_hud.gsc — bottom-left HUD stack. Timer / zombie count / health bar. */
/* tws_t5_hud.gsc — top-left Discord URL, timers, zombie count and health bar. */
#include maps\_utility;
#include common_scripts\utility;
@@ -14,6 +14,21 @@ init()
level thread game_over_watcher();
scripts\sp\tws_t5_common::register_spawn_handler(::hud_start);
scripts\sp\tws_t5_common::register_connect_handler(::hud_discord);
}
// One static label per connection, including newcomers waiting to spawn.
hud_discord()
{
self endon("disconnect");
label = scripts\sp\tws_t5_common::make_text_elem(
self, 10, 10, "left", level.hud_font_small, level.hud_c_label);
label SetText("https://discord.thewrightserver.net");
elems = [];
elems[elems.size] = label;
self thread scripts\sp\tws_t5_common::destroy_on_disconnect(elems);
}
hud_start()