diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 73e550111f..b8ec75ce5c 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -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: '' diff --git a/.github/ISSUE_TEMPLATE/ui_report.md b/.github/ISSUE_TEMPLATE/ui_report.md new file mode 100644 index 0000000000..83dfec32e7 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/ui_report.md @@ -0,0 +1,35 @@ +--- +name: UI Bug report +about: Create a report, specific to any UI related things. +title: '[UI] ' +labels: 'Type: Bug' +assignees: '' + +--- + + + + + + +#### Brief description of the bug + + +#### What you expected to happen + + +#### What actually happened + + +#### Steps to reproduce +- (Step 1) +- (Step 2) +- (and so on) + + +#### Code Revision +- (Found using the "Show Server Revision" verb under the OOC tab.) + + +#### Anything else you may wish to add: +- (Location if it's a mapping issue, screenshots, sprites, etc.) diff --git a/code/__defines/dcs/signals.dm b/code/__defines/dcs/signals.dm index ae3773be74..1ae4237a0d 100644 --- a/code/__defines/dcs/signals.dm +++ b/code/__defines/dcs/signals.dm @@ -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) diff --git a/code/_helpers/unsorted.dm b/code/_helpers/unsorted.dm index c1d5cbcaef..717d7a927b 100644 --- a/code/_helpers/unsorted.dm +++ b/code/_helpers/unsorted.dm @@ -344,7 +344,8 @@ Turf and target are seperate in case you want to teleport some distance from a t var/newname 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) 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. diff --git a/code/modules/tgui/external.dm b/code/modules/tgui/external.dm index ce30eb2f45..cfd8db1368 100644 --- a/code/modules/tgui/external.dm +++ b/code/modules/tgui/external.dm @@ -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 * diff --git a/code/modules/tgui/modules/admin/player_notes.dm b/code/modules/tgui/modules/admin/player_notes.dm index ce17eb043d..a736ffe3d9 100644 --- a/code/modules/tgui/modules/admin/player_notes.dm +++ b/code/modules/tgui/modules/admin/player_notes.dm @@ -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) diff --git a/code/modules/tgui/tgui.dm b/code/modules/tgui/tgui.dm index 42acb1eac0..30cb71fc13 100644 --- a/code/modules/tgui/tgui.dm +++ b/code/modules/tgui/tgui.dm @@ -341,4 +341,9 @@ return LAZYINITLIST(src_object.tgui_shared_states) src_object.tgui_shared_states[href_list["key"]] = href_list["value"] - SStgui.update_uis(src_object) \ No newline at end of file + 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) \ No newline at end of file diff --git a/code/modules/tgui_input/alert.dm b/code/modules/tgui_input/alert.dm index a53089e4b0..2b0757dc16 100644 --- a/code/modules/tgui_input/alert.dm +++ b/code/modules/tgui_input/alert.dm @@ -26,9 +26,9 @@ else return // A gentle nudge - you should not be using TGUI alert for anything other than a simple message. - if(length(buttons) > 3) - 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) + //if(length(buttons) > 3) + // 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) // Client does NOT have tgui_input on: Returns regular input if(!usr.client.prefs.tgui_input_mode) diff --git a/tgui/public/tgui.html b/tgui/public/tgui.html index 3d9268dcc5..07d74341f7 100644 --- a/tgui/public/tgui.html +++ b/tgui/public/tgui.html @@ -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;