[MIRROR] BYOND 516 Compatibility (#9382)

Co-authored-by: ShadowLarkens <shadowlarkens@gmail.com>
Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
CHOMPStation2StaffMirrorBot
2024-11-02 10:18:18 -07:00
committed by GitHub
parent c5c603926d
commit 111e61a0a3
34 changed files with 250 additions and 160 deletions

View File

@@ -185,6 +185,10 @@
//CONNECT//
///////////
/client/New(TopicData)
// TODO: Remove version check with 516
if(byond_version >= 516) // Enable 516 compat browser storage mechanisms
winset(src, null, "browser-options=[DEFAULT_CLIENT_BROWSER_OPTIONS]")
TopicData = null //Prevent calls to client.Topic from connect
if(!(connection in list("seeker", "web"))) //Invalid connection type.
@@ -314,6 +318,12 @@
fully_created = TRUE
attempt_auto_fit_viewport()
// TODO: Remove version check with 516
if(byond_version >= 516)
// Now that we're fully initialized, use our prefs
if(prefs?.read_preference(/datum/preference/toggle/browser_dev_tools))
winset(src, null, "browser-options=[DEFAULT_CLIENT_BROWSER_OPTIONS],devtools")
//////////////
//DISCONNECT//
//////////////

View File

@@ -81,3 +81,15 @@
savefile_key = "AutoPunctuation"
default_value = FALSE
savefile_identifier = PREFERENCE_PLAYER
/datum/preference/toggle/browser_dev_tools
category = PREFERENCE_CATEGORY_GAME_PREFERENCES
savefile_key = "BrowserDevTools"
default_value = FALSE
savefile_identifier = PREFERENCE_PLAYER
/datum/preference/toggle/browser_dev_tools/apply_to_client(client/client, value)
if(value)
winset(client, null, "browser-options=[DEFAULT_CLIENT_BROWSER_OPTIONS],devtools")
else
winset(client, null, "browser-options=[DEFAULT_CLIENT_BROWSER_OPTIONS]")