Files
Jeremiah c771360e00 Removes tgui fancy mode as a preference, we're only fancy now (#94389)
## About The Pull Request
This defaults every tgui to fancy mode and removes the preference
entirely.
## Why It's Good For The Game
If you look through the code you'll find comments like these 
> //some browsers (IE8) have trouble with unsupported css3 elements that
break the panel's functionality, so we won't load those if a user is in
no frills tgui mode since that's for similar compatability support

We're far and away from IE8, therefore our need for compatibility
support, so I think it's valid to remove this so called 'no frills tgui
mode'. It's tied into the event message system with every backend
update, so there's a tad less overhead.
## Changelog
🆑
del: TGUI now defaults to fancy mode, there is only fancy mode. Welcome
to the future.
/🆑
2025-12-09 13:54:13 -07:00

88 lines
3.0 KiB
Plaintext

// Determines if input boxes are in tgui or old fashioned
/datum/preference/toggle/tgui_input
category = PREFERENCE_CATEGORY_GAME_PREFERENCES
savefile_key = "tgui_input"
savefile_identifier = PREFERENCE_PLAYER
/// Large button preference. Error text is in tooltip.
/datum/preference/toggle/tgui_input_large
category = PREFERENCE_CATEGORY_GAME_PREFERENCES
savefile_key = "tgui_input_large"
savefile_identifier = PREFERENCE_PLAYER
default_value = FALSE
/datum/preference/toggle/tgui_input_large/apply_to_client(client/client, value)
for (var/datum/tgui/tgui as anything in client.mob?.tgui_open_uis)
// Force it to reload either way
tgui.send_full_update(client.mob)
/// Swapped button state - sets buttons to SS13 traditional SUBMIT/CANCEL
/datum/preference/toggle/tgui_input_swapped
category = PREFERENCE_CATEGORY_GAME_PREFERENCES
savefile_key = "tgui_input_swapped"
savefile_identifier = PREFERENCE_PLAYER
/datum/preference/toggle/tgui_input_swapped/apply_to_client(client/client, value)
for (var/datum/tgui/tgui as anything in client.mob?.tgui_open_uis)
// Force it to reload either way
tgui.send_full_update(client.mob)
/// Changes layout in some UI's, like Vending, Smartfridge etc. Making it list or grid
/datum/preference/choiced/tgui_layout
savefile_key = "tgui_layout"
savefile_identifier = PREFERENCE_PLAYER
/datum/preference/choiced/tgui_layout/init_possible_values()
return list(
TGUI_LAYOUT_GRID,
TGUI_LAYOUT_LIST,
)
/datum/preference/choiced/tgui_layout/create_default_value()
return TGUI_LAYOUT_LIST
/datum/preference/choiced/tgui_layout/apply_to_client(client/client, value)
for (var/datum/tgui/tgui as anything in client.mob?.tgui_open_uis)
// Force it to reload either way
tgui.update_static_data(client.mob)
/datum/preference/choiced/tgui_layout/smartfridge
savefile_key = "tgui_layout_smartfridge"
/datum/preference/choiced/tgui_layout/create_default_value()
return TGUI_LAYOUT_GRID
/datum/preference/toggle/tgui_lock
category = PREFERENCE_CATEGORY_GAME_PREFERENCES
savefile_key = "tgui_lock"
savefile_identifier = PREFERENCE_PLAYER
default_value = FALSE
/datum/preference/toggle/tgui_lock/apply_to_client(client/client, value)
for (var/datum/tgui/tgui as anything in client.mob?.tgui_open_uis)
// Force it to reload either way
tgui.update_static_data(client.mob)
/// Light mode for tgui say
/datum/preference/toggle/tgui_say_light_mode
category = PREFERENCE_CATEGORY_GAME_PREFERENCES
savefile_key = "tgui_say_light_mode"
savefile_identifier = PREFERENCE_PLAYER
default_value = FALSE
/datum/preference/toggle/tgui_say_light_mode/apply_to_client(client/client)
client.tgui_say?.load()
/datum/preference/toggle/ui_scale
category = PREFERENCE_CATEGORY_GAME_PREFERENCES
savefile_key = "ui_scale"
savefile_identifier = PREFERENCE_PLAYER
default_value = TRUE
/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()