TGUI updates + statpanel

This commit is contained in:
Artur
2020-09-02 17:52:47 +03:00
parent d97d9f564b
commit 3bef4ba35e
175 changed files with 12354 additions and 7980 deletions
+8 -2
View File
@@ -175,7 +175,11 @@
var/type = href_list["type"]
// Unconditionally collect tgui logs
if(type == "log")
log_tgui(usr, href_list["message"])
var/context = href_list["window_id"]
if (href_list["ns"])
context += " ([href_list["ns"]])"
log_tgui(usr, href_list["message"],
context = context)
// Reload all tgui windows
if(type == "cacheReloaded")
if(!check_rights(R_ADMIN) || usr.client.tgui_cache_reloaded)
@@ -195,7 +199,9 @@
if(window_id)
window = usr.client.tgui_windows[window_id]
if(!window)
log_tgui(usr, "Error: Couldn't find the window datum, force closing.")
log_tgui(usr,
"Error: Couldn't find the window datum, force closing.",
context = window_id)
SStgui.force_close_window(usr, window_id)
return TRUE
// Decode payload
+11 -7
View File
@@ -49,7 +49,9 @@
* return datum/tgui The requested UI.
*/
/datum/tgui/New(mob/user, datum/src_object, interface, title, ui_x, ui_y)
log_tgui(user, "new [interface] fancy [user.client.prefs.tgui_fancy]")
log_tgui(user,
"new [interface] fancy [user.client.prefs.tgui_fancy]",
src_object = src_object)
src.user = user
src.src_object = src_object
src.window_key = "[REF(src_object)]-main"
@@ -245,11 +247,9 @@
return
// Validate ping
if(!initialized && world.time - opened_at > TGUI_PING_TIMEOUT)
log_tgui(user, \
"Error: Zombie window detected, killing it with fire.\n" \
+ "window_id: [window.id]\n" \
+ "opened_at: [opened_at]\n" \
+ "world.time: [world.time]")
log_tgui(user, "Error: Zombie window detected, closing.",
window = window,
src_object = src_object)
close(can_be_suspended = FALSE)
return
// Update through a normal call to ui_interact
@@ -282,8 +282,12 @@
/datum/tgui/proc/on_message(type, list/payload, list/href_list)
// Pass act type messages to ui_act
if(type && copytext(type, 1, 5) == "act/")
var/act_type = copytext(type, 5)
log_tgui(user, "Action: [act_type] [href_list["payload"]]",
window = window,
src_object = src_object)
process_status()
if(src_object.ui_act(copytext(type, 5), payload, src, state))
if(src_object.ui_act(act_type, payload, src, state))
SStgui.update_uis(src_object)
return FALSE
switch(type)
+9 -3
View File
@@ -52,7 +52,9 @@
inline_assets = list(),
inline_html = "",
fancy = FALSE)
log_tgui(client, "[id]/initialize")
log_tgui(client,
context = "[id]/initialize",
window = src)
if(!client)
return
src.inline_assets = inline_assets
@@ -177,11 +179,15 @@
if(!client)
return
if(can_be_suspended && can_be_suspended())
log_tgui(client, "[id]/close: suspending")
log_tgui(client,
context = "[id]/close (suspending)",
window = src)
status = TGUI_WINDOW_READY
send_message("suspend")
return
log_tgui(client, "[id]/close")
log_tgui(client,
context = "[id]/close",
window = src)
release_lock()
status = TGUI_WINDOW_CLOSED
message_queue = null