Always contracts lists when VVing GLOB (#76091)

## About The Pull Request

This takes render times from like 20 seconds to maybe 2 Most of the time
appears to be clientside rn, so the best we could do further would be
reducing the amount of shit that actually needs to render

So like, removing the E C M buttons (or at least adding a toggle to
render them), that sort of thing

## Why It's Good For The Game

A glob vv you can actually use

![image](https://github.com/tgstation/tgstation/assets/58055496/d7c29c9a-aa45-4cad-9f38-7131140cab5b)

## Changelog
🆑
admin: VV for global vars will now load MUCH faster, in exchange lists
are now perma contracted in that particular pane
/🆑
This commit is contained in:
LemonInTheDark
2023-06-17 17:56:05 +02:00
committed by GitHub
parent 64e69b8682
commit 5b2cd2f34b
3 changed files with 13 additions and 2 deletions
+5
View File
@@ -159,3 +159,8 @@
#define VV_HK_TO_OUTFIT_EDITOR "outfit_editor"
#define VV_HK_WEAKREF_RESOLVE "weakref_resolve"
// Flags for debug_variable() that do little things to what we end up rendering
/// ALWAYS render a reduced list, useful for fuckoff big datums that need to be condensed for the sake of client load
#define VV_ALWAYS_CONTRACT_LIST (1<<0)
+6
View File
@@ -33,6 +33,12 @@ GLOBAL_REAL(GLOB, /datum/controller/global_vars)
return FALSE
return ..()
/datum/controller/global_vars/vv_get_var(var_name)
switch(var_name)
if (NAMEOF(src, vars))
return debug_variable(var_name, list(), 0, src)
return debug_variable(var_name, vars[var_name], 0, src, display_flags = VV_ALWAYS_CONTRACT_LIST)
/datum/controller/global_vars/Initialize()
gvars_datum_init_order = list()
gvars_datum_protected_varlist = list(NAMEOF(src, gvars_datum_protected_varlist) = TRUE)
@@ -1,6 +1,6 @@
#define VV_HTML_ENCODE(thing) ( sanitize ? html_encode(thing) : thing )
/// Get displayed variable in VV variable list
/proc/debug_variable(name, value, level, datum/D, sanitize = TRUE) //if D is a list, name will be index, and value will be assoc value.
/proc/debug_variable(name, value, level, datum/D, sanitize = TRUE, display_flags = NONE) //if D is a list, name will be index, and value will be assoc value.
var/header
if(D)
if(islist(D))
@@ -69,7 +69,7 @@
var/list/L = value
var/list/items = list()
if (L.len > 0 && !(name == "underlays" || name == "overlays" || L.len > (IS_NORMAL_LIST(L) ? VV_NORMAL_LIST_NO_EXPAND_THRESHOLD : VV_SPECIAL_LIST_NO_EXPAND_THRESHOLD)))
if (!(display_flags & VV_ALWAYS_CONTRACT_LIST) && L.len > 0 && !(name == "underlays" || name == "overlays" || L.len > (IS_NORMAL_LIST(L) ? VV_NORMAL_LIST_NO_EXPAND_THRESHOLD : VV_SPECIAL_LIST_NO_EXPAND_THRESHOLD)))
for (var/i in 1 to L.len)
var/key = L[i]
var/val