Files
Paradise/code/controllers/globals.dm
S34N 91660824fa Browser/TGUI Stat Panels (#24065)
* initial commit (broken)

* load the html

* fix this

* Fix various issues with browser statpanel

* Fix Alt Clicking opening up a window and Add back some object verbs to the browser stat panel

* Optimize stat panel and fix guardian verbs

* Restyles Stat Panel, Adds Subpanel Sub-Categories

* Use better layout for verbs in stat panel

* Updates statpanel verb widths to be more dynamic at higher screen resolutions.

* Adjust stat panel grid item widths and breakpoints

* refactors statpanel to use tgui API

* CI moment

* more CI

* this stupid thing

* Apply suggestions from code review

Co-authored-by: GDN <96800819+GDNgit@users.noreply.github.com>
Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>

* Update code/modules/client/client_procs.dm

* ci fix

* emergency mc debug view

* temp revert some code change suggestions due to massive runtiming

* proper atom click topic implementation

* optimise

* mob clicking in stat panels work

* yeet spell tab thingy

* yeet simple stat panel pref

* allow insertion of html into MC tab content

* tidy up status tab

* Apply suggestions from code review

* fix this

* fix CI

* oops

* fix index runtime

* fixes MC tab showing up for mentors, fixes runtime

* safeties!

* Return of theme support

* more fixes

* fix view range pref, tidy prefs tab

* Remove old stat panel from themes

* fixes

* make sure verbs don't go missing

* fix ooc/looc breaking

* Revert "make sure verbs don't go missing"

This reverts commit 7d07ad45ed.

* fix this properly

* fix stat panel hitting rate limiters

* fix borg status tab

* Object Window Niceties

* Adds file cycling for icon2base64

* optimizes icon2html() for icon files known to be in the rsc at compile time

* CI moment

* remove dupe emergency shuttle timers

* more robust verb updates

* statpanel tweaks

* zip archived changelog to avoid search results

* optimise

* fix mentor chat wonkyness when disabled

* debug log moment

* i am very smart

* reintroduce this because it was needed

* better time listings

* less jank

* stops telling admins they arent mentors

* returns MC tab pref for admins

* Update code/controllers/subsystem/SSstatpanel.dm

Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>

* lewcc

* OD typemaker prep

---------

Co-authored-by: GDN <96800819+GDNgit@users.noreply.github.com>
Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>
Co-authored-by: Aylong <alexanderkitsa@gmail.com>
Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
2024-03-07 10:31:36 -05:00

69 lines
2.2 KiB
Plaintext

GLOBAL_REAL(GLOB, /datum/controller/global_vars)
/datum/controller/global_vars
name = "Global Variables"
var/list/gvars_datum_protected_varlist
var/list/gvars_datum_in_built_vars
var/list/gvars_datum_init_order
/datum/controller/global_vars/New()
if(GLOB)
CRASH("Multiple instances of global variable controller created")
GLOB = src
var/datum/controller/exclude_these = new
gvars_datum_in_built_vars = exclude_these.vars + list("gvars_datum_protected_varlist", "gvars_datum_in_built_vars", "gvars_datum_init_order")
Initialize()
/datum/controller/global_vars/Destroy(force)
stack_trace("Some fucker qdel'd the global holder!")
if(!force)
return QDEL_HINT_LETMELIVE
gvars_datum_protected_varlist.Cut()
gvars_datum_in_built_vars.Cut()
GLOB = null
return ..()
/datum/controller/global_vars/stat_entry(msg)
msg += "Edit"
return ..()
/datum/controller/global_vars/can_vv_get(var_name)
var/static/list/protected_vars = list(
"asays", "admin_log", "logging", "open_logging_views"
)
if(!check_rights(R_ADMIN, FALSE, usr) && (var_name in protected_vars))
return FALSE
if(gvars_datum_protected_varlist[var_name])
return FALSE
return ..()
/datum/controller/global_vars/vv_edit_var(var_name, var_value)
if(gvars_datum_protected_varlist[var_name])
return FALSE
return ..()
/datum/controller/global_vars/Initialize()
gvars_datum_init_order = list()
gvars_datum_protected_varlist = list("gvars_datum_protected_varlist" = TRUE)
var/list/global_procs = typesof(/datum/controller/global_vars/proc)
var/expected_len = vars.len - gvars_datum_in_built_vars.len
if(global_procs.len != expected_len)
warning("Unable to detect all global initialization procs! Expected [expected_len] got [global_procs.len]!")
if(global_procs.len)
var/list/expected_global_procs = vars - gvars_datum_in_built_vars
for(var/I in global_procs)
expected_global_procs -= replacetext("[I]", "InitGlobal", "")
log_world("Missing procs: [expected_global_procs.Join(", ")]")
for(var/I in global_procs)
var/start_tick = world.time
call(src, I)()
var/end_tick = world.time
if(end_tick - start_tick)
warning("Global [replacetext("[I]", "InitGlobal", "")] slept during initialization!")