mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-20 04:26:03 +01:00
[Ready for Review] Admin lua scripting (#65635)
Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user