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

preferences

Vars

be_specialList of ROLE_X that the client wants to be eligible for
character_dataThe savefile relating to character preferences, PREFERENCE_CHARACTER
character_preview_viewA preview of the current character
current_windowThe current window, PREFERENCE_TAB_* in [code/__DEFINES/preferences.dm]
default_slotEnsures that we always load the last used save, QOL
favorite_outfitsWhat outfit typepaths we've favorited in the SelectEquipment menu
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")
last_idLast CID that this client has connected from
last_ipLast IP that this client has connected from
lastchangelogCached changelog size, to detect new changelogs since last join
load_and_saveWhether or not we allow saving/loading. Used for guests, if they're enabled
max_save_slotsThe maximum number of slots we're allowed to contain
middlewareA list of instantiated middleware
mutedBitflags for communications that are muted
pathThe path to the general savefile for this datum
recently_updated_keysA list of keys that have been updated since the last save.
savefileThe json savefile for this datum
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

add_loadout_itemHelper for slotting in a new loadout item
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_save_data_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_legacy_sound_togglesPreviously, 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_menuHandle the migrations necessary from pre-tgui prefs to post-tgui prefs
migrate_quirk_to_loadoutMove quirk items into loadout items
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.
remove_loadout_itemHelper for removing a loadout item
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.
update_tts_blip_prefsPreviously, tts enabled/blip were individual buttons PR #76558 changed them to one dropdown choice. This migration transfers the player's existing preferences into the new dropdown
write_preferenceSet a /datum/preference entry. Returns TRUE for a successful preference application. Returns FALSE if it is invalid.

Var Details

be_special

List of ROLE_X that the client wants to be eligible for

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]

default_slot

Ensures that we always load the last used save, QOL

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")

last_id

Last CID that this client has connected from

last_ip

Last IP that this client has connected from

lastchangelog

Cached changelog size, to detect new changelogs since last join

load_and_save

Whether or not we allow saving/loading. Used for guests, if they're enabled

max_save_slots

The maximum number of slots we're allowed to contain

middleware

A list of instantiated middleware

muted

Bitflags for communications that are muted

path

The path to the general savefile for this datum

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

add_loadout_item

Helper for slotting in a new loadout item

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

migrate_quirk_to_loadout

Move quirk items into loadout items

If this is accompanied with removal of a quirk, you don't need to worry about handling that here - quirk sanitization happens AFTER migration

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.

remove_loadout_item

Helper for removing a loadout item

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.

update_tts_blip_prefs

Previously, tts enabled/blip were individual buttons PR #76558 changed them to one dropdown choice. This migration transfers the player's existing preferences into the new dropdown

write_preference

Set a /datum/preference entry. Returns TRUE for a successful preference application. Returns FALSE if it is invalid.