mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 10:12:45 +00:00
upstream-merge-16484 [MDB IGNORE] (#9289)
Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
@@ -61,7 +61,7 @@ GLOBAL_LIST_EMPTY(asset_datums)
|
||||
|
||||
/// Returns whether or not the asset should attempt to read from cache
|
||||
/datum/asset/proc/should_refresh()
|
||||
return !cross_round_cachable || !CONFIG_GET(flag/cache_assets) // CHOMPEdit
|
||||
return !cross_round_cachable || !CONFIG_GET(flag/cache_assets)
|
||||
|
||||
/// Simply takes any generated file and saves it to the round-specific /logs folder. Useful for debugging potential issues with spritesheet generation/display.
|
||||
/// Only called when the SAVE_SPRITESHEETS config option is uncommented.
|
||||
@@ -180,7 +180,7 @@ GLOBAL_LIST_EMPTY(asset_datums)
|
||||
return
|
||||
|
||||
// If it's cached, may as well load it now, while the loading is cheap
|
||||
if(CONFIG_GET(flag/cache_assets) && cross_round_cachable) // CHOMPEdit
|
||||
if(CONFIG_GET(flag/cache_assets) && cross_round_cachable)
|
||||
load_immediately = TRUE
|
||||
|
||||
create_spritesheets()
|
||||
@@ -209,12 +209,12 @@ GLOBAL_LIST_EMPTY(asset_datums)
|
||||
text2file(generate_css(), file_directory)
|
||||
SSassets.transport.register_asset(css_name, fcopy_rsc(file_directory))
|
||||
|
||||
if(CONFIG_GET(flag/save_spritesheets)) // CHOMPEdit
|
||||
if(CONFIG_GET(flag/save_spritesheets))
|
||||
save_to_logs(file_name = css_name, file_location = file_directory)
|
||||
|
||||
fdel(file_directory)
|
||||
|
||||
if (CONFIG_GET(flag/cache_assets) && cross_round_cachable) // CHOMPEdit
|
||||
if (CONFIG_GET(flag/cache_assets) && cross_round_cachable)
|
||||
write_to_cache()
|
||||
fully_generated = TRUE
|
||||
// If we were ever in there, remove ourselves
|
||||
@@ -267,7 +267,7 @@ GLOBAL_LIST_EMPTY(asset_datums)
|
||||
size[SPRSZ_STRIPPED] = icon(file_directory)
|
||||
|
||||
// this is useful here for determining if weird sprite issues (like having a white background) are a cause of what we're doing DM-side or not since we can see the full flattened thing at-a-glance.
|
||||
if(CONFIG_GET(flag/save_spritesheets)) // CHOMPEdit
|
||||
if(CONFIG_GET(flag/save_spritesheets))
|
||||
save_to_logs(file_name = png_name, file_location = file_directory)
|
||||
|
||||
fdel(file_directory)
|
||||
@@ -321,7 +321,7 @@ GLOBAL_LIST_EMPTY(asset_datums)
|
||||
rustg_file_write(replaced_css, replaced_css_filename)
|
||||
SSassets.transport.register_asset(finalized_name, replaced_css_filename)
|
||||
|
||||
if(CONFIG_GET(flag/save_spritesheets)) // CHOMPEdit
|
||||
if(CONFIG_GET(flag/save_spritesheets))
|
||||
save_to_logs(file_name = finalized_name, file_location = replaced_css_filename)
|
||||
|
||||
fdel(replaced_css_filename)
|
||||
|
||||
@@ -12,14 +12,14 @@
|
||||
|
||||
/// Called when the transport is loaded by the config controller, not called on the default transport unless it gets loaded by a config change.
|
||||
/datum/asset_transport/proc/Load()
|
||||
if (CONFIG_GET(flag/asset_simple_preload)) // CHOMPEdit
|
||||
if (CONFIG_GET(flag/asset_simple_preload))
|
||||
for(var/client/C in GLOB.clients)
|
||||
addtimer(CALLBACK(src, PROC_REF(send_assets_slow), C, preload), 1 SECONDS)
|
||||
|
||||
/// Initialize - Called when SSassets initializes.
|
||||
/datum/asset_transport/proc/Initialize(list/assets)
|
||||
preload = assets.Copy()
|
||||
if (!CONFIG_GET(flag/asset_simple_preload)) // CHOMPEdit
|
||||
if (!CONFIG_GET(flag/asset_simple_preload))
|
||||
return
|
||||
for(var/client/C in GLOB.clients)
|
||||
addtimer(CALLBACK(src, PROC_REF(send_assets_slow), C, preload), 1 SECONDS)
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
/// Saves the asset to the webroot taking into account namespaces and hashes.
|
||||
/datum/asset_transport/webroot/proc/save_asset_to_webroot(datum/asset_cache_item/ACI)
|
||||
var/webroot = CONFIG_GET(string/asset_cdn_webroot) // CHOMPEdit
|
||||
var/webroot = CONFIG_GET(string/asset_cdn_webroot)
|
||||
var/newpath = "[webroot][get_asset_suffex(ACI)]"
|
||||
if (fexists(newpath))
|
||||
return
|
||||
@@ -39,7 +39,7 @@
|
||||
/datum/asset_transport/webroot/get_asset_url(asset_name, datum/asset_cache_item/asset_cache_item)
|
||||
if (!istype(asset_cache_item))
|
||||
asset_cache_item = SSassets.cache[asset_name]
|
||||
var/url = CONFIG_GET(string/asset_cdn_url) //config loading will handle making sure this ends in a / // CHOMPEdit
|
||||
var/url = CONFIG_GET(string/asset_cdn_url) //config loading will handle making sure this ends in a /
|
||||
return "[url][get_asset_suffex(asset_cache_item)]"
|
||||
|
||||
/datum/asset_transport/webroot/proc/get_asset_suffex(datum/asset_cache_item/asset_cache_item)
|
||||
@@ -76,11 +76,11 @@
|
||||
return FALSE
|
||||
|
||||
/datum/asset_transport/webroot/validate_config(log = TRUE)
|
||||
if (!CONFIG_GET(string/asset_cdn_url)) // CHOMPEdit
|
||||
if (!CONFIG_GET(string/asset_cdn_url))
|
||||
if (log)
|
||||
log_asset("ERROR: [type]: Invalid Config: ASSET_CDN_URL")
|
||||
return FALSE
|
||||
if (!CONFIG_GET(string/asset_cdn_webroot)) // CHOMPEdit
|
||||
if (!CONFIG_GET(string/asset_cdn_webroot))
|
||||
if (log)
|
||||
log_asset("ERROR: [type]: Invalid Config: ASSET_CDN_WEBROOT")
|
||||
return FALSE
|
||||
|
||||
Reference in New Issue
Block a user