mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 18:53:06 +00:00
Merge pull request #13139 from ItsSelis/fallback-behavior
Changed TGUI fallback behavior
This commit is contained in:
4
.github/ISSUE_TEMPLATE/bug_report.md
vendored
4
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
name: Bug report
|
name: General Bug report
|
||||||
about: Create a report to help us improve
|
about: Create a report to help us improve
|
||||||
title: ''
|
title: '[GENERAL] '
|
||||||
labels: 'Type: Bug'
|
labels: 'Type: Bug'
|
||||||
assignees: ''
|
assignees: ''
|
||||||
|
|
||||||
|
|||||||
35
.github/ISSUE_TEMPLATE/ui_report.md
vendored
Normal file
35
.github/ISSUE_TEMPLATE/ui_report.md
vendored
Normal file
@@ -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"
|
#define COMSIG_PARENT_QDELETING "parent_qdeleting"
|
||||||
/// generic topic handler (usr, href_list)
|
/// generic topic handler (usr, href_list)
|
||||||
#define COMSIG_TOPIC "handle_topic"
|
#define COMSIG_TOPIC "handle_topic"
|
||||||
/// from datum ui_act (usr, action)
|
/// from datum tgui_act (usr, action)
|
||||||
#define COMSIG_UI_ACT "COMSIG_UI_ACT"
|
#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)
|
/// fires on the target datum when an element is attached to it (/datum/element)
|
||||||
|
|||||||
@@ -344,7 +344,8 @@ Turf and target are seperate in case you want to teleport some distance from a t
|
|||||||
var/newname
|
var/newname
|
||||||
|
|
||||||
for(var/i=1,i<=3,i++) //we get 3 attempts to pick a suitable name.
|
for(var/i=1,i<=3,i++) //we get 3 attempts to pick a suitable name.
|
||||||
newname = tgui_input_text(src,"You are \a [role]. Would you like to change your name to something else?", "Name change",oldname)
|
//newname = tgui_input_text(src,"You are \a [role]. Would you like to change your name to something else?", "Name change",oldname)
|
||||||
|
newname = input(src,"You are \a [role]. Would you like to change your name to something else?", "Name change",oldname)
|
||||||
if((world.time-time_passed)>3000)
|
if((world.time-time_passed)>3000)
|
||||||
return //took too long
|
return //took too long
|
||||||
newname = sanitizeName(newname, ,allow_numbers) //returns null if the name doesn't meet some basic requirements. Tidies up a few other things like bad-characters.
|
newname = sanitizeName(newname, ,allow_numbers) //returns null if the name doesn't meet some basic requirements. Tidies up a few other things like bad-characters.
|
||||||
|
|||||||
@@ -82,6 +82,17 @@
|
|||||||
if(!ui || ui.status != STATUS_INTERACTIVE)
|
if(!ui || ui.status != STATUS_INTERACTIVE)
|
||||||
return TRUE
|
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
|
* public
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -54,15 +54,17 @@
|
|||||||
/datum/tgui_module/player_notes/tgui_state(mob/user)
|
/datum/tgui_module/player_notes/tgui_state(mob/user)
|
||||||
return GLOB.tgui_admin_state
|
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)
|
/datum/tgui_module/player_notes/tgui_act(action, params, datum/tgui/ui)
|
||||||
if(..())
|
if(..())
|
||||||
return TRUE
|
return TRUE
|
||||||
|
|
||||||
switch(action)
|
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")
|
if("show_player_info")
|
||||||
var/datum/tgui_module/player_notes_info/A = new(src)
|
var/datum/tgui_module/player_notes_info/A = new(src)
|
||||||
A.key = params["name"]
|
A.key = params["name"]
|
||||||
@@ -107,15 +109,18 @@
|
|||||||
/datum/tgui_module/player_notes_info/tgui_state(mob/user)
|
/datum/tgui_module/player_notes_info/tgui_state(mob/user)
|
||||||
return GLOB.tgui_admin_state
|
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)
|
/datum/tgui_module/player_notes_info/tgui_act(action, params, datum/tgui/ui)
|
||||||
if(..())
|
if(..())
|
||||||
return TRUE
|
return TRUE
|
||||||
|
|
||||||
switch(action)
|
switch(action)
|
||||||
if("__fallback")
|
|
||||||
var/datum/admins/A = admin_datums[usr.ckey]
|
|
||||||
A.show_player_info_legacy(key)
|
|
||||||
|
|
||||||
if("add_player_info")
|
if("add_player_info")
|
||||||
var/key = params["ckey"]
|
var/key = params["ckey"]
|
||||||
var/add = tgui_input_text(usr, "Write your comment below.", "Add Player Info", multiline = TRUE)
|
var/add = tgui_input_text(usr, "Write your comment below.", "Add Player Info", multiline = TRUE)
|
||||||
|
|||||||
@@ -341,4 +341,9 @@
|
|||||||
return
|
return
|
||||||
LAZYINITLIST(src_object.tgui_shared_states)
|
LAZYINITLIST(src_object.tgui_shared_states)
|
||||||
src_object.tgui_shared_states[href_list["key"]] = href_list["value"]
|
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)
|
||||||
@@ -26,9 +26,9 @@
|
|||||||
else
|
else
|
||||||
return
|
return
|
||||||
// A gentle nudge - you should not be using TGUI alert for anything other than a simple message.
|
// A gentle nudge - you should not be using TGUI alert for anything other than a simple message.
|
||||||
if(length(buttons) > 3)
|
//if(length(buttons) > 3)
|
||||||
log_tgui(user, "Error: TGUI Alert initiated with too many buttons. Use a list.", "TguiAlert")
|
// log_tgui(user, "Error: TGUI Alert initiated with too many buttons. Use a list.", "TguiAlert")
|
||||||
return tgui_input_list(user, message, title, buttons, timeout, autofocus)
|
// return tgui_input_list(user, message, title, buttons, timeout, autofocus)
|
||||||
|
|
||||||
// Client does NOT have tgui_input on: Returns regular input
|
// Client does NOT have tgui_input on: Returns regular input
|
||||||
if(!usr.client.prefs.tgui_input_mode)
|
if(!usr.client.prefs.tgui_input_mode)
|
||||||
|
|||||||
@@ -368,7 +368,7 @@ window.onerror = function (msg, url, line, col, error) {
|
|||||||
Byond.topic({
|
Byond.topic({
|
||||||
tgui: 1,
|
tgui: 1,
|
||||||
window_id: window.__windowId__,
|
window_id: window.__windowId__,
|
||||||
type: 'act/__fallback',
|
type: 'fallback',
|
||||||
});
|
});
|
||||||
// Proper stacktrace
|
// Proper stacktrace
|
||||||
var stack = error && error.stack;
|
var stack = error && error.stack;
|
||||||
|
|||||||
Reference in New Issue
Block a user