Cache asset/mappings results (#59914)

This commit is contained in:
Mothblocks
2021-07-07 01:35:17 -07:00
committed by GitHub
parent 0654cde093
commit a15c9fb23f
2 changed files with 9 additions and 1 deletions
+8
View File
@@ -11,6 +11,7 @@ GLOBAL_LIST_EMPTY(asset_datums)
/datum/asset
var/_abstract = /datum/asset
var/cached_url_mappings
/datum/asset/New()
GLOB.asset_datums[type] = src
@@ -19,6 +20,13 @@ GLOBAL_LIST_EMPTY(asset_datums)
/datum/asset/proc/get_url_mappings()
return list()
/// Returns a cached tgui message of URL mappings
/datum/asset/proc/get_serialized_url_mappings()
if (isnull(cached_url_mappings))
cached_url_mappings = TGUI_CREATE_MESSAGE("asset/mappings", get_url_mappings())
return cached_url_mappings
/datum/asset/proc/register()
return