mirror of
https://github.com/Citadel-Station-13/Citadel-Station-13-RP.git
synced 2026-08-21 02:26:32 +01:00
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>
25 lines
561 B
Plaintext
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)
|