diff --git a/code/__DEFINES/~skyrat_defines/DNA.dm b/code/__DEFINES/~skyrat_defines/DNA.dm index 69cc1b6372e..1e9fb43b7be 100644 --- a/code/__DEFINES/~skyrat_defines/DNA.dm +++ b/code/__DEFINES/~skyrat_defines/DNA.dm @@ -34,8 +34,9 @@ #define COLOR_SRC_MATRIXED 4 // Defines for mutant bodyparts indexes -#define MUTANT_INDEX_NAME "name" -#define MUTANT_INDEX_COLOR_LIST "color" +#define MUTANT_INDEX_NAME "name" +#define MUTANT_INDEX_COLOR_LIST "color" +#define MUTANT_INDEX_EMISSIVE_LIST "emissive" //The color list that is passed to color matrixed things when a person is husked #define HUSK_COLOR_LIST list(list(0.64, 0.64, 0.64, 0), list(0.64, 0.64, 0.64, 0), list(0.64, 0.64, 0.64, 0), list(0, 0, 0, 1)) diff --git a/code/__HELPERS/lighting.dm b/code/__HELPERS/lighting.dm index 08c360849b5..d4f8b98b9f6 100644 --- a/code/__HELPERS/lighting.dm +++ b/code/__HELPERS/lighting.dm @@ -9,3 +9,12 @@ var/mutable_appearance/appearance = mutable_appearance(icon, icon_state, layer, EMISSIVE_PLANE, alpha, appearance_flags | EMISSIVE_APPEARANCE_FLAGS) appearance.color = GLOB.em_block_color return appearance + +//SKYRAT EDIT ADDITION +/// Creates a mutable appearance glued to the EMISSIVE_PLAN, using the values from a mutable appearance +/proc/emissive_appearance_copy(mutable_appearance/to_use, appearance_flags = (RESET_COLOR|KEEP_APART)) + var/mutable_appearance/appearance = mutable_appearance(to_use.icon, to_use.icon_state, to_use.layer, EMISSIVE_PLANE, to_use.alpha, to_use.appearance_flags | appearance_flags) + appearance.color = GLOB.emissive_color + appearance.pixel_x = to_use.pixel_x + appearance.pixel_y = to_use.pixel_y + return appearance diff --git a/code/__HELPERS/~skyrat_helpers/colors.dm b/code/__HELPERS/~skyrat_helpers/colors.dm deleted file mode 100644 index 540ce9cebcc..00000000000 --- a/code/__HELPERS/~skyrat_helpers/colors.dm +++ /dev/null @@ -1,7 +0,0 @@ -/proc/get_alpha_padded_color(color) - var/add = color[1] == "#" ? 1 : 0 - if (length_char(color) == 3+add) - return "[color]0" - else if (length_char(color) == 6+add) - return "[color]00" - return null diff --git a/code/modules/client/preferences/_preference.dm b/code/modules/client/preferences/_preference.dm index f7606f07bec..e5384bc7da1 100644 --- a/code/modules/client/preferences/_preference.dm +++ b/code/modules/client/preferences/_preference.dm @@ -548,14 +548,62 @@ GLOBAL_LIST_INIT(preference_entries_by_key, init_preference_entries_by_key()) /datum/preference/tri_color abstract_type = /datum/preference/tri_color + var/type_to_check = /datum/preference/toggle/allow_mismatched_parts + var/actually_check = TRUE /datum/preference/tri_color/deserialize(input, datum/preferences/preferences) var/list/input_colors = input - return list(sanitize_color(input_colors[1]), sanitize_color(input_colors[2]), sanitize_color(input_colors[3])) + return list(sanitize_hexcolor(input_colors[1]), sanitize_hexcolor(input_colors[2]), sanitize_hexcolor(input_colors[3])) /datum/preference/tri_color/create_default_value() - return list(random_color(), random_color(), random_color()) + return list("#[random_color()]", "#[random_color()]", "#[random_color()]") /datum/preference/tri_color/is_valid(list/value) return islist(value) && value.len == 3 && (findtext(value[1], GLOB.is_color) && findtext(value[2], GLOB.is_color) && findtext(value[3], GLOB.is_color)) + +/datum/preference/tri_color/is_accessible(datum/preferences/preferences) + if (!actually_check || type == abstract_type) + return ..(preferences) + var/passed_initial_check = ..(preferences) + var/allowed = preferences.read_preference(/datum/preference/toggle/allow_mismatched_parts) + var/part_enabled = preferences.read_preference(type_to_check) + return ((passed_initial_check || allowed) && part_enabled) + +/datum/preference/tri_color/apply_to_human(mob/living/carbon/human/target, value) + if (type == abstract_type) + return ..() + if(!target.dna.mutant_bodyparts[relevant_mutant_bodypart]) + target.dna.mutant_bodyparts[relevant_mutant_bodypart] = list(MUTANT_INDEX_NAME = "None", MUTANT_INDEX_COLOR_LIST = list("#FFFFFF", "#FFFFFF", "#FFFFFF"), MUTANT_INDEX_EMISSIVE_LIST = list(FALSE, FALSE, FALSE)) + target.dna.mutant_bodyparts[relevant_mutant_bodypart][MUTANT_INDEX_COLOR_LIST] = list(sanitize_hexcolor(value[1]), sanitize_hexcolor(value[2]), sanitize_hexcolor(value[3])) + +/datum/preference/tri_bool + abstract_type = /datum/preference/tri_bool + var/type_to_check = /datum/preference/toggle/allow_mismatched_parts + +/datum/preference/tri_bool/deserialize(input, datum/preferences/preferences) + var/list/input_bools = input + return list(sanitize_integer(input_bools[1]), sanitize_integer(input_bools[2]), sanitize_integer(input_bools[3])) + +/datum/preference/tri_bool/create_default_value() + return list(FALSE, FALSE, FALSE) + +/datum/preference/tri_bool/is_valid(list/value) + return islist(value) && value.len == 3 && isnum(value[1]) && isnum(value[2]) && isnum(value[3]) + +/datum/preference/tri_bool/is_accessible(datum/preferences/preferences) + if(type == abstract_type) + return ..(preferences) + var/passed_initial_check = ..(preferences) + var/allowed = preferences.read_preference(/datum/preference/toggle/allow_mismatched_parts) + var/emissives_allowed = preferences.read_preference(/datum/preference/toggle/allow_emissives) + var/part_enabled = preferences.read_preference(type_to_check) + return ((passed_initial_check || allowed) && part_enabled && emissives_allowed) + +/datum/preference/tri_bool/apply_to_human(mob/living/carbon/human/target, value) + if (type == abstract_type) + return ..() + if(!target.dna.mutant_bodyparts[relevant_mutant_bodypart]) + target.dna.mutant_bodyparts[relevant_mutant_bodypart] = list(MUTANT_INDEX_NAME = "None", MUTANT_INDEX_COLOR_LIST = list("#FFFFFF", "#FFFFFF", "#FFFFFF"), MUTANT_INDEX_EMISSIVE_LIST = list(FALSE, FALSE, FALSE)) + target.dna.mutant_bodyparts[relevant_mutant_bodypart][MUTANT_INDEX_EMISSIVE_LIST] = list(sanitize_integer(value[1]), sanitize_integer(value[2]), sanitize_integer(value[3])) + // SKYRAT EDIT END diff --git a/code/modules/mob/living/carbon/human/human_update_icons.dm b/code/modules/mob/living/carbon/human/human_update_icons.dm index 7641664dfee..286c11b4058 100644 --- a/code/modules/mob/living/carbon/human/human_update_icons.dm +++ b/code/modules/mob/living/carbon/human/human_update_icons.dm @@ -709,6 +709,15 @@ generate/load female uniform sprites matching all previously decided variables eye_overlay.pixel_x += dna.species.offset_features[OFFSET_FACE][1] eye_overlay.pixel_y += dna.species.offset_features[OFFSET_FACE][2] add_overlay(eye_overlay) + //SKYRAT EDIT ADDITION + if (E && E.is_emissive) + var/mutable_appearance/emissive_appearance = emissive_appearance('icons/mob/human_face.dmi', E ? E.eye_icon_state : "eyes_missing", -BODY_LAYER) + emissive_appearance.appearance_flags &= ~RESET_TRANSFORM + if(OFFSET_FACE in dna.species.offset_features) + emissive_appearance.pixel_x += dna.species.offset_features[OFFSET_FACE][1] + emissive_appearance.pixel_y += dna.species.offset_features[OFFSET_FACE][2] + add_overlay(emissive_appearance) + //SKYRAT EDIT END dna.species.handle_hair(src) diff --git a/code/modules/surgery/organs/eyes.dm b/code/modules/surgery/organs/eyes.dm index 6fbcdb56932..cf4ffb4a419 100644 --- a/code/modules/surgery/organs/eyes.dm +++ b/code/modules/surgery/organs/eyes.dm @@ -33,11 +33,14 @@ var/no_glasses /// indication that the eyes are undergoing some negative effect var/damaged = FALSE + var/is_emissive = FALSE //SKYRAT EDIT ADDITION /obj/item/organ/eyes/Insert(mob/living/carbon/eye_owner, special = FALSE, drop_if_replaced = FALSE, initialising) . = ..() if(ishuman(eye_owner)) var/mob/living/carbon/human/human_owner = eye_owner + if (human_owner.emissive_eyes) + is_emissive = TRUE old_eye_color = human_owner.eye_color if(eye_color) human_owner.eye_color = eye_color @@ -55,6 +58,8 @@ if(ishuman(owner)) var/mob/living/carbon/human/affected_human = owner old_eye_color = affected_human.eye_color + if (affected_human.emissive_eyes) + is_emissive = TRUE if(eye_color) affected_human.eye_color = eye_color affected_human.regenerate_icons() @@ -81,6 +86,7 @@ eye_owner.set_blurriness(0) eye_owner.clear_fullscreen("eye_damage", 0) eye_owner.update_sight() + is_emissive = FALSE /obj/item/organ/eyes/on_life(delta_time, times_fired) diff --git a/modular_skyrat/master_files/code/modules/client/preferences/cursed_shit.dm b/modular_skyrat/master_files/code/modules/client/preferences/cursed_shit.dm index 4547374af6b..4eaf9676e16 100644 --- a/modular_skyrat/master_files/code/modules/client/preferences/cursed_shit.dm +++ b/modular_skyrat/master_files/code/modules/client/preferences/cursed_shit.dm @@ -85,17 +85,14 @@ savefile_identifier = PREFERENCE_CHARACTER savefile_key = "penis_color" relevant_mutant_bodypart = "penis" + type_to_check = /datum/preference/toggle/penis -/datum/preference/tri_color/penis/is_accessible(datum/preferences/preferences) - var/passed_initial_check = ..(preferences) - var/allowed = preferences.read_preference(/datum/preference/toggle/allow_mismatched_parts) - var/part_enabled = preferences.read_preference(/datum/preference/toggle/penis) - return ((passed_initial_check || allowed) && part_enabled) - -/datum/preference/tri_color/penis/apply_to_human(mob/living/carbon/human/target, value) - if(!target.dna.mutant_bodyparts["penis"]) - target.dna.mutant_bodyparts["penis"] = list("name" = "None", "color" = list("#FFFFFF", "#FFFFFF", "#FFFFFF")) - target.dna.mutant_bodyparts["penis"]["color"] = list(sanitize_hexcolor(value[1]), sanitize_hexcolor(value[2]), sanitize_hexcolor(value[3])) +/datum/preference/tri_bool/penis + category = PREFERENCE_CATEGORY_SECONDARY_FEATURES + savefile_identifier = PREFERENCE_CHARACTER + savefile_key = "penis_emissive" + relevant_mutant_bodypart = "penis" + type_to_check = /datum/preference/toggle/penis /datum/preference/toggle/penis_taur_mode category = PREFERENCE_CATEGORY_SECONDARY_FEATURES @@ -179,17 +176,14 @@ savefile_identifier = PREFERENCE_CHARACTER savefile_key = "testicles_color" relevant_mutant_bodypart = "testicles" + type_to_check = /datum/preference/toggle/testicles -/datum/preference/tri_color/testicles/is_accessible(datum/preferences/preferences) - var/passed_initial_check = ..(preferences) - var/allowed = preferences.read_preference(/datum/preference/toggle/allow_mismatched_parts) - var/part_enabled = preferences.read_preference(/datum/preference/toggle/testicles) - return ((passed_initial_check || allowed) && part_enabled) - -/datum/preference/tri_color/testicles/apply_to_human(mob/living/carbon/human/target, value) - if(!target.dna.mutant_bodyparts["testicles"]) - target.dna.mutant_bodyparts["testicles"] = list("name" = "None", "color" = list("#FFFFFF", "#FFFFFF", "#FFFFFF")) - target.dna.mutant_bodyparts["testicles"]["color"] = list(sanitize_hexcolor(value[1]), sanitize_hexcolor(value[2]), sanitize_hexcolor(value[3])) +/datum/preference/tri_bool/testicles + category = PREFERENCE_CATEGORY_SECONDARY_FEATURES + savefile_identifier = PREFERENCE_CHARACTER + savefile_key = "testicles_emissive" + relevant_mutant_bodypart = "testicles" + type_to_check = /datum/preference/toggle/testicles /datum/preference/numeric/balls_size category = PREFERENCE_CATEGORY_SECONDARY_FEATURES @@ -256,17 +250,14 @@ savefile_identifier = PREFERENCE_CHARACTER savefile_key = "vagina_color" relevant_mutant_bodypart = "vagina" + type_to_check = /datum/preference/toggle/vagina -/datum/preference/tri_color/vagina/is_accessible(datum/preferences/preferences) - var/passed_initial_check = ..(preferences) - var/allowed = preferences.read_preference(/datum/preference/toggle/allow_mismatched_parts) - var/part_enabled = preferences.read_preference(/datum/preference/toggle/vagina) - return ((passed_initial_check || allowed) && part_enabled) - -/datum/preference/tri_color/vagina/apply_to_human(mob/living/carbon/human/target, value) - if(!target.dna.mutant_bodyparts["vagina"]) - target.dna.mutant_bodyparts["vagina"] = list("name" = "None", "color" = list("#FFFFFF", "#FFFFFF", "#FFFFFF")) - target.dna.mutant_bodyparts["vagina"]["color"] = list(sanitize_hexcolor(value[1]), sanitize_hexcolor(value[2]), sanitize_hexcolor(value[3])) +/datum/preference/tri_bool/vagina + category = PREFERENCE_CATEGORY_SECONDARY_FEATURES + savefile_identifier = PREFERENCE_CHARACTER + savefile_key = "vagina_emissive" + relevant_mutant_bodypart = "vagina" + type_to_check = /datum/preference/toggle/vagina /datum/preference/toggle/womb category = PREFERENCE_CATEGORY_SECONDARY_FEATURES @@ -353,17 +344,14 @@ savefile_identifier = PREFERENCE_CHARACTER savefile_key = "breasts_color" relevant_mutant_bodypart = "breasts" + type_to_check = /datum/preference/toggle/breasts -/datum/preference/tri_color/breasts/is_accessible(datum/preferences/preferences) - var/passed_initial_check = ..(preferences) - var/allowed = preferences.read_preference(/datum/preference/toggle/allow_mismatched_parts) - var/part_enabled = preferences.read_preference(/datum/preference/toggle/breasts) - return ((passed_initial_check || allowed) && part_enabled) - -/datum/preference/tri_color/breasts/apply_to_human(mob/living/carbon/human/target, value) - if(!target.dna.mutant_bodyparts["breasts"]) - target.dna.mutant_bodyparts["breasts"] = list("name" = "None", "color" = list("#FFFFFF", "#FFFFFF", "#FFFFFF")) - target.dna.mutant_bodyparts["breasts"]["color"] = list(sanitize_hexcolor(value[1]), sanitize_hexcolor(value[2]), sanitize_hexcolor(value[3])) +/datum/preference/tri_bool/breasts + category = PREFERENCE_CATEGORY_SECONDARY_FEATURES + savefile_identifier = PREFERENCE_CHARACTER + savefile_key = "breasts_emissive" + relevant_mutant_bodypart = "breasts" + type_to_check = /datum/preference/toggle/breasts /datum/preference/toggle/breasts_lactation category = PREFERENCE_CATEGORY_SECONDARY_FEATURES diff --git a/modular_skyrat/master_files/code/modules/client/preferences/middleware/limbs_and_markings.dm b/modular_skyrat/master_files/code/modules/client/preferences/middleware/limbs_and_markings.dm index 53e92cb016b..8373ad5b8dc 100644 --- a/modular_skyrat/master_files/code/modules/client/preferences/middleware/limbs_and_markings.dm +++ b/modular_skyrat/master_files/code/modules/client/preferences/middleware/limbs_and_markings.dm @@ -12,6 +12,7 @@ "remove_marking" = .proc/remove_marking, "set_organ_aug" = .proc/set_organ_aug, "set_preset" = .proc/set_preset, + "change_emissive" = .proc/change_emissive_marking, ) var/list/limbs_to_process = list( "l_arm" = "Left Arm", @@ -77,9 +78,10 @@ var/marking_count = 0 for(var/marking in markings_list) var/name = marking - var/color = markings_list[name] + var/color = markings_list[name][1] + var/emissive = markings_list[name][2] marking_count++ - fixed_markings += list(list("name" = name, "color" = sanitize_hexcolor(color), "marking_id" = "[limb_slot]_[marking_count]")) + fixed_markings += list(list("name" = name, "color" = sanitize_hexcolor(color), "marking_id" = "[limb_slot]_[marking_count]", "emissive" = emissive)) return fixed_markings /datum/preference_middleware/limbs_and_markings/proc/add_marking(list/params, mob/user) @@ -88,7 +90,7 @@ preferences.body_markings[limb_slot] = list() if(preferences.body_markings[limb_slot].len >= MAXIMUM_MARKINGS_PER_LIMB) return - preferences.body_markings[limb_slot] += list(GLOB.body_markings_per_limb[limb_slot][1] = "#FFFFFF") // Default to the first in the list for the limb. + preferences.body_markings[limb_slot] += list(GLOB.body_markings_per_limb[limb_slot][1] = list("#FFFFFF", FALSE)) // Default to the first in the list for the limb. preferences.character_preview_view.update_body() return TRUE @@ -130,7 +132,26 @@ ) as color | null if(!new_color) return TRUE - new_markings[marking_entry_name] = sanitize_hexcolor(new_color) // gets the new color from the picker + new_markings[marking_entry_name][1] = sanitize_hexcolor(new_color) // gets the new color from the picker + preferences.body_markings[limb_slot] = new_markings + preferences.character_preview_view.update_body() + return TRUE + + +/datum/preference_middleware/limbs_and_markings/proc/change_emissive_marking(list/params, mob/user) + var/limb_slot = params["limb_slot"] + var/marking_id = params["marking_id"] + var/emissive = !params["emissive"] + var/list/markings = preferences.body_markings[limb_slot] + var/list/new_markings = list() + var/marking_count = 0 + var/marking_entry_name + for(var/marking_entry in markings) + marking_count++ + if(marking_id == "[limb_slot]_[marking_count]") + marking_entry_name = marking_entry + new_markings[marking_entry] = markings[marking_entry] + new_markings[marking_entry_name][2] = sanitize_integer(emissive) preferences.body_markings[limb_slot] = new_markings preferences.character_preview_view.update_body() return TRUE diff --git a/modular_skyrat/master_files/code/modules/client/preferences/mutant_parts.dm b/modular_skyrat/master_files/code/modules/client/preferences/mutant_parts.dm index f15317038f5..413676ad4d1 100644 --- a/modular_skyrat/master_files/code/modules/client/preferences/mutant_parts.dm +++ b/modular_skyrat/master_files/code/modules/client/preferences/mutant_parts.dm @@ -7,16 +7,49 @@ /datum/preference/toggle/allow_mismatched_parts/apply_to_human(mob/living/carbon/human/target, value, datum/preferences/preferences) return TRUE // we dont actually want this to do anything +/datum/preference/toggle/allow_emissives + category = PREFERENCE_CATEGORY_SECONDARY_FEATURES + savefile_identifier = PREFERENCE_CHARACTER + savefile_key = "allow_emissives_toggle" //no 'e' so it goes right after allow_mismatched_parts, not before + default_value = FALSE + +/datum/preference/toggle/allow_emissives/apply_to_human(mob/living/carbon/human/target, value, datum/preferences/preferences) + return TRUE // we dont actually want this to do anything + /datum/preference/tri_color/mutant_colors category = PREFERENCE_CATEGORY_SECONDARY_FEATURES savefile_identifier = PREFERENCE_CHARACTER savefile_key = "mutant_colors_color" + actually_check = FALSE /datum/preference/tri_color/mutant_colors/apply_to_human(mob/living/carbon/human/target, value) target.dna.features["mcolor"] = sanitize_hexcolor(value[1]) target.dna.features["mcolor2"] = sanitize_hexcolor(value[2]) target.dna.features["mcolor3"] = sanitize_hexcolor(value[3]) +/datum/preference/toggle/eye_emissives + savefile_key = "eye_emissives" + savefile_identifier = PREFERENCE_CHARACTER + category = PREFERENCE_CATEGORY_SECONDARY_FEATURES + relevant_species_trait = EYECOLOR + +/datum/preference/toggle/eye_emissives/apply_to_human(mob/living/carbon/human/target, value) + var/obj/item/organ/eyes/eyes_organ = target.getorgan(/obj/item/organ/eyes) + target.emissive_eyes = TRUE + if (istype(eyes_organ)) + eyes_organ.is_emissive = value + +/datum/preference/toggle/eye_emissives/create_default_value() + return FALSE + +/datum/preference/toggle/eye_emissives/is_accessible(datum/preferences/preferences) + var/passed_initial_check = ..(preferences) + var/allowed = preferences.read_preference(/datum/preference/toggle/allow_emissives) + return passed_initial_check && allowed + + +// Body Markings + /datum/preference/toggle/body_markings category = PREFERENCE_CATEGORY_SECONDARY_FEATURES savefile_identifier = PREFERENCE_CHARACTER @@ -48,9 +81,9 @@ return assoc_to_keys(GLOB.sprite_accessories["body_markings"]) /datum/preference/choiced/body_markings/apply_to_human(mob/living/carbon/human/target, value) - if(!target.dna.mutant_bodyparts["body_markings"]) - target.dna.mutant_bodyparts["body_markings"] = list("name" = "None", "color" = list("#FFFFFF", "#FFFFFF", "#FFFFFF")) - target.dna.mutant_bodyparts["body_markings"]["name"] = value + if(!target.dna.mutant_bodyparts[relevant_mutant_bodypart]) + target.dna.mutant_bodyparts[relevant_mutant_bodypart] = list(MUTANT_INDEX_NAME = "None", MUTANT_INDEX_COLOR_LIST = list("#FFFFFF", "#FFFFFF", "#FFFFFF"), MUTANT_INDEX_EMISSIVE_LIST = list(FALSE, FALSE, FALSE)) + target.dna.mutant_bodyparts[relevant_mutant_bodypart][MUTANT_INDEX_NAME] = value /datum/preference/choiced/body_markings/create_default_value() var/datum/sprite_accessory/body_markings/none/default = /datum/sprite_accessory/body_markings/none @@ -61,17 +94,14 @@ savefile_identifier = PREFERENCE_CHARACTER savefile_key = "body_markings_color" relevant_mutant_bodypart = "body_markings" + type_to_check = /datum/preference/toggle/body_markings -/datum/preference/tri_color/body_markings/is_accessible(datum/preferences/preferences) - var/passed_initial_check = ..(preferences) - var/allowed = preferences.read_preference(/datum/preference/toggle/allow_mismatched_parts) - var/part_enabled = preferences.read_preference(/datum/preference/toggle/body_markings) - return ((passed_initial_check || allowed) && part_enabled) - -/datum/preference/tri_color/body_markings/apply_to_human(mob/living/carbon/human/target, value) - if(!target.dna.mutant_bodyparts["body_markings"]) - target.dna.mutant_bodyparts["body_markings"] = list("name" = "None", "color" = list("#FFFFFF", "#FFFFFF", "#FFFFFF")) - target.dna.mutant_bodyparts["body_markings"]["color"] = list(sanitize_hexcolor(value[1]), sanitize_hexcolor(value[2]), sanitize_hexcolor(value[3])) +/datum/preference/tri_bool/body_markings + category = PREFERENCE_CATEGORY_SECONDARY_FEATURES + savefile_identifier = PREFERENCE_CHARACTER + savefile_key = "body_markings_emissive" + relevant_mutant_bodypart = "body_markings" + type_to_check = /datum/preference/toggle/body_markings /// Tails @@ -106,9 +136,9 @@ return assoc_to_keys(GLOB.sprite_accessories["tail"]) /datum/preference/choiced/tail/apply_to_human(mob/living/carbon/human/target, value) - if(!target.dna.mutant_bodyparts["tail"]) - target.dna.mutant_bodyparts["tail"] = list("name" = "None", "color" = list("#FFFFFF", "#FFFFFF", "#FFFFFF")) - target.dna.mutant_bodyparts["tail"]["name"] = value + if(!target.dna.mutant_bodyparts[relevant_mutant_bodypart]) + target.dna.mutant_bodyparts[relevant_mutant_bodypart] = list(MUTANT_INDEX_NAME = "None", MUTANT_INDEX_COLOR_LIST = list("#FFFFFF", "#FFFFFF", "#FFFFFF"), MUTANT_INDEX_EMISSIVE_LIST = list(FALSE, FALSE, FALSE)) + target.dna.mutant_bodyparts[relevant_mutant_bodypart][MUTANT_INDEX_NAME] = value /datum/preference/choiced/tail/create_default_value() var/datum/sprite_accessory/tails/none/default = /datum/sprite_accessory/tails/none @@ -119,17 +149,14 @@ savefile_identifier = PREFERENCE_CHARACTER savefile_key = "tail_color" relevant_mutant_bodypart = "tail" + type_to_check = /datum/preference/toggle/tail -/datum/preference/tri_color/tail/is_accessible(datum/preferences/preferences) - var/passed_initial_check = ..(preferences) - var/allowed = preferences.read_preference(/datum/preference/toggle/allow_mismatched_parts) - var/part_enabled = preferences.read_preference(/datum/preference/toggle/tail) - return ((passed_initial_check || allowed) && part_enabled) - -/datum/preference/tri_color/tail/apply_to_human(mob/living/carbon/human/target, value) - if(!target.dna.mutant_bodyparts["tail"]) - target.dna.mutant_bodyparts["tail"] = list("name" = "None", "color" = list("#FFFFFF", "#FFFFFF", "#FFFFFF")) - target.dna.mutant_bodyparts["tail"]["color"] = list(sanitize_hexcolor(value[1]), sanitize_hexcolor(value[2]), sanitize_hexcolor(value[3])) +/datum/preference/tri_bool/tail + category = PREFERENCE_CATEGORY_SECONDARY_FEATURES + savefile_identifier = PREFERENCE_CHARACTER + savefile_key = "tail_emissive" + relevant_mutant_bodypart = "tail" + type_to_check = /datum/preference/toggle/tail /// Snouts @@ -164,9 +191,9 @@ return assoc_to_keys(GLOB.sprite_accessories["snout"]) /datum/preference/choiced/snout/apply_to_human(mob/living/carbon/human/target, value) - if(!target.dna.mutant_bodyparts["snout"]) - target.dna.mutant_bodyparts["snout"] = list("name" = "None", "color" = list("#FFFFFF", "#FFFFFF", "#FFFFFF")) - target.dna.mutant_bodyparts["snout"]["name"] = value + if(!target.dna.mutant_bodyparts[relevant_mutant_bodypart]) + target.dna.mutant_bodyparts[relevant_mutant_bodypart] = list(MUTANT_INDEX_NAME = "None", MUTANT_INDEX_COLOR_LIST = list("#FFFFFF", "#FFFFFF", "#FFFFFF"), MUTANT_INDEX_EMISSIVE_LIST = list(FALSE, FALSE, FALSE)) + target.dna.mutant_bodyparts[relevant_mutant_bodypart][MUTANT_INDEX_NAME] = value /datum/preference/choiced/snout/create_default_value() var/datum/sprite_accessory/snouts/none/default = /datum/sprite_accessory/snouts/none @@ -177,17 +204,14 @@ savefile_identifier = PREFERENCE_CHARACTER savefile_key = "snout_color" relevant_mutant_bodypart = "snout" + type_to_check = /datum/preference/toggle/snout -/datum/preference/tri_color/snout/is_accessible(datum/preferences/preferences) - var/passed_initial_check = ..(preferences) - var/allowed = preferences.read_preference(/datum/preference/toggle/allow_mismatched_parts) - var/part_enabled = preferences.read_preference(/datum/preference/toggle/snout) - return ((passed_initial_check || allowed) && part_enabled) - -/datum/preference/tri_color/snout/apply_to_human(mob/living/carbon/human/target, value) - if(!target.dna.mutant_bodyparts["snout"]) - target.dna.mutant_bodyparts["snout"] = list("name" = "None", "color" = list("#FFFFFF", "#FFFFFF", "#FFFFFF")) - target.dna.mutant_bodyparts["snout"]["color"] = list(sanitize_hexcolor(value[1]), sanitize_hexcolor(value[2]), sanitize_hexcolor(value[3])) +/datum/preference/tri_bool/snout + category = PREFERENCE_CATEGORY_SECONDARY_FEATURES + savefile_identifier = PREFERENCE_CHARACTER + savefile_key = "snout_emissive" + relevant_mutant_bodypart = "snout" + type_to_check = /datum/preference/toggle/snout /// Horns @@ -222,9 +246,9 @@ return assoc_to_keys(GLOB.sprite_accessories["horns"]) /datum/preference/choiced/horns/apply_to_human(mob/living/carbon/human/target, value) - if(!target.dna.mutant_bodyparts["horns"]) - target.dna.mutant_bodyparts["horns"] = list("name" = "None", "color" = list("#FFFFFF", "#FFFFFF", "#FFFFFF")) - target.dna.mutant_bodyparts["horns"]["name"] = value + if(!target.dna.mutant_bodyparts[relevant_mutant_bodypart]) + target.dna.mutant_bodyparts[relevant_mutant_bodypart] = list(MUTANT_INDEX_NAME = "None", MUTANT_INDEX_COLOR_LIST = list("#FFFFFF", "#FFFFFF", "#FFFFFF"), MUTANT_INDEX_EMISSIVE_LIST = list(FALSE, FALSE, FALSE)) + target.dna.mutant_bodyparts[relevant_mutant_bodypart][MUTANT_INDEX_NAME] = value /datum/preference/choiced/horns/create_default_value() var/datum/sprite_accessory/horns/none/default = /datum/sprite_accessory/horns/none @@ -235,17 +259,14 @@ savefile_identifier = PREFERENCE_CHARACTER savefile_key = "horns_color" relevant_mutant_bodypart = "horns" + type_to_check = /datum/preference/toggle/horns -/datum/preference/tri_color/horns/is_accessible(datum/preferences/preferences) - var/passed_initial_check = ..(preferences) - var/allowed = preferences.read_preference(/datum/preference/toggle/allow_mismatched_parts) - var/part_enabled = preferences.read_preference(/datum/preference/toggle/horns) - return ((passed_initial_check || allowed) && part_enabled) - -/datum/preference/tri_color/horns/apply_to_human(mob/living/carbon/human/target, value) - if(!target.dna.mutant_bodyparts["horns"]) - target.dna.mutant_bodyparts["horns"] = list("name" = "None", "color" = list("#FFFFFF", "#FFFFFF", "#FFFFFF")) - target.dna.mutant_bodyparts["horns"]["color"] = list(sanitize_hexcolor(value[1]), sanitize_hexcolor(value[2]), sanitize_hexcolor(value[3])) +/datum/preference/tri_bool/horns + category = PREFERENCE_CATEGORY_SECONDARY_FEATURES + savefile_identifier = PREFERENCE_CHARACTER + savefile_key = "horns_emissive" + relevant_mutant_bodypart = "horns" + type_to_check = /datum/preference/toggle/horns /// Ears @@ -280,9 +301,9 @@ return assoc_to_keys(GLOB.sprite_accessories["ears"]) /datum/preference/choiced/ears/apply_to_human(mob/living/carbon/human/target, value) - if(!target.dna.mutant_bodyparts["ears"]) - target.dna.mutant_bodyparts["ears"] = list("name" = "None", "color" = list("#FFFFFF", "#FFFFFF", "#FFFFFF")) - target.dna.mutant_bodyparts["ears"]["name"] = value + if(!target.dna.mutant_bodyparts[relevant_mutant_bodypart]) + target.dna.mutant_bodyparts[relevant_mutant_bodypart] = list(MUTANT_INDEX_NAME = "None", MUTANT_INDEX_COLOR_LIST = list("#FFFFFF", "#FFFFFF", "#FFFFFF"), MUTANT_INDEX_EMISSIVE_LIST = list(FALSE, FALSE, FALSE)) + target.dna.mutant_bodyparts[relevant_mutant_bodypart][MUTANT_INDEX_NAME] = value /datum/preference/choiced/ears/create_default_value() var/datum/sprite_accessory/ears/none/default = /datum/sprite_accessory/ears/none @@ -293,17 +314,14 @@ savefile_identifier = PREFERENCE_CHARACTER savefile_key = "ears_color" relevant_mutant_bodypart = "ears" + type_to_check = /datum/preference/toggle/ears -/datum/preference/tri_color/ears/is_accessible(datum/preferences/preferences) - var/passed_initial_check = ..(preferences) - var/allowed = preferences.read_preference(/datum/preference/toggle/allow_mismatched_parts) - var/part_enabled = preferences.read_preference(/datum/preference/toggle/ears) - return ((passed_initial_check || allowed) && part_enabled) - -/datum/preference/tri_color/ears/apply_to_human(mob/living/carbon/human/target, value) - if(!target.dna.mutant_bodyparts["ears"]) - target.dna.mutant_bodyparts["ears"] = list("name" = "None", "color" = list("#FFFFFF", "#FFFFFF", "#FFFFFF")) - target.dna.mutant_bodyparts["ears"]["color"] = list(sanitize_hexcolor(value[1]), sanitize_hexcolor(value[2]), sanitize_hexcolor(value[3])) +/datum/preference/tri_bool/ears + category = PREFERENCE_CATEGORY_SECONDARY_FEATURES + savefile_identifier = PREFERENCE_CHARACTER + savefile_key = "ears_emissive" + relevant_mutant_bodypart = "ears" + type_to_check = /datum/preference/toggle/ears /// Wings @@ -338,9 +356,9 @@ return assoc_to_keys(GLOB.sprite_accessories["wings"]) /datum/preference/choiced/wings/apply_to_human(mob/living/carbon/human/target, value) - if(!target.dna.mutant_bodyparts["wings"]) - target.dna.mutant_bodyparts["wings"] = list("name" = "None", "color" = list("#FFFFFF", "#FFFFFF", "#FFFFFF")) - target.dna.mutant_bodyparts["wings"]["name"] = value + if(!target.dna.mutant_bodyparts[relevant_mutant_bodypart]) + target.dna.mutant_bodyparts[relevant_mutant_bodypart] = list(MUTANT_INDEX_NAME = "None", MUTANT_INDEX_COLOR_LIST = list("#FFFFFF", "#FFFFFF", "#FFFFFF"), MUTANT_INDEX_EMISSIVE_LIST = list(FALSE, FALSE, FALSE)) + target.dna.mutant_bodyparts[relevant_mutant_bodypart][MUTANT_INDEX_NAME] = value /datum/preference/choiced/wings/create_default_value() var/datum/sprite_accessory/wings/none/default = /datum/sprite_accessory/wings/none @@ -351,17 +369,14 @@ savefile_identifier = PREFERENCE_CHARACTER savefile_key = "wings_color" relevant_mutant_bodypart = "wings" + type_to_check = /datum/preference/toggle/wings -/datum/preference/tri_color/wings/is_accessible(datum/preferences/preferences) - var/passed_initial_check = ..(preferences) - var/allowed = preferences.read_preference(/datum/preference/toggle/allow_mismatched_parts) - var/part_enabled = preferences.read_preference(/datum/preference/toggle/wings) - return ((passed_initial_check || allowed) && part_enabled) - -/datum/preference/tri_color/wings/apply_to_human(mob/living/carbon/human/target, value) - if(!target.dna.mutant_bodyparts["wings"]) - target.dna.mutant_bodyparts["wings"] = list("name" = "None", "color" = list("#FFFFFF", "#FFFFFF", "#FFFFFF")) - target.dna.mutant_bodyparts["wings"]["color"] = list(sanitize_hexcolor(value[1]), sanitize_hexcolor(value[2]), sanitize_hexcolor(value[3])) +/datum/preference/tri_bool/wings + category = PREFERENCE_CATEGORY_SECONDARY_FEATURES + savefile_identifier = PREFERENCE_CHARACTER + savefile_key = "wings_emissive" + relevant_mutant_bodypart = "wings" + type_to_check = /datum/preference/toggle/wings /// Frills @@ -396,9 +411,9 @@ return assoc_to_keys(GLOB.sprite_accessories["frills"]) /datum/preference/choiced/frills/apply_to_human(mob/living/carbon/human/target, value) - if(!target.dna.mutant_bodyparts["frills"]) - target.dna.mutant_bodyparts["frills"] = list("name" = "None", "color" = list("#FFFFFF", "#FFFFFF", "#FFFFFF")) - target.dna.mutant_bodyparts["frills"]["name"] = value + if(!target.dna.mutant_bodyparts[relevant_mutant_bodypart]) + target.dna.mutant_bodyparts[relevant_mutant_bodypart] = list(MUTANT_INDEX_NAME = "None", MUTANT_INDEX_COLOR_LIST = list("#FFFFFF", "#FFFFFF", "#FFFFFF"), MUTANT_INDEX_EMISSIVE_LIST = list(FALSE, FALSE, FALSE)) + target.dna.mutant_bodyparts[relevant_mutant_bodypart][MUTANT_INDEX_NAME] = value /datum/preference/choiced/frills/create_default_value() var/datum/sprite_accessory/frills/none/default = /datum/sprite_accessory/frills/none @@ -409,17 +424,14 @@ savefile_identifier = PREFERENCE_CHARACTER savefile_key = "frills_color" relevant_mutant_bodypart = "frills" + type_to_check = /datum/preference/toggle/frills -/datum/preference/tri_color/frills/is_accessible(datum/preferences/preferences) - var/passed_initial_check = ..(preferences) - var/allowed = preferences.read_preference(/datum/preference/toggle/allow_mismatched_parts) - var/part_enabled = preferences.read_preference(/datum/preference/toggle/frills) - return ((passed_initial_check || allowed) && part_enabled) - -/datum/preference/tri_color/frills/apply_to_human(mob/living/carbon/human/target, value) - if(!target.dna.mutant_bodyparts["frills"]) - target.dna.mutant_bodyparts["frills"] = list("name" = "None", "color" = list("#FFFFFF", "#FFFFFF", "#FFFFFF")) - target.dna.mutant_bodyparts["frills"]["color"] = list(sanitize_hexcolor(value[1]), sanitize_hexcolor(value[2]), sanitize_hexcolor(value[3])) +/datum/preference/tri_bool/frills + category = PREFERENCE_CATEGORY_SECONDARY_FEATURES + savefile_identifier = PREFERENCE_CHARACTER + savefile_key = "frills_emissive" + relevant_mutant_bodypart = "frills" + type_to_check = /datum/preference/toggle/frills /// Spines @@ -454,9 +466,9 @@ return assoc_to_keys(GLOB.sprite_accessories["spines"]) /datum/preference/choiced/spines/apply_to_human(mob/living/carbon/human/target, value) - if(!target.dna.mutant_bodyparts["spines"]) - target.dna.mutant_bodyparts["spines"] = list("name" = "None", "color" = list("#FFFFFF", "#FFFFFF", "#FFFFFF")) - target.dna.mutant_bodyparts["spines"]["name"] = value + if(!target.dna.mutant_bodyparts[relevant_mutant_bodypart]) + target.dna.mutant_bodyparts[relevant_mutant_bodypart] = list(MUTANT_INDEX_NAME = "None", MUTANT_INDEX_COLOR_LIST = list("#FFFFFF", "#FFFFFF", "#FFFFFF"), MUTANT_INDEX_EMISSIVE_LIST = list(FALSE, FALSE, FALSE)) + target.dna.mutant_bodyparts[relevant_mutant_bodypart][MUTANT_INDEX_NAME] = value /datum/preference/choiced/spines/create_default_value() var/datum/sprite_accessory/spines/none/default = /datum/sprite_accessory/spines/none @@ -467,17 +479,14 @@ savefile_identifier = PREFERENCE_CHARACTER savefile_key = "spines_color" relevant_mutant_bodypart = "spines" + type_to_check = /datum/preference/toggle/spines -/datum/preference/tri_color/spines/is_accessible(datum/preferences/preferences) - var/passed_initial_check = ..(preferences) - var/allowed = preferences.read_preference(/datum/preference/toggle/allow_mismatched_parts) - var/part_enabled = preferences.read_preference(/datum/preference/toggle/spines) - return ((passed_initial_check || allowed) && part_enabled) - -/datum/preference/tri_color/spines/apply_to_human(mob/living/carbon/human/target, value) - if(!target.dna.mutant_bodyparts["spines"]) - target.dna.mutant_bodyparts["spines"] = list("name" = "None", "color" = list("#FFFFFF", "#FFFFFF", "#FFFFFF")) - target.dna.mutant_bodyparts["spines"]["color"] = list(sanitize_hexcolor(value[1]), sanitize_hexcolor(value[2]), sanitize_hexcolor(value[3])) +/datum/preference/tri_bool/spines + category = PREFERENCE_CATEGORY_SECONDARY_FEATURES + savefile_identifier = PREFERENCE_CHARACTER + savefile_key = "spines_emissive" + relevant_mutant_bodypart = "spines" + type_to_check = /datum/preference/toggle/spines /// Legs @@ -512,9 +521,9 @@ return assoc_to_keys(GLOB.sprite_accessories["legs"]) /datum/preference/choiced/legs/apply_to_human(mob/living/carbon/human/target, value) - if(!target.dna.mutant_bodyparts["legs"]) - target.dna.mutant_bodyparts["legs"] = list("name" = "None", "color" = list("#FFFFFF", "#FFFFFF", "#FFFFFF")) - target.dna.mutant_bodyparts["legs"]["name"] = value + if(!target.dna.mutant_bodyparts[relevant_mutant_bodypart]) + target.dna.mutant_bodyparts[relevant_mutant_bodypart] = list(MUTANT_INDEX_NAME = "None", MUTANT_INDEX_COLOR_LIST = list("#FFFFFF", "#FFFFFF", "#FFFFFF"), MUTANT_INDEX_EMISSIVE_LIST = list(FALSE, FALSE, FALSE)) + target.dna.mutant_bodyparts[relevant_mutant_bodypart][MUTANT_INDEX_NAME] = value /datum/preference/choiced/legs/create_default_value() var/datum/sprite_accessory/legs/none/default = /datum/sprite_accessory/legs/none @@ -525,17 +534,7 @@ savefile_identifier = PREFERENCE_CHARACTER savefile_key = "legs_color" relevant_mutant_bodypart = "legs" - -/datum/preference/tri_color/legs/is_accessible(datum/preferences/preferences) - var/passed_initial_check = ..(preferences) - var/allowed = preferences.read_preference(/datum/preference/toggle/allow_mismatched_parts) - var/part_enabled = preferences.read_preference(/datum/preference/toggle/legs) - return ((passed_initial_check || allowed) && part_enabled) - -/datum/preference/tri_color/legs/apply_to_human(mob/living/carbon/human/target, value) - if(!target.dna.mutant_bodyparts["legs"]) - target.dna.mutant_bodyparts["legs"] = list("name" = "None", "color" = list("#FFFFFF", "#FFFFFF", "#FFFFFF")) - target.dna.mutant_bodyparts["legs"]["color"] = list(sanitize_hexcolor(value[1]), sanitize_hexcolor(value[2]), sanitize_hexcolor(value[3])) + type_to_check = /datum/preference/toggle/legs /// Caps @@ -570,9 +569,9 @@ return assoc_to_keys(GLOB.sprite_accessories["caps"]) /datum/preference/choiced/caps/apply_to_human(mob/living/carbon/human/target, value) - if(!target.dna.mutant_bodyparts["caps"]) - target.dna.mutant_bodyparts["caps"] = list("name" = "None", "color" = list("#FFFFFF", "#FFFFFF", "#FFFFFF")) - target.dna.mutant_bodyparts["caps"]["name"] = value + if(!target.dna.mutant_bodyparts[relevant_mutant_bodypart]) + target.dna.mutant_bodyparts[relevant_mutant_bodypart] = list(MUTANT_INDEX_NAME = "None", MUTANT_INDEX_COLOR_LIST = list("#FFFFFF", "#FFFFFF", "#FFFFFF"), MUTANT_INDEX_EMISSIVE_LIST = list(FALSE, FALSE, FALSE)) + target.dna.mutant_bodyparts[relevant_mutant_bodypart][MUTANT_INDEX_NAME] = value /datum/preference/choiced/caps/create_default_value() var/datum/sprite_accessory/caps/none/default = /datum/sprite_accessory/caps/none @@ -583,17 +582,14 @@ savefile_identifier = PREFERENCE_CHARACTER savefile_key = "caps_color" relevant_mutant_bodypart = "caps" + type_to_check = /datum/preference/toggle/caps -/datum/preference/tri_color/caps/is_accessible(datum/preferences/preferences) - var/passed_initial_check = ..(preferences) - var/allowed = preferences.read_preference(/datum/preference/toggle/allow_mismatched_parts) - var/part_enabled = preferences.read_preference(/datum/preference/toggle/caps) - return ((passed_initial_check || allowed) && part_enabled) - -/datum/preference/tri_color/caps/apply_to_human(mob/living/carbon/human/target, value) - if(!target.dna.mutant_bodyparts["caps"]) - target.dna.mutant_bodyparts["caps"] = list("name" = "None", "color" = list("#FFFFFF", "#FFFFFF", "#FFFFFF")) - target.dna.mutant_bodyparts["caps"]["color"] = list(sanitize_hexcolor(value[1]), sanitize_hexcolor(value[2]), sanitize_hexcolor(value[3])) +/datum/preference/tri_bool/caps + category = PREFERENCE_CATEGORY_SECONDARY_FEATURES + savefile_identifier = PREFERENCE_CHARACTER + savefile_key = "caps_emissive" + relevant_mutant_bodypart = "caps" + type_to_check = /datum/preference/toggle/caps /// Moth Antennae @@ -628,9 +624,9 @@ return assoc_to_keys(GLOB.sprite_accessories["moth_antennae"]) /datum/preference/choiced/moth_antennae/apply_to_human(mob/living/carbon/human/target, value) - if(!target.dna.mutant_bodyparts["moth_antennae"]) - target.dna.mutant_bodyparts["moth_antennae"] = list("name" = "None", "color" = list("#FFFFFF", "#FFFFFF", "#FFFFFF")) - target.dna.mutant_bodyparts["moth_antennae"]["name"] = value + if(!target.dna.mutant_bodyparts[relevant_mutant_bodypart]) + target.dna.mutant_bodyparts[relevant_mutant_bodypart] = list(MUTANT_INDEX_NAME = "None", MUTANT_INDEX_COLOR_LIST = list("#FFFFFF", "#FFFFFF", "#FFFFFF"), MUTANT_INDEX_EMISSIVE_LIST = list(FALSE, FALSE, FALSE)) + target.dna.mutant_bodyparts[relevant_mutant_bodypart][MUTANT_INDEX_NAME] = value /datum/preference/choiced/moth_antennae/create_default_value() var/datum/sprite_accessory/moth_antennae/none/default = /datum/sprite_accessory/moth_antennae/none @@ -641,17 +637,14 @@ savefile_identifier = PREFERENCE_CHARACTER savefile_key = "moth_antennae_color" relevant_mutant_bodypart = "moth_antennae" + type_to_check = /datum/preference/toggle/moth_antennae -/datum/preference/tri_color/moth_antennae/is_accessible(datum/preferences/preferences) - var/passed_initial_check = ..(preferences) - var/allowed = preferences.read_preference(/datum/preference/toggle/allow_mismatched_parts) - var/part_enabled = preferences.read_preference(/datum/preference/toggle/moth_antennae) - return ((passed_initial_check || allowed) && part_enabled) - -/datum/preference/tri_color/moth_antennae/apply_to_human(mob/living/carbon/human/target, value) - if(!target.dna.mutant_bodyparts["moth_antennae"]) - target.dna.mutant_bodyparts["moth_antennae"] = list("name" = "None", "color" = list("#FFFFFF", "#FFFFFF", "#FFFFFF")) - target.dna.mutant_bodyparts["moth_antennae"]["color"] = list(sanitize_hexcolor(value[1]), sanitize_hexcolor(value[2]), sanitize_hexcolor(value[3])) +/datum/preference/tri_bool/moth_antennae + category = PREFERENCE_CATEGORY_SECONDARY_FEATURES + savefile_identifier = PREFERENCE_CHARACTER + savefile_key = "moth_antennae_emissive" + relevant_mutant_bodypart = "moth_antennae" + type_to_check = /datum/preference/toggle/moth_antennae /// Moth Markings @@ -686,9 +679,9 @@ return assoc_to_keys(GLOB.sprite_accessories["moth_markings"]) /datum/preference/choiced/moth_markings/apply_to_human(mob/living/carbon/human/target, value) - if(!target.dna.mutant_bodyparts["moth_markings"]) - target.dna.mutant_bodyparts["moth_markings"] = list("name" = "None", "color" = list("#FFFFFF", "#FFFFFF", "#FFFFFF")) - target.dna.mutant_bodyparts["moth_markings"]["name"] = value + if(!target.dna.mutant_bodyparts[relevant_mutant_bodypart]) + target.dna.mutant_bodyparts[relevant_mutant_bodypart] = list(MUTANT_INDEX_NAME = "None", MUTANT_INDEX_COLOR_LIST = list("#FFFFFF", "#FFFFFF", "#FFFFFF"), MUTANT_INDEX_EMISSIVE_LIST = list(FALSE, FALSE, FALSE)) + target.dna.mutant_bodyparts[relevant_mutant_bodypart][MUTANT_INDEX_NAME] = value /datum/preference/choiced/moth_markings/create_default_value() var/datum/sprite_accessory/moth_markings/none/default = /datum/sprite_accessory/moth_markings/none @@ -699,17 +692,14 @@ savefile_identifier = PREFERENCE_CHARACTER savefile_key = "moth_markings_color" relevant_mutant_bodypart = "moth_markings" + type_to_check = /datum/preference/toggle/moth_markings -/datum/preference/tri_color/moth_markings/is_accessible(datum/preferences/preferences) - var/passed_initial_check = ..(preferences) - var/allowed = preferences.read_preference(/datum/preference/toggle/allow_mismatched_parts) - var/part_enabled = preferences.read_preference(/datum/preference/toggle/moth_markings) - return ((passed_initial_check || allowed) && part_enabled) - -/datum/preference/tri_color/moth_markings/apply_to_human(mob/living/carbon/human/target, value) - if(!target.dna.mutant_bodyparts["moth_markings"]) - target.dna.mutant_bodyparts["moth_markings"] = list("name" = "None", "color" = list("#FFFFFF", "#FFFFFF", "#FFFFFF")) - target.dna.mutant_bodyparts["moth_markings"]["color"] = list(sanitize_hexcolor(value[1]), sanitize_hexcolor(value[2]), sanitize_hexcolor(value[3])) +/datum/preference/tri_bool/moth_markings + category = PREFERENCE_CATEGORY_SECONDARY_FEATURES + savefile_identifier = PREFERENCE_CHARACTER + savefile_key = "moth_markings_emissive" + relevant_mutant_bodypart = "moth_markings" + type_to_check = /datum/preference/toggle/moth_markings /// Fluff @@ -744,9 +734,9 @@ return assoc_to_keys(GLOB.sprite_accessories["fluff"]) /datum/preference/choiced/fluff/apply_to_human(mob/living/carbon/human/target, value) - if(!target.dna.mutant_bodyparts["fluff"]) - target.dna.mutant_bodyparts["fluff"] = list("name" = "None", "color" = list("#FFFFFF", "#FFFFFF", "#FFFFFF")) - target.dna.mutant_bodyparts["fluff"]["name"] = value + if(!target.dna.mutant_bodyparts[relevant_mutant_bodypart]) + target.dna.mutant_bodyparts[relevant_mutant_bodypart] = list(MUTANT_INDEX_NAME = "None", MUTANT_INDEX_COLOR_LIST = list("#FFFFFF", "#FFFFFF", "#FFFFFF"), MUTANT_INDEX_EMISSIVE_LIST = list(FALSE, FALSE, FALSE)) + target.dna.mutant_bodyparts[relevant_mutant_bodypart][MUTANT_INDEX_NAME] = value /datum/preference/choiced/fluff/create_default_value() var/datum/sprite_accessory/fluff/moth/none/default = /datum/sprite_accessory/fluff/moth/none @@ -757,75 +747,14 @@ savefile_identifier = PREFERENCE_CHARACTER savefile_key = "fluff_color" relevant_mutant_bodypart = "fluff" + type_to_check = /datum/preference/toggle/fluff -/datum/preference/tri_color/fluff/is_accessible(datum/preferences/preferences) - var/passed_initial_check = ..(preferences) - var/allowed = preferences.read_preference(/datum/preference/toggle/allow_mismatched_parts) - var/part_enabled = preferences.read_preference(/datum/preference/toggle/fluff) - return ((passed_initial_check || allowed) && part_enabled) - -/datum/preference/tri_color/fluff/apply_to_human(mob/living/carbon/human/target, value) - if(!target.dna.mutant_bodyparts["fluff"]) - target.dna.mutant_bodyparts["fluff"] = list("name" = "None", "color" = list("#FFFFFF", "#FFFFFF", "#FFFFFF")) - target.dna.mutant_bodyparts["fluff"]["color"] = list(sanitize_hexcolor(value[1]), sanitize_hexcolor(value[2]), sanitize_hexcolor(value[3])) - -/// Head Accessories - -/datum/preference/toggle/head_acc +/datum/preference/tri_bool/fluff category = PREFERENCE_CATEGORY_SECONDARY_FEATURES savefile_identifier = PREFERENCE_CHARACTER - savefile_key = "head_acc_toggle" - relevant_mutant_bodypart = "head_acc" - default_value = FALSE - -/datum/preference/toggle/head_acc/apply_to_human(mob/living/carbon/human/target, value, datum/preferences/preferences) - return TRUE // we dont actually want this to do anything - -/datum/preference/toggle/head_acc/is_accessible(datum/preferences/preferences) - var/passed_initial_check = ..(preferences) - var/allowed = preferences.read_preference(/datum/preference/toggle/allow_mismatched_parts) - return passed_initial_check || allowed - -/datum/preference/choiced/head_acc - savefile_key = "feature_head_acc" - savefile_identifier = PREFERENCE_CHARACTER - category = PREFERENCE_CATEGORY_SECONDARY_FEATURES - relevant_mutant_bodypart = "head_acc" - -/datum/preference/choiced/head_acc/is_accessible(datum/preferences/preferences) - var/passed_initial_check = ..(preferences) - var/allowed = preferences.read_preference(/datum/preference/toggle/allow_mismatched_parts) - var/part_enabled = preferences.read_preference(/datum/preference/toggle/head_acc) - return ((passed_initial_check || allowed) && part_enabled) - -/datum/preference/choiced/head_acc/init_possible_values() - return assoc_to_keys(GLOB.sprite_accessories["head_acc"]) - -/datum/preference/choiced/head_acc/apply_to_human(mob/living/carbon/human/target, value) - if(!target.dna.mutant_bodyparts["head_acc"]) - target.dna.mutant_bodyparts["head_acc"] = list("name" = "None", "color" = list("#FFFFFF", "#FFFFFF", "#FFFFFF")) - target.dna.mutant_bodyparts["head_acc"]["name"] = value - -/datum/preference/choiced/head_acc/create_default_value() - var/datum/sprite_accessory/head_accessory/none/default = /datum/sprite_accessory/head_accessory/none - return initial(default.name) - -/datum/preference/tri_color/head_acc - category = PREFERENCE_CATEGORY_SECONDARY_FEATURES - savefile_identifier = PREFERENCE_CHARACTER - savefile_key = "head_acc_color" - relevant_mutant_bodypart = "head_acc" - -/datum/preference/tri_color/head_acc/is_accessible(datum/preferences/preferences) - var/passed_initial_check = ..(preferences) - var/allowed = preferences.read_preference(/datum/preference/toggle/allow_mismatched_parts) - var/part_enabled = preferences.read_preference(/datum/preference/toggle/head_acc) - return ((passed_initial_check || allowed) && part_enabled) - -/datum/preference/tri_color/head_acc/apply_to_human(mob/living/carbon/human/target, value) - if(!target.dna.mutant_bodyparts["head_acc"]) - target.dna.mutant_bodyparts["head_acc"] = list("name" = "None", "color" = list("#FFFFFF", "#FFFFFF", "#FFFFFF")) - target.dna.mutant_bodyparts["head_acc"]["color"] = list(sanitize_hexcolor(value[1]), sanitize_hexcolor(value[2]), sanitize_hexcolor(value[3])) + savefile_key = "fluff_emissive" + relevant_mutant_bodypart = "fluff" + type_to_check = /datum/preference/toggle/fluff /// IPC Screens @@ -860,9 +789,9 @@ return assoc_to_keys(GLOB.sprite_accessories["ipc_screen"]) /datum/preference/choiced/ipc_screen/apply_to_human(mob/living/carbon/human/target, value) - if(!target.dna.mutant_bodyparts["ipc_screen"]) - target.dna.mutant_bodyparts["ipc_screen"] = list("name" = "None", "color" = list("#FFFFFF", "#FFFFFF", "#FFFFFF")) - target.dna.mutant_bodyparts["ipc_screen"]["name"] = value + if(!target.dna.mutant_bodyparts[relevant_mutant_bodypart]) + target.dna.mutant_bodyparts[relevant_mutant_bodypart] = list(MUTANT_INDEX_NAME = "None", MUTANT_INDEX_COLOR_LIST = list("#FFFFFF", "#FFFFFF", "#FFFFFF"), MUTANT_INDEX_EMISSIVE_LIST = list(FALSE, FALSE, FALSE)) + target.dna.mutant_bodyparts[relevant_mutant_bodypart][MUTANT_INDEX_NAME] = value /datum/preference/choiced/ipc_screen/create_default_value() var/datum/sprite_accessory/screen/none/default = /datum/sprite_accessory/screen/none @@ -873,17 +802,14 @@ savefile_identifier = PREFERENCE_CHARACTER savefile_key = "ipc_screen_color" relevant_mutant_bodypart = "ipc_screen" + type_to_check = /datum/preference/toggle/ipc_screen -/datum/preference/tri_color/ipc_screen/is_accessible(datum/preferences/preferences) - var/passed_initial_check = ..(preferences) - var/allowed = preferences.read_preference(/datum/preference/toggle/allow_mismatched_parts) - var/part_enabled = preferences.read_preference(/datum/preference/toggle/ipc_screen) - return ((passed_initial_check || allowed) && part_enabled) - -/datum/preference/tri_color/ipc_screen/apply_to_human(mob/living/carbon/human/target, value) - if(!target.dna.mutant_bodyparts["ipc_screen"]) - target.dna.mutant_bodyparts["ipc_screen"] = list("name" = "None", "color" = list("#FFFFFF", "#FFFFFF", "#FFFFFF")) - target.dna.mutant_bodyparts["ipc_screen"]["color"] = list(sanitize_hexcolor(value[1]), sanitize_hexcolor(value[2]), sanitize_hexcolor(value[3])) +/datum/preference/tri_bool/ipc_screen + category = PREFERENCE_CATEGORY_SECONDARY_FEATURES + savefile_identifier = PREFERENCE_CHARACTER + savefile_key = "ipc_screen_emissive" + relevant_mutant_bodypart = "ipc_screen" + type_to_check = /datum/preference/toggle/ipc_screen /// IPC Antennas @@ -918,9 +844,9 @@ return assoc_to_keys(GLOB.sprite_accessories["ipc_antenna"]) /datum/preference/choiced/ipc_antenna/apply_to_human(mob/living/carbon/human/target, value) - if(!target.dna.mutant_bodyparts["ipc_antenna"]) - target.dna.mutant_bodyparts["ipc_antenna"] = list("name" = "None", "color" = list("#FFFFFF", "#FFFFFF", "#FFFFFF")) - target.dna.mutant_bodyparts["ipc_antenna"]["name"] = value + if(!target.dna.mutant_bodyparts[relevant_mutant_bodypart]) + target.dna.mutant_bodyparts[relevant_mutant_bodypart] = list(MUTANT_INDEX_NAME = "None", MUTANT_INDEX_COLOR_LIST = list("#FFFFFF", "#FFFFFF", "#FFFFFF"), MUTANT_INDEX_EMISSIVE_LIST = list(FALSE, FALSE, FALSE)) + target.dna.mutant_bodyparts[relevant_mutant_bodypart][MUTANT_INDEX_NAME] = value /datum/preference/choiced/ipc_antenna/create_default_value() var/datum/sprite_accessory/antenna/none/default = /datum/sprite_accessory/antenna/none @@ -931,17 +857,14 @@ savefile_identifier = PREFERENCE_CHARACTER savefile_key = "ipc_antenna_color" relevant_mutant_bodypart = "ipc_antenna" + type_to_check = /datum/preference/toggle/ipc_antenna -/datum/preference/tri_color/ipc_antenna/is_accessible(datum/preferences/preferences) - var/passed_initial_check = ..(preferences) - var/allowed = preferences.read_preference(/datum/preference/toggle/allow_mismatched_parts) - var/part_enabled = preferences.read_preference(/datum/preference/toggle/ipc_antenna) - return ((passed_initial_check || allowed) && part_enabled) - -/datum/preference/tri_color/ipc_antenna/apply_to_human(mob/living/carbon/human/target, value) - if(!target.dna.mutant_bodyparts["ipc_antenna"]) - target.dna.mutant_bodyparts["ipc_antenna"] = list("name" = "None", "color" = list("#FFFFFF", "#FFFFFF", "#FFFFFF")) - target.dna.mutant_bodyparts["ipc_antenna"]["color"] = list(sanitize_hexcolor(value[1]), sanitize_hexcolor(value[2]), sanitize_hexcolor(value[3])) +/datum/preference/tri_bool/ipc_antenna + category = PREFERENCE_CATEGORY_SECONDARY_FEATURES + savefile_identifier = PREFERENCE_CHARACTER + savefile_key = "ipc_antenna_emissive" + relevant_mutant_bodypart = "ipc_antenna" + type_to_check = /datum/preference/toggle/ipc_antenna /// IPC Chassis @@ -976,9 +899,9 @@ return assoc_to_keys(GLOB.sprite_accessories["ipc_chassis"]) /datum/preference/choiced/ipc_chassis/apply_to_human(mob/living/carbon/human/target, value) - if(!target.dna.mutant_bodyparts["ipc_chassis"]) - target.dna.mutant_bodyparts["ipc_chassis"] = list("name" = "None", "color" = list("#FFFFFF", "#FFFFFF", "#FFFFFF")) - target.dna.mutant_bodyparts["ipc_chassis"]["name"] = value + if(!target.dna.mutant_bodyparts[relevant_mutant_bodypart]) + target.dna.mutant_bodyparts[relevant_mutant_bodypart] = list(MUTANT_INDEX_NAME = "None", MUTANT_INDEX_COLOR_LIST = list("#FFFFFF", "#FFFFFF", "#FFFFFF"), MUTANT_INDEX_EMISSIVE_LIST = list(FALSE, FALSE, FALSE)) + target.dna.mutant_bodyparts[relevant_mutant_bodypart][MUTANT_INDEX_NAME] = value /datum/preference/choiced/ipc_chassis/create_default_value() var/datum/sprite_accessory/ipc_chassis/default = /datum/sprite_accessory/ipc_chassis/none @@ -989,17 +912,7 @@ savefile_identifier = PREFERENCE_CHARACTER savefile_key = "ipc_chassis_color" relevant_mutant_bodypart = "ipc_chassis" - -/datum/preference/tri_color/ipc_chassis/is_accessible(datum/preferences/preferences) - var/passed_initial_check = ..(preferences) - var/allowed = preferences.read_preference(/datum/preference/toggle/allow_mismatched_parts) - var/part_enabled = preferences.read_preference(/datum/preference/toggle/ipc_chassis) - return ((passed_initial_check || allowed) && part_enabled) - -/datum/preference/tri_color/ipc_chassis/apply_to_human(mob/living/carbon/human/target, value) - if(!target.dna.mutant_bodyparts["ipc_chassis"]) - target.dna.mutant_bodyparts["ipc_chassis"] = list("name" = "None", "color" = list("#FFFFFF", "#FFFFFF", "#FFFFFF")) - target.dna.mutant_bodyparts["ipc_chassis"]["color"] = list(sanitize_hexcolor(value[1]), sanitize_hexcolor(value[2]), sanitize_hexcolor(value[3])) + type_to_check = /datum/preference/toggle/ipc_chassis /// Neck Accessories @@ -1034,9 +947,9 @@ return assoc_to_keys(GLOB.sprite_accessories["neck_acc"]) /datum/preference/choiced/neck_acc/apply_to_human(mob/living/carbon/human/target, value) - if(!target.dna.mutant_bodyparts["neck_acc"]) - target.dna.mutant_bodyparts["neck_acc"] = list("name" = "None", "color" = list("#FFFFFF", "#FFFFFF", "#FFFFFF")) - target.dna.mutant_bodyparts["neck_acc"]["name"] = value + if(!target.dna.mutant_bodyparts[relevant_mutant_bodypart]) + target.dna.mutant_bodyparts[relevant_mutant_bodypart] = list(MUTANT_INDEX_NAME = "None", MUTANT_INDEX_COLOR_LIST = list("#FFFFFF", "#FFFFFF", "#FFFFFF"), MUTANT_INDEX_EMISSIVE_LIST = list(FALSE, FALSE, FALSE)) + target.dna.mutant_bodyparts[relevant_mutant_bodypart][MUTANT_INDEX_NAME] = value /datum/preference/choiced/neck_acc/create_default_value() var/datum/sprite_accessory/neck_accessory/none/default = /datum/sprite_accessory/neck_accessory/none @@ -1047,17 +960,14 @@ savefile_identifier = PREFERENCE_CHARACTER savefile_key = "neck_acc_color" relevant_mutant_bodypart = "neck_acc" + type_to_check = /datum/preference/toggle/neck_acc -/datum/preference/tri_color/neck_acc/is_accessible(datum/preferences/preferences) - var/passed_initial_check = ..(preferences) - var/allowed = preferences.read_preference(/datum/preference/toggle/allow_mismatched_parts) - var/part_enabled = preferences.read_preference(/datum/preference/toggle/neck_acc) - return ((passed_initial_check || allowed) && part_enabled) - -/datum/preference/tri_color/neck_acc/apply_to_human(mob/living/carbon/human/target, value) - if(!target.dna.mutant_bodyparts["neck_acc"]) - target.dna.mutant_bodyparts["neck_acc"] = list("name" = "None", "color" = list("#FFFFFF", "#FFFFFF", "#FFFFFF")) - target.dna.mutant_bodyparts["neck_acc"]["color"] = list(sanitize_hexcolor(value[1]), sanitize_hexcolor(value[2]), sanitize_hexcolor(value[3])) +/datum/preference/tri_bool/neck_acc + category = PREFERENCE_CATEGORY_SECONDARY_FEATURES + savefile_identifier = PREFERENCE_CHARACTER + savefile_key = "neck_acc_emissive" + relevant_mutant_bodypart = "neck_acc" + type_to_check = /datum/preference/toggle/neck_acc /// Skrell Hair @@ -1092,9 +1002,9 @@ return assoc_to_keys(GLOB.sprite_accessories["skrell_hair"]) /datum/preference/choiced/skrell_hair/apply_to_human(mob/living/carbon/human/target, value) - if(!target.dna.mutant_bodyparts["skrell_hair"]) - target.dna.mutant_bodyparts["skrell_hair"] = list("name" = "None", "color" = list("#FFFFFF", "#FFFFFF", "#FFFFFF")) - target.dna.mutant_bodyparts["skrell_hair"]["name"] = value + if(!target.dna.mutant_bodyparts[relevant_mutant_bodypart]) + target.dna.mutant_bodyparts[relevant_mutant_bodypart] = list(MUTANT_INDEX_NAME = "None", MUTANT_INDEX_COLOR_LIST = list("#FFFFFF", "#FFFFFF", "#FFFFFF"), MUTANT_INDEX_EMISSIVE_LIST = list(FALSE, FALSE, FALSE)) + target.dna.mutant_bodyparts[relevant_mutant_bodypart][MUTANT_INDEX_NAME] = value /datum/preference/choiced/skrell_hair/create_default_value() var/datum/sprite_accessory/skrell_hair/none/default = /datum/sprite_accessory/skrell_hair/none @@ -1105,17 +1015,14 @@ savefile_identifier = PREFERENCE_CHARACTER savefile_key = "skrell_hair_color" relevant_mutant_bodypart = "skrell_hair" + type_to_check = /datum/preference/toggle/skrell_hair -/datum/preference/tri_color/skrell_hair/is_accessible(datum/preferences/preferences) - var/passed_initial_check = ..(preferences) - var/allowed = preferences.read_preference(/datum/preference/toggle/allow_mismatched_parts) - var/part_enabled = preferences.read_preference(/datum/preference/toggle/skrell_hair) - return ((passed_initial_check || allowed) && part_enabled) - -/datum/preference/tri_color/skrell_hair/apply_to_human(mob/living/carbon/human/target, value) - if(!target.dna.mutant_bodyparts["skrell_hair"]) - target.dna.mutant_bodyparts["skrell_hair"] = list("name" = "None", "color" = list("#FFFFFF", "#FFFFFF", "#FFFFFF")) - target.dna.mutant_bodyparts["skrell_hair"]["color"] = list(sanitize_hexcolor(value[1]), sanitize_hexcolor(value[2]), sanitize_hexcolor(value[3])) +/datum/preference/tri_bool/skrell_hair + category = PREFERENCE_CATEGORY_SECONDARY_FEATURES + savefile_identifier = PREFERENCE_CHARACTER + savefile_key = "skrell_hair_emissive" + relevant_mutant_bodypart = "skrell_hair" + type_to_check = /datum/preference/toggle/skrell_hair /// Taur @@ -1150,9 +1057,9 @@ return assoc_to_keys(GLOB.sprite_accessories["taur"]) /datum/preference/choiced/taur/apply_to_human(mob/living/carbon/human/target, value) - if(!target.dna.mutant_bodyparts["taur"]) - target.dna.mutant_bodyparts["taur"] = list("name" = "None", "color" = list("#FFFFFF", "#FFFFFF", "#FFFFFF")) - target.dna.mutant_bodyparts["taur"]["name"] = value + if(!target.dna.mutant_bodyparts[relevant_mutant_bodypart]) + target.dna.mutant_bodyparts[relevant_mutant_bodypart] = list(MUTANT_INDEX_NAME = "None", MUTANT_INDEX_COLOR_LIST = list("#FFFFFF", "#FFFFFF", "#FFFFFF"), MUTANT_INDEX_EMISSIVE_LIST = list(FALSE, FALSE, FALSE)) + target.dna.mutant_bodyparts[relevant_mutant_bodypart][MUTANT_INDEX_NAME] = value /datum/preference/choiced/taur/create_default_value() var/datum/sprite_accessory/taur/none/default = /datum/sprite_accessory/taur/none @@ -1163,17 +1070,14 @@ savefile_identifier = PREFERENCE_CHARACTER savefile_key = "taur_color" relevant_mutant_bodypart = "taur" + type_to_check = /datum/preference/toggle/taur -/datum/preference/tri_color/taur/is_accessible(datum/preferences/preferences) - var/passed_initial_check = ..(preferences) - var/allowed = preferences.read_preference(/datum/preference/toggle/allow_mismatched_parts) - var/part_enabled = preferences.read_preference(/datum/preference/toggle/taur) - return ((passed_initial_check || allowed) && part_enabled) - -/datum/preference/tri_color/taur/apply_to_human(mob/living/carbon/human/target, value) - if(!target.dna.mutant_bodyparts["taur"]) - target.dna.mutant_bodyparts["taur"] = list("name" = "None", "color" = list("#FFFFFF", "#FFFFFF", "#FFFFFF")) - target.dna.mutant_bodyparts["taur"]["color"] = list(sanitize_hexcolor(value[1]), sanitize_hexcolor(value[2]), sanitize_hexcolor(value[3])) +/datum/preference/tri_bool/taur + category = PREFERENCE_CATEGORY_SECONDARY_FEATURES + savefile_identifier = PREFERENCE_CHARACTER + savefile_key = "taur_emissive" + relevant_mutant_bodypart = "taur" + type_to_check = /datum/preference/toggle/taur /// Xenodorsal @@ -1208,9 +1112,9 @@ return assoc_to_keys(GLOB.sprite_accessories["xenodorsal"]) /datum/preference/choiced/xenodorsal/apply_to_human(mob/living/carbon/human/target, value) - if(!target.dna.mutant_bodyparts["xenodorsal"]) - target.dna.mutant_bodyparts["xenodorsal"] = list("name" = "None", "color" = list("#FFFFFF", "#FFFFFF", "#FFFFFF")) - target.dna.mutant_bodyparts["xenodorsal"]["name"] = value + if(!target.dna.mutant_bodyparts[relevant_mutant_bodypart]) + target.dna.mutant_bodyparts[relevant_mutant_bodypart] = list(MUTANT_INDEX_NAME = "None", MUTANT_INDEX_COLOR_LIST = list("#FFFFFF", "#FFFFFF", "#FFFFFF"), MUTANT_INDEX_EMISSIVE_LIST = list(FALSE, FALSE, FALSE)) + target.dna.mutant_bodyparts[relevant_mutant_bodypart][MUTANT_INDEX_NAME] = value /datum/preference/choiced/xenodorsal/create_default_value() var/datum/sprite_accessory/xenodorsal/none/default = /datum/sprite_accessory/xenodorsal/none @@ -1221,17 +1125,14 @@ savefile_identifier = PREFERENCE_CHARACTER savefile_key = "xenodorsal_color" relevant_mutant_bodypart = "xenodorsal" + type_to_check = /datum/preference/toggle/xenodorsal -/datum/preference/tri_color/xenodorsal/is_accessible(datum/preferences/preferences) - var/passed_initial_check = ..(preferences) - var/allowed = preferences.read_preference(/datum/preference/toggle/allow_mismatched_parts) - var/part_enabled = preferences.read_preference(/datum/preference/toggle/xenodorsal) - return ((passed_initial_check || allowed) && part_enabled) - -/datum/preference/tri_color/xenodorsal/apply_to_human(mob/living/carbon/human/target, value) - if(!target.dna.mutant_bodyparts["xenodorsal"]) - target.dna.mutant_bodyparts["xenodorsal"] = list("name" = "None", "color" = list("#FFFFFF", "#FFFFFF", "#FFFFFF")) - target.dna.mutant_bodyparts["xenodorsal"]["color"] = list(sanitize_hexcolor(value[1]), sanitize_hexcolor(value[2]), sanitize_hexcolor(value[3])) +/datum/preference/tri_bool/xenodorsal + category = PREFERENCE_CATEGORY_SECONDARY_FEATURES + savefile_identifier = PREFERENCE_CHARACTER + savefile_key = "xenodorsal_emissive" + relevant_mutant_bodypart = "xenodorsal" + type_to_check = /datum/preference/toggle/xenodorsal /// Xeno heads @@ -1266,9 +1167,9 @@ return assoc_to_keys(GLOB.sprite_accessories["xenohead"]) /datum/preference/choiced/xenohead/apply_to_human(mob/living/carbon/human/target, value) - if(!target.dna.mutant_bodyparts["xenohead"]) - target.dna.mutant_bodyparts["xenohead"] = list("name" = "None", "color" = list("#FFFFFF", "#FFFFFF", "#FFFFFF")) - target.dna.mutant_bodyparts["xenohead"]["name"] = value + if(!target.dna.mutant_bodyparts[relevant_mutant_bodypart]) + target.dna.mutant_bodyparts[relevant_mutant_bodypart] = list(MUTANT_INDEX_NAME = "None", MUTANT_INDEX_COLOR_LIST = list("#FFFFFF", "#FFFFFF", "#FFFFFF"), MUTANT_INDEX_EMISSIVE_LIST = list(FALSE, FALSE, FALSE)) + target.dna.mutant_bodyparts[relevant_mutant_bodypart][MUTANT_INDEX_NAME] = value /datum/preference/choiced/xenohead/create_default_value() var/datum/sprite_accessory/xenohead/none/default = /datum/sprite_accessory/xenohead/none @@ -1279,14 +1180,124 @@ savefile_identifier = PREFERENCE_CHARACTER savefile_key = "xenohead_color" relevant_mutant_bodypart = "xenohead" + type_to_check = /datum/preference/toggle/xenohead -/datum/preference/tri_color/xenohead/is_accessible(datum/preferences/preferences) +/datum/preference/tri_bool/xenohead + category = PREFERENCE_CATEGORY_SECONDARY_FEATURES + savefile_identifier = PREFERENCE_CHARACTER + savefile_key = "xenohead_emissive" + relevant_mutant_bodypart = "xenohead" + type_to_check = /datum/preference/toggle/xenohead + + +/// Head Accessories - Unless more get added, this is only able to be applied for one person, a donator only thing + +/datum/preference/toggle/head_acc + category = PREFERENCE_CATEGORY_SECONDARY_FEATURES + savefile_identifier = PREFERENCE_CHARACTER + savefile_key = "head_acc_toggle" + relevant_mutant_bodypart = "head_acc" + default_value = FALSE + +/datum/preference/toggle/head_acc/apply_to_human(mob/living/carbon/human/target, value, datum/preferences/preferences) + return TRUE // we dont actually want this to do anything + +/datum/preference/toggle/head_acc/is_accessible(datum/preferences/preferences) + var/ckeycheck = preferences?.parent.ckey == "whirlsam" var/passed_initial_check = ..(preferences) var/allowed = preferences.read_preference(/datum/preference/toggle/allow_mismatched_parts) - var/part_enabled = preferences.read_preference(/datum/preference/toggle/xenohead) + return ckeycheck && (passed_initial_check || allowed) + +/datum/preference/choiced/head_acc + savefile_key = "feature_head_acc" + savefile_identifier = PREFERENCE_CHARACTER + category = PREFERENCE_CATEGORY_SECONDARY_FEATURES + relevant_mutant_bodypart = "head_acc" + +/datum/preference/choiced/head_acc/is_accessible(datum/preferences/preferences) + var/passed_initial_check = ..(preferences) + var/allowed = preferences.read_preference(/datum/preference/toggle/allow_mismatched_parts) + var/part_enabled = preferences.read_preference(/datum/preference/toggle/head_acc) return ((passed_initial_check || allowed) && part_enabled) -/datum/preference/tri_color/xenohead/apply_to_human(mob/living/carbon/human/target, value) - if(!target.dna.mutant_bodyparts["xenohead"]) - target.dna.mutant_bodyparts["xenohead"] = list("name" = "None", "color" = list("#FFFFFF", "#FFFFFF", "#FFFFFF")) - target.dna.mutant_bodyparts["xenohead"]["color"] = list(sanitize_hexcolor(value[1]), sanitize_hexcolor(value[2]), sanitize_hexcolor(value[3])) +/datum/preference/choiced/head_acc/init_possible_values() + return assoc_to_keys(GLOB.sprite_accessories["head_acc"]) + +/datum/preference/choiced/head_acc/apply_to_human(mob/living/carbon/human/target, value) + if(!target.dna.mutant_bodyparts[relevant_mutant_bodypart]) + target.dna.mutant_bodyparts[relevant_mutant_bodypart] = list(MUTANT_INDEX_NAME = "None", MUTANT_INDEX_COLOR_LIST = list("#FFFFFF", "#FFFFFF", "#FFFFFF"), MUTANT_INDEX_EMISSIVE_LIST = list(FALSE, FALSE, FALSE)) + target.dna.mutant_bodyparts[relevant_mutant_bodypart][MUTANT_INDEX_NAME] = value + +/datum/preference/choiced/head_acc/create_default_value() + var/datum/sprite_accessory/head_accessory/none/default = /datum/sprite_accessory/head_accessory/none + return initial(default.name) + +/datum/preference/tri_color/head_acc + category = PREFERENCE_CATEGORY_SECONDARY_FEATURES + savefile_identifier = PREFERENCE_CHARACTER + savefile_key = "head_acc_color" + relevant_mutant_bodypart = "head_acc" + type_to_check = /datum/preference/toggle/head_acc + +/datum/preference/tri_bool/head_acc + category = PREFERENCE_CATEGORY_SECONDARY_FEATURES + savefile_identifier = PREFERENCE_CHARACTER + savefile_key = "head_acc_emissive" + relevant_mutant_bodypart = "head_acc" + type_to_check = /datum/preference/toggle/head_acc + +/// Neck Accessories - Same as head_acc + +/datum/preference/toggle/neck_acc + category = PREFERENCE_CATEGORY_SECONDARY_FEATURES + savefile_identifier = PREFERENCE_CHARACTER + savefile_key = "neck_acc_toggle" + relevant_mutant_bodypart = "neck_acc" + default_value = FALSE + +/datum/preference/toggle/neck_acc/apply_to_human(mob/living/carbon/human/target, value, datum/preferences/preferences) + return TRUE // we dont actually want this to do anything + +/datum/preference/toggle/neck_acc/is_accessible(datum/preferences/preferences) + var/ckeycheck = preferences?.parent.ckey == "whirlsam" + var/passed_initial_check = ..(preferences) + var/allowed = preferences.read_preference(/datum/preference/toggle/allow_mismatched_parts) + return ckeycheck && (passed_initial_check || allowed) + +/datum/preference/choiced/neck_acc + savefile_key = "feature_neck_acc" + savefile_identifier = PREFERENCE_CHARACTER + category = PREFERENCE_CATEGORY_SECONDARY_FEATURES + relevant_mutant_bodypart = "neck_acc" + +/datum/preference/choiced/neck_acc/is_accessible(datum/preferences/preferences) + var/passed_initial_check = ..(preferences) + var/allowed = preferences.read_preference(/datum/preference/toggle/allow_mismatched_parts) + var/part_enabled = preferences.read_preference(/datum/preference/toggle/neck_acc) + return ((passed_initial_check || allowed) && part_enabled) + +/datum/preference/choiced/neck_acc/init_possible_values() + return assoc_to_keys(GLOB.sprite_accessories["neck_acc"]) + +/datum/preference/choiced/neck_acc/apply_to_human(mob/living/carbon/human/target, value) + if(!target.dna.mutant_bodyparts[relevant_mutant_bodypart]) + target.dna.mutant_bodyparts[relevant_mutant_bodypart] = list(MUTANT_INDEX_NAME = "None", MUTANT_INDEX_COLOR_LIST = list("#FFFFFF", "#FFFFFF", "#FFFFFF"), MUTANT_INDEX_EMISSIVE_LIST = list(FALSE, FALSE, FALSE)) + target.dna.mutant_bodyparts[relevant_mutant_bodypart][MUTANT_INDEX_NAME] = value + +/datum/preference/choiced/neck_acc/create_default_value() + var/datum/sprite_accessory/neck_accessory/none/default = /datum/sprite_accessory/neck_accessory/none + return initial(default.name) + +/datum/preference/tri_color/neck_acc + category = PREFERENCE_CATEGORY_SECONDARY_FEATURES + savefile_identifier = PREFERENCE_CHARACTER + savefile_key = "neck_acc_color" + relevant_mutant_bodypart = "neck_acc" + type_to_check = /datum/preference/toggle/neck_acc + +/datum/preference/tri_bool/neck_acc + category = PREFERENCE_CATEGORY_SECONDARY_FEATURES + savefile_identifier = PREFERENCE_CHARACTER + savefile_key = "neck_acc_emissive" + relevant_mutant_bodypart = "neck_acc" + type_to_check = /datum/preference/toggle/neck_acc diff --git a/modular_skyrat/master_files/code/modules/client/preferences_savefile.dm b/modular_skyrat/master_files/code/modules/client/preferences_savefile.dm index 1a787783cc9..78d78318625 100644 --- a/modular_skyrat/master_files/code/modules/client/preferences_savefile.dm +++ b/modular_skyrat/master_files/code/modules/client/preferences_savefile.dm @@ -107,5 +107,6 @@ if (islist(markings)) for (var/marking in markings) for (var/title in markings[marking]) - markings[marking][title] = sanitize_hexcolor(markings[marking][title]) + if (!islist(markings[marking][title])) + markings[marking][title] = list(sanitize_hexcolor(markings[marking][title]), FALSE) return markings diff --git a/modular_skyrat/master_files/icons/mob/sprite_accessory/ears.dmi b/modular_skyrat/master_files/icons/mob/sprite_accessory/ears.dmi index 996077a7833..f3cc62e6c10 100644 Binary files a/modular_skyrat/master_files/icons/mob/sprite_accessory/ears.dmi and b/modular_skyrat/master_files/icons/mob/sprite_accessory/ears.dmi differ diff --git a/modular_skyrat/master_files/icons/mob/sprite_accessory/frills.dmi b/modular_skyrat/master_files/icons/mob/sprite_accessory/frills.dmi index b116b734117..fd08195adbc 100644 Binary files a/modular_skyrat/master_files/icons/mob/sprite_accessory/frills.dmi and b/modular_skyrat/master_files/icons/mob/sprite_accessory/frills.dmi differ diff --git a/modular_skyrat/master_files/icons/mob/sprite_accessory/genitals/breasts_onmob.dmi b/modular_skyrat/master_files/icons/mob/sprite_accessory/genitals/breasts_onmob.dmi index 47c61a4af48..99ec4fe4746 100644 Binary files a/modular_skyrat/master_files/icons/mob/sprite_accessory/genitals/breasts_onmob.dmi and b/modular_skyrat/master_files/icons/mob/sprite_accessory/genitals/breasts_onmob.dmi differ diff --git a/modular_skyrat/master_files/icons/mob/sprite_accessory/genitals/penis_onmob.dmi b/modular_skyrat/master_files/icons/mob/sprite_accessory/genitals/penis_onmob.dmi index 562395b28e1..bf394f24824 100644 Binary files a/modular_skyrat/master_files/icons/mob/sprite_accessory/genitals/penis_onmob.dmi and b/modular_skyrat/master_files/icons/mob/sprite_accessory/genitals/penis_onmob.dmi differ diff --git a/modular_skyrat/master_files/icons/mob/sprite_accessory/genitals/taur_penis_onmob.dmi b/modular_skyrat/master_files/icons/mob/sprite_accessory/genitals/taur_penis_onmob.dmi index 4ef5607f0bc..16869180426 100644 Binary files a/modular_skyrat/master_files/icons/mob/sprite_accessory/genitals/taur_penis_onmob.dmi and b/modular_skyrat/master_files/icons/mob/sprite_accessory/genitals/taur_penis_onmob.dmi differ diff --git a/modular_skyrat/master_files/icons/mob/sprite_accessory/genitals/taur_testicles_onmob.dmi b/modular_skyrat/master_files/icons/mob/sprite_accessory/genitals/taur_testicles_onmob.dmi index 8baf5d827a3..3018b88aeee 100644 Binary files a/modular_skyrat/master_files/icons/mob/sprite_accessory/genitals/taur_testicles_onmob.dmi and b/modular_skyrat/master_files/icons/mob/sprite_accessory/genitals/taur_testicles_onmob.dmi differ diff --git a/modular_skyrat/master_files/icons/mob/sprite_accessory/genitals/testicles_onmob.dmi b/modular_skyrat/master_files/icons/mob/sprite_accessory/genitals/testicles_onmob.dmi index 11fd2c518bb..885c1b903c9 100644 Binary files a/modular_skyrat/master_files/icons/mob/sprite_accessory/genitals/testicles_onmob.dmi and b/modular_skyrat/master_files/icons/mob/sprite_accessory/genitals/testicles_onmob.dmi differ diff --git a/modular_skyrat/master_files/icons/mob/sprite_accessory/genitals/vagina_onmob.dmi b/modular_skyrat/master_files/icons/mob/sprite_accessory/genitals/vagina_onmob.dmi index 62ee10b1c22..5c6ebaab3be 100644 Binary files a/modular_skyrat/master_files/icons/mob/sprite_accessory/genitals/vagina_onmob.dmi and b/modular_skyrat/master_files/icons/mob/sprite_accessory/genitals/vagina_onmob.dmi differ diff --git a/modular_skyrat/master_files/icons/mob/sprite_accessory/head_accessory.dmi b/modular_skyrat/master_files/icons/mob/sprite_accessory/head_accessory.dmi index 3f882b39754..4f27b7f2aa2 100644 Binary files a/modular_skyrat/master_files/icons/mob/sprite_accessory/head_accessory.dmi and b/modular_skyrat/master_files/icons/mob/sprite_accessory/head_accessory.dmi differ diff --git a/modular_skyrat/master_files/icons/mob/sprite_accessory/lizard_snouts.dmi b/modular_skyrat/master_files/icons/mob/sprite_accessory/lizard_snouts.dmi index 32372222cbc..9d463eaf855 100644 Binary files a/modular_skyrat/master_files/icons/mob/sprite_accessory/lizard_snouts.dmi and b/modular_skyrat/master_files/icons/mob/sprite_accessory/lizard_snouts.dmi differ diff --git a/modular_skyrat/master_files/icons/mob/sprite_accessory/neck_accessory.dmi b/modular_skyrat/master_files/icons/mob/sprite_accessory/neck_accessory.dmi index a8705f40f43..911acc1dd26 100644 Binary files a/modular_skyrat/master_files/icons/mob/sprite_accessory/neck_accessory.dmi and b/modular_skyrat/master_files/icons/mob/sprite_accessory/neck_accessory.dmi differ diff --git a/modular_skyrat/master_files/icons/mob/sprite_accessory/snouts.dmi b/modular_skyrat/master_files/icons/mob/sprite_accessory/snouts.dmi index 7ee73a56114..94b0d379556 100644 Binary files a/modular_skyrat/master_files/icons/mob/sprite_accessory/snouts.dmi and b/modular_skyrat/master_files/icons/mob/sprite_accessory/snouts.dmi differ diff --git a/modular_skyrat/master_files/icons/mob/sprite_accessory/synthliz_antennas.dmi b/modular_skyrat/master_files/icons/mob/sprite_accessory/synthliz_antennas.dmi index dd8f25647f5..b09f7e6f7d6 100644 Binary files a/modular_skyrat/master_files/icons/mob/sprite_accessory/synthliz_antennas.dmi and b/modular_skyrat/master_files/icons/mob/sprite_accessory/synthliz_antennas.dmi differ diff --git a/modular_skyrat/master_files/icons/mob/sprite_accessory/synthliz_snouts.dmi b/modular_skyrat/master_files/icons/mob/sprite_accessory/synthliz_snouts.dmi index b1b2c4ed58c..8b1cd62ff6b 100644 Binary files a/modular_skyrat/master_files/icons/mob/sprite_accessory/synthliz_snouts.dmi and b/modular_skyrat/master_files/icons/mob/sprite_accessory/synthliz_snouts.dmi differ diff --git a/modular_skyrat/master_files/icons/mob/sprite_accessory/tails.dmi b/modular_skyrat/master_files/icons/mob/sprite_accessory/tails.dmi index ecd1178915d..98a25490706 100644 Binary files a/modular_skyrat/master_files/icons/mob/sprite_accessory/tails.dmi and b/modular_skyrat/master_files/icons/mob/sprite_accessory/tails.dmi differ diff --git a/modular_skyrat/master_files/icons/mob/sprite_accessory/taur.dmi b/modular_skyrat/master_files/icons/mob/sprite_accessory/taur.dmi index 7ff36e13835..75c351d5f3d 100644 Binary files a/modular_skyrat/master_files/icons/mob/sprite_accessory/taur.dmi and b/modular_skyrat/master_files/icons/mob/sprite_accessory/taur.dmi differ diff --git a/modular_skyrat/master_files/icons/mob/sprite_accessory/wings.dmi b/modular_skyrat/master_files/icons/mob/sprite_accessory/wings.dmi index f1906bd81f0..d0cc595febd 100644 Binary files a/modular_skyrat/master_files/icons/mob/sprite_accessory/wings.dmi and b/modular_skyrat/master_files/icons/mob/sprite_accessory/wings.dmi differ diff --git a/modular_skyrat/modules/customization/__HELPERS/mobs.dm b/modular_skyrat/modules/customization/__HELPERS/mobs.dm index aacf2943617..cc99e3ccb7d 100644 --- a/modular_skyrat/modules/customization/__HELPERS/mobs.dm +++ b/modular_skyrat/modules/customization/__HELPERS/mobs.dm @@ -61,5 +61,5 @@ if(set_name in marking_list) if(!body_markings[zone]) body_markings[zone] = list() - body_markings[zone][set_name] = BM.get_default_color(features, pref_species) + body_markings[zone][set_name] = list(BM.get_default_color(features, pref_species), FALSE) return body_markings diff --git a/modular_skyrat/modules/customization/datums/elements/polychromic.dm b/modular_skyrat/modules/customization/datums/elements/polychromic.dm index d1add6ca9c0..f686553852a 100644 --- a/modular_skyrat/modules/customization/datums/elements/polychromic.dm +++ b/modular_skyrat/modules/customization/datums/elements/polychromic.dm @@ -17,7 +17,7 @@ var/obj/item/our_thing = target var/list/finished_list = list() for(var/read_color in 1 to colors.len) - finished_list += ReadRGB(get_alpha_padded_color(colors[read_color])) + finished_list += ReadRGB("[colors[read_color]]00") var/remaining_count = 3 - length(colors) if(remaining_count > 0) for(var/remaining_color in 1 to remaining_count) diff --git a/modular_skyrat/modules/customization/modules/mob/dead/new_player/sprite_accessories.dm b/modular_skyrat/modules/customization/modules/mob/dead/new_player/sprite_accessories.dm index 82cd98ebe74..98a369faed4 100644 --- a/modular_skyrat/modules/customization/modules/mob/dead/new_player/sprite_accessories.dm +++ b/modular_skyrat/modules/customization/modules/mob/dead/new_player/sprite_accessories.dm @@ -1,3 +1,5 @@ +GLOBAL_LIST_EMPTY(cached_mutant_icon_files) + /datum/sprite_accessory ///Unique key of an accessroy. All tails should have "tail", ears "ears" etc. var/key = null @@ -41,6 +43,8 @@ var/list/ckey_whitelist ///Whether this feature is genetic, and thus modifiable by DNA consoles var/genetic = FALSE + var/uses_emissives = FALSE + var/color_layer_names /datum/sprite_accessory/New() if(!default_color) @@ -55,6 +59,18 @@ factual = FALSE if(color_src == USE_MATRIXED_COLORS && default_color != DEFAULT_MATRIXED) default_color = DEFAULT_MATRIXED + if (color_src == USE_MATRIXED_COLORS) + color_layer_names = list() + if (!GLOB.cached_mutant_icon_files[icon]) + GLOB.cached_mutant_icon_files[icon] = icon_states(new /icon(icon)) + for (var/layer in relevent_layers) + var/layertext = layer == BODY_BEHIND_LAYER ? "BEHIND" : (layer == BODY_ADJ_LAYER ? "ADJ" : "FRONT") + if ("m_[key]_[icon_state]_[layertext]_primary" in GLOB.cached_mutant_icon_files[icon]) + color_layer_names["1"] = "primary" + if ("m_[key]_[icon_state]_[layertext]_secondary" in GLOB.cached_mutant_icon_files[icon]) + color_layer_names["2"] = "secondary" + if ("m_[key]_[icon_state]_[layertext]_tertiary" in GLOB.cached_mutant_icon_files[icon]) + color_layer_names["3"] = "tertiary" /datum/sprite_accessory/proc/is_hidden(mob/living/carbon/human/H, obj/item/bodypart/BP) return FALSE diff --git a/modular_skyrat/modules/customization/modules/mob/dead/new_player/sprite_accessories/ears.dm b/modular_skyrat/modules/customization/modules/mob/dead/new_player/sprite_accessories/ears.dm index 1f4087c88f3..6b299dbf23c 100644 --- a/modular_skyrat/modules/customization/modules/mob/dead/new_player/sprite_accessories/ears.dm +++ b/modular_skyrat/modules/customization/modules/mob/dead/new_player/sprite_accessories/ears.dm @@ -20,6 +20,7 @@ organ_type = /obj/item/organ/ears/mutant color_src = USE_MATRIXED_COLORS recommended_species = list(SPECIES_SYNTHMAMMAL, SPECIES_MAMMAL, SPECIES_HUMAN, SPECIES_SYNTHHUMAN, SPECIES_FELINE, SPECIES_HUMANOID, SPECIES_GHOUL) + uses_emissives = TRUE /datum/sprite_accessory/ears/mutant/none name = "None" diff --git a/modular_skyrat/modules/customization/modules/mob/dead/new_player/sprite_accessories/fluff.dm b/modular_skyrat/modules/customization/modules/mob/dead/new_player/sprite_accessories/fluff.dm index aa009dc3896..15181d45cd6 100644 --- a/modular_skyrat/modules/customization/modules/mob/dead/new_player/sprite_accessories/fluff.dm +++ b/modular_skyrat/modules/customization/modules/mob/dead/new_player/sprite_accessories/fluff.dm @@ -12,7 +12,7 @@ icon_state = "none" /datum/sprite_accessory/fluff/moth/is_hidden(mob/living/carbon/human/H, obj/item/bodypart/HD) - if(H.head && (H.head.flags_inv & HIDEHAIR) || (H.wear_mask && (H.wear_mask.flags_inv & HIDEHAIR)) || !HD || HD.status == BODYPART_ROBOTIC) + if((H.head && (H.head.flags_inv & HIDEHAIR)) || (H.wear_mask && (H.wear_mask.flags_inv & HIDEHAIR))) return TRUE return FALSE diff --git a/modular_skyrat/modules/customization/modules/mob/dead/new_player/sprite_accessories/snout.dm b/modular_skyrat/modules/customization/modules/mob/dead/new_player/sprite_accessories/snout.dm index 9f91a06b4a3..cd9695101b9 100644 --- a/modular_skyrat/modules/customization/modules/mob/dead/new_player/sprite_accessories/snout.dm +++ b/modular_skyrat/modules/customization/modules/mob/dead/new_player/sprite_accessories/snout.dm @@ -61,7 +61,7 @@ name = "Horn" icon_state = "rhino" extra = TRUE - extra = MUTCOLORS3 + extra_color_src = MUTCOLORS3 /datum/sprite_accessory/snouts/mammal/rodent name = "Rodent" @@ -201,7 +201,7 @@ name = "Horn (Top)" icon_state = "frhino" extra = TRUE - extra = MUTCOLORS3 + extra_color_src = MUTCOLORS3 /datum/sprite_accessory/snouts/mammal/fhusky name = "Husky (Top)" diff --git a/modular_skyrat/modules/customization/modules/mob/dead/new_player/sprite_accessories/synthliz.dm b/modular_skyrat/modules/customization/modules/mob/dead/new_player/sprite_accessories/synthliz.dm index fd2cedfcc76..55e43e77ed9 100644 --- a/modular_skyrat/modules/customization/modules/mob/dead/new_player/sprite_accessories/synthliz.dm +++ b/modular_skyrat/modules/customization/modules/mob/dead/new_player/sprite_accessories/synthliz.dm @@ -12,16 +12,21 @@ color_src = USE_MATRIXED_COLORS name = "Synthetic Lizard - Snout Under" icon_state = "synthliz_under" + extra = TRUE /datum/sprite_accessory/snouts/synthliz/synthliz_tert color_src = USE_MATRIXED_COLORS name = "Synthetic Lizard - Snout Tertiary" icon_state = "synthliz_tert" + extra = TRUE + extra_color_src = USE_MATRIXED_COLORS /datum/sprite_accessory/snouts/synthliz/synthliz_tertunder color_src = USE_MATRIXED_COLORS name = "Synthetic Lizard - Snout Tertiary Under" icon_state = "synthliz_tertunder" + extra = TRUE + extra_color_src = USE_MATRIXED_COLORS /datum/sprite_accessory/snouts/synthliz/synthliz_long color_src = USE_ONE_COLOR @@ -42,32 +47,44 @@ color_src = USE_MATRIXED_COLORS name = "Synthetic Lizard - Barless Under" icon_state = "synthliz_barless_under" + extra = TRUE + extra_color_src = USE_MATRIXED_COLORS /datum/sprite_accessory/snouts/synthliz/barlessover color_src = USE_MATRIXED_COLORS name = "Synthetic Lizard - Barless Over" icon_state = "synthliz_barless_over" + extra = TRUE + extra_color_src = USE_MATRIXED_COLORS /datum/sprite_accessory/snouts/synthliz/barlesstert color_src = USE_MATRIXED_COLORS name = "Synthetic Lizard - Barless Tertiary" icon_state = "synthliz_barless_tert" + extra = TRUE + extra_color_src = USE_MATRIXED_COLORS /datum/sprite_accessory/snouts/synthliz/barlesstertunder color_src = USE_MATRIXED_COLORS name = "Synthetic Lizard - Barless Tertiary Under" icon_state = "synthliz_barless_tertunder" + extra = TRUE + extra_color_src = USE_MATRIXED_COLORS //Protogen snoot /datum/sprite_accessory/snouts/synthliz/protogen color_src = USE_MATRIXED_COLORS name = "Protogen" icon_state = "protogen" + extra = TRUE + extra_color_src = USE_MATRIXED_COLORS /datum/sprite_accessory/snouts/synthliz/protogen_withbolt color_src = USE_MATRIXED_COLORS name = "Protogen - With Bolt" icon_state = "protogen_withbolt" + extra = TRUE + extra_color_src = USE_MATRIXED_COLORS //Synth tails diff --git a/modular_skyrat/modules/customization/modules/mob/dead/new_player/sprite_accessories/tails.dm b/modular_skyrat/modules/customization/modules/mob/dead/new_player/sprite_accessories/tails.dm index 65142eca26c..8748e78ed52 100644 --- a/modular_skyrat/modules/customization/modules/mob/dead/new_player/sprite_accessories/tails.dm +++ b/modular_skyrat/modules/customization/modules/mob/dead/new_player/sprite_accessories/tails.dm @@ -38,9 +38,9 @@ if(HS.hardsuit_tail_colors) //Currently this way, when I have more time I'll write a hex -> matrix converter to pre-bake them instead var/list/finished_list = list() - finished_list += ReadRGB(get_alpha_padded_color(HS.hardsuit_tail_colors[1])) - finished_list += ReadRGB(get_alpha_padded_color(HS.hardsuit_tail_colors[2])) - finished_list += ReadRGB(get_alpha_padded_color(HS.hardsuit_tail_colors[3])) + finished_list += ReadRGB("[HS.hardsuit_tail_colors[1]]00") + finished_list += ReadRGB("[HS.hardsuit_tail_colors[2]]00") + finished_list += ReadRGB("[HS.hardsuit_tail_colors[3]]00") finished_list += list(0,0,0,255) for(var/index in 1 to finished_list.len) finished_list[index] /= 255 diff --git a/modular_skyrat/modules/customization/modules/mob/dead/new_player/sprite_accessories/wings.dm b/modular_skyrat/modules/customization/modules/mob/dead/new_player/sprite_accessories/wings.dm index 6064a23c4a8..234adf2031a 100644 --- a/modular_skyrat/modules/customization/modules/mob/dead/new_player/sprite_accessories/wings.dm +++ b/modular_skyrat/modules/customization/modules/mob/dead/new_player/sprite_accessories/wings.dm @@ -130,6 +130,9 @@ default_color = DEFAULT_PRIMARY recommended_species = list(SPECIES_SYNTHMAMMAL, SPECIES_MAMMAL, SPECIES_LIZARD, SPECIES_INSECT, SPECIES_SYNTHLIZ) relevent_layers = list(BODY_BEHIND_LAYER, BODY_FRONT_LAYER) + dimension_x = 46 + dimension_y = 34 + center = TRUE /datum/sprite_accessory/wings/mammal/bat //TODO: port my sprite from hyper for this one name = "Bat" @@ -217,8 +220,14 @@ icon = 'modular_skyrat/master_files/icons/mob/sprite_accessory/wings.dmi' name = "Low wings" icon_state = "low" + dimension_x = 46 + dimension_y = 34 + center = TRUE /datum/sprite_accessory/wings/low_wings_top icon = 'modular_skyrat/master_files/icons/mob/sprite_accessory/wings.dmi' name = "Low wings (Top)" icon_state = "low_top" + dimension_x = 46 + dimension_y = 34 + center = TRUE diff --git a/modular_skyrat/modules/customization/modules/mob/living/carbon/human/human_defines.dm b/modular_skyrat/modules/customization/modules/mob/living/carbon/human/human_defines.dm index 6d856fabdd7..3df8b06f1c1 100644 --- a/modular_skyrat/modules/customization/modules/mob/living/carbon/human/human_defines.dm +++ b/modular_skyrat/modules/customization/modules/mob/living/carbon/human/human_defines.dm @@ -11,3 +11,5 @@ var/try_hide_mutant_parts = FALSE ///The Examine Panel TGUI. var/datum/examine_panel/tgui = new() //create the datum + //Whether or not the human has emissive eyes + var/emissive_eyes diff --git a/modular_skyrat/modules/customization/modules/mob/living/carbon/human/species.dm b/modular_skyrat/modules/customization/modules/mob/living/carbon/human/species.dm index 83071dc313b..1f3eec3f016 100644 --- a/modular_skyrat/modules/customization/modules/mob/living/carbon/human/species.dm +++ b/modular_skyrat/modules/customization/modules/mob/living/carbon/human/species.dm @@ -90,7 +90,6 @@ GLOBAL_LIST_EMPTY(customizable_races) H.remove_overlay(BODY_FRONT_LAYER) var/g = (H.body_type == FEMALE) ? "f" : "m" - for(var/bodypart in bodyparts_to_add) var/datum/sprite_accessory/S = bodypart var/key = S.key @@ -103,11 +102,15 @@ GLOBAL_LIST_EMPTY(customizable_races) if(!override_color && S.special_colorize) override_color = S.get_special_render_colour(H, render_state) + var/color_layer_list = S.color_layer_names if(S.special_icon_case) icon_to_use = S.get_special_icon(H, render_state) else icon_to_use = S.icon + if (S.special_render_case) + color_layer_list = list("1" = "primary", "2" = "secondary", "3" = "tertiary") + if(S.special_x_dimension) x_shift = S.get_special_x_dimension(H, render_state) else @@ -120,10 +123,13 @@ GLOBAL_LIST_EMPTY(customizable_races) for(var/layer in S.relevent_layers) var/layertext = mutant_bodyparts_layertext(layer) - + var/list/mutable_appearance/accessories var/mutable_appearance/accessory_overlay = mutable_appearance(icon_to_use, layer = -layer) accessory_overlay.icon_state = "[render_state]_[layertext]" + if (S.color_src == USE_MATRIXED_COLORS && color_layer_list) + accessory_overlay.icon_state = "[render_state]_[layertext]_primary" + accessories = list() if(S.center) accessory_overlay = center_image(accessory_overlay, x_shift, S.dimension_y) @@ -141,15 +147,20 @@ GLOBAL_LIST_EMPTY(customizable_races) accessory_overlay.color = mutant_bodyparts[key][MUTANT_INDEX_COLOR_LIST][1] if(USE_MATRIXED_COLORS) var/list/color_list = mutant_bodyparts[key][MUTANT_INDEX_COLOR_LIST] - var/alpha_value = specific_alpha //this is here and not with the alpha setting code below as setting the alpha on a matrix color mutable appearance breaks it (at least in this case) - var/list/finished_list = list() - finished_list += ReadRGB("[get_alpha_padded_color(color_list[1])]") - finished_list += ReadRGB("[get_alpha_padded_color(color_list[2])]") - finished_list += ReadRGB("[get_alpha_padded_color(color_list[3])]") - finished_list += list(0,0,0,alpha_value) - for(var/index in 1 to finished_list.len) - finished_list[index] /= 255 - accessory_overlay.color = finished_list + for (var/n in color_layer_list) + var/num = text2num(n) + var/mutable_appearance/matrixed_acce = mutable_appearance(icon_to_use, layer = -layer) + matrixed_acce.icon_state = "[render_state]_[layertext]_[color_layer_list[n]]" + matrixed_acce.color = color_list[num] + matrixed_acce.alpha = specific_alpha + if (S.center) + matrixed_acce = center_image(matrixed_acce, x_shift, S.dimension_y) + accessories += matrixed_acce + if (mutant_bodyparts[key][MUTANT_INDEX_EMISSIVE_LIST] && mutant_bodyparts[key][MUTANT_INDEX_EMISSIVE_LIST][num]) + var/mutable_appearance/emissive_overlay = emissive_appearance_copy(matrixed_acce) + //if (S.center) + // emissive_overlay = center_image(emissive_overlay, x_shift, S.dimension_y) + accessories += emissive_overlay if(MUTCOLORS) if(fixed_mut_color) accessory_overlay.color = fixed_mut_color @@ -168,7 +179,16 @@ GLOBAL_LIST_EMPTY(customizable_races) accessory_overlay.color = H.eye_color else accessory_overlay.color = override_color - standing += accessory_overlay + if (accessories) + for (var/acces in accessories) + standing += acces + else + standing += accessory_overlay + if (mutant_bodyparts[key][MUTANT_INDEX_EMISSIVE_LIST] && mutant_bodyparts[key][MUTANT_INDEX_EMISSIVE_LIST][1]) + var/mutable_appearance/emissive_overlay = emissive_appearance_copy(accessory_overlay) + //if (S.center) + // emissive_overlay = center_image(emissive_overlay, x_shift, S.dimension_y) + standing += emissive_overlay if(S.hasinner) var/mutable_appearance/inner_accessory_overlay = mutable_appearance(S.icon, layer = -layer) @@ -444,17 +464,25 @@ GLOBAL_LIST_EMPTY(customizable_races) if(!(NOEYESPRITES in species_traits)) var/obj/item/organ/eyes/E = species_human.getorganslot(ORGAN_SLOT_EYES) var/mutable_appearance/eye_overlay + var/mutable_appearance/eye_emissive var/eye_icon = eyes_icon || 'icons/mob/human_face.dmi' if(!E) eye_overlay = mutable_appearance(eye_icon, "eyes_missing", -BODY_LAYER) else eye_overlay = mutable_appearance(eye_icon, E.eye_icon_state, -BODY_LAYER) + if (E.is_emissive) + eye_emissive = emissive_appearance_copy(eye_overlay) if((EYECOLOR in species_traits) && E) eye_overlay.color = species_human.eye_color if(OFFSET_FACE in species_human.dna.species.offset_features) eye_overlay.pixel_x += species_human.dna.species.offset_features[OFFSET_FACE][1] eye_overlay.pixel_y += species_human.dna.species.offset_features[OFFSET_FACE][2] + if (eye_emissive) + eye_emissive.pixel_x += species_human.dna.species.offset_features[OFFSET_FACE][1] + eye_emissive.pixel_y += species_human.dna.species.offset_features[OFFSET_FACE][2] standing += eye_overlay + if (eye_emissive) + standing += eye_emissive //Underwear, Undershirts & Socks if(!(NO_UNDERWEAR in species_traits)) diff --git a/modular_skyrat/modules/customization/modules/surgery/bodyparts/_bodyparts.dm b/modular_skyrat/modules/customization/modules/surgery/bodyparts/_bodyparts.dm index 02247450f47..64e3a9b4ad5 100644 --- a/modular_skyrat/modules/customization/modules/surgery/bodyparts/_bodyparts.dm +++ b/modular_skyrat/modules/customization/modules/surgery/bodyparts/_bodyparts.dm @@ -67,10 +67,10 @@ aux = image(limb.icon, "[aux_zone]", -aux_layer, image_dir) . += aux if(blocks_emissive) - var/mutable_appearance/limb_em_block = mutable_appearance(limb.icon, limb.icon_state, plane = EMISSIVE_PLANE, appearance_flags = KEEP_APART) + var/mutable_appearance/limb_em_block = mutable_appearance(limb.icon, limb.icon_state, -BODYPARTS_LAYER, plane = EMISSIVE_PLANE, appearance_flags = KEEP_APART) limb_em_block.dir = image_dir limb_em_block.color = GLOB.em_block_color - limb.overlays += limb_em_block + . += limb_em_block return var/draw_color @@ -85,6 +85,19 @@ return var/mob/living/carbon/human/H = owner + + if(blocks_emissive) + var/mutable_appearance/limb_em_block = mutable_appearance(limb.icon, limb.icon_state, -BODYPARTS_LAYER, plane = EMISSIVE_PLANE, appearance_flags = KEEP_APART) + limb_em_block.dir = image_dir + limb_em_block.color = GLOB.em_block_color + . += limb_em_block + + if(aux_zone) + var/mutable_appearance/aux_em_block = mutable_appearance(aux.icon, aux.icon_state, -BODYPARTS_LAYER, plane = EMISSIVE_PLANE, appearance_flags = KEEP_APART) + aux_em_block.dir = image_dir + aux_em_block.color = GLOB.em_block_color + . += aux_em_block + //set specific alpha before setting the markings alpha if (alpha != 255) for (var/ov in .) @@ -97,7 +110,8 @@ for(var/key in H.dna.species.body_markings[body_zone]) var/datum/body_marking/BM = GLOB.body_markings[key] - + if (!BM) + continue var/render_limb_string = body_zone switch(body_zone) if(BODY_ZONE_R_LEG, BODY_ZONE_L_LEG) @@ -108,13 +122,19 @@ var/gendaar = (H.body_type == FEMALE) ? "f" : "m" render_limb_string = "[render_limb_string]_[gendaar]" - var/mutable_appearance/accessory_overlay = mutable_appearance(BM.icon, "[BM.icon_state]_[render_limb_string]", -BODYPARTS_LAYER) + var/mutable_appearance/accessory_overlay + var/mutable_appearance/emissive + accessory_overlay = mutable_appearance(BM.icon, "[BM.icon_state]_[render_limb_string]", -BODYPARTS_LAYER) + accessory_overlay.alpha = H.dna.species.markings_alpha + if (H.dna.species.body_markings[body_zone][key][2]) + emissive = emissive_appearance_copy(accessory_overlay) if(override_color) accessory_overlay.color = override_color else - accessory_overlay.color = H.dna.species.body_markings[body_zone][key] - accessory_overlay.alpha = H.dna.species.markings_alpha + accessory_overlay.color = H.dna.species.body_markings[body_zone][key][1] . += accessory_overlay + if (emissive) + . += emissive if(aux_zone) for(var/key in H.dna.species.body_markings[aux_zone]) @@ -122,25 +142,19 @@ var/render_limb_string = aux_zone - var/mutable_appearance/accessory_overlay = mutable_appearance(BM.icon, "[BM.icon_state]_[render_limb_string]", -aux_layer) + var/mutable_appearance/emissive + var/mutable_appearance/accessory_overlay + accessory_overlay = mutable_appearance(BM.icon, "[BM.icon_state]_[render_limb_string]", -aux_layer) + accessory_overlay.alpha = H.dna.species.markings_alpha + if (H.dna.species.body_markings[aux_zone][key][2]) + emissive = emissive_appearance_copy(accessory_overlay) if(override_color) accessory_overlay.color = override_color else - accessory_overlay.color = H.dna.species.body_markings[aux_zone][key] - accessory_overlay.alpha = H.dna.species.markings_alpha + accessory_overlay.color = H.dna.species.body_markings[aux_zone][key][1] . += accessory_overlay - - if(blocks_emissive) - var/mutable_appearance/limb_em_block = mutable_appearance(limb.icon, limb.icon_state, plane = EMISSIVE_PLANE, appearance_flags = KEEP_APART) - limb_em_block.dir = image_dir - limb_em_block.color = GLOB.em_block_color - limb.overlays += limb_em_block - - if(aux_zone) - var/mutable_appearance/aux_em_block = mutable_appearance(aux.icon, aux.icon_state, plane = EMISSIVE_PLANE, appearance_flags = KEEP_APART) - aux_em_block.dir = image_dir - aux_em_block.color = GLOB.em_block_color - + if (emissive) + . += emissive if(!draw_external_organs) return diff --git a/modular_skyrat/modules/emotes/code/additionalemotes/turf_emote.dm b/modular_skyrat/modules/emotes/code/additionalemotes/turf_emote.dm index 371eb97420e..4c5b2b4d3a2 100644 --- a/modular_skyrat/modules/emotes/code/additionalemotes/turf_emote.dm +++ b/modular_skyrat/modules/emotes/code/additionalemotes/turf_emote.dm @@ -133,11 +133,11 @@ var/current_turf switch(sprite_type.color_src) if(USE_MATRIXED_COLORS) - finished_list += ReadRGB("[get_alpha_padded_color(color_list[1])]") - finished_list += ReadRGB("[get_alpha_padded_color(color_list[2])]") - finished_list += ReadRGB("[get_alpha_padded_color(color_list[3])]") + finished_list += ReadRGB("[color_list[1]]00") + finished_list += ReadRGB("[color_list[2]]00") + finished_list += ReadRGB("[color_list[3]]00") if(USE_ONE_COLOR) - var/padded_string = get_alpha_padded_color(color_list[1]) + var/padded_string = "[color_list[1]]00" finished_list += ReadRGB(padded_string) finished_list += ReadRGB(padded_string) finished_list += ReadRGB(padded_string) diff --git a/tgstation.dme b/tgstation.dme index 81c1a3da61f..d6043364841 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -287,7 +287,6 @@ #include "code\__HELPERS\sorts\InsertSort.dm" #include "code\__HELPERS\sorts\MergeSort.dm" #include "code\__HELPERS\sorts\TimSort.dm" -#include "code\__HELPERS\~skyrat_helpers\colors.dm" #include "code\__HELPERS\~skyrat_helpers\is_helpers.dm" #include "code\__HELPERS\~skyrat_helpers\level_traits.dm" #include "code\__HELPERS\~skyrat_helpers\logging.dm" diff --git a/tgui/packages/tgui/interfaces/PreferencesMenu/LimbsPage.tsx b/tgui/packages/tgui/interfaces/PreferencesMenu/LimbsPage.tsx index 01ec79e64b1..848043bd313 100644 --- a/tgui/packages/tgui/interfaces/PreferencesMenu/LimbsPage.tsx +++ b/tgui/packages/tgui/interfaces/PreferencesMenu/LimbsPage.tsx @@ -29,6 +29,15 @@ export const Markings = (props, context) => { /> + + +