From 1bb9d0dfdfc90447258da025bb58540f33c7d93f Mon Sep 17 00:00:00 2001 From: CHOMPStation2StaffMirrorBot <94713762+CHOMPStation2StaffMirrorBot@users.noreply.github.com> Date: Fri, 20 Dec 2024 13:52:09 -0700 Subject: [PATCH] [MIRROR] Change how legacy output is hidden for 516 to remove chat flickering (#9667) Co-authored-by: ShadowLarkens --- code/modules/tgui_panel/external.dm | 9 ++--- interface/skin.dmf | 56 ++++++++++++++++++++++------- tgui/packages/tgui-panel/index.tsx | 10 ++---- 3 files changed, 48 insertions(+), 27 deletions(-) diff --git a/code/modules/tgui_panel/external.dm b/code/modules/tgui_panel/external.dm index a4c8855fca..8912eb8c12 100644 --- a/code/modules/tgui_panel/external.dm +++ b/code/modules/tgui_panel/external.dm @@ -19,22 +19,19 @@ // Failed to fix, using tgalert as fallback action = tgalert(src, "Did that work?", "", "Yes", "No, switch to old ui") if (action == "No, switch to old ui") - winset(src, "output", "on-show=&is-disabled=0&is-visible=1") - winset(src, "browseroutput", "is-disabled=1;is-visible=0") + winset(src, "legacy_output_selector", "left=output_legacy") log_tgui(src, "Failed to fix.", context = "verb/fix_tgui_panel") /client/proc/nuke_chat() // Catch all solution (kick the whole thing in the pants) - winset(src, "output", "on-show=&is-disabled=0&is-visible=1") - winset(src, "browseroutput", "is-disabled=1;is-visible=0") + winset(src, "legacy_output_selector", "left=output_legacy") if(!tgui_panel || !istype(tgui_panel)) log_tgui(src, "tgui_panel datum is missing", context = "verb/fix_tgui_panel") tgui_panel = new(src) tgui_panel.initialize(force = TRUE) // Force show the panel to see if there are any errors - winset(src, "output", "is-disabled=1&is-visible=0") - winset(src, "browseroutput", "is-disabled=0;is-visible=1") + winset(src, "legacy_output_selector", "left=output_browser") // TODO: Remove version check with 516 if(byond_version >= 516) if(prefs?.read_preference(/datum/preference/toggle/browser_dev_tools)) diff --git a/interface/skin.dmf b/interface/skin.dmf index 7998163a73..b46b60889d 100644 --- a/interface/skin.dmf +++ b/interface/skin.dmf @@ -1287,7 +1287,48 @@ window "mapwindow" window "outputwindow" elem "outputwindow" type = MAIN - pos = 281,0 + pos = 0,0 + size = 640x480 + anchor1 = -1,-1 + anchor2 = -1,-1 + background-color = none + saved-params = "pos;size;is-minimized;is-maximized" + is-pane = true + elem "legacy_output_selector" + type = CHILD + pos = 0,0 + size = 640x480 + anchor1 = 0,0 + anchor2 = 100,100 + saved-params = "splitter" + left = "output_legacy" + is-vert = false + +window "output_legacy" + elem "output_legacy" + type = MAIN + pos = 0,0 + size = 640x480 + anchor1 = -1,-1 + anchor2 = -1,-1 + background-color = none + saved-params = "pos;size;is-minimized;is-maximized" + is-pane = true + elem "output" + type = OUTPUT + pos = 0,0 + size = 640x480 + anchor1 = 0,0 + anchor2 = 100,100 + is-default = true + saved-params = "max-lines" + style = ".system {color:#FF0000;}" + enable-http-images = true + +window "output_browser" + elem "output_browser" + type = MAIN + pos = 0,0 size = 640x480 anchor1 = -1,-1 anchor2 = -1,-1 @@ -1302,19 +1343,8 @@ window "outputwindow" size = 640x480 anchor1 = 0,0 anchor2 = 100,100 - is-visible = false - is-disabled = true + background-color = none saved-params = "" - elem "output" - type = OUTPUT - pos = 0,0 - size = 640x480 - anchor1 = 0,0 - anchor2 = 100,100 - is-default = true - saved-params = "" - style = ".system {color:#FF0000;}" - enable-http-images = true window "prefs_markings_subwindow" elem "prefs_markings_subwindow" diff --git a/tgui/packages/tgui-panel/index.tsx b/tgui/packages/tgui-panel/index.tsx index 92b7f2e4e3..a4138b67d7 100644 --- a/tgui/packages/tgui-panel/index.tsx +++ b/tgui/packages/tgui-panel/index.tsx @@ -77,14 +77,8 @@ const setupApp = () => { Byond.subscribe((type, payload) => store.dispatch({ type, payload })); // Unhide the panel - Byond.winset('output', { - 'is-visible': false, - }); - Byond.winset('browseroutput', { - 'is-visible': true, - 'is-disabled': false, - pos: '0x0', - size: '0x0', + Byond.winset('legacy_output_selector', { + left: 'output_browser', }); // Resize the panel to match the non-browser output