Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.

Commit 3777de4

Browse files
all the misc ports
1 parent 59e4892 commit 3777de4

File tree

38 files changed

+431
-279
lines changed

38 files changed

+431
-279
lines changed

code/__DEFINES/html_assistant.dm

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,10 @@
3232
"[(GLOB.tooltips[config_key] ? "<div class='tooltip'>[hover_me]<span class='tooltiptext' style='width: [width_px]px'>[GLOB.tooltips[config_key]]</span></div>" : "[hover_me]")]"
3333

3434
#define OPEN_WIKI(wiki_url, text) (CONFIG_GET(string/wikiurl) ? "<a href='[CONFIG_GET(string/wikiurl)+"/"+wiki_url]' target='_blank'>[text]</a>" : "[text]")
35+
36+
37+
#define HTML_SKELETON_INTERNAL(head, body) \
38+
"<!DOCTYPE html><html><head><meta http-equiv='Content-Type' content='text/html; charset=UTF-8'><meta http-equiv='X-UA-Compatible' content='IE=edge'>[head]</head><body>[body]</body></html>"
39+
40+
#define HTML_SKELETON_TITLE(title, body) HTML_SKELETON_INTERNAL("<title>[title]</title>", body)
41+
#define HTML_SKELETON(body) HTML_SKELETON_INTERNAL("", body)

code/__DEFINES/vv.dm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
//#define IS_VALID_ASSOC_KEY(V) (istext(V) || ispath(V) || isdatum(V) || islist(V))
2727
#define IS_VALID_ASSOC_KEY(V) (!isnum(V)) //hhmmm..
2828
//General helpers
29-
#define VV_HREF_TARGET_INTERNAL(target, href_key) "?_src_=vars;[HrefToken()];[href_key]=TRUE;[VV_HK_TARGET]=[REF(target)]"
30-
#define VV_HREF_TARGETREF_INTERNAL(targetref, href_key) "?_src_=vars;[HrefToken()];[href_key]=TRUE;[VV_HK_TARGET]=[targetref]"
29+
#define VV_HREF_TARGET_INTERNAL(target, href_key) "byond://?_src_=vars;[HrefToken()];[href_key]=TRUE;[VV_HK_TARGET]=[REF(target)]"
30+
#define VV_HREF_TARGETREF_INTERNAL(targetref, href_key) "byond://?_src_=vars;[HrefToken()];[href_key]=TRUE;[VV_HK_TARGET]=[targetref]"
3131
#define VV_HREF_TARGET(target, href_key, text) "<a href='[VV_HREF_TARGET_INTERNAL(target, href_key)]'>[text]</a>"
3232
#define VV_HREF_TARGETREF(targetref, href_key, text) "<a href='[VV_HREF_TARGETREF_INTERNAL(targetref, href_key)]'>[text]</a>"
3333
#define VV_HREF_TARGET_1V(target, href_key, text, varname) "<a href='[VV_HREF_TARGET_INTERNAL(target, href_key)];[VV_HK_VARNAME]=[varname]'>[text]</a>" //for stuff like basic varedits, one variable

code/__HELPERS/stat_tracking.dm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88
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)])"
99

1010
if (user)
11-
user << browse("<html><head><meta charset='UTF-8'></head><body><ol><li>[lines.Join("</li><li>")]</li></ol></body></html>", "window=[url_encode("stats:[REF(stats)]")]")
11+
user << browse(HTML_SKELETON("<ol><li>[lines.Join("</li><li>")]</li></ol>"), "window=[url_encode("stats:[REF(stats)]")]")
1212

1313
. = lines.Join("\n")

code/__byond_version_compat.dm

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,6 @@
99
#error You need version 515.1630 or higher
1010
#endif
1111

12-
//If you update these values, update the message in the #error
13-
#define MAX_BYOND_MAJOR 515
14-
#define MAX_BYOND_MINOR 1647
15-
#if ((DM_VERSION > MAX_BYOND_MAJOR) || (DM_BUILD > MAX_BYOND_MINOR)) && !defined(SPACEMAN_DMM)
16-
#error Your version of BYOND is too new to compile this project.
17-
#error Download version 515.1647 at www.byond.com/download/build/515/515.1642_byond.exe
18-
#endif
19-
2012
// 515 split call for external libraries into call_ext
2113
#if DM_VERSION < 515
2214
#define LIBCALL call

code/_globalvars/misc.dm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ GLOBAL_LIST_EMPTY(powernets)
1717

1818
GLOBAL_VAR_INIT(bsa_unlock, FALSE) //BSA unlocked by head ID swipes
1919

20-
GLOBAL_LIST_EMPTY(player_details) // ckey -> /datum/player_details
20+
GLOBAL_LIST_EMPTY_TYPED(player_details, /datum/player_details) // ckey -> /datum/player_details
2121

2222
GLOBAL_LIST_INIT(preview_backgrounds, list(
2323
"floor" = "Default Tile",

code/_onclick/hud/hud.dm

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,10 @@ GLOBAL_LIST_INIT(available_ui_styles, list(
107107
// and avoid needing to make changes to all idk 300 consumers if we want to change the appearance
108108
var/list/asset_refs_for_reuse = list()
109109

110+
/// The BYOND version of the client that was last logged into this mob.
111+
/// Currently used to rebuild all plane master groups when going between 515<->516.
112+
var/last_byond_version
113+
110114
/datum/hud/New(mob/owner)
111115
mymob = owner
112116

@@ -153,8 +157,20 @@ GLOBAL_LIST_INIT(available_ui_styles, list(
153157

154158
/datum/hud/proc/client_refresh(datum/source)
155159
SIGNAL_HANDLER
156-
RegisterSignal(mymob.canon_client, COMSIG_CLIENT_SET_EYE, PROC_REF(on_eye_change))
157-
on_eye_change(null, null, mymob.canon_client.eye)
160+
var/client/client = mymob.canon_client
161+
var/new_byond_version = client.byond_version
162+
#if MIN_COMPILER_VERSION > 515
163+
#warn Fully change default relay_loc to "1,1", rather than changing it based on client version
164+
#endif
165+
if(!isnull(last_byond_version) && new_byond_version != last_byond_version)
166+
var/new_relay_loc = (new_byond_version > 515) ? "1,1" : "CENTER"
167+
for(var/group_key as anything in master_groups)
168+
var/datum/plane_master_group/group = master_groups[group_key]
169+
group.relay_loc = new_relay_loc
170+
group.rebuild_hud()
171+
last_byond_version = new_byond_version
172+
RegisterSignal(client, COMSIG_CLIENT_SET_EYE, PROC_REF(on_eye_change))
173+
on_eye_change(null, null, client.eye)
158174

159175
/datum/hud/proc/clear_client(datum/source)
160176
SIGNAL_HANDLER

code/_onclick/hud/rendering/plane_master_group.dm

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,19 @@
4747
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")
4848
return
4949

50+
#if MIN_COMPILER_VERSION > 516
51+
#warn Fully change default relay_loc to "1,1", rather than changing it based on client version
52+
#endif
53+
5054
set_hud(viewing_hud)
5155
our_hud.master_groups[key] = src
5256
show_hud()
5357
transform_lower_turfs(our_hud, active_offset)
5458

59+
if(viewing_hud.mymob?.client?.byond_version > 515)
60+
relay_loc = "1,1"
61+
rebuild_plane_masters()
62+
5563
/// Well, refresh our group, mostly useful for plane specific updates
5664
/datum/plane_master_group/proc/refresh_hud()
5765
hide_hud()
@@ -62,6 +70,7 @@
6270
hide_hud()
6371
rebuild_plane_masters()
6472
show_hud()
73+
our_hud.update_parallax_pref()
6574
transform_lower_turfs(our_hud, active_offset)
6675

6776
/// 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 @@
183192
/// If you wanna try someday feel free, but I can't manage it
184193
/datum/plane_master_group/popup
185194

186-
/// 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
187-
/// using LEFT,TOP *at* or *before* 1614 will result in another broken offset for cameras
188-
#define MAX_CLIENT_BUILD_WITH_WORKING_SECONDARY_MAPS 1614
189-
195+
/// Note do not use return ..() because it will cause client crush when screen gets deleted
196+
/// TOOD: Remove this entirely when 516 is stable
190197
/datum/plane_master_group/popup/attach_to(datum/hud/viewing_hud)
191-
// 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
192-
// with the correct screen_loc using the relay override
193-
if(viewing_hud.mymob?.client?.byond_build > MAX_CLIENT_BUILD_WITH_WORKING_SECONDARY_MAPS)
194-
relay_loc = "LEFT,TOP"
195-
rebuild_plane_masters()
196-
return ..()
197-
198-
#undef MAX_CLIENT_BUILD_WITH_WORKING_SECONDARY_MAPS
198+
if(viewing_hud.master_groups[key])
199+
stack_trace("[key] is already in use by a plane master group on the passed in hud, belonging to [viewing_hud.mymob]!")
200+
return
201+
relay_loc = "1,1"
202+
rebuild_plane_masters()
203+
set_hud(viewing_hud)
204+
show_hud()
199205

200206
/datum/plane_master_group/popup/transform_lower_turfs(datum/hud/source, new_offset, use_scale = TRUE)
201207
return ..(source, new_offset, FALSE)

code/_onclick/hud/rendering/render_plate.dm

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@
382382
render_relay_planes = list(RENDER_PLANE_MASTER)
383383

384384
/**
385-
* Plane master proc called in Initialize() that creates relay objects, and sets them uo as needed
385+
* Plane master proc called in Initialize() that creates relay objects, and sets them up as needed
386386
* Sets:
387387
* * layer from plane to avoid z-fighting
388388
* * planes to relay the render to
@@ -392,6 +392,9 @@
392392
* Other vars such as alpha will automatically be applied with the render source
393393
*/
394394
/atom/movable/screen/plane_master/proc/generate_render_relays()
395+
#if MIN_COMPILER_VERSION > 516
396+
#warn Fully change default relay_loc to "1,1"
397+
#endif
395398
var/relay_loc = home?.relay_loc || "CENTER"
396399
// If we're using a submap (say for a popup window) make sure we draw onto it
397400
if(home?.map)
@@ -426,7 +429,7 @@
426429
if(!length(relays) && !initial(render_target))
427430
render_target = OFFSET_RENDER_TARGET(get_plane_master_render_base(name), offset)
428431
if(!relay_loc)
429-
relay_loc = "CENTER"
432+
relay_loc = (show_to?.byond_version > 515) ? "1,1" : "CENTER"
430433
// If we're using a submap (say for a popup window) make sure we draw onto it
431434
if(home?.map)
432435
relay_loc = "[home.map]:[relay_loc]"

code/controllers/subsystem/blackbox.dm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ SUBSYSTEM_DEF(blackbox)
9393

9494
for(var/player_key in GLOB.player_details)
9595
var/datum/player_details/PD = GLOB.player_details[player_key]
96-
record_feedback("tally", "client_byond_version", 1, PD.byond_version)
96+
record_feedback("tally", "client_byond_version", 1, PD.full_byond_version())
9797

9898
/datum/controller/subsystem/blackbox/Shutdown()
9999
sealed = FALSE

code/datums/profiling.dm

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,6 @@ GLOBAL_REAL_VAR(PROFILE_TIME)
1515
var/list/data = PROFILE_STORE[entry]
1616
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)])"
1717

18-
user << browse("<HTML><HEAD><meta charset='UTF-8'></HEAD><BODY><ol><li>[lines.Join("</li><li>")]</li></ol></BODY></HTML>", "window=[url_encode(GUID())]")
18+
var/datum/browser/browser = new(user, "[url_encode(GUID())]", null, 500, 500)
19+
browser.set_content("<ol><li>[lines.Join("</li><li>")]</li></ol>")
20+
browser.open()

0 commit comments

Comments
 (0)