Files
00807234b9 refactors asset subsystem (#6459)
refactors the asset subsystem to make it much more managed

adds support for 'deferred' assets for tgui, which will be later used
for things like tgui character setup and admin panels.
deferred means that it'll be 'sent in a timely manner after the ui
opens', as opposed to 'sent before the ui opens'

---------

Co-authored-by: silicons <no@you.cat>
2024-06-01 17:08:13 -06:00

25 lines
561 B
Plaintext

/// If you don't need anything complicated.
/datum/asset_pack/simple
abstract_type = /datum/asset_pack/simple
/**
* List of assets for this datum in the form of:
* * filename = file
* At runtime the asset file will be converted into a asset_item datum.
*/
var/assets = list()
/datum/asset_pack/simple/New(id, list/assets)
..(id)
if(!isnull(assets))
src.assets = assets.Copy()
/datum/asset_pack/simple/register()
. = list()
for(var/key in assets)
var/value = assets[key]
if(isfile(value))
.[key] = value
else
.[key] = file(value)