mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-22 04:30:44 +01:00
Fix FPS and other preferences not properly applying after reconnect (#61542)
Fixes #61515. Preferences were only applied on load_preferences(), which only fires when the preferences datum is created. Preferences datums are cached, and so load_preferences is only called the once.
This commit is contained in:
@@ -238,6 +238,7 @@ GLOBAL_LIST_INIT(blacklisted_builds, list(
|
||||
prefs = GLOB.preferences_datums[ckey]
|
||||
if(prefs)
|
||||
prefs.parent = src
|
||||
prefs.apply_all_client_preferences()
|
||||
else
|
||||
prefs = new /datum/preferences(src)
|
||||
GLOB.preferences_datums[ckey] = prefs
|
||||
|
||||
@@ -329,6 +329,15 @@ GLOBAL_LIST_EMPTY(preferences_datums)
|
||||
|
||||
return preferences
|
||||
|
||||
/// Applies all PREFERENCE_PLAYER preferences
|
||||
/datum/preferences/proc/apply_all_client_preferences()
|
||||
for (var/datum/preference/preference as anything in get_preferences_in_priority_order())
|
||||
if (preference.savefile_identifier != PREFERENCE_PLAYER)
|
||||
continue
|
||||
|
||||
value_cache -= preference.type
|
||||
preference.apply_to_client(parent, read_preference(preference.type))
|
||||
|
||||
// This is necessary because you can open the set preferences menu before
|
||||
// the atoms SS is done loading.
|
||||
INITIALIZE_IMMEDIATE(/atom/movable/screen/character_preview_view)
|
||||
|
||||
@@ -163,12 +163,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
|
||||
fcopy(S, bacpath) //byond helpfully lets you use a savefile for the first arg.
|
||||
return FALSE
|
||||
|
||||
for (var/datum/preference/preference as anything in get_preferences_in_priority_order())
|
||||
if (preference.savefile_identifier != PREFERENCE_PLAYER)
|
||||
continue
|
||||
|
||||
value_cache -= preference.type
|
||||
preference.apply_to_client(parent, read_preference(preference.type))
|
||||
apply_all_client_preferences()
|
||||
|
||||
//general preferences
|
||||
READ_FILE(S["lastchangelog"], lastchangelog)
|
||||
|
||||
Reference in New Issue
Block a user