[MIRROR] [TGUI v6] Migration to CSS Variables, styles refactor & React 19 (#10615)

Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
CHOMPStation2StaffMirrorBot
2025-04-09 11:17:59 -07:00
committed by GitHub
parent 82e419e9b1
commit 8164837ba0
141 changed files with 2627 additions and 1990 deletions

View File

@@ -181,3 +181,6 @@
/// Token used for the external chatlog api. Only valid for the current round.
var/chatlog_token
/// The DPI scale of the client. 1 is equivalent to 100% window scaling, 2 will be 200% window scaling
var/window_scaling

View File

@@ -298,9 +298,12 @@
)
addtimer(CALLBACK(src, PROC_REF(check_panel_loaded)), 30 SECONDS)
INVOKE_ASYNC(src, PROC_REF(acquire_dpi))
tgui_panel.initialize()
// Initialize tgui panel
tgui_say.initialize()
tgui_panel.initialize()
connection_time = world.time
connection_realtime = world.realtime
@@ -814,6 +817,10 @@
SEND_SIGNAL(src, COMSIG_CLIENT_CLICK, object, location, control, params, usr)
. = ..()
/// This grabs the DPI of the user per their skin
/client/proc/acquire_dpi()
window_scaling = text2num(winget(src, null, "dpi"))
#undef ADMINSWARNED_AT
#undef CURRENT_MINUTE
#undef CURRENT_SECOND

View File

@@ -114,3 +114,16 @@
/datum/preference/text/preset_colors/apply_to_client(client/client, value)
return
/datum/preference/toggle/ui_scale
category = PREFERENCE_CATEGORY_GAME_PREFERENCES
savefile_key = "ui_scale"
savefile_identifier = PREFERENCE_PLAYER
default_value = FALSE // Set to true once lobby screen is migrated to tgui and browse are replaced with datum browser
/datum/preference/toggle/ui_scale/apply_to_client(client/client, value)
if(!istype(client))
return
INVOKE_ASYNC(client, TYPE_VERB_REF(/client, refresh_tgui))
client.tgui_say?.load()