mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-08-26 13:39:16 +01:00
Fallback proc & Issue templates
This commit is contained in:
@@ -82,6 +82,17 @@
|
||||
if(!ui || ui.status != STATUS_INTERACTIVE)
|
||||
return TRUE
|
||||
|
||||
/**
|
||||
* public
|
||||
*
|
||||
* Called on a UI when the UI crashed.
|
||||
*
|
||||
* required payload list A list of the payload supposed to be set on the regular UI.
|
||||
*/
|
||||
/datum/proc/tgui_fallback(list/payload)
|
||||
SHOULD_CALL_PARENT(TRUE)
|
||||
SEND_SIGNAL(src, COMSIG_UI_FALLBACK, usr)
|
||||
|
||||
/**
|
||||
* public
|
||||
*
|
||||
|
||||
@@ -54,15 +54,17 @@
|
||||
/datum/tgui_module/player_notes/tgui_state(mob/user)
|
||||
return GLOB.tgui_admin_state
|
||||
|
||||
/datum/tgui_module/player_notes/tgui_fallback(payload)
|
||||
if(..())
|
||||
return TRUE
|
||||
|
||||
open_legacy()
|
||||
|
||||
/datum/tgui_module/player_notes/tgui_act(action, params, datum/tgui/ui)
|
||||
if(..())
|
||||
return TRUE
|
||||
|
||||
switch(action)
|
||||
if("__fallback")
|
||||
log_runtime(EXCEPTION("TGUI Fallback Triggered: \"[ui.user]\" tried to use/open \"[ui.title]/[ui.interface]\"! Trying to open legacy UI!"))
|
||||
open_legacy()
|
||||
|
||||
if("show_player_info")
|
||||
var/datum/tgui_module/player_notes_info/A = new(src)
|
||||
A.key = params["name"]
|
||||
@@ -107,15 +109,18 @@
|
||||
/datum/tgui_module/player_notes_info/tgui_state(mob/user)
|
||||
return GLOB.tgui_admin_state
|
||||
|
||||
/datum/tgui_module/player_notes_info/tgui_fallback(payload)
|
||||
if(..())
|
||||
return TRUE
|
||||
|
||||
var/datum/admins/A = admin_datums[usr.ckey]
|
||||
A.show_player_info_legacy(key)
|
||||
|
||||
/datum/tgui_module/player_notes_info/tgui_act(action, params, datum/tgui/ui)
|
||||
if(..())
|
||||
return TRUE
|
||||
|
||||
switch(action)
|
||||
if("__fallback")
|
||||
var/datum/admins/A = admin_datums[usr.ckey]
|
||||
A.show_player_info_legacy(key)
|
||||
|
||||
if("add_player_info")
|
||||
var/key = params["ckey"]
|
||||
var/add = tgui_input_text(usr, "Write your comment below.", "Add Player Info", multiline = TRUE, prevent_enter = TRUE)
|
||||
|
||||
@@ -342,4 +342,9 @@
|
||||
return
|
||||
LAZYINITLIST(src_object.tgui_shared_states)
|
||||
src_object.tgui_shared_states[href_list["key"]] = href_list["value"]
|
||||
SStgui.update_uis(src_object)
|
||||
SStgui.update_uis(src_object)
|
||||
if("fallback")
|
||||
#ifdef TGUI_DEBUGGING
|
||||
log_tgui(user, "Fallback Triggered: [href_list["payload"]], Window: [window.id], Source: [src_object]")
|
||||
#endif
|
||||
src_object.tgui_fallback(payload)
|
||||
Reference in New Issue
Block a user