/tg/ Station 13 - Modules - TypesVar Details - Proc Details

preferences

Vars

character_preview_viewA preview of the current character
character_savefileThe savefile relating to character preferences, PREFERENCE_CHARACTER
current_windowThe current window, PREFERENCE_TAB_* in [code/__DEFINES/preferences.dm]
favorite_outfitsWhat outfit typepaths we've favorited in the SelectEquipment menu
game_savefileThe savefile relating to core preferences, PREFERENCE_PLAYER
heartedSomeone 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_untilIf we have a hearted commendations, we honor it every time the player loads preferences until this time has been passed
key_bindingsCustom keybindings. Map of keybind names to keyboard inputs. For example, by default would have "swap_hands" -> list("X")
key_bindings_by_keyCached list of keybindings, mapping keys to actions. For example, by default would have "X" -> list("swap_hands")
middlewareA list of instantiated middleware
persistent_scarsIf we have persistent scars enabled
recently_updated_keysA list of keys that have been updated since the last save.
tainted_character_profilesIf set to TRUE, will update character_profiles on the next ui_data tick.
value_cacheA cache of preference entries to values. Used to avoid expensive READ_FILE every time a preference is retrieved.

Procs

apply_all_client_preferencesApplies all PREFERENCE_PLAYER preferences
apply_character_randomization_prefsRandomizes the character according to preferences.
apply_prefs_toApplies the given preferences to a human mob.
check_keybindingschecks through keybindings for outdated unbound keys and updates them
get_default_randomizationReturns the default randomise variable ouptut
get_highest_priority_jobReturns what job is marked as highest
get_key_bindings_by_keyInverts the key_bindings list such that it can be used for key_bindings_by_key
get_savefile_for_savefile_identifierReturns which savefile to use for a given savefile identifier
hardcore_random_setupSetup the random hardcore quirks and give the character the new score prize.
migrate_body_typesPreviously, 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_menuHandle the migrations necessary from pre-tgui prefs to post-tgui prefs, for characters
migrate_preferences_to_tgui_prefs_menuHandle the migrations necessary from pre-tgui prefs to post-tgui prefs
randomise_appearance_prefsFully randomizes everything in the character.
read_preferenceRead 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_toSanitizes the preferences, applies the randomization prefs, and then applies the preference to the human mob.
select_hardcore_quirksGoes 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_hardcoreReturns whether the parent mob should have the random hardcore settings enabled. Assumes it has a mind.
should_randomizeReturns if a preference should be randomized.
update_preferenceWill 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_preferenceSet a /datum/preference entry. Returns TRUE for a successful preference application. Returns FALSE if it is invalid.

Var Details

character_preview_view

A preview of the current character

character_savefile

The savefile relating to character preferences, PREFERENCE_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

game_savefile

The savefile relating to core preferences, PREFERENCE_PLAYER

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

persistent_scars

If we have persistent scars enabled

recently_updated_keys

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

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_savefile_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_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.