preferences
Vars | |
allow_advanced_colors | Allows the user to freely color his body markings and mutant parts. |
---|---|
alt_job_titles | Alternative job titles stored in preferences. Assoc list, ie. alt_job_titles["Scientist"] = "Cytologist" |
augment_limb_styles | List of chosen preferred styles for limb replacements |
augments | List of chosen augmentations. It's an associative list with key name of the slot, pointing to a typepath of an augment define |
be_special | List of ROLE_X that the client wants to be eligible for |
body_markings | A list of all bodymarkings |
character_data | The savefile relating to character preferences, PREFERENCE_CHARACTER |
character_preview_view | A preview of the current character |
chosen_augment_slot | Which augment slot we currently have chosen, this is for UI display |
current_window | The current window, PREFERENCE_TAB_* in [code/__DEFINES/preferences.dm ] |
default_slot | Ensures that we always load the last used save, QOL |
donator_status | Does this member have donator status on the server |
favorite_outfits | What outfit typepaths we've favorited in the SelectEquipment menu |
features | Has to include all information that extra organs from mutant bodyparts would need. (so far only genitals now) |
food_preferences | An assoc list of food types to liked or dislike values. If null or empty, default species tastes are used instead on application. If a food doesn't exist in this list, it uses the default value. |
headshot | A photo of the character, visible on close examine |
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") |
languages | Associative list, keyed by language typepath, pointing to UNDERSTOOD_LANGUAGE, or UNDERSTOOD_LANGUAGE | SPOKEN_LANGUAGE, for whether we understand or speak the language |
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 |
mismatched_customization | Will the person see accessories not meant for their species to choose from |
mutant_bodyparts | A list containing all of our mutant bodparts |
muted | Bitflags for communications that are muted |
path | The path to the general savefile for this datum |
preview_pref | Preference of how the preview should show the character. |
recently_updated_keys | A list of keys that have been updated since the last save. |
savefile | The json savefile for this datum |
show_body_size | Whether the user wants to see body size being shown in the preview |
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 | |
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_adjusted_language_holder | This helper proc gets the current species language holder and does any post-processing that's required in one easy to track place. This proc should always be edited or used when modifying or getting the default languages of a player controlled, unrestricted species, to prevent any errant conflicts. |
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. |
load_character_skyrat | Loads the modular customizations of a character from the savefile |
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 |
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_with_damage | This proc saves the damage currently on character (human) and reapplies it after safe_transfer_prefs() is applied to the character . |
sanitize_languages | Cleans up any invalid languages. Typically happens on language renames and codedels. |
sanitize_quirks | Cleans any quirks that should be hidden, or just simply don't exist from quirk code. |
save_character_skyrat | Saves the modular customizations of a character on the savefile |
savefile_needs_update_skyrat | Checks if the modular side of the savefile is up to date. If the return value is higher than 0, update_character_skyrat() will be called later. |
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. |
try_get_common_language | Tries to get the topmost language of the language holder. Should be the species' native language, and if it isn't, you should pester a coder. |
update_character_skyrat | Brings a savefile up to date with modular preferences. Called if savefile_needs_update_skyrat() returned a value higher than 0 |
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. |
Var Details
allow_advanced_colors
Allows the user to freely color his body markings and mutant parts.
alt_job_titles
Alternative job titles stored in preferences. Assoc list, ie. alt_job_titles["Scientist"] = "Cytologist"
augment_limb_styles
List of chosen preferred styles for limb replacements
augments
List of chosen augmentations. It's an associative list with key name of the slot, pointing to a typepath of an augment define
be_special
List of ROLE_X that the client wants to be eligible for
body_markings
A list of all bodymarkings
character_data
The savefile relating to character preferences, PREFERENCE_CHARACTER
character_preview_view
A preview of the current character
chosen_augment_slot
Which augment slot we currently have chosen, this is for UI display
current_window
The current window, PREFERENCE_TAB_* in [code/__DEFINES/preferences.dm
]
default_slot
Ensures that we always load the last used save, QOL
donator_status
Does this member have donator status on the server
favorite_outfits
What outfit typepaths we've favorited in the SelectEquipment menu
features
Has to include all information that extra organs from mutant bodyparts would need. (so far only genitals now)
food_preferences
An assoc list of food types to liked or dislike values. If null or empty, default species tastes are used instead on application. If a food doesn't exist in this list, it uses the default value.
headshot
A photo of the character, visible on close examine
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")
languages
Associative list, keyed by language typepath, pointing to UNDERSTOOD_LANGUAGE, or UNDERSTOOD_LANGUAGE | SPOKEN_LANGUAGE, for whether we understand or speak the language
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
mismatched_customization
Will the person see accessories not meant for their species to choose from
mutant_bodyparts
A list containing all of our mutant bodparts
muted
Bitflags for communications that are muted
path
The path to the general savefile for this datum
preview_pref
Preference of how the preview should show the character.
recently_updated_keys
A list of keys that have been updated since the last save.
savefile
The json savefile for this datum
show_body_size
Whether the user wants to see body size being shown in the preview
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_adjusted_language_holder
This helper proc gets the current species language holder and does any post-processing that's required in one easy to track place. This proc should always be edited or used when modifying or getting the default languages of a player controlled, unrestricted species, to prevent any errant conflicts.
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.
load_character_skyrat
Loads the modular customizations of a character from the savefile
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_with_damage
This proc saves the damage currently on character
(human) and reapplies it after safe_transfer_prefs()
is applied to the character
.
sanitize_languages
Cleans up any invalid languages. Typically happens on language renames and codedels.
sanitize_quirks
Cleans any quirks that should be hidden, or just simply don't exist from quirk code.
save_character_skyrat
Saves the modular customizations of a character on the savefile
savefile_needs_update_skyrat
Checks if the modular side of the savefile is up to date. If the return value is higher than 0, update_character_skyrat() will be called later.
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.
try_get_common_language
Tries to get the topmost language of the language holder. Should be the species' native language, and if it isn't, you should pester a coder.
update_character_skyrat
Brings a savefile up to date with modular preferences. Called if savefile_needs_update_skyrat() returned a value higher than 0
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.