[MIRROR] Optimizes qdel related things (slight init time savings) [MDB IGNORE] (#17240)

* Optimizes qdel related things (slight init time savings)

* lang holder

* cleanup custom spawners slightly

* ref update

Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
Co-authored-by: tastyfish <crazychris32@gmail.com>
This commit is contained in:
SkyratBot
2022-10-31 04:15:38 +01:00
committed by GitHub
parent df593e05a0
commit 375fea374a
37 changed files with 178 additions and 135 deletions
+6 -6
View File
@@ -20,7 +20,7 @@
. = ..()
if(state)
current_state = state
LAZYADDASSOCLIST(SSlua.editors, "\ref[current_state]", src)
LAZYADDASSOCLIST(SSlua.editors, text_ref(current_state), src)
/datum/lua_editor/ui_interact(mob/user, datum/tgui/ui)
ui = SStgui.try_update_ui(user, src, ui)
@@ -32,7 +32,7 @@
/datum/lua_editor/Destroy(force, ...)
. = ..()
if(current_state)
LAZYREMOVEASSOC(SSlua.editors, "\ref[current_state]", src)
LAZYREMOVEASSOC(SSlua.editors, text_ref(current_state), src)
/datum/lua_editor/ui_state(mob/user)
return GLOB.debug_state
@@ -107,16 +107,16 @@
return TRUE
var/datum/lua_state/new_state = new(state_name)
SSlua.states += new_state
LAZYREMOVEASSOC(SSlua.editors, "\ref[current_state]", src)
LAZYREMOVEASSOC(SSlua.editors, text_ref(current_state), src)
current_state = new_state
LAZYADDASSOCLIST(SSlua.editors, "\ref[current_state]", src)
LAZYADDASSOCLIST(SSlua.editors, text_ref(current_state), src)
page = 0
return TRUE
if("switchState")
var/state_index = params["index"]
LAZYREMOVEASSOC(SSlua.editors, "\ref[current_state]", src)
LAZYREMOVEASSOC(SSlua.editors, text_ref(current_state), src)
current_state = SSlua.states[state_index]
LAZYADDASSOCLIST(SSlua.editors, "\ref[current_state]", src)
LAZYADDASSOCLIST(SSlua.editors, text_ref(current_state), src)
page = 0
return TRUE
if("runCode")
+2 -2
View File
@@ -95,7 +95,7 @@ GLOBAL_PROTECT(lua_usr)
var/datum/weakref/weak_ref = path_element
var/resolved = weak_ref.hard_resolve()
if(!resolved)
return list("status" = "errored", "param" = "Weakref in function path ([weak_ref] \ref[weak_ref]) resolved to null.", "name" = jointext(function, "."))
return list("status" = "errored", "param" = "Weakref in function path ([weak_ref] [text_ref(weak_ref)]) resolved to null.", "name" = jointext(function, "."))
new_function_path += resolved
else
new_function_path += path_element
@@ -163,7 +163,7 @@ GLOBAL_PROTECT(lua_usr)
__lua_kill_task(internal_id, task_info)
/datum/lua_state/proc/update_editors()
var/list/editor_list = LAZYACCESS(SSlua.editors, "\ref[src]")
var/list/editor_list = LAZYACCESS(SSlua.editors, text_ref(src))
if(editor_list)
for(var/datum/lua_editor/editor as anything in editor_list)
SStgui.update_uis(editor)