[MIRROR] Admin lua scripting (#65635) (#15118)

[Ready for Review] Admin lua scripting (#65635)

Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com>

Co-authored-by: Y0SH1M4S73R <legoboyo@earthlink.net>
Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com>
This commit is contained in:
Zonespace
2022-07-24 19:55:53 +01:00
committed by GitHub
co-authored by Mothblocks Y0SH1M4S73R
parent cc051b4cb4
commit 15a223ff2d
46 changed files with 2163 additions and 15 deletions
+19
View File
@@ -2003,3 +2003,22 @@
if(!datum_to_mark)
return
return usr.client?.mark_datum(datum_to_mark)
else if(href_list["lua_state"])
if(!check_rights(R_DEBUG))
return
var/datum/lua_state/state_to_view = locate(href_list["lua_state"])
if(!state_to_view)
return
var/datum/lua_editor/editor = new(state_to_view)
var/log_index = href_list["log_index"]
if(log_index)
log_index = text2num(log_index)
if(log_index <= state_to_view.log.len)
var/list/log_entry = state_to_view.log[log_index]
if(log_entry["chunk"])
LAZYINITLIST(editor.tgui_shared_states)
editor.tgui_shared_states["viewedChunk"] = json_encode(log_entry["chunk"])
editor.tgui_shared_states["modal"] = json_encode("viewChunk")
editor.ui_interact(usr)
editor.tgui_shared_states = null