mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-01-27 17:51:43 +00:00
Got tired of the issues here when working on something else. Ported several PRs from /tg/station to fix DPI scaling issues. This was not a problem before 516, however 516 now respects Window's DPI setting, causing misalignment in several of our UI elements. This PR implements these ~~four~~ ~~five~~ six PRs: https://github.com/tgstation/tgstation/pull/65686 https://github.com/tgstation/tgstation/pull/89994 https://github.com/tgstation/tgstation/pull/90416 https://github.com/tgstation/tgstation/pull/90418 https://github.com/tgstation/tgstation/pull/90796 https://github.com/cmss13-devs/cmss13/pull/8734 ~~Does not include fixes with TGUI-Say. /tg/station refactored TGUI-Say after their port to React before they fixed DPI scaling, and this would be pain to deconstruct to port over to Inferno. Since porting to React is "inevitable", I considered it not worth my time to fix this.~~ Thanks to the assistance of harry, TGUI-Say fixes now included.
35 lines
1.1 KiB
Plaintext
35 lines
1.1 KiB
Plaintext
/*!
|
|
* Copyright (c) 2020 Aleksej Komarov
|
|
* SPDX-License-Identifier: MIT
|
|
*/
|
|
|
|
/client/var/datum/tgui_panel/tgui_panel
|
|
|
|
/**
|
|
* tgui panel / chat troubleshooting verb
|
|
*/
|
|
/client/verb/fix_tgui_panel()
|
|
set name = "Fix chat"
|
|
set category = "OOC"
|
|
var/action
|
|
log_tgui(src, "Started fixing.", context = "verb/fix_tgui_panel")
|
|
|
|
nuke_chat()
|
|
|
|
// Failed to fix, using tgalert as fallback
|
|
action = input(src, "Did that work?", "", "Yes") in list("Yes", "No, switch to old ui")
|
|
if (action == "No, switch to old ui")
|
|
winset(src, "output_selector.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_selector.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_selector.legacy_output_selector", "left=output_browser")
|