From e413fcb09134cb8e71796f0ebca9765e65b29e41 Mon Sep 17 00:00:00 2001 From: Timothy Teakettle <59849408+timothyteakettle@users.noreply.github.com> Date: Sun, 6 Dec 2020 22:14:35 +0000 Subject: [PATCH] more fixes --- code/modules/client/preferences.dm | 2 +- code/modules/client/preferences_savefile.dm | 8 +++++++- modular_citadel/code/modules/client/loadout/uniform.dm | 2 ++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index d1b9739a9a..16e472f9a4 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -2927,7 +2927,7 @@ GLOBAL_LIST_EMPTY(preferences_datums) /datum/preferences/proc/remove_gear_from_loadout(save_slot, gear_type) var/find_gear = has_loadout_gear(save_slot, gear_type) if(find_gear) - loadout_data["SAVE_[save_slot]"] -= find_gear + loadout_data["SAVE_[save_slot]"] -= list(find_gear) #undef DEFAULT_SLOT_AMT #undef HANDS_SLOT_AMT diff --git a/code/modules/client/preferences_savefile.dm b/code/modules/client/preferences_savefile.dm index 67e73ef713..a2d6497b9d 100644 --- a/code/modules/client/preferences_savefile.dm +++ b/code/modules/client/preferences_savefile.dm @@ -274,8 +274,14 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car if(!ispath(text2path(some_gear_item))) message_admins("Failed to copy item [some_gear_item] to new loadout system when migrating from version [current_version] to 40, issue: item is not a path") continue - loadout_data["SAVE_1"] += list(list(LOADOUT_ITEM = some_gear_item)) //for the migration we put their old save into the first save slot, which is loaded by default! + var/datum/gear/gear_item = text2path(some_gear_item) + if(!initial(gear_item.loadout_initial_colors)) + loadout_data["SAVE_1"] += list(list(LOADOUT_ITEM = some_gear_item)) //for the migration we put their old save into the first save slot, which is loaded by default! + else + //the same but we setup some new polychromic data + loadout_data["SAVE_1"] += list(list(LOADOUT_ITEM = some_gear_item, LOADOUT_COLOR = initial(gear_item.loadout_initial_colors))) //it's double packed into a list because += will union the two lists contents + S["loadout"] = safe_json_encode(loadout_data) /datum/preferences/proc/load_path(ckey,filename="preferences.sav") diff --git a/modular_citadel/code/modules/client/loadout/uniform.dm b/modular_citadel/code/modules/client/loadout/uniform.dm index f8a5edeca8..b76e223f25 100644 --- a/modular_citadel/code/modules/client/loadout/uniform.dm +++ b/modular_citadel/code/modules/client/loadout/uniform.dm @@ -47,6 +47,8 @@ /datum/gear/uniform/maidcostume/polychromic name = "Polychromic maid costume" path = /obj/item/clothing/under/rank/civilian/janitor/maid/polychromic + loadout_flags = LOADOUT_CAN_COLOR_POLYCHROMIC + loadout_initial_colors = list("#FFFFFF", "#000000") /datum/gear/uniform/mailmanuniform name = "Mailman's jumpsuit"