mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-29 06:57:42 +01:00
NanoUI caching for cameras/crew manifest
This commit is contained in:
@@ -132,10 +132,11 @@ using /obj/effect/datacore/proc/manifest_inject( ), or manifest_insert( )
|
||||
*/
|
||||
|
||||
var/global/list/PDA_Manifest = list()
|
||||
var/global/ManifestJSON
|
||||
|
||||
/obj/effect/datacore/proc/get_manifest_json()
|
||||
if(PDA_Manifest.len)
|
||||
return PDA_Manifest
|
||||
return
|
||||
var/heads[0]
|
||||
var/sec[0]
|
||||
var/eng[0]
|
||||
@@ -206,5 +207,6 @@ var/global/list/PDA_Manifest = list()
|
||||
"bot" = bot,\
|
||||
"misc" = misc\
|
||||
)
|
||||
return PDA_Manifest
|
||||
ManifestJSON = list2json(PDA_Manifest)
|
||||
return
|
||||
|
||||
|
||||
@@ -467,7 +467,7 @@ var/global/list/obj/item/device/pda/PDAs = list()
|
||||
data["convo_job"] = sanitize(c["job"])
|
||||
break
|
||||
if(mode==41)
|
||||
data["manifest"] = data_core.get_manifest_json()
|
||||
data_core.get_manifest_json()
|
||||
|
||||
|
||||
if(mode==3)
|
||||
@@ -499,12 +499,15 @@ var/global/list/obj/item/device/pda/PDAs = list()
|
||||
data["aircontents"] = list("reading" = 0)
|
||||
|
||||
|
||||
data["manifest"] = list("__json_cache" = ManifestJSON)
|
||||
|
||||
// update the ui if it exists, returns null if no ui is passed/found
|
||||
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
|
||||
if (!ui)
|
||||
// the ui does not exist, so we'll create a new() one
|
||||
// for a list of parameters and their descriptions see the code docs in \code\modules\nano\nanoui.dm
|
||||
ui = new(user, src, ui_key, "pda.tmpl", title, 630, 600)
|
||||
|
||||
// when the ui is first opened this is the data it will use
|
||||
ui.set_initial_data(data)
|
||||
// open the new ui window
|
||||
|
||||
Reference in New Issue
Block a user