mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-08-29 15:08:34 +01:00
Port of the iframe storage for settings (#18751)
* Port of the iframe storage for settings * Update resources.txt * re add keying * fix byond storage * port the adjustments --------- Co-authored-by: Selis <12716288+ItsSelis@users.noreply.github.com>
This commit is contained in:
@@ -11,3 +11,7 @@
|
||||
/datum/config_entry/flag/smart_cache_assets
|
||||
|
||||
/datum/config_entry/flag/save_spritesheets
|
||||
|
||||
/datum/config_entry/string/storage_cdn_iframe
|
||||
protection = CONFIG_ENTRY_LOCKED
|
||||
default = "https://vorestation.github.io/byond-client-storage/iframe.html"
|
||||
|
||||
@@ -40,6 +40,25 @@ SUBSYSTEM_DEF(tgui)
|
||||
|
||||
basehtml = replacetextEx(basehtml, "<!-- tgui:nt-copyright -->", "Nanotrasen (c) 2284-[text2num(time2text(world.realtime,"YYYY")) + STATION_YEAR_OFFSET]")
|
||||
|
||||
/datum/controller/subsystem/tgui/OnConfigLoad()
|
||||
var/storage_iframe = CONFIG_GET(string/storage_cdn_iframe)
|
||||
|
||||
if(storage_iframe && storage_iframe != /datum/config_entry/string/storage_cdn_iframe::default)
|
||||
basehtml = replacetext(basehtml, "\[tgui:storagecdn\]", storage_iframe)
|
||||
return
|
||||
|
||||
if(CONFIG_GET(string/asset_transport) == "webroot")
|
||||
var/datum/asset_transport/webroot/webroot = SSassets.transport
|
||||
|
||||
var/datum/asset_cache_item/item = webroot.register_asset("iframe.html", file("tgui/public/iframe.html"))
|
||||
basehtml = replacetext(basehtml, "\[tgui:storagecdn\]", webroot.get_asset_url("iframe.html", item))
|
||||
return
|
||||
|
||||
if(!storage_iframe)
|
||||
return
|
||||
|
||||
basehtml = replacetext(basehtml, "\[tgui:storagecdn\]", storage_iframe)
|
||||
|
||||
/datum/controller/subsystem/tgui/Shutdown()
|
||||
close_all_uis()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user