mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2026-01-06 07:23:16 +00:00
[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:
committed by
GitHub
parent
82e419e9b1
commit
8164837ba0
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user