preferences

Vars | |
| character_data | The savefile relating to character preferences, PREFERENCE_CHARACTER |
|---|---|
| character_preview_view | A preview of the current character |
| current_window | The current window, PREFERENCE_TAB_* in [code/__DEFINES/preferences.dm] |
| favorite_outfits | What outfit typepaths we've favorited in the SelectEquipment menu |
| hearted | Someone thought we were nice! We get a little heart in OOC until we join the server past the below time (we can keep it until the end of the round otherwise) |
| hearted_until | If we have a hearted commendations, we honor it every time the player loads preferences until this time has been passed |
| key_bindings | Custom keybindings. Map of keybind names to keyboard inputs. For example, by default would have "swap_hands" -> list("X") |
| key_bindings_by_key | Cached list of keybindings, mapping keys to actions. For example, by default would have "X" -> list("swap_hands") |
| middleware | A list of instantiated middleware |
| recently_updated_keys | A list of keys that have been updated since the last save. |
| savefile | The json savefile for this datum |
| tainted_character_profiles | If set to TRUE, will update character_profiles on the next ui_data tick. |
| value_cache | A cache of preference entries to values. Used to avoid expensive READ_FILE every time a preference is retrieved. |
Procs | |
| apply_all_client_preferences | Applies all PREFERENCE_PLAYER preferences |
| apply_character_randomization_prefs | Randomizes the character according to preferences. |
| apply_prefs_to | Applies the given preferences to a human mob. |
| check_keybindings | checks through keybindings for outdated unbound keys and updates them |
| get_default_randomization | Returns the default randomise variable ouptut |
| get_highest_priority_job | Returns what job is marked as highest |
| get_key_bindings_by_key | Inverts the key_bindings list such that it can be used for key_bindings_by_key |
| get_save_data_for_savefile_identifier | Returns which savefile to use for a given savefile identifier |
| hardcore_random_setup | Setup the random hardcore quirks and give the character the new score prize. |
| migrate_body_types | Previously, body types could only be used on non-binary characters. PR #62733 changed this to allow all characters to use body type. This migration moves binary-gendered characters over to the "use gender" body type so that old characters are preserved. |
| migrate_character_to_tgui_prefs_menu | Handle the migrations necessary from pre-tgui prefs to post-tgui prefs, for characters |
| migrate_legacy_sound_toggles | Previously, sound preferences were legacy toggles. PR #71040 changed these to modern toggles. This migration transfers the player's existing preferences into the new toggles |
| migrate_preferences_to_tgui_prefs_menu | Handle the migrations necessary from pre-tgui prefs to post-tgui prefs |
| randomise_appearance_prefs | Fully randomizes everything in the character. |
| read_preference | Read a /datum/preference type and return its value. This will write to the savefile if a value was not found with the new value. |
| safe_transfer_prefs_to | Sanitizes the preferences, applies the randomization prefs, and then applies the preference to the human mob. |
| select_hardcore_quirks | Goes through all quirks that can be used in hardcore mode and select some based on a random budget. Returns the new value to be gained with this setup, plus the previously earned score. |
| should_be_random_hardcore | Returns whether the parent mob should have the random hardcore settings enabled. Assumes it has a mind. |
| should_randomize | Returns if a preference should be randomized. |
| update_preference | Will perform an update on the preference, but not write to the savefile. This will, for instance, update the character preference view. Performs sanity checks. |
| write_preference | Set a /datum/preference entry. Returns TRUE for a successful preference application. Returns FALSE if it is invalid. |
Var Details
character_data

The savefile relating to character preferences, PREFERENCE_CHARACTER
character_preview_view

A preview of the current character
current_window

The current window, PREFERENCE_TAB_* in [code/__DEFINES/preferences.dm]
favorite_outfits

What outfit typepaths we've favorited in the SelectEquipment menu
hearted

Someone thought we were nice! We get a little heart in OOC until we join the server past the below time (we can keep it until the end of the round otherwise)
hearted_until

If we have a hearted commendations, we honor it every time the player loads preferences until this time has been passed
key_bindings

Custom keybindings. Map of keybind names to keyboard inputs. For example, by default would have "swap_hands" -> list("X")
key_bindings_by_key

Cached list of keybindings, mapping keys to actions. For example, by default would have "X" -> list("swap_hands")
middleware

A list of instantiated middleware
recently_updated_keys

A list of keys that have been updated since the last save.
savefile

The json savefile for this datum
tainted_character_profiles

If set to TRUE, will update character_profiles on the next ui_data tick.
value_cache

A cache of preference entries to values. Used to avoid expensive READ_FILE every time a preference is retrieved.
Proc Details
apply_all_client_preferences
Applies all PREFERENCE_PLAYER preferences
apply_character_randomization_prefs
Randomizes the character according to preferences.
apply_prefs_to
Applies the given preferences to a human mob.
check_keybindings
checks through keybindings for outdated unbound keys and updates them
get_default_randomization
Returns the default randomise variable ouptut
get_highest_priority_job
Returns what job is marked as highest
get_key_bindings_by_key
Inverts the key_bindings list such that it can be used for key_bindings_by_key
get_save_data_for_savefile_identifier
Returns which savefile to use for a given savefile identifier
hardcore_random_setup
Setup the random hardcore quirks and give the character the new score prize.
migrate_body_types
Previously, body types could only be used on non-binary characters. PR #62733 changed this to allow all characters to use body type. This migration moves binary-gendered characters over to the "use gender" body type so that old characters are preserved.
migrate_character_to_tgui_prefs_menu
Handle the migrations necessary from pre-tgui prefs to post-tgui prefs, for characters
migrate_legacy_sound_toggles
Previously, sound preferences were legacy toggles. PR #71040 changed these to modern toggles. This migration transfers the player's existing preferences into the new toggles
migrate_preferences_to_tgui_prefs_menu
Handle the migrations necessary from pre-tgui prefs to post-tgui prefs
randomise_appearance_prefs
Fully randomizes everything in the character.
read_preference
Read a /datum/preference type and return its value. This will write to the savefile if a value was not found with the new value.
safe_transfer_prefs_to
Sanitizes the preferences, applies the randomization prefs, and then applies the preference to the human mob.
select_hardcore_quirks
Goes through all quirks that can be used in hardcore mode and select some based on a random budget. Returns the new value to be gained with this setup, plus the previously earned score.
should_be_random_hardcore
Returns whether the parent mob should have the random hardcore settings enabled. Assumes it has a mind.
should_randomize
Returns if a preference should be randomized.
update_preference
Will perform an update on the preference, but not write to the savefile. This will, for instance, update the character preference view. Performs sanity checks.
write_preference
Set a /datum/preference entry. Returns TRUE for a successful preference application. Returns FALSE if it is invalid.