From 4e460d9cd7bca7a112d654419c35f41c2a0c2a1f Mon Sep 17 00:00:00 2001 From: Azarak Date: Wed, 11 Nov 2020 03:57:56 +0100 Subject: [PATCH] Fixes saving of undershirt color, socks color, and augmentation limb styles, fixes byond members loosing slots, donators now get extra slots (#1658) * Fixes saving * Update preferences.dm * Update preferences.dm --- .../customization/modules/client/preferences.dm | 4 ++-- .../modules/client/preferences_savefile.dm | 15 ++++++++++++--- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/modular_skyrat/modules/customization/modules/client/preferences.dm b/modular_skyrat/modules/customization/modules/client/preferences.dm index 47cdb232647..7060df3f3f8 100644 --- a/modular_skyrat/modules/customization/modules/client/preferences.dm +++ b/modular_skyrat/modules/customization/modules/client/preferences.dm @@ -195,9 +195,9 @@ if(istype(C)) if(!IsGuestKey(C.key)) load_path(C.ckey) - unlock_content = C.IsByondMember() + unlock_content = GLOB.donator_list[C.ckey] if(unlock_content) - max_save_slots = 8 + max_save_slots = 30 var/loaded_preferences_successfully = load_preferences() if(loaded_preferences_successfully) if(load_character()) diff --git a/modular_skyrat/modules/customization/modules/client/preferences_savefile.dm b/modular_skyrat/modules/customization/modules/client/preferences_savefile.dm index 684b2588b8d..840aaf88325 100644 --- a/modular_skyrat/modules/customization/modules/client/preferences_savefile.dm +++ b/modular_skyrat/modules/customization/modules/client/preferences_savefile.dm @@ -477,6 +477,12 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car READ_FILE(S["augments"] , augments) READ_FILE(S["augment_limb_styles"] , augment_limb_styles) + READ_FILE(S["undershirt_color"], undershirt_color) + undershirt_color = sanitize_hexcolor(undershirt_color, 3, 0) + + READ_FILE(S["socks_color"], socks_color) + socks_color = sanitize_hexcolor(socks_color, 3, 0) + features = SANITIZE_LIST(features) mutant_bodyparts = SANITIZE_LIST(mutant_bodyparts) body_markings = SANITIZE_LIST(body_markings) @@ -533,9 +539,9 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car augments -= aug_slot augment_limb_styles = SANITIZE_LIST(augment_limb_styles) //validating limb styles - for(var/key in augment_limb_styles) - if(!GLOB.robotic_styles_list[key]) - augment_limb_styles -= key + for(var/limb_slot in augment_limb_styles) + if(!GLOB.robotic_styles_list[augment_limb_styles[limb_slot]]) + augment_limb_styles -= limb_slot validate_species_parts() @@ -634,6 +640,9 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car WRITE_FILE(S["augments"] , augments) WRITE_FILE(S["augment_limb_styles"] , augment_limb_styles) + WRITE_FILE(S["undershirt_color"], undershirt_color) + WRITE_FILE(S["socks_color"], socks_color) + return TRUE