From 3777de4a2e5129eff451c8c0848c0ab8d77f8737 Mon Sep 17 00:00:00 2001
From: John Willard <53777086+JohnFulpWillard@users.noreply.github.com>
Date: Fri, 14 Mar 2025 16:16:01 -0400
Subject: [PATCH 01/38] all the misc ports
---
code/__DEFINES/html_assistant.dm | 7 +
code/__DEFINES/vv.dm | 4 +-
code/__HELPERS/stat_tracking.dm | 2 +-
code/__byond_version_compat.dm | 8 --
code/_globalvars/misc.dm | 2 +-
code/_onclick/hud/hud.dm | 20 ++-
.../hud/rendering/plane_master_group.dm | 30 +++--
code/_onclick/hud/rendering/render_plate.dm | 7 +-
code/controllers/subsystem/blackbox.dm | 2 +-
code/datums/profiling.dm | 4 +-
code/modules/admin/admin.dm | 4 +-
code/modules/admin/admin_investigate.dm | 4 +-
code/modules/admin/topic.dm | 4 +-
code/modules/admin/verbs/debug.dm | 4 +-
code/modules/admin/verbs/getlogs.dm | 2 +-
code/modules/admin/verbs/mapping.dm | 6 +-
code/modules/admin/verbs/plane_debugger.dm | 2 +-
code/modules/admin/verbs/randomverbs.dm | 5 +-
code/modules/client/client_procs.dm | 10 +-
code/modules/client/player_details.dm | 11 +-
code/modules/mob/dead/new_player/poll.dm | 14 +-
code/modules/tgui_panel/external.dm | 9 +-
html/admin/search.js | 4 +-
html/statbrowser.html | 23 +++-
interface/skin.dmf | 42 +++++-
tgui/global.d.ts | 32 +++--
.../common/{storage.js => storage.ts} | 123 +++++++++++-------
tgui/packages/tgui-panel/audio/player.js | 117 -----------------
tgui/packages/tgui-panel/audio/player.ts | 101 ++++++++++++++
tgui/packages/tgui-panel/chat/renderer.js | 7 +-
tgui/packages/tgui-panel/index.js | 10 +-
.../tgui-panel/styles/tgchat/chat-dark.scss | 1 +
.../tgui/interfaces/PersonalCrafting.tsx | 3 +-
.../tgui/interfaces/PlaneMasterDebug.tsx | 10 +-
tgui/packages/tgui/layouts/Layout.js | 1 +
tgui/packages/tgui/styles/layouts/Layout.scss | 18 ++-
tgui/packages/tgui/styles/main.scss | 2 +-
tgui/public/tgui.html | 55 +++++++-
38 files changed, 431 insertions(+), 279 deletions(-)
rename tgui/packages/common/{storage.js => storage.ts} (53%)
delete mode 100644 tgui/packages/tgui-panel/audio/player.js
create mode 100644 tgui/packages/tgui-panel/audio/player.ts
diff --git a/code/__DEFINES/html_assistant.dm b/code/__DEFINES/html_assistant.dm
index 03f95ad20158b..ed16afb481c1f 100644
--- a/code/__DEFINES/html_assistant.dm
+++ b/code/__DEFINES/html_assistant.dm
@@ -32,3 +32,10 @@
"[(GLOB.tooltips[config_key] ? "
[hover_me][GLOB.tooltips[config_key]]
" : "[hover_me]")]"
#define OPEN_WIKI(wiki_url, text) (CONFIG_GET(string/wikiurl) ? "[text]" : "[text]")
+
+
+#define HTML_SKELETON_INTERNAL(head, body) \
+"[head][body]"
+
+#define HTML_SKELETON_TITLE(title, body) HTML_SKELETON_INTERNAL("[title]", body)
+#define HTML_SKELETON(body) HTML_SKELETON_INTERNAL("", body)
diff --git a/code/__DEFINES/vv.dm b/code/__DEFINES/vv.dm
index 10d0204ed7ef0..2c15d195f9fcb 100644
--- a/code/__DEFINES/vv.dm
+++ b/code/__DEFINES/vv.dm
@@ -26,8 +26,8 @@
//#define IS_VALID_ASSOC_KEY(V) (istext(V) || ispath(V) || isdatum(V) || islist(V))
#define IS_VALID_ASSOC_KEY(V) (!isnum(V)) //hhmmm..
//General helpers
-#define VV_HREF_TARGET_INTERNAL(target, href_key) "?_src_=vars;[HrefToken()];[href_key]=TRUE;[VV_HK_TARGET]=[REF(target)]"
-#define VV_HREF_TARGETREF_INTERNAL(targetref, href_key) "?_src_=vars;[HrefToken()];[href_key]=TRUE;[VV_HK_TARGET]=[targetref]"
+#define VV_HREF_TARGET_INTERNAL(target, href_key) "byond://?_src_=vars;[HrefToken()];[href_key]=TRUE;[VV_HK_TARGET]=[REF(target)]"
+#define VV_HREF_TARGETREF_INTERNAL(targetref, href_key) "byond://?_src_=vars;[HrefToken()];[href_key]=TRUE;[VV_HK_TARGET]=[targetref]"
#define VV_HREF_TARGET(target, href_key, text) "[text]"
#define VV_HREF_TARGETREF(targetref, href_key, text) "[text]"
#define VV_HREF_TARGET_1V(target, href_key, text, varname) "[text]" //for stuff like basic varedits, one variable
diff --git a/code/__HELPERS/stat_tracking.dm b/code/__HELPERS/stat_tracking.dm
index 097715b940474..2f55ea0455dfd 100644
--- a/code/__HELPERS/stat_tracking.dm
+++ b/code/__HELPERS/stat_tracking.dm
@@ -8,6 +8,6 @@
lines += "[entry] => [num2text(data[STAT_ENTRY_TIME], 10)]ms ([data[STAT_ENTRY_COUNT]]) (avg:[num2text(data[STAT_ENTRY_TIME]/(data[STAT_ENTRY_COUNT] || 1), 99)])"
if (user)
- user << browse("- [lines.Join("
- ")]
", "window=[url_encode("stats:[REF(stats)]")]")
+ user << browse(HTML_SKELETON("- [lines.Join("
- ")]
"), "window=[url_encode("stats:[REF(stats)]")]")
. = lines.Join("\n")
diff --git a/code/__byond_version_compat.dm b/code/__byond_version_compat.dm
index 7e69aa34da46b..933e67092c8e0 100644
--- a/code/__byond_version_compat.dm
+++ b/code/__byond_version_compat.dm
@@ -9,14 +9,6 @@
#error You need version 515.1630 or higher
#endif
-//If you update these values, update the message in the #error
-#define MAX_BYOND_MAJOR 515
-#define MAX_BYOND_MINOR 1647
-#if ((DM_VERSION > MAX_BYOND_MAJOR) || (DM_BUILD > MAX_BYOND_MINOR)) && !defined(SPACEMAN_DMM)
-#error Your version of BYOND is too new to compile this project.
-#error Download version 515.1647 at www.byond.com/download/build/515/515.1642_byond.exe
-#endif
-
// 515 split call for external libraries into call_ext
#if DM_VERSION < 515
#define LIBCALL call
diff --git a/code/_globalvars/misc.dm b/code/_globalvars/misc.dm
index b407cf78d19c5..ffd51d879015f 100644
--- a/code/_globalvars/misc.dm
+++ b/code/_globalvars/misc.dm
@@ -17,7 +17,7 @@ GLOBAL_LIST_EMPTY(powernets)
GLOBAL_VAR_INIT(bsa_unlock, FALSE) //BSA unlocked by head ID swipes
-GLOBAL_LIST_EMPTY(player_details) // ckey -> /datum/player_details
+GLOBAL_LIST_EMPTY_TYPED(player_details, /datum/player_details) // ckey -> /datum/player_details
GLOBAL_LIST_INIT(preview_backgrounds, list(
"floor" = "Default Tile",
diff --git a/code/_onclick/hud/hud.dm b/code/_onclick/hud/hud.dm
index 85099e5bdcd7e..734d79d002db4 100644
--- a/code/_onclick/hud/hud.dm
+++ b/code/_onclick/hud/hud.dm
@@ -107,6 +107,10 @@ GLOBAL_LIST_INIT(available_ui_styles, list(
// and avoid needing to make changes to all idk 300 consumers if we want to change the appearance
var/list/asset_refs_for_reuse = list()
+ /// The BYOND version of the client that was last logged into this mob.
+ /// Currently used to rebuild all plane master groups when going between 515<->516.
+ var/last_byond_version
+
/datum/hud/New(mob/owner)
mymob = owner
@@ -153,8 +157,20 @@ GLOBAL_LIST_INIT(available_ui_styles, list(
/datum/hud/proc/client_refresh(datum/source)
SIGNAL_HANDLER
- RegisterSignal(mymob.canon_client, COMSIG_CLIENT_SET_EYE, PROC_REF(on_eye_change))
- on_eye_change(null, null, mymob.canon_client.eye)
+ var/client/client = mymob.canon_client
+ var/new_byond_version = client.byond_version
+#if MIN_COMPILER_VERSION > 515
+ #warn Fully change default relay_loc to "1,1", rather than changing it based on client version
+#endif
+ if(!isnull(last_byond_version) && new_byond_version != last_byond_version)
+ var/new_relay_loc = (new_byond_version > 515) ? "1,1" : "CENTER"
+ for(var/group_key as anything in master_groups)
+ var/datum/plane_master_group/group = master_groups[group_key]
+ group.relay_loc = new_relay_loc
+ group.rebuild_hud()
+ last_byond_version = new_byond_version
+ RegisterSignal(client, COMSIG_CLIENT_SET_EYE, PROC_REF(on_eye_change))
+ on_eye_change(null, null, client.eye)
/datum/hud/proc/clear_client(datum/source)
SIGNAL_HANDLER
diff --git a/code/_onclick/hud/rendering/plane_master_group.dm b/code/_onclick/hud/rendering/plane_master_group.dm
index 1aa9cd28ace7c..247db0515ad1d 100644
--- a/code/_onclick/hud/rendering/plane_master_group.dm
+++ b/code/_onclick/hud/rendering/plane_master_group.dm
@@ -47,11 +47,19 @@
stack_trace("Hey brother, our key [key] is already in use by a plane master group on the passed in hud, belonging to [viewing_hud.mymob]. Ya fucked up, why are there dupes")
return
+#if MIN_COMPILER_VERSION > 516
+ #warn Fully change default relay_loc to "1,1", rather than changing it based on client version
+#endif
+
set_hud(viewing_hud)
our_hud.master_groups[key] = src
show_hud()
transform_lower_turfs(our_hud, active_offset)
+ if(viewing_hud.mymob?.client?.byond_version > 515)
+ relay_loc = "1,1"
+ rebuild_plane_masters()
+
/// Well, refresh our group, mostly useful for plane specific updates
/datum/plane_master_group/proc/refresh_hud()
hide_hud()
@@ -62,6 +70,7 @@
hide_hud()
rebuild_plane_masters()
show_hud()
+ our_hud.update_parallax_pref()
transform_lower_turfs(our_hud, active_offset)
/// Regenerate our plane masters, this is useful if we don't have a mob but still want to rebuild. Such in the case of changing the screen_loc of relays
@@ -183,19 +192,16 @@
/// If you wanna try someday feel free, but I can't manage it
/datum/plane_master_group/popup
-/// This is janky as hell but since something changed with CENTER positioning after build 1614 we have to switch to the bandaid LEFT,TOP positioning
-/// using LEFT,TOP *at* or *before* 1614 will result in another broken offset for cameras
-#define MAX_CLIENT_BUILD_WITH_WORKING_SECONDARY_MAPS 1614
-
+/// Note do not use return ..() because it will cause client crush when screen gets deleted
+/// TOOD: Remove this entirely when 516 is stable
/datum/plane_master_group/popup/attach_to(datum/hud/viewing_hud)
- // If we're about to display this group to a mob who's client is more recent than the last known version with working CENTER, then we need to remake the relays
- // with the correct screen_loc using the relay override
- if(viewing_hud.mymob?.client?.byond_build > MAX_CLIENT_BUILD_WITH_WORKING_SECONDARY_MAPS)
- relay_loc = "LEFT,TOP"
- rebuild_plane_masters()
- return ..()
-
-#undef MAX_CLIENT_BUILD_WITH_WORKING_SECONDARY_MAPS
+ if(viewing_hud.master_groups[key])
+ stack_trace("[key] is already in use by a plane master group on the passed in hud, belonging to [viewing_hud.mymob]!")
+ return
+ relay_loc = "1,1"
+ rebuild_plane_masters()
+ set_hud(viewing_hud)
+ show_hud()
/datum/plane_master_group/popup/transform_lower_turfs(datum/hud/source, new_offset, use_scale = TRUE)
return ..(source, new_offset, FALSE)
diff --git a/code/_onclick/hud/rendering/render_plate.dm b/code/_onclick/hud/rendering/render_plate.dm
index 8cafa5d2599f0..c7cc41040c7dd 100644
--- a/code/_onclick/hud/rendering/render_plate.dm
+++ b/code/_onclick/hud/rendering/render_plate.dm
@@ -382,7 +382,7 @@
render_relay_planes = list(RENDER_PLANE_MASTER)
/**
- * Plane master proc called in Initialize() that creates relay objects, and sets them uo as needed
+ * Plane master proc called in Initialize() that creates relay objects, and sets them up as needed
* Sets:
* * layer from plane to avoid z-fighting
* * planes to relay the render to
@@ -392,6 +392,9 @@
* Other vars such as alpha will automatically be applied with the render source
*/
/atom/movable/screen/plane_master/proc/generate_render_relays()
+#if MIN_COMPILER_VERSION > 516
+ #warn Fully change default relay_loc to "1,1"
+#endif
var/relay_loc = home?.relay_loc || "CENTER"
// If we're using a submap (say for a popup window) make sure we draw onto it
if(home?.map)
@@ -426,7 +429,7 @@
if(!length(relays) && !initial(render_target))
render_target = OFFSET_RENDER_TARGET(get_plane_master_render_base(name), offset)
if(!relay_loc)
- relay_loc = "CENTER"
+ relay_loc = (show_to?.byond_version > 515) ? "1,1" : "CENTER"
// If we're using a submap (say for a popup window) make sure we draw onto it
if(home?.map)
relay_loc = "[home.map]:[relay_loc]"
diff --git a/code/controllers/subsystem/blackbox.dm b/code/controllers/subsystem/blackbox.dm
index 68fade5867eaa..aabbc6ac7e9de 100644
--- a/code/controllers/subsystem/blackbox.dm
+++ b/code/controllers/subsystem/blackbox.dm
@@ -93,7 +93,7 @@ SUBSYSTEM_DEF(blackbox)
for(var/player_key in GLOB.player_details)
var/datum/player_details/PD = GLOB.player_details[player_key]
- record_feedback("tally", "client_byond_version", 1, PD.byond_version)
+ record_feedback("tally", "client_byond_version", 1, PD.full_byond_version())
/datum/controller/subsystem/blackbox/Shutdown()
sealed = FALSE
diff --git a/code/datums/profiling.dm b/code/datums/profiling.dm
index dcf966750a627..1313655a7e139 100644
--- a/code/datums/profiling.dm
+++ b/code/datums/profiling.dm
@@ -15,4 +15,6 @@ GLOBAL_REAL_VAR(PROFILE_TIME)
var/list/data = PROFILE_STORE[entry]
lines += "[entry] => [num2text(data[PROFILE_ITEM_TIME], 10)]ms ([data[PROFILE_ITEM_COUNT]]) (avg:[num2text(data[PROFILE_ITEM_TIME]/(data[PROFILE_ITEM_COUNT] || 1), 99)])"
- user << browse("- [lines.Join("
- ")]
", "window=[url_encode(GUID())]")
+ var/datum/browser/browser = new(user, "[url_encode(GUID())]", null, 500, 500)
+ browser.set_content("- [lines.Join("
- ")]
")
+ browser.open()
diff --git a/code/modules/admin/admin.dm b/code/modules/admin/admin.dm
index 114c0df8cf4ea..800fb82cf76ee 100644
--- a/code/modules/admin/admin.dm
+++ b/code/modules/admin/admin.dm
@@ -447,7 +447,9 @@
dat += "