Files
CHOMPStation2/code/modules/client/preferences/migrations/13_preferences.dm
2024-09-14 12:30:15 +02:00

13 lines
537 B
Plaintext

/// Transforms the bay style `"preferences": ["SOUND_MIDI", ...]` to `"SOUND_MIDI": 1` and `"preferences_disabled": [...]` to `0`.
/datum/preferences/proc/migration_13_preferences(datum/json_savefile/S)
var/list/preferences_enabled = S.get_entry("preferences")
for(var/key in preferences_enabled)
S.set_entry("[key]", TRUE)
var/list/preferences_disabled = S.get_entry("preferences_disabled")
for(var/key in preferences_disabled)
S.set_entry("[key]", FALSE)
// Force a reload of the value cache
apply_all_client_preferences()