mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-08-22 19:47:47 +01:00
Fallback proc & Issue templates
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
---
|
||||
name: Bug report
|
||||
name: General Bug report
|
||||
about: Create a report to help us improve
|
||||
title: ''
|
||||
title: '[GENERAL] '
|
||||
labels: 'Type: Bug'
|
||||
assignees: ''
|
||||
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
---
|
||||
name: UI Bug report
|
||||
about: Create a report, specific to any UI related things.
|
||||
title: '[UI] '
|
||||
labels: 'Type: Bug'
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
<!-- Please DO NOT report 'suggestions' on GitHub. If your issue consists of an opinion about how something should be, it doesn't belong here. -->
|
||||
<!-- If your issue consists of something not operating as intended, please report it below by filling out the template. -->
|
||||
<!-- These directions will not appear in the issue, when submitted. -->
|
||||
|
||||
<!--Please provide a clear and concise description of what the bug is.-->
|
||||
#### Brief description of the bug
|
||||
|
||||
<!--What normally happens when this occurs? Keep in mind that behavior may be different on other servers.-->
|
||||
#### What you expected to happen
|
||||
|
||||
<!--Please use as much detail as possible when describing the bug behavior, including any context (things you did before) that might be relevant.-->
|
||||
#### What actually happened
|
||||
|
||||
<!-- Same here, please include any context that might have contributed, such as actions taken right before.-->
|
||||
#### Steps to reproduce
|
||||
- (Step 1)
|
||||
- (Step 2)
|
||||
- (and so on)
|
||||
|
||||
<!--Optional, you may remove this section.-->
|
||||
#### Code Revision
|
||||
- (Found using the "Show Server Revision" verb under the OOC tab.)
|
||||
|
||||
<!--Optional, you may remove this section.-->
|
||||
#### Anything else you may wish to add:
|
||||
- (Location if it's a mapping issue, screenshots, sprites, etc.)
|
||||
@@ -42,8 +42,10 @@
|
||||
#define COMSIG_PARENT_QDELETING "parent_qdeleting"
|
||||
/// generic topic handler (usr, href_list)
|
||||
#define COMSIG_TOPIC "handle_topic"
|
||||
/// from datum ui_act (usr, action)
|
||||
/// from datum tgui_act (usr, action)
|
||||
#define COMSIG_UI_ACT "COMSIG_UI_ACT"
|
||||
/// from datum tgui_fallback (payload)
|
||||
#define COMSIG_UI_FALLBACK "COMSIG_UI_FALLBACK"
|
||||
|
||||
|
||||
/// fires on the target datum when an element is attached to it (/datum/element)
|
||||
|
||||
@@ -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)
|
||||
@@ -368,7 +368,7 @@ window.onerror = function (msg, url, line, col, error) {
|
||||
Byond.topic({
|
||||
tgui: 1,
|
||||
window_id: window.__windowId__,
|
||||
type: 'act/__fallback',
|
||||
type: 'fallback',
|
||||
});
|
||||
// Proper stacktrace
|
||||
var stack = error && error.stack;
|
||||
|
||||
Reference in New Issue
Block a user