mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-07-13 17:07:53 +01:00
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:
@@ -48,6 +48,8 @@ var/global/enabled_spooking = 0
|
||||
to_chat(usr, "Error: you are not an admin!")
|
||||
return
|
||||
|
||||
var/ui_scale = owner.prefs?.ui_scale
|
||||
|
||||
var/body = "<html><head><title>Options for [M.key]</title></head>"
|
||||
body += "<body>Options panel for <b>[M]</b>"
|
||||
if(M.client)
|
||||
@@ -219,7 +221,11 @@ var/global/enabled_spooking = 0
|
||||
</body></html>
|
||||
"}
|
||||
|
||||
usr << browse(body, "window=adminplayeropts;size=550x515")
|
||||
var/window_size = "size=550x515"
|
||||
if(owner.window_scaling && ui_scale)
|
||||
window_size = "size=[550 * owner.window_scaling]x[515 * owner.window_scaling]"
|
||||
|
||||
usr << browse(body, "window=adminplayeropts;[window_size]")
|
||||
feedback_add_details("admin_verb","SPP") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
return
|
||||
|
||||
var/datum/browser/config_window = new(usr, "access_control", "Access Control")
|
||||
config_window.add_head_content("<title>Access Control</title>")
|
||||
config_window.set_head_content("<title>Access Control</title>")
|
||||
|
||||
var/data = "These settings control who can access the server during this round.<br>"
|
||||
data += "They must be reset every single time the server restarts.<br>"
|
||||
|
||||
Reference in New Issue
Block a user