Fix DPI scaling with TGUI, TGUI Say, and Tooltips (#20734)

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.
This commit is contained in:
Cody Brittain
2025-05-14 08:39:41 -04:00
committed by GitHub
parent 5b54dd2557
commit 45139cea5c
43 changed files with 1248 additions and 498 deletions
+9 -6
View File
@@ -10,9 +10,7 @@
* string - A JSON encoded message to open the modal.
*/
/client/proc/tgui_say_create_open_command(channel)
var/message = TGUI_CREATE_MESSAGE("open", list(
channel = channel,
))
var/message = TGUI_CREATE_OPEN_MESSAGE(channel)
return "\".output tgui_say.browser:update [message]\""
/**
@@ -36,6 +34,7 @@
/datum/tgui_say/New(client/client, id)
src.client = client
window = new(client, id)
winset(client, "tgui_say", "size=1,1;is-visible=0;")
window.subscribe(src, PROC_REF(on_message))
window.is_browser = TRUE
@@ -62,11 +61,15 @@
*/
/datum/tgui_say/proc/load()
window_open = FALSE
winshow(client, "tgui_say", FALSE)
winset(client, "tgui_say", "pos=700,500;is-visible=0;")
window.send_message("props", list(
lightMode = FALSE,
maxLength = max_length,
"lightMode" = client?.prefs.tgui_say_light_mode,
"scale" = client?.prefs.ui_scale,
"maxLength" = max_length,
))
stop_thinking()
return TRUE