Files
Bubberstation/code/controllers/subsystem/early_assets.dm
Tastyfish 4733643f39 Clean up subsystem Initialize(), require an explicit result returned, give a formal way to fail (for SSlua) (#69775)
* cleanup SS API, give SSlua a proper way to error out

* New SS_INIT_ system
2022-09-14 23:52:10 -04:00

25 lines
780 B
Plaintext

/// Initializes any assets that need to be loaded ASAP.
/// This houses preference menu assets, since they can be loaded at any time,
/// most dangerously before the atoms SS initializes.
/// Thus, we want it to fail consistently in CI as if it would've if a player
/// opened it up early.
SUBSYSTEM_DEF(early_assets)
name = "Early Assets"
init_order = INIT_ORDER_EARLY_ASSETS
flags = SS_NO_FIRE
/datum/controller/subsystem/early_assets/Initialize()
for (var/datum/asset/asset_type as anything in subtypesof(/datum/asset))
if (initial(asset_type._abstract) == asset_type)
continue
if (!initial(asset_type.early))
continue
if (!load_asset_datum(asset_type))
stack_trace("Could not initialize early asset [asset_type]!")
CHECK_TICK
return SS_INIT_SUCCESS