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

Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com>
This commit is contained in:
Y0SH1M4S73R
2022-07-19 18:45:23 -04:00
committed by GitHub
parent a6723944c1
commit 4e6e1f090e
46 changed files with 2161 additions and 15 deletions
+19
View File
@@ -1977,3 +1977,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