preferences 
Custom sprite editing's per-player pace.
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" |
| asking_applicability | TRUE while is_applicable() asks a preference: is_accessible() then leaves out its setup page test. Set by it alone. |
| augment_limb_colors | Each augment slot's recolourable finish's colours, slot name -> a colour string as /obj/item/bodypart/var/augment_colors. A slot without one draws its finish's default. |
| 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 | Every body marking this character wears |
| cached_character_profiles | The character profiles, saved so we can cheaply recompute them in ui_data only when necessary, without having to use expensive update_static_data calls. |
| 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] |
| custom_facial_hair | Saved facial hair drawing for the loaded character slot. |
| custom_hair | Saved hair drawing for the loaded character slot. |
| custom_limb_markings | Body zone -> saved drawing for the loaded character slot. |
| custom_sprite_editors | Editor key -> open preferences editor; allocated on first use. |
| custom_sprite_pace | Paces this player's costly custom sprite work across all their editors. |
| custom_sprite_savefile | Lazily loaded drawing sidecar owned by these preferences. |
| custom_sprite_slot | Character slot currently loaded from the drawing sidecar. |
| custom_style_previous | Editor key -> the one previous saved package for that drawing target. |
| cyborg_layout_savefile | Lazily loaded cyborg layout sidecar owned by these preferences. |
| 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 |
| 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. |
| 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 |
| job_assigned_profiles | Lazylist of job titles to character slot numbers When rolling for a job, if that job is present in this list, we load that slot instead of the active slot |
| job_preferences | List of job titles to their priority level, JP_LOW, JP_MEDIUM, JP_HIGH If a job is absent from the list, it is considered to be "JP_NEVER" |
| 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") |
| language_understanding | How much of each language the character only understands they follow, in percent, where that is less than all of it: language type -> level. Null while every one of them is followed in full. |
| languages | Associative list, keyed by language typepath, pointing to LANGUAGE_UNDERSTOOD, or LANGUAGE_SPOKEN, 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 |
| muted | Bitflags for communications that are muted |
| path | The path to the general savefile for this datum |
| preferred_spawn_methods | Admin-only: Preferred spawn methods for the IC Quick Spawn menu. |
| preferred_spawn_outfits | Admin-only: Preferred outfit typepaths for the IC Quick Spawn menu. |
| preview_drawing | Draws the character preview that every tab of character setup shows. |
| preview_pref | Preference of how the preview should show the character. |
| previous_preview_pref | What we previously had this set to (if we should update_body() or not) |
| 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 cached_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. |
| character_preview_changed | The preview mob changed: draws it again for the window, if one is open. |
| character_preview_open | Whether a character setup window is open to show the preview. |
| check_keybindings | checks through keybindings for outdated unbound keys and updates them |
| clear_custom_sprite_slot | Forgets the loaded slot's drawings, so the next load_custom_sprites() reads them again. |
| close_custom_sprite_editors | Saves and closes every open editor. Returns FALSE when one couldn't be saved; it stays open with its error. When the preferences window or owner is closing, drain accepted strokes before the save instead of waiting for a retry. |
| commit_custom_style | Saves one style package to a character slot. See commit_custom_styles(). |
| commit_custom_styles | Saves several style packages to a character slot in one sidecar write. |
| custom_sprite_open_editors | Every editor using this account's Custom swatches, including a retained salon draft. |
| custom_sprite_slot_data | The loaded slot's drawings and previous styles as the sidecar stores them. |
| custom_style_hair_context | This character's saved base look for a head target. |
| custom_style_hair_problem | Returns why a hair look can't be used by this character, or null when it can. |
| custom_style_pending_markings_problem | Recipient saves compare against the actual saved file, which pending character setup edits haven't reached. |
| custom_style_previous_package | A copy of the previous saved style for a target, or null. |
| custom_style_saved_package | The currently saved package for a target, including its native base look. |
| cyborg_body_snapshot | What a spawning body keeps of the open character's layouts: its active layout and its model defaults. A draft open in the editor is copied, unsaved edits and all. Otherwise the body keeps the save text and decodes only the active layout now, and each model default when its chassis first asks for it (see cyborg_appearance_model_default()). Null when the slot holds a newer schema. |
| cyborg_layout_store | The sidecar store, created on first use. Guests and dev preferences keep it in memory only. |
| cyborg_session | Returns the existing editor owner; preferences own only native persistence. |
| finish_custom_sprite_editors_for_change | Saves and closes open editors before a setup change. When one can't be saved, the change waits and the player is told why. |
| flush_nova_import_preferences | Existing preference serialization, with its write result checked before claiming consent was saved. |
| food_preferences_allowed | Whether food preferences will actually do anything for this character. |
| get_alt_job_title | The player's chosen alt title for a job |
| 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. |
| has_taur_body | Returns whether these preferences give the character a taur body. |
| has_taur_tail | Returns whether these preferences give the character a taur body that brings its own tail. |
| language_understanding_level | How much of a language the character follows, in percent: all of any they speak, or only understand in full. |
| load_augment_colors | Loads the augment colours from a save: each slot's colour string, kept only where the slot's finish is recolourable and the string is valid. A bad, stale or hand-edited entry is dropped, never drawn. |
| load_character_nova | Loads the modular customizations of a character from the savefile |
| load_custom_sprites | Loads the selected slot's drawings from the sidecar, creating the store on first use. |
| migrate_augment_items | Migrates everyone's prefs augments over to the new format, (slot, /datum/augment_item) |
| 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_boolean_sound_prefs_to_default_volume | |
| migrate_character_to_tgui_prefs_menu | Handle the migrations necessary from pre-tgui prefs to post-tgui prefs, for characters |
| migrate_felinid_feature_keys | Rename feature_human_tail and feature_human_ears to something not stupid |
| migrate_gendered_nonbinary_physique | Previously, physiques only supported binary characters, so "Use gender" on a non-binary character played havoc due to all checks being binary (some checked for females others for males) This caused inconsistencies when it was in play (male laughs and female screams) Force non-binary characters to have a female physique |
| 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 |
| migrate_quirk_to_personality | Replace a quirk with a personality |
| mismatched_parts_change_nothing | Returns whether turning allow_mismatched_parts on would leave how this character is drawn as it is. The toggle reaches a body only through questions an apply_to_human() asks, so this puts each question as it is put there, with the toggle off and then on, and compares what the answers let onto the body: |
| nova_painting_import_answer | Return the account's explicit yes/no answer; a missing or invalid value remains unset. |
| prefs_import_finalise | Pass 2. Rebuilds every known pref through the validating write path. |
| prefs_import_forget | Clear the whole character cache before loading a slot, including defaults that read other preferences. |
| prefs_import_prune_unknown | Only out-of-range slots go. load_preferences scans these names, other junk is inert. |
| prefs_import_rebuild | Round-trips each pref through the write path, tallying as we go. |
| prepare_custom_style | Validates one package against the saved character without changing anything. |
| publish_custom_style_hair | Writes a hair look into value_cache and the in-memory character tree. Disk writes happen elsewhere. |
| publish_custom_style_markings | Publish only the committed zone, preserving native markings and pending edits on other limbs. |
| randomise_appearance_prefs | Fully randomizes everything in the character. |
| read_cyborg_layout | The saved layout for a character slot, or null when it has none. Save text is decoded into a tree the caller owns. A tree from an older build, or text from a newer one, comes back as stored and stays read-only. |
| 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. |
| refresh_custom_sprite_preview | Redraws the character setup preview without waiting on it. |
| remove_custom_sprite_slot | Removes a slot's drawings from the sidecar and saves it. Returns whether the save succeeded. |
| remove_cyborg_layout_slot | Forgets a deleted slot's layout, including any unsaved draft for it, so a reused slot starts empty. |
| 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_nova | Saves the modular customizations of a character on the savefile |
| save_nova_painting_import_answer | Persist an explicit answer, restoring the in-memory value if the preferences write fails. |
| saved_language_understanding | The levels worth saving: understood-only languages set below full, keyed by their type as text. Null if none. |
| savefile_needs_update_nova | Checks if the modular side of the savefile is up to date. If the return value is higher than 0, update_character_nova() 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. |
| set_custom_style_drawing | Replaces the loaded slot's drawing for a target in memory. |
| set_meridian_theme | Validate, persist, and distribute a MeridianOS theme selection. |
| 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. |
| species_grows_legs | Returns whether the chosen species grows legs of its own. |
| store_custom_sprite_slot | Writes the loaded slot's drawings and previous styles into the in-memory sidecar tree. |
| ui_act | Setup actions that change the body or its markings outside set_preference save and close open editors first, as preference changes do. Most of those actions send the window only what they change; a drawing saved on the way changes more of it, so then the window gets all of its data again. |
| update_character_nova | Brings a savefile up to date with modular preferences. Called if savefile_needs_update_nova() 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_cyborg_layout | Stores a character slot's layout and writes the sidecar. Returns FALSE when the write failed, or when the layout is past CYBORG_LAYOUT_MAX_SLOT_BYTES, which leaves the slot as it was. |
| 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"
asking_applicability 
TRUE while is_applicable() asks a preference: is_accessible() then leaves out its setup page test. Set by it alone.
augment_limb_colors 
Each augment slot's recolourable finish's colours, slot name -> a colour string as /obj/item/bodypart/var/augment_colors. A slot without one draws its finish's default.
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 
Every body marking this character wears
cached_character_profiles 
The character profiles, saved so we can cheaply recompute them in ui_data only when necessary, without having to use expensive update_static_data calls.
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]
custom_facial_hair 
Saved facial hair drawing for the loaded character slot.
custom_hair 
Saved hair drawing for the loaded character slot.
custom_limb_markings 
Body zone -> saved drawing for the loaded character slot.
custom_sprite_editors 
Editor key -> open preferences editor; allocated on first use.
custom_sprite_pace 
Paces this player's costly custom sprite work across all their editors.
custom_sprite_savefile 
Lazily loaded drawing sidecar owned by these preferences.
custom_sprite_slot 
Character slot currently loaded from the drawing sidecar.
custom_style_previous 
Editor key -> the one previous saved package for that drawing target.
cyborg_layout_savefile 
Lazily loaded cyborg layout sidecar owned by these preferences.
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
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.
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
job_assigned_profiles 
Lazylist of job titles to character slot numbers When rolling for a job, if that job is present in this list, we load that slot instead of the active slot
job_preferences 
List of job titles to their priority level, JP_LOW, JP_MEDIUM, JP_HIGH If a job is absent from the list, it is considered to be "JP_NEVER"
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")
language_understanding 
How much of each language the character only understands they follow, in percent, where that is less than all of it: language type -> level. Null while every one of them is followed in full.
languages 
Associative list, keyed by language typepath, pointing to LANGUAGE_UNDERSTOOD, or LANGUAGE_SPOKEN, 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
muted 
Bitflags for communications that are muted
path 
The path to the general savefile for this datum
preferred_spawn_methods 
Admin-only: Preferred spawn methods for the IC Quick Spawn menu.
preferred_spawn_outfits 
Admin-only: Preferred outfit typepaths for the IC Quick Spawn menu.
preview_drawing 
Draws the character preview that every tab of character setup shows.
preview_pref 
Preference of how the preview should show the character.
previous_preview_pref 
What we previously had this set to (if we should update_body() or not)
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 cached_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.
Arguments:
- character - The human mob to apply the preferences to
- icon_updates - Whether to update the mob's icons after applying preferences. Is often skipped to save processing when an update will happen later anyway.
- do_not_apply - A list of preference types to skip when applying preferences.
character_preview_changed
The preview mob changed: draws it again for the window, if one is open.
character_preview_open
Whether a character setup window is open to show the preview.
check_keybindings
checks through keybindings for outdated unbound keys and updates them
clear_custom_sprite_slot
Forgets the loaded slot's drawings, so the next load_custom_sprites() reads them again.
close_custom_sprite_editors
Saves and closes every open editor. Returns FALSE when one couldn't be saved; it stays open with its error. When the preferences window or owner is closing, drain accepted strokes before the save instead of waiting for a retry.
commit_custom_style
Saves one style package to a character slot. See commit_custom_styles().
Arguments:
- rotate: Keeps the currently saved package as the previous style. Only whole-style replacement, import, restoration and salon saves rotate it.
commit_custom_styles
Saves several style packages to a character slot in one sidecar write.
Every package is validated before anything changes. Packages identical to what's saved are skipped and never rotate. The drawings are written first, through the verified sidecar writer, once; if that fails, every package is rolled back and nothing in memory changes. Changed native base looks are then published and preferences.json written once, so an interruption between the two writes can only leave new drawings on old base looks.
Arguments:
- packages: Canonical packages, at most one per target and zone.
- slot: The slot the caller bound the save to. It must still be selected.
- rotate_keys: Style keys (custom_style_key()) whose saved package becomes the previous style.
- reject_pending_hair: Refuses when character setup has unsaved hair edits.
- reject_pending_markings: Refuses when a target zone has unsaved native marking edits.
Returns:
- null: Saved, or already identical.
- text: Why nothing was saved. Safe to show the player.
custom_sprite_open_editors
Every editor using this account's Custom swatches, including a retained salon draft.
custom_sprite_slot_data
The loaded slot's drawings and previous styles as the sidecar stores them.
custom_style_hair_context
This character's saved base look for a head target.
custom_style_hair_problem
Returns why a hair look can't be used by this character, or null when it can.
This applies the character setup menu's feature and species rules independently of its selected page, plus the character's master emissive permission.
custom_style_pending_markings_problem
Recipient saves compare against the actual saved file, which pending character setup edits haven't reached.
custom_style_previous_package
A copy of the previous saved style for a target, or null.
custom_style_saved_package
The currently saved package for a target, including its native base look.
cyborg_body_snapshot
What a spawning body keeps of the open character's layouts: its active layout and its model defaults. A draft open in the editor is copied, unsaved edits and all. Otherwise the body keeps the save text and decodes only the active layout now, and each model default when its chassis first asks for it (see cyborg_appearance_model_default()). Null when the slot holds a newer schema.
cyborg_layout_store
The sidecar store, created on first use. Guests and dev preferences keep it in memory only.
cyborg_session
Returns the existing editor owner; preferences own only native persistence.
finish_custom_sprite_editors_for_change
Saves and closes open editors before a setup change. When one can't be saved, the change waits and the player is told why.
flush_nova_import_preferences
Existing preference serialization, with its write result checked before claiming consent was saved.
food_preferences_allowed
Whether food preferences will actually do anything for this character.
On top of the species check, a Hemophage's corrupted tongue is inserted after preferences are applied and hardcodes its own liked foodtypes, so anything set here would be silently discarded.
get_alt_job_title
The player's chosen alt title for a job
Always use this rather than indexing alt_job_titles directly - the load path can't check the title against the job, so this is where a made-up one gets caught. Falls back to the real title.
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.
has_taur_body
Returns whether these preferences give the character a taur body.
has_taur_tail
Returns whether these preferences give the character a taur body that brings its own tail.
That tail fills the tail slot, so the tail preferences step aside while it is chosen. Their saved values are kept for when the character goes back to a taur without one.
Returns:
- TRUE: The taur choice will be applied and its body has a tail, drawn separately or baked in.
- FALSE: No taur will be applied, or its body has no tail.
language_understanding_level
How much of a language the character follows, in percent: all of any they speak, or only understand in full.
load_augment_colors
Loads the augment colours from a save: each slot's colour string, kept only where the slot's finish is recolourable and the string is valid. A bad, stale or hand-edited entry is dropped, never drawn.
Arguments:
- save_data: The character's save data, its augment_limb_styles already loaded.
load_character_nova
Loads the modular customizations of a character from the savefile
load_custom_sprites
Loads the selected slot's drawings from the sidecar, creating the store on first use.
migrate_augment_items
Migrates everyone's prefs augments over to the new format, (slot, /datum/augment_item)
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_boolean_sound_prefs_to_default_volume
-
Pull request: #86932 Sound mixer part 1
-
Multiplies boolean sound prefs by 100
-
Changed ambience tick pref to numeric slider
-
Changed ship ambience tick pref to numeric slider
-
Changed lobby music tick pref to numeric slider
-
Changed Radio noise tick pref to numeric slider
migrate_character_to_tgui_prefs_menu
Handle the migrations necessary from pre-tgui prefs to post-tgui prefs, for characters
migrate_felinid_feature_keys
Rename feature_human_tail and feature_human_ears to something not stupid
migrate_gendered_nonbinary_physique
Previously, physiques only supported binary characters, so "Use gender" on a non-binary character played havoc due to all checks being binary (some checked for females others for males) This caused inconsistencies when it was in play (male laughs and female screams) Force non-binary characters to have a female physique
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
migrate_quirk_to_personality
Replace a quirk with a personality
If this is accompanied with removal of a quirk, you don't need to worry about handling that here - quirk sanitization happens AFTER migration
mismatched_parts_change_nothing
Returns whether turning allow_mismatched_parts on would leave how this character is drawn as it is. The toggle reaches a body only through questions an apply_to_human() asks, so this puts each question as it is put there, with the toggle off and then on, and compares what the answers let onto the body:
- every mutant part and genital preference applies its value where is_visible() says it shows, else its default; the snout also snouts the head whenever it shows, None or not (masks and helmets then take their muzzled sprites);
- hair opacity applies its value only where is_visible() says it shows;
- penis taur mode and penis sheath write their value only while is_applicable();
- the knot preference, while it is on, gives the knot only while the penis choice is_applicable();
- the limbs and markings middleware refuses leg augments while the taur choice is_applicable() with a taur chosen. The answers alone would not do: the IPC screen, chassis and head always count as switched on, so every character but a synth would see them show with the toggle on, and apply the same None or default either way. Every question is put as a spawn puts it, without the setup page, so one pass with the toggle off and one with it on decide. The toggle's own value is put back.
nova_painting_import_answer
Return the account's explicit yes/no answer; a missing or invalid value remains unset.
prefs_import_finalise
Pass 2. Rebuilds every known pref through the validating write path.
prefs_import_forget
Clear the whole character cache before loading a slot, including defaults that read other preferences.
prefs_import_prune_unknown
Only out-of-range slots go. load_preferences scans these names, other junk is inert.
prefs_import_rebuild
Round-trips each pref through the write path, tallying as we go.
prepare_custom_style
Validates one package against the saved character without changing anything.
Returns:
- list("error" = text): Nothing may be saved.
- list("package" = null): Identical to what's saved.
- list("package", "current", "hair_changed", "markings_changed"): Ready to write.
publish_custom_style_hair
Writes a hair look into value_cache and the in-memory character tree. Disk writes happen elsewhere.
publish_custom_style_markings
Publish only the committed zone, preserving native markings and pending edits on other limbs.
randomise_appearance_prefs
Fully randomizes everything in the character.
read_cyborg_layout
The saved layout for a character slot, or null when it has none. Save text is decoded into a tree the caller owns. A tree from an older build, or text from a newer one, comes back as stored and stays read-only.
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.
refresh_custom_sprite_preview
Redraws the character setup preview without waiting on it.
Saves and teardown must not sleep, but the preview renderer can reach resolve_ai_icon(), whose Portrait branch opens a window. Character setup never offers Portrait, so in practice this runs straight through; detaching it keeps the no-sleep guarantee without editing the renderer.
remove_custom_sprite_slot
Removes a slot's drawings from the sidecar and saves it. Returns whether the save succeeded.
remove_cyborg_layout_slot
Forgets a deleted slot's layout, including any unsaved draft for it, so a reused slot starts empty.
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_nova
Saves the modular customizations of a character on the savefile
save_nova_painting_import_answer
Persist an explicit answer, restoring the in-memory value if the preferences write fails.
saved_language_understanding
The levels worth saving: understood-only languages set below full, keyed by their type as text. Null if none.
savefile_needs_update_nova
Checks if the modular side of the savefile is up to date. If the return value is higher than 0, update_character_nova() 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.
set_custom_style_drawing
Replaces the loaded slot's drawing for a target in memory.
set_meridian_theme
Validate, persist, and distribute a MeridianOS theme selection.
The explicit membership check must remain before update_preference(); the generic choiced deserializer converts unknown input to its default, which would otherwise let an invalid wire value silently change the selection.
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.
species_grows_legs
Returns whether the chosen species grows legs of its own.
A taur body replaces the legs, and a legless species' own tail fills the tail slot, so neither the taur nor the tail preferences apply to one. Their saved values are kept for other species.
store_custom_sprite_slot
Writes the loaded slot's drawings and previous styles into the in-memory sidecar tree.
ui_act
Setup actions that change the body or its markings outside set_preference save and close open editors first, as preference changes do. Most of those actions send the window only what they change; a drawing saved on the way changes more of it, so then the window gets all of its data again.
update_character_nova
Brings a savefile up to date with modular preferences. Called if savefile_needs_update_nova() 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_cyborg_layout
Stores a character slot's layout and writes the sidecar. Returns FALSE when the write failed, or when the layout is past CYBORG_LAYOUT_MAX_SLOT_BYTES, which leaves the slot as it was.
write_preference
Set a /datum/preference entry. Returns TRUE for a successful preference application. Returns FALSE if it is invalid.