From eda2c7e76d28c11a61905756a9b1d33b6d7c17b5 Mon Sep 17 00:00:00 2001 From: Josh Wright Date: Mon, 12 Oct 2026 19:42:39 -0400 Subject: [PATCH] Add persistent Discord URL to T5 and T6 HUDs --- CHANGELOG.md | 26 ++++++++++++++++++++++++++ t5/scripts/README.md | 11 ++++++++++- t5/scripts/tws_t5_common.gsc | 4 ++-- t5/scripts/tws_t5_hud.gsc | 17 ++++++++++++++++- t6/scripts/README.md | 11 ++++++++++- t6/scripts/tws_t6_common.gsc | 4 ++-- t6/scripts/tws_t6_hud.gsc | 17 ++++++++++++++++- versions.json | 8 ++++---- 8 files changed, 86 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index df68b3b..4463b53 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,32 @@ T5/T6 script and each native plugin. Current versions are recorded in - Portable regression fixtures: `node tools/check_join.mjs`. Compilation and live Plutonium validation remain required; no deployment was performed. +### Persistent top-left Discord URL + +| Script | Version | Affected source | +| --- | --- | --- | +| `tws_t5_hud.gsc` | `1.1.0` | `t5/scripts/tws_t5_hud.gsc` | +| `tws_t5_common.gsc` | `1.1.0` | `t5/scripts/tws_t5_common.gsc` | +| `tws_t6_hud.gsc` | `1.1.0` | `t6/scripts/tws_t6_hud.gsc` | +| `tws_t6_common.gsc` | `1.1.0` | `t6/scripts/tws_t6_common.gsc` | + +- Add `https://discord.thewrightserver.net` as a small, light-gray top-left + HUD label, created once per connection, including spectator newcomers. + It has no expiry or death/respawn reset and is cleaned up on disconnect. + Move the gameplay stack down 20 HUD units to leave room above the timers; + help and record positioning follow the shared layout automatically. +- Both engines receive the feature using their existing HUD anchors: T5 + left/top safe-area alignment and T6 fullscreen alignment. +- Compatibility: deploy each game's HUD and common `1.1.0` together for the + reserved top line. No new native plugin or external dependency requirement. + Other scripts and both plugins retain their existing versions. +- Deployment: copy the updated HUD and common scripts to `storage/t5/scripts/sp/` + or `storage/t6/scripts/zm/`, respectively, and restart the map. No full + server-process restart is required. No deployment has been performed here. +- Live validation remains required on both Plutonium games: check placement + and readability, join as a spectator, die/respawn, reconnect, and open help + and records to verify spacing and that only one URL label appears. + ### Initial versioning baseline Established independent version `1.0.0` entries for each of the 14 scripts and diff --git a/t5/scripts/README.md b/t5/scripts/README.md index 9f9bc28..5d617b1 100644 --- a/t5/scripts/README.md +++ b/t5/scripts/README.md @@ -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 diff --git a/t5/scripts/tws_t5_common.gsc b/t5/scripts/tws_t5_common.gsc index 4cbb0a7..5bf7f81 100644 --- a/t5/scripts/tws_t5_common.gsc +++ b/t5/scripts/tws_t5_common.gsc @@ -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; diff --git a/t5/scripts/tws_t5_hud.gsc b/t5/scripts/tws_t5_hud.gsc index 8c9d71d..83d0fde 100644 --- a/t5/scripts/tws_t5_hud.gsc +++ b/t5/scripts/tws_t5_hud.gsc @@ -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() diff --git a/t6/scripts/README.md b/t6/scripts/README.md index 623c318..7af6853 100644 --- a/t6/scripts/README.md +++ b/t6/scripts/README.md @@ -7,7 +7,7 @@ separate token config or database setup is required. | File | Role | Dependencies | | --- | --- | --- | | `tws_t6_common.gsc` | Shared HUD values, helpers, `.help`, connection and first-spawn dispatchers | Stock T6 | -| `tws_t6_hud.gsc` | Match/round timers, name, zombie count and health bar | Common | +| `tws_t6_hud.gsc` | Top-left Discord URL, match/round timers, name, zombie count and health bar | Common | | `tws_t6_afk.gsc` | `.afk` / `.back`, protection, movement and weapon blocking | Common | | `tws_t6_lock.gsc` | Lock at round 20; clear password on game over | Common, HUD | | `tws_t6_telemetry.gsc` | Async queued game reports (game_start/heartbeat/round_change/game_end) | tws-t6-gsc-utils | @@ -40,6 +40,15 @@ Keep the filenames and `scripts/zm` location so shared references resolve. To omit telemetry, remove its script; disabling it at runtime does not remove its plugin dependency during linking. The same rule applies to leaderboard. +## 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 `tws_t6_leaderboard.gsc` reads the public Electric Cherry API without credentials. diff --git a/t6/scripts/tws_t6_common.gsc b/t6/scripts/tws_t6_common.gsc index 9cc3030..bf753a2 100644 --- a/t6/scripts/tws_t6_common.gsc +++ b/t6/scripts/tws_t6_common.gsc @@ -22,9 +22,9 @@ common_config() if (isDefined(level.hud_x)) return; - // Small inset from the physical screen corner (fullscreen HUD coordinates). + // Fullscreen coordinates; reserve the top line for the Discord URL. 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; diff --git a/t6/scripts/tws_t6_hud.gsc b/t6/scripts/tws_t6_hud.gsc index a3db37e..3c105f7 100644 --- a/t6/scripts/tws_t6_hud.gsc +++ b/t6/scripts/tws_t6_hud.gsc @@ -1,4 +1,4 @@ -/* tws_t6_hud.gsc - configurable HUD stack: timers, zombie count, health bar. */ +/* tws_t6_hud.gsc - top-left Discord URL, timers, zombie count and health bar. */ #include maps\mp\_utility; #include common_scripts\utility; @@ -16,6 +16,21 @@ init() level thread game_over_watcher(); scripts\zm\tws_t6_common::register_spawn_handler(::hud_start); + scripts\zm\tws_t6_common::register_connect_handler(::hud_discord); +} + +// One static label per connection, including newcomers waiting to spawn. +hud_discord() +{ + self endon("disconnect"); + + label = scripts\zm\tws_t6_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\zm\tws_t6_common::destroy_on_disconnect(elems); } hud_start() diff --git a/versions.json b/versions.json index 374d19f..1ddcafc 100644 --- a/versions.json +++ b/versions.json @@ -1,14 +1,14 @@ { "tws_t5_afk.gsc": "1.0.0", - "tws_t5_common.gsc": "1.0.0", - "tws_t5_hud.gsc": "1.0.0", + "tws_t5_common.gsc": "1.1.0", + "tws_t5_hud.gsc": "1.1.0", "tws_t5_join.gsc": "1.0.0", "tws_t5_leaderboard.gsc": "1.0.0", "tws_t5_lock.gsc": "1.0.0", "tws_t5_telemetry.gsc": "1.0.0", "tws_t6_afk.gsc": "1.0.0", - "tws_t6_common.gsc": "1.0.0", - "tws_t6_hud.gsc": "1.0.0", + "tws_t6_common.gsc": "1.1.0", + "tws_t6_hud.gsc": "1.1.0", "tws_t6_join.gsc": "1.0.1", "tws_t6_leaderboard.gsc": "1.0.0", "tws_t6_lock.gsc": "1.0.0",