Files
Bubberstation/code/controllers/subsystem/assets.dm
SkyratBot a00cad0164 [MIRROR] Clean up subsystem Initialize(), require an explicit result returned, give a formal way to fail (for SSlua) [MDB IGNORE] (#16248)
* Clean up subsystem Initialize(), require an explicit result returned, give a formal way to fail (for SSlua)

* [PR for MIRROR PR] Changes for 16248 (#16277)

* Merge skyrat changes, update SR SS's, and remove lobby_eye

* Apply suggestions from code review

Co-authored-by: GoldenAlpharex <58045821+GoldenAlpharex@users.noreply.github.com>

* Update modular_skyrat/modules/autotransfer/code/autotransfer.dm

Co-authored-by: GoldenAlpharex <58045821+GoldenAlpharex@users.noreply.github.com>

* restore lobby_cam for now

Co-authored-by: GoldenAlpharex <58045821+GoldenAlpharex@users.noreply.github.com>

Co-authored-by: Tastyfish <crazychris32@gmail.com>
Co-authored-by: GoldenAlpharex <58045821+GoldenAlpharex@users.noreply.github.com>
2022-09-24 17:32:40 -04:00

38 lines
957 B
Plaintext

SUBSYSTEM_DEF(assets)
name = "Assets"
init_order = INIT_ORDER_ASSETS
flags = SS_NO_FIRE
var/list/datum/asset_cache_item/cache = list()
var/list/preload = list()
var/datum/asset_transport/transport = new()
/datum/controller/subsystem/assets/OnConfigLoad()
var/newtransporttype = /datum/asset_transport
switch (CONFIG_GET(string/asset_transport))
if ("webroot")
newtransporttype = /datum/asset_transport/webroot
if (newtransporttype == transport.type)
return
var/datum/asset_transport/newtransport = new newtransporttype ()
if (newtransport.validate_config())
transport = newtransport
transport.Load()
/datum/controller/subsystem/assets/Initialize()
for(var/type in typesof(/datum/asset))
var/datum/asset/A = type
if (type != initial(A._abstract))
load_asset_datum(type)
transport.Initialize(cache)
return SS_INIT_SUCCESS
/datum/controller/subsystem/assets/Recover()
cache = SSassets.cache
preload = SSassets.preload