diff --git a/code/__HELPERS/global_lists.dm b/code/__HELPERS/global_lists.dm index 83294d26180..84299fc3021 100644 --- a/code/__HELPERS/global_lists.dm +++ b/code/__HELPERS/global_lists.dm @@ -2,37 +2,6 @@ /////Initial Building///// ////////////////////////// -/proc/init_sprite_accessories() - //hair - init_sprite_accessory_subtypes(/datum/sprite_accessory/hair, GLOB.hairstyles_list, GLOB.hairstyles_male_list, GLOB.hairstyles_female_list) - //facial hair - init_sprite_accessory_subtypes(/datum/sprite_accessory/facial_hair, GLOB.facial_hairstyles_list, GLOB.facial_hairstyles_male_list, GLOB.facial_hairstyles_female_list) - //underwear - init_sprite_accessory_subtypes(/datum/sprite_accessory/underwear, GLOB.underwear_list, GLOB.underwear_m, GLOB.underwear_f) - //undershirt - init_sprite_accessory_subtypes(/datum/sprite_accessory/undershirt, GLOB.undershirt_list, GLOB.undershirt_m, GLOB.undershirt_f) - //socks - init_sprite_accessory_subtypes(/datum/sprite_accessory/socks, GLOB.socks_list) - //bodypart accessories (blizzard intensifies) - init_sprite_accessory_subtypes(/datum/sprite_accessory/body_markings, GLOB.body_markings_list) - init_sprite_accessory_subtypes(/datum/sprite_accessory/tails/human, GLOB.tails_list_human, add_blank = TRUE) - init_sprite_accessory_subtypes(/datum/sprite_accessory/tails/lizard, GLOB.tails_list_lizard, add_blank = TRUE) - init_sprite_accessory_subtypes(/datum/sprite_accessory/tails/monkey, GLOB.tails_list_monkey, add_blank = FALSE) - init_sprite_accessory_subtypes(/datum/sprite_accessory/snouts, GLOB.snouts_list) - init_sprite_accessory_subtypes(/datum/sprite_accessory/horns,GLOB.horns_list) - init_sprite_accessory_subtypes(/datum/sprite_accessory/ears, GLOB.ears_list) - init_sprite_accessory_subtypes(/datum/sprite_accessory/wings, GLOB.wings_list) - init_sprite_accessory_subtypes(/datum/sprite_accessory/wings_open, GLOB.wings_open_list) - init_sprite_accessory_subtypes(/datum/sprite_accessory/frills, GLOB.frills_list) - init_sprite_accessory_subtypes(/datum/sprite_accessory/spines, GLOB.spines_list) - init_sprite_accessory_subtypes(/datum/sprite_accessory/tail_spines, GLOB.tail_spines_list) - init_sprite_accessory_subtypes(/datum/sprite_accessory/legs, GLOB.legs_list) - init_sprite_accessory_subtypes(/datum/sprite_accessory/caps, GLOB.caps_list) - init_sprite_accessory_subtypes(/datum/sprite_accessory/moth_wings, GLOB.moth_wings_list) - init_sprite_accessory_subtypes(/datum/sprite_accessory/moth_antennae, GLOB.moth_antennae_list) - init_sprite_accessory_subtypes(/datum/sprite_accessory/moth_markings, GLOB.moth_markings_list) - init_sprite_accessory_subtypes(/datum/sprite_accessory/pod_hair, GLOB.pod_hair_list) - /// Inits GLOB.species_list. Not using GLOBAL_LIST_INIT b/c it depends on GLOB.string_lists /proc/init_species_list() for(var/species_path in subtypesof(/datum/species)) @@ -48,21 +17,10 @@ sort_list(surgeries, GLOBAL_PROC_REF(cmp_typepaths_asc)) return surgeries -/// Hair Gradients - Initialise all /datum/sprite_accessory/hair_gradient into an list indexed by gradient-style name -/proc/init_hair_gradients() - for(var/path in subtypesof(/datum/sprite_accessory/gradient)) - var/datum/sprite_accessory/gradient/gradient = new path() - if(gradient.gradient_category & GRADIENT_APPLIES_TO_HAIR) - GLOB.hair_gradients_list[gradient.name] = gradient - if(gradient.gradient_category & GRADIENT_APPLIES_TO_FACIAL_HAIR) - GLOB.facial_hair_gradients_list[gradient.name] = gradient - /// Legacy procs that really should be replaced with proper _INIT macros /proc/make_datum_reference_lists() // I tried to eliminate this proc but I couldn't untangle their init-order interdependencies -Dominion/Cyberboss - init_sprite_accessories() init_species_list() - init_hair_gradients() init_keybindings() GLOB.emote_list = init_emote_list() // WHY DOES THIS NEED TO GO HERE? IT JUST INITS DATUMS init_crafting_recipes() diff --git a/code/__HELPERS/mobs.dm b/code/__HELPERS/mobs.dm index 68965248115..9bc3beb3a1b 100644 --- a/code/__HELPERS/mobs.dm +++ b/code/__HELPERS/mobs.dm @@ -29,31 +29,31 @@ return COLOR_BLACK /proc/random_underwear(gender) - if(!GLOB.underwear_list.len) - init_sprite_accessory_subtypes(/datum/sprite_accessory/underwear, GLOB.underwear_list, GLOB.underwear_m, GLOB.underwear_f) + if(length(SSaccessories.underwear_list) == 0) + CRASH("No underwear to choose from!") switch(gender) if(MALE) - return pick(GLOB.underwear_m) + return pick(SSaccessories.underwear_m) if(FEMALE) - return pick(GLOB.underwear_f) + return pick(SSaccessories.underwear_f) else - return pick(GLOB.underwear_list) + return pick(SSaccessories.underwear_list) /proc/random_undershirt(gender) - if(!GLOB.undershirt_list.len) - init_sprite_accessory_subtypes(/datum/sprite_accessory/undershirt, GLOB.undershirt_list, GLOB.undershirt_m, GLOB.undershirt_f) + if(length(SSaccessories.undershirt_list) == 0) + CRASH("No undershirts to choose from!") switch(gender) if(MALE) - return pick(GLOB.undershirt_m) + return pick(SSaccessories.undershirt_m) if(FEMALE) - return pick(GLOB.undershirt_f) + return pick(SSaccessories.undershirt_f) else - return pick(GLOB.undershirt_list) + return pick(SSaccessories.undershirt_list) /proc/random_socks() - if(!GLOB.socks_list.len) - init_sprite_accessory_subtypes(/datum/sprite_accessory/socks, GLOB.socks_list) - return pick(GLOB.socks_list) + if(length(SSaccessories.socks_list) == 0) + CRASH("No socks to choose from!") + return pick(SSaccessories.socks_list) /proc/random_backpack() return pick(GLOB.backpacklist) @@ -61,20 +61,20 @@ /proc/random_hairstyle(gender) switch(gender) if(MALE) - return pick(GLOB.hairstyles_male_list) + return pick(SSaccessories.hairstyles_male_list) if(FEMALE) - return pick(GLOB.hairstyles_female_list) + return pick(SSaccessories.hairstyles_female_list) else - return pick(GLOB.hairstyles_list) + return pick(SSaccessories.hairstyles_list) /proc/random_facial_hairstyle(gender) switch(gender) if(MALE) - return pick(GLOB.facial_hairstyles_male_list) + return pick(SSaccessories.facial_hairstyles_male_list) if(FEMALE) - return pick(GLOB.facial_hairstyles_female_list) + return pick(SSaccessories.facial_hairstyles_female_list) else - return pick(GLOB.facial_hairstyles_list) + return pick(SSaccessories.facial_hairstyles_list) /proc/random_unique_name(gender, attempts_to_find_unique_name=10) for(var/i in 1 to attempts_to_find_unique_name) diff --git a/code/_globalvars/lists/flavor_misc.dm b/code/_globalvars/lists/flavor_misc.dm index ce4d8479289..e7c6368d4d5 100644 --- a/code/_globalvars/lists/flavor_misc.dm +++ b/code/_globalvars/lists/flavor_misc.dm @@ -1,45 +1,3 @@ -//Preferences stuff - //Hairstyles -GLOBAL_LIST_EMPTY(hairstyles_list) //stores /datum/sprite_accessory/hair indexed by name -GLOBAL_LIST_EMPTY(hairstyles_male_list) //stores only hair names -GLOBAL_LIST_EMPTY(hairstyles_female_list) //stores only hair names -GLOBAL_LIST_EMPTY(facial_hairstyles_list) //stores /datum/sprite_accessory/facial_hair indexed by name -GLOBAL_LIST_EMPTY(facial_hairstyles_male_list) //stores only hair names -GLOBAL_LIST_EMPTY(facial_hairstyles_female_list) //stores only hair names -GLOBAL_LIST_EMPTY(hair_gradients_list) //stores /datum/sprite_accessory/hair_gradient indexed by name -GLOBAL_LIST_EMPTY(facial_hair_gradients_list) //stores /datum/sprite_accessory/facial_hair_gradient indexed by name - //Underwear -GLOBAL_LIST_EMPTY(underwear_list) //stores /datum/sprite_accessory/underwear indexed by name -GLOBAL_LIST_EMPTY(underwear_m) //stores only underwear name -GLOBAL_LIST_EMPTY(underwear_f) //stores only underwear name - //Undershirts -GLOBAL_LIST_EMPTY(undershirt_list) //stores /datum/sprite_accessory/undershirt indexed by name -GLOBAL_LIST_EMPTY(undershirt_m) //stores only undershirt name -GLOBAL_LIST_EMPTY(undershirt_f) //stores only undershirt name - //Socks -GLOBAL_LIST_EMPTY(socks_list) //stores /datum/sprite_accessory/socks indexed by name - //Lizard Bits (all datum lists indexed by name) -GLOBAL_LIST_EMPTY(body_markings_list) -GLOBAL_LIST_EMPTY(snouts_list) -GLOBAL_LIST_EMPTY(horns_list) -GLOBAL_LIST_EMPTY(frills_list) -GLOBAL_LIST_EMPTY(spines_list) -GLOBAL_LIST_EMPTY(tail_spines_list) -GLOBAL_LIST_EMPTY(legs_list) - - //Mutant Human bits -GLOBAL_LIST_EMPTY(tails_list_human) -GLOBAL_LIST_EMPTY(tails_list_lizard) -GLOBAL_LIST_EMPTY(tails_list_monkey) -GLOBAL_LIST_EMPTY(ears_list) -GLOBAL_LIST_EMPTY(wings_list) -GLOBAL_LIST_EMPTY(wings_open_list) -GLOBAL_LIST_EMPTY(moth_wings_list) -GLOBAL_LIST_EMPTY(moth_antennae_list) -GLOBAL_LIST_EMPTY(moth_markings_list) -GLOBAL_LIST_EMPTY(caps_list) -GLOBAL_LIST_EMPTY(pod_hair_list) - GLOBAL_LIST_INIT(color_list_ethereal, list( "Blue" = "#3399ff", "Bright Yellow" = "#ffff99", diff --git a/code/controllers/subsystem/sprite_accessories.dm b/code/controllers/subsystem/sprite_accessories.dm new file mode 100644 index 00000000000..ec5934ac8e8 --- /dev/null +++ b/code/controllers/subsystem/sprite_accessories.dm @@ -0,0 +1,154 @@ +/// The non gender specific list that we get from init_sprite_accessory_subtypes() +#define DEFAULT_SPRITE_LIST "default_sprites" +/// The male specific list that we get from init_sprite_accessory_subtypes() +#define MALE_SPRITE_LIST "male_sprites" +/// The female specific list that we get from init_sprite_accessory_subtypes() +#define FEMALE_SPRITE_LIST "female_sprites" + +/// subsystem that just holds lists of sprite accessories for accession in generating said sprites. +/// A sprite accessory is something that we add to a human sprite to make them look different. This is hair, facial hair, underwear, mutant bits, etc. +SUBSYSTEM_DEF(accessories) // just 'accessories' for brevity + name = "Sprite Accessories" + flags = SS_NO_FIRE | SS_NO_INIT + + //Hairstyles + var/list/hairstyles_list //! stores /datum/sprite_accessory/hair indexed by name + var/list/hairstyles_male_list //! stores only hair names + var/list/hairstyles_female_list //! stores only hair names + var/list/facial_hairstyles_list //! stores /datum/sprite_accessory/facial_hair indexed by name + var/list/facial_hairstyles_male_list //! stores only hair names + var/list/facial_hairstyles_female_list //! stores only hair names + var/list/hair_gradients_list //! stores /datum/sprite_accessory/hair_gradient indexed by name + var/list/facial_hair_gradients_list //! stores /datum/sprite_accessory/facial_hair_gradient indexed by name + + //Underwear + var/list/underwear_list //! stores /datum/sprite_accessory/underwear indexed by name + var/list/underwear_m //! stores only underwear name + var/list/underwear_f //! stores only underwear name + + //Undershirts + var/list/undershirt_list //! stores /datum/sprite_accessory/undershirt indexed by name + var/list/undershirt_m //! stores only undershirt name + var/list/undershirt_f //! stores only undershirt name + + //Socks + var/list/socks_list //! stores /datum/sprite_accessory/socks indexed by name + + //Lizard Bits (all datum lists indexed by name) + var/list/body_markings_list + var/list/snouts_list + var/list/horns_list + var/list/frills_list + var/list/spines_list + var/list/legs_list + var/list/tail_spines_list + + //Mutant Human bits + var/list/tails_list_human + var/list/tails_list_lizard + var/list/tails_list_monkey + var/list/ears_list + var/list/wings_list + var/list/wings_open_list + var/list/moth_wings_list + var/list/moth_antennae_list + var/list/moth_markings_list + var/list/caps_list + var/list/pod_hair_list + +/datum/controller/subsystem/accessories/PreInit() // this stuff NEEDS to be set up before GLOB for preferences and stuff to work so this must go here. sorry + setup_lists() + init_hair_gradients() + +/// Sets up all of the lists for later utilization in the round and building sprites. +/// In an ideal world we could tack everything that just needed `DEFAULT_SPRITE_LIST` into static variables on the top, but due to the initialization order +/// where this subsystem will initialize BEFORE statics, it's just not feasible since this all needs to be ready for actual subsystems to use. +/// Sorry. +/datum/controller/subsystem/accessories/proc/setup_lists() + var/hair_lists = init_sprite_accessory_subtypes(/datum/sprite_accessory/hair) + hairstyles_list = hair_lists[DEFAULT_SPRITE_LIST] + hairstyles_male_list = hair_lists[MALE_SPRITE_LIST] + hairstyles_female_list = hair_lists[FEMALE_SPRITE_LIST] + + var/facial_hair_lists = init_sprite_accessory_subtypes(/datum/sprite_accessory/facial_hair) + facial_hairstyles_list = facial_hair_lists[DEFAULT_SPRITE_LIST] + facial_hairstyles_male_list = facial_hair_lists[MALE_SPRITE_LIST] + facial_hairstyles_female_list = facial_hair_lists[FEMALE_SPRITE_LIST] + + var/underwear_lists = init_sprite_accessory_subtypes(/datum/sprite_accessory/underwear) + underwear_list = underwear_lists[DEFAULT_SPRITE_LIST] + underwear_m = underwear_lists[MALE_SPRITE_LIST] + underwear_f = underwear_lists[FEMALE_SPRITE_LIST] + + var/undershirt_lists = init_sprite_accessory_subtypes(/datum/sprite_accessory/undershirt) + undershirt_list = undershirt_lists[DEFAULT_SPRITE_LIST] + undershirt_m = undershirt_lists[MALE_SPRITE_LIST] + undershirt_f = undershirt_lists[FEMALE_SPRITE_LIST] + + socks_list = init_sprite_accessory_subtypes(/datum/sprite_accessory/socks)[DEFAULT_SPRITE_LIST] + + body_markings_list = init_sprite_accessory_subtypes(/datum/sprite_accessory/body_markings)[DEFAULT_SPRITE_LIST] + tails_list_human = init_sprite_accessory_subtypes(/datum/sprite_accessory/tails/human, add_blank = TRUE)[DEFAULT_SPRITE_LIST] + tails_list_lizard = init_sprite_accessory_subtypes(/datum/sprite_accessory/tails/lizard, add_blank = TRUE)[DEFAULT_SPRITE_LIST] + tails_list_monkey = init_sprite_accessory_subtypes(/datum/sprite_accessory/tails/monkey, add_blank = TRUE)[DEFAULT_SPRITE_LIST] + snouts_list = init_sprite_accessory_subtypes(/datum/sprite_accessory/snouts)[DEFAULT_SPRITE_LIST] + horns_list = init_sprite_accessory_subtypes(/datum/sprite_accessory/horns)[DEFAULT_SPRITE_LIST] + ears_list = init_sprite_accessory_subtypes(/datum/sprite_accessory/ears)[DEFAULT_SPRITE_LIST] + wings_list = init_sprite_accessory_subtypes(/datum/sprite_accessory/wings)[DEFAULT_SPRITE_LIST] + wings_open_list = init_sprite_accessory_subtypes(/datum/sprite_accessory/wings_open)[DEFAULT_SPRITE_LIST] + frills_list = init_sprite_accessory_subtypes(/datum/sprite_accessory/frills)[DEFAULT_SPRITE_LIST] + spines_list = init_sprite_accessory_subtypes(/datum/sprite_accessory/spines)[DEFAULT_SPRITE_LIST] + tail_spines_list = init_sprite_accessory_subtypes(/datum/sprite_accessory/tail_spines)[DEFAULT_SPRITE_LIST] + legs_list = init_sprite_accessory_subtypes(/datum/sprite_accessory/legs)[DEFAULT_SPRITE_LIST] + caps_list = init_sprite_accessory_subtypes(/datum/sprite_accessory/caps)[DEFAULT_SPRITE_LIST] + moth_wings_list = init_sprite_accessory_subtypes(/datum/sprite_accessory/moth_wings)[DEFAULT_SPRITE_LIST] + moth_antennae_list = init_sprite_accessory_subtypes(/datum/sprite_accessory/moth_antennae)[DEFAULT_SPRITE_LIST] + moth_markings_list = init_sprite_accessory_subtypes(/datum/sprite_accessory/moth_markings)[DEFAULT_SPRITE_LIST] + pod_hair_list = init_sprite_accessory_subtypes(/datum/sprite_accessory/pod_hair)[DEFAULT_SPRITE_LIST] + +/// This proc just intializes all /datum/sprite_accessory/hair_gradient into an list indexed by gradient-style name +/datum/controller/subsystem/accessories/proc/init_hair_gradients() + hair_gradients_list = list() + facial_hair_gradients_list = list() + for(var/path in subtypesof(/datum/sprite_accessory/gradient)) + var/datum/sprite_accessory/gradient/gradient = new path + if(gradient.gradient_category & GRADIENT_APPLIES_TO_HAIR) + hair_gradients_list[gradient.name] = gradient + if(gradient.gradient_category & GRADIENT_APPLIES_TO_FACIAL_HAIR) + facial_hair_gradients_list[gradient.name] = gradient + +/// This reads the applicable sprite accessory datum's subtypes and adds it to the subsystem's list of sprite accessories. +/// The boolean `add_blank` argument just adds a "None" option to the list of sprite accessories, like if a felinid doesn't want a tail or something, typically good for gated-off things. +/datum/controller/subsystem/accessories/proc/init_sprite_accessory_subtypes(prototype, add_blank = FALSE) + RETURN_TYPE(/list) + var/returnable_list = list( + DEFAULT_SPRITE_LIST = list(), + MALE_SPRITE_LIST = list(), + FEMALE_SPRITE_LIST = list(), + ) + + for(var/path in subtypesof(prototype)) + var/datum/sprite_accessory/accessory = new path + + if(accessory.icon_state) + returnable_list[DEFAULT_SPRITE_LIST][accessory.name] = accessory + else + returnable_list[DEFAULT_SPRITE_LIST] += accessory.name + + switch(accessory.gender) + if(MALE) + returnable_list[MALE_SPRITE_LIST] += accessory.name + if(FEMALE) + returnable_list[FEMALE_SPRITE_LIST] += accessory.name + else + returnable_list[MALE_SPRITE_LIST] += accessory.name + returnable_list[FEMALE_SPRITE_LIST] += accessory.name + + if(add_blank) + returnable_list[DEFAULT_SPRITE_LIST][SPRITE_ACCESSORY_NONE] = new /datum/sprite_accessory/blank + + return returnable_list + +#undef DEFAULT_SPRITE_LIST +#undef MALE_SPRITE_LIST +#undef FEMALE_SPRITE_LIST diff --git a/code/datums/dna.dm b/code/datums/dna.dm index 7d69353e02f..ab5407bc78c 100644 --- a/code/datums/dna.dm +++ b/code/datums/dna.dm @@ -179,13 +179,12 @@ GLOBAL_LIST_INIT(total_uf_len_by_block, populate_total_uf_len_by_block()) L[DNA_GENDER_BLOCK] = construct_block(G_PLURAL, GENDERS) if(ishuman(holder)) var/mob/living/carbon/human/H = holder - if(!GLOB.hairstyles_list.len) - init_sprite_accessory_subtypes(/datum/sprite_accessory/hair,GLOB.hairstyles_list, GLOB.hairstyles_male_list, GLOB.hairstyles_female_list) - L[DNA_HAIRSTYLE_BLOCK] = construct_block(GLOB.hairstyles_list.Find(H.hairstyle), GLOB.hairstyles_list.len) + if(length(SSaccessories.hairstyles_list) == 0 || length(SSaccessories.facial_hairstyles_list) == 0) + CRASH("SSaccessories lists are empty, this is bad!") + + L[DNA_HAIRSTYLE_BLOCK] = construct_block(SSaccessories.hairstyles_list.Find(H.hairstyle), length(SSaccessories.hairstyles_list)) L[DNA_HAIR_COLOR_BLOCK] = sanitize_hexcolor(H.hair_color, include_crunch = FALSE) - if(!GLOB.facial_hairstyles_list.len) - init_sprite_accessory_subtypes(/datum/sprite_accessory/facial_hair, GLOB.facial_hairstyles_list, GLOB.facial_hairstyles_male_list, GLOB.facial_hairstyles_female_list) - L[DNA_FACIAL_HAIRSTYLE_BLOCK] = construct_block(GLOB.facial_hairstyles_list.Find(H.facial_hairstyle), GLOB.facial_hairstyles_list.len) + L[DNA_FACIAL_HAIRSTYLE_BLOCK] = construct_block(SSaccessories.facial_hairstyles_list.Find(H.facial_hairstyle), length(SSaccessories.facial_hairstyles_list)) L[DNA_FACIAL_HAIR_COLOR_BLOCK] = sanitize_hexcolor(H.facial_hair_color, include_crunch = FALSE) L[DNA_SKIN_TONE_BLOCK] = construct_block(GLOB.skin_tones.Find(H.skin_tone), GLOB.skin_tones.len) L[DNA_EYE_COLOR_LEFT_BLOCK] = sanitize_hexcolor(H.eye_color_left, include_crunch = FALSE) @@ -203,33 +202,33 @@ GLOBAL_LIST_INIT(total_uf_len_by_block, populate_total_uf_len_by_block()) if(features["ethcolor"]) L[DNA_ETHEREAL_COLOR_BLOCK] = sanitize_hexcolor(features["ethcolor"], include_crunch = FALSE) if(features["body_markings"]) - L[DNA_LIZARD_MARKINGS_BLOCK] = construct_block(GLOB.body_markings_list.Find(features["body_markings"]), GLOB.body_markings_list.len) + L[DNA_LIZARD_MARKINGS_BLOCK] = construct_block(SSaccessories.body_markings_list.Find(features["body_markings"]), length(SSaccessories.body_markings_list)) if(features["tail_cat"]) - L[DNA_TAIL_BLOCK] = construct_block(GLOB.tails_list_human.Find(features["tail_cat"]), GLOB.tails_list_human.len) + L[DNA_TAIL_BLOCK] = construct_block(SSaccessories.tails_list_human.Find(features["tail_cat"]), length(SSaccessories.tails_list_human)) if(features["tail_lizard"]) - L[DNA_LIZARD_TAIL_BLOCK] = construct_block(GLOB.tails_list_lizard.Find(features["tail_lizard"]), GLOB.tails_list_lizard.len) + L[DNA_LIZARD_TAIL_BLOCK] = construct_block(SSaccessories.tails_list_lizard.Find(features["tail_lizard"]), length(SSaccessories.tails_list_lizard)) if(features["tail_monkey"]) - L[DNA_MONKEY_TAIL_BLOCK] = construct_block(GLOB.tails_list_monkey.Find(features["tail_monkey"]), GLOB.tails_list_monkey.len) + L[DNA_MONKEY_TAIL_BLOCK] = construct_block(SSaccessories.tails_list_monkey.Find(features["tail_monkey"]), length(SSaccessories.tails_list_monkey)) if(features["snout"]) - L[DNA_SNOUT_BLOCK] = construct_block(GLOB.snouts_list.Find(features["snout"]), GLOB.snouts_list.len) + L[DNA_SNOUT_BLOCK] = construct_block(SSaccessories.snouts_list.Find(features["snout"]), length(SSaccessories.snouts_list)) if(features["horns"]) - L[DNA_HORNS_BLOCK] = construct_block(GLOB.horns_list.Find(features["horns"]), GLOB.horns_list.len) + L[DNA_HORNS_BLOCK] = construct_block(SSaccessories.horns_list.Find(features["horns"]), length(SSaccessories.horns_list)) if(features["frills"]) - L[DNA_FRILLS_BLOCK] = construct_block(GLOB.frills_list.Find(features["frills"]), GLOB.frills_list.len) + L[DNA_FRILLS_BLOCK] = construct_block(SSaccessories.frills_list.Find(features["frills"]), length(SSaccessories.frills_list)) if(features["spines"]) - L[DNA_SPINES_BLOCK] = construct_block(GLOB.spines_list.Find(features["spines"]), GLOB.spines_list.len) + L[DNA_SPINES_BLOCK] = construct_block(SSaccessories.spines_list.Find(features["spines"]), length(SSaccessories.spines_list)) if(features["ears"]) - L[DNA_EARS_BLOCK] = construct_block(GLOB.ears_list.Find(features["ears"]), GLOB.ears_list.len) + L[DNA_EARS_BLOCK] = construct_block(SSaccessories.ears_list.Find(features["ears"]), length(SSaccessories.ears_list)) if(features["moth_wings"] != "Burnt Off") - L[DNA_MOTH_WINGS_BLOCK] = construct_block(GLOB.moth_wings_list.Find(features["moth_wings"]), GLOB.moth_wings_list.len) + L[DNA_MOTH_WINGS_BLOCK] = construct_block(SSaccessories.moth_wings_list.Find(features["moth_wings"]), length(SSaccessories.moth_wings_list)) if(features["moth_antennae"] != "Burnt Off") - L[DNA_MOTH_ANTENNAE_BLOCK] = construct_block(GLOB.moth_antennae_list.Find(features["moth_antennae"]), GLOB.moth_antennae_list.len) + L[DNA_MOTH_ANTENNAE_BLOCK] = construct_block(SSaccessories.moth_antennae_list.Find(features["moth_antennae"]), length(SSaccessories.moth_antennae_list)) if(features["moth_markings"]) - L[DNA_MOTH_MARKINGS_BLOCK] = construct_block(GLOB.moth_markings_list.Find(features["moth_markings"]), GLOB.moth_markings_list.len) + L[DNA_MOTH_MARKINGS_BLOCK] = construct_block(SSaccessories.moth_markings_list.Find(features["moth_markings"]), length(SSaccessories.moth_markings_list)) if(features["caps"]) - L[DNA_MUSHROOM_CAPS_BLOCK] = construct_block(GLOB.caps_list.Find(features["caps"]), GLOB.caps_list.len) + L[DNA_MUSHROOM_CAPS_BLOCK] = construct_block(SSaccessories.caps_list.Find(features["caps"]), length(SSaccessories.caps_list)) if(features["pod_hair"]) - L[DNA_POD_HAIR_BLOCK] = construct_block(GLOB.pod_hair_list.Find(features["pod_hair"]), GLOB.pod_hair_list.len) + L[DNA_POD_HAIR_BLOCK] = construct_block(SSaccessories.pod_hair_list.Find(features["pod_hair"]), length(SSaccessories.pod_hair_list)) for(var/blocknum in 1 to DNA_FEATURE_BLOCKS) . += L[blocknum] || random_string(GET_UI_BLOCK_LEN(blocknum), GLOB.hex_characters) @@ -326,9 +325,9 @@ GLOBAL_LIST_INIT(total_uf_len_by_block, populate_total_uf_len_by_block()) else set_uni_identity_block(blocknumber, construct_block(G_PLURAL, GENDERS)) if(DNA_FACIAL_HAIRSTYLE_BLOCK) - set_uni_identity_block(blocknumber, construct_block(GLOB.facial_hairstyles_list.Find(H.facial_hairstyle), GLOB.facial_hairstyles_list.len)) + set_uni_identity_block(blocknumber, construct_block(SSaccessories.facial_hairstyles_list.Find(H.facial_hairstyle), length(SSaccessories.facial_hairstyles_list))) if(DNA_HAIRSTYLE_BLOCK) - set_uni_identity_block(blocknumber, construct_block(GLOB.hairstyles_list.Find(H.hairstyle), GLOB.hairstyles_list.len)) + set_uni_identity_block(blocknumber, construct_block(SSaccessories.hairstyles_list.Find(H.hairstyle), length(SSaccessories.hairstyles_list))) /datum/dna/proc/update_uf_block(blocknumber) if(!blocknumber) @@ -341,33 +340,33 @@ GLOBAL_LIST_INIT(total_uf_len_by_block, populate_total_uf_len_by_block()) if(DNA_ETHEREAL_COLOR_BLOCK) set_uni_feature_block(blocknumber, sanitize_hexcolor(features["ethcolor"], include_crunch = FALSE)) if(DNA_LIZARD_MARKINGS_BLOCK) - set_uni_feature_block(blocknumber, construct_block(GLOB.body_markings_list.Find(features["body_markings"]), GLOB.body_markings_list.len)) + set_uni_feature_block(blocknumber, construct_block(SSaccessories.body_markings_list.Find(features["body_markings"]), length(SSaccessories.body_markings_list))) if(DNA_TAIL_BLOCK) - set_uni_feature_block(blocknumber, construct_block(GLOB.tails_list_human.Find(features["tail_cat"]), GLOB.tails_list_human.len)) + set_uni_feature_block(blocknumber, construct_block(SSaccessories.tails_list_human.Find(features["tail_cat"]), length(SSaccessories.tails_list_human))) if(DNA_LIZARD_TAIL_BLOCK) - set_uni_feature_block(blocknumber, construct_block(GLOB.tails_list_lizard.Find(features["tail_lizard"]), GLOB.tails_list_lizard.len)) + set_uni_feature_block(blocknumber, construct_block(SSaccessories.tails_list_lizard.Find(features["tail_lizard"]), length(SSaccessories.tails_list_lizard))) if(DNA_MONKEY_TAIL_BLOCK) - set_uni_feature_block(blocknumber, construct_block(GLOB.tails_list_monkey.Find(features["tail_monkey"]), GLOB.tails_list_monkey.len)) + set_uni_feature_block(blocknumber, construct_block(SSaccessories.tails_list_monkey.Find(features["tail_monkey"]), length(SSaccessories.tails_list_monkey))) if(DNA_SNOUT_BLOCK) - set_uni_feature_block(blocknumber, construct_block(GLOB.snouts_list.Find(features["snout"]), GLOB.snouts_list.len)) + set_uni_feature_block(blocknumber, construct_block(SSaccessories.snouts_list.Find(features["snout"]), length(SSaccessories.snouts_list))) if(DNA_HORNS_BLOCK) - set_uni_feature_block(blocknumber, construct_block(GLOB.horns_list.Find(features["horns"]), GLOB.horns_list.len)) + set_uni_feature_block(blocknumber, construct_block(SSaccessories.horns_list.Find(features["horns"]), length(SSaccessories.horns_list))) if(DNA_FRILLS_BLOCK) - set_uni_feature_block(blocknumber, construct_block(GLOB.frills_list.Find(features["frills"]), GLOB.frills_list.len)) + set_uni_feature_block(blocknumber, construct_block(SSaccessories.frills_list.Find(features["frills"]), length(SSaccessories.frills_list))) if(DNA_SPINES_BLOCK) - set_uni_feature_block(blocknumber, construct_block(GLOB.spines_list.Find(features["spines"]), GLOB.spines_list.len)) + set_uni_feature_block(blocknumber, construct_block(SSaccessories.spines_list.Find(features["spines"]), length(SSaccessories.spines_list))) if(DNA_EARS_BLOCK) - set_uni_feature_block(blocknumber, construct_block(GLOB.ears_list.Find(features["ears"]), GLOB.ears_list.len)) + set_uni_feature_block(blocknumber, construct_block(SSaccessories.ears_list.Find(features["ears"]), length(SSaccessories.ears_list))) if(DNA_MOTH_WINGS_BLOCK) - set_uni_feature_block(blocknumber, construct_block(GLOB.moth_wings_list.Find(features["moth_wings"]), GLOB.moth_wings_list.len)) + set_uni_feature_block(blocknumber, construct_block(SSaccessories.moth_wings_list.Find(features["moth_wings"]), length(SSaccessories.moth_wings_list))) if(DNA_MOTH_ANTENNAE_BLOCK) - set_uni_feature_block(blocknumber, construct_block(GLOB.moth_antennae_list.Find(features["moth_antennae"]), GLOB.moth_antennae_list.len)) + set_uni_feature_block(blocknumber, construct_block(SSaccessories.moth_antennae_list.Find(features["moth_antennae"]), length(SSaccessories.moth_antennae_list))) if(DNA_MOTH_MARKINGS_BLOCK) - set_uni_feature_block(blocknumber, construct_block(GLOB.moth_markings_list.Find(features["moth_markings"]), GLOB.moth_markings_list.len)) + set_uni_feature_block(blocknumber, construct_block(SSaccessories.moth_markings_list.Find(features["moth_markings"]), length(SSaccessories.moth_markings_list))) if(DNA_MUSHROOM_CAPS_BLOCK) - set_uni_feature_block(blocknumber, construct_block(GLOB.caps_list.Find(features["caps"]), GLOB.caps_list.len)) + set_uni_feature_block(blocknumber, construct_block(SSaccessories.caps_list.Find(features["caps"]), length(SSaccessories.caps_list))) if(DNA_POD_HAIR_BLOCK) - set_uni_feature_block(blocknumber, construct_block(GLOB.pod_hair_list.Find(features["pod_hair"]), GLOB.pod_hair_list.len)) + set_uni_feature_block(blocknumber, construct_block(SSaccessories.pod_hair_list.Find(features["pod_hair"]), length(SSaccessories.pod_hair_list))) //Please use add_mutation or activate_mutation instead /datum/dna/proc/force_give(datum/mutation/human/human_mutation) @@ -624,12 +623,12 @@ GLOBAL_LIST_INIT(total_uf_len_by_block, populate_total_uf_len_by_block()) if(HAS_TRAIT(src, TRAIT_SHAVED)) set_facial_hairstyle("Shaved", update = FALSE) else - var/style = GLOB.facial_hairstyles_list[deconstruct_block(get_uni_identity_block(structure, DNA_FACIAL_HAIRSTYLE_BLOCK), GLOB.facial_hairstyles_list.len)] + var/style = SSaccessories.facial_hairstyles_list[deconstruct_block(get_uni_identity_block(structure, DNA_FACIAL_HAIRSTYLE_BLOCK), length(SSaccessories.facial_hairstyles_list))] set_facial_hairstyle(style, update = FALSE) if(HAS_TRAIT(src, TRAIT_BALD)) set_hairstyle("Bald", update = FALSE) else - var/style = GLOB.hairstyles_list[deconstruct_block(get_uni_identity_block(structure, DNA_HAIRSTYLE_BLOCK), GLOB.hairstyles_list.len)] + var/style = SSaccessories.hairstyles_list[deconstruct_block(get_uni_identity_block(structure, DNA_HAIRSTYLE_BLOCK), length(SSaccessories.hairstyles_list))] set_hairstyle(style, update = FALSE) var/features = dna.unique_features if(dna.features["mcolor"]) @@ -637,37 +636,37 @@ GLOBAL_LIST_INIT(total_uf_len_by_block, populate_total_uf_len_by_block()) if(dna.features["ethcolor"]) dna.features["ethcolor"] = sanitize_hexcolor(get_uni_feature_block(features, DNA_ETHEREAL_COLOR_BLOCK)) if(dna.features["body_markings"]) - dna.features["body_markings"] = GLOB.body_markings_list[deconstruct_block(get_uni_feature_block(features, DNA_LIZARD_MARKINGS_BLOCK), GLOB.body_markings_list.len)] + dna.features["body_markings"] = SSaccessories.body_markings_list[deconstruct_block(get_uni_feature_block(features, DNA_LIZARD_MARKINGS_BLOCK), length(SSaccessories.body_markings_list))] if(dna.features["snout"]) - dna.features["snout"] = GLOB.snouts_list[deconstruct_block(get_uni_feature_block(features, DNA_SNOUT_BLOCK), GLOB.snouts_list.len)] + dna.features["snout"] = SSaccessories.snouts_list[deconstruct_block(get_uni_feature_block(features, DNA_SNOUT_BLOCK), length(SSaccessories.snouts_list))] if(dna.features["horns"]) - dna.features["horns"] = GLOB.horns_list[deconstruct_block(get_uni_feature_block(features, DNA_HORNS_BLOCK), GLOB.horns_list.len)] + dna.features["horns"] = SSaccessories.horns_list[deconstruct_block(get_uni_feature_block(features, DNA_HORNS_BLOCK), length(SSaccessories.horns_list))] if(dna.features["frills"]) - dna.features["frills"] = GLOB.frills_list[deconstruct_block(get_uni_feature_block(features, DNA_FRILLS_BLOCK), GLOB.frills_list.len)] + dna.features["frills"] = SSaccessories.frills_list[deconstruct_block(get_uni_feature_block(features, DNA_FRILLS_BLOCK), length(SSaccessories.frills_list))] if(dna.features["spines"]) - dna.features["spines"] = GLOB.spines_list[deconstruct_block(get_uni_feature_block(features, DNA_SPINES_BLOCK), GLOB.spines_list.len)] + dna.features["spines"] = SSaccessories.spines_list[deconstruct_block(get_uni_feature_block(features, DNA_SPINES_BLOCK), length(SSaccessories.spines_list))] if(dna.features["tail_cat"]) - dna.features["tail_cat"] = GLOB.tails_list_human[deconstruct_block(get_uni_feature_block(features, DNA_TAIL_BLOCK), GLOB.tails_list_human.len)] + dna.features["tail_cat"] = SSaccessories.tails_list_human[deconstruct_block(get_uni_feature_block(features, DNA_TAIL_BLOCK), length(SSaccessories.tails_list_human))] if(dna.features["tail_lizard"]) - dna.features["tail_lizard"] = GLOB.tails_list_lizard[deconstruct_block(get_uni_feature_block(features, DNA_LIZARD_TAIL_BLOCK), GLOB.tails_list_lizard.len)] + dna.features["tail_lizard"] = SSaccessories.tails_list_lizard[deconstruct_block(get_uni_feature_block(features, DNA_LIZARD_TAIL_BLOCK), length(SSaccessories.tails_list_lizard))] if(dna.features["tail_monkey"]) - dna.features["tail_monkey"] = GLOB.tails_list_monkey[deconstruct_block(get_uni_feature_block(features, DNA_MONKEY_TAIL_BLOCK), GLOB.tails_list_monkey.len)] + dna.features["tail_monkey"] = SSaccessories.tails_list_monkey[deconstruct_block(get_uni_feature_block(features, DNA_MONKEY_TAIL_BLOCK), length(SSaccessories.tails_list_monkey))] if(dna.features["ears"]) - dna.features["ears"] = GLOB.ears_list[deconstruct_block(get_uni_feature_block(features, DNA_EARS_BLOCK), GLOB.ears_list.len)] + dna.features["ears"] = SSaccessories.ears_list[deconstruct_block(get_uni_feature_block(features, DNA_EARS_BLOCK), length(SSaccessories.ears_list))] if(dna.features["moth_wings"]) - var/genetic_value = GLOB.moth_wings_list[deconstruct_block(get_uni_feature_block(features, DNA_MOTH_WINGS_BLOCK), GLOB.moth_wings_list.len)] + var/genetic_value = SSaccessories.moth_wings_list[deconstruct_block(get_uni_feature_block(features, DNA_MOTH_WINGS_BLOCK), length(SSaccessories.moth_wings_list))] dna.features["original_moth_wings"] = genetic_value dna.features["moth_wings"] = genetic_value if(dna.features["moth_antennae"]) - var/genetic_value = GLOB.moth_antennae_list[deconstruct_block(get_uni_feature_block(features, DNA_MOTH_ANTENNAE_BLOCK), GLOB.moth_antennae_list.len)] + var/genetic_value = SSaccessories.moth_antennae_list[deconstruct_block(get_uni_feature_block(features, DNA_MOTH_ANTENNAE_BLOCK), length(SSaccessories.moth_antennae_list))] dna.features["original_moth_antennae"] = genetic_value dna.features["moth_antennae"] = genetic_value if(dna.features["moth_markings"]) - dna.features["moth_markings"] = GLOB.moth_markings_list[deconstruct_block(get_uni_feature_block(features, DNA_MOTH_MARKINGS_BLOCK), GLOB.moth_markings_list.len)] + dna.features["moth_markings"] = SSaccessories.moth_markings_list[deconstruct_block(get_uni_feature_block(features, DNA_MOTH_MARKINGS_BLOCK), length(SSaccessories.moth_markings_list))] if(dna.features["caps"]) - dna.features["caps"] = GLOB.caps_list[deconstruct_block(get_uni_feature_block(features, DNA_MUSHROOM_CAPS_BLOCK), GLOB.caps_list.len)] + dna.features["caps"] = SSaccessories.caps_list[deconstruct_block(get_uni_feature_block(features, DNA_MUSHROOM_CAPS_BLOCK), length(SSaccessories.caps_list))] if(dna.features["pod_hair"]) - dna.features["pod_hair"] = GLOB.pod_hair_list[deconstruct_block(get_uni_feature_block(features, DNA_POD_HAIR_BLOCK), GLOB.pod_hair_list.len)] + dna.features["pod_hair"] = SSaccessories.pod_hair_list[deconstruct_block(get_uni_feature_block(features, DNA_POD_HAIR_BLOCK), length(SSaccessories.pod_hair_list))] for(var/obj/item/organ/external/external_organ in organs) external_organ.mutate_feature(features, src) diff --git a/code/datums/quirks/neutral_quirks/bald.dm b/code/datums/quirks/neutral_quirks/bald.dm index 8a760f6ceef..2844b790ddf 100644 --- a/code/datums/quirks/neutral_quirks/bald.dm +++ b/code/datums/quirks/neutral_quirks/bald.dm @@ -21,7 +21,7 @@ /datum/quirk/item_quirk/bald/add_unique(client/client_source) var/obj/item/clothing/head/wig/natural/baldie_wig = new(get_turf(quirk_holder)) if(old_hair == "Bald") - baldie_wig.hairstyle = pick(GLOB.hairstyles_list - "Bald") + baldie_wig.hairstyle = pick(SSaccessories.hairstyles_list - "Bald") else baldie_wig.hairstyle = old_hair diff --git a/code/datums/sprite_accessories.dm b/code/datums/sprite_accessories.dm index 40c17b774b1..e6e8b956e65 100644 --- a/code/datums/sprite_accessories.dm +++ b/code/datums/sprite_accessories.dm @@ -16,35 +16,6 @@ * conversion in savefile.dm */ -/proc/init_sprite_accessory_subtypes(prototype, list/L, list/male, list/female, add_blank)//Roundstart argument builds a specific list for roundstart parts where some parts may be locked - if(!istype(L)) - L = list() - if(!istype(male)) - male = list() - if(!istype(female)) - female = list() - - for(var/path in subtypesof(prototype)) - var/datum/sprite_accessory/D = new path() - - if(D.icon_state) - L[D.name] = D - else - L += D.name - - switch(D.gender) - if(MALE) - male += D.name - if(FEMALE) - female += D.name - else - male += D.name - female += D.name - if(add_blank) - L[SPRITE_ACCESSORY_NONE] = new /datum/sprite_accessory/blank - - return L - /datum/sprite_accessory /// The icon file the accessory is located in. var/icon diff --git a/code/game/objects/items/cosmetics.dm b/code/game/objects/items/cosmetics.dm index a78d9d4fbf0..b16cf3a6ef6 100644 --- a/code/game/objects/items/cosmetics.dm +++ b/code/game/objects/items/cosmetics.dm @@ -217,7 +217,7 @@ return if(!user.can_perform_action(src, FORBID_TELEKINESIS_REACH)) return - var/new_style = tgui_input_list(user, "Select a facial hairstyle", "Grooming", GLOB.facial_hairstyles_list) + var/new_style = tgui_input_list(user, "Select a facial hairstyle", "Grooming", SSaccessories.facial_hairstyles_list) if(isnull(new_style)) return if(!get_location_accessible(human_target, location)) @@ -270,7 +270,7 @@ return if(!user.can_perform_action(src, FORBID_TELEKINESIS_REACH)) return - var/new_style = tgui_input_list(user, "Select a hairstyle", "Grooming", GLOB.hairstyles_list) + var/new_style = tgui_input_list(user, "Select a hairstyle", "Grooming", SSaccessories.hairstyles_list) if(isnull(new_style)) return if(!get_location_accessible(human_target, location)) diff --git a/code/game/objects/items/dyespray.dm b/code/game/objects/items/dyespray.dm index fd198ec1c40..b64f15fe690 100644 --- a/code/game/objects/items/dyespray.dm +++ b/code/game/objects/items/dyespray.dm @@ -27,7 +27,7 @@ if(!beard_or_hair || !user.can_perform_action(src, NEED_DEXTERITY)) return - var/list/choices = beard_or_hair == "Hair" ? GLOB.hair_gradients_list : GLOB.facial_hair_gradients_list + var/list/choices = beard_or_hair == "Hair" ? SSaccessories.hair_gradients_list : SSaccessories.facial_hair_gradients_list var/new_grad_style = tgui_input_list(user, "Choose a color pattern", "Character Preference", choices) if(isnull(new_grad_style)) return diff --git a/code/game/objects/structures/dresser.dm b/code/game/objects/structures/dresser.dm index 4296ac33684..cf3864b1400 100644 --- a/code/game/objects/structures/dresser.dm +++ b/code/game/objects/structures/dresser.dm @@ -40,7 +40,7 @@ return switch(choice) if("Underwear") - var/new_undies = tgui_input_list(user, "Select your underwear", "Changing", GLOB.underwear_list) + var/new_undies = tgui_input_list(user, "Select your underwear", "Changing", SSaccessories.underwear_list) if(new_undies) dressing_human.underwear = new_undies if("Underwear Color") @@ -48,11 +48,11 @@ if(new_underwear_color) dressing_human.underwear_color = sanitize_hexcolor(new_underwear_color) if("Undershirt") - var/new_undershirt = tgui_input_list(user, "Select your undershirt", "Changing", GLOB.undershirt_list) + var/new_undershirt = tgui_input_list(user, "Select your undershirt", "Changing", SSaccessories.undershirt_list) if(new_undershirt) dressing_human.undershirt = new_undershirt if("Socks") - var/new_socks = tgui_input_list(user, "Select your socks", "Changing", GLOB.socks_list) + var/new_socks = tgui_input_list(user, "Select your socks", "Changing", SSaccessories.socks_list) if(new_socks) dressing_human.socks = new_socks diff --git a/code/game/objects/structures/mannequin.dm b/code/game/objects/structures/mannequin.dm index bdb5344d7fe..a47802273d5 100644 --- a/code/game/objects/structures/mannequin.dm +++ b/code/game/objects/structures/mannequin.dm @@ -95,19 +95,19 @@ var/mutable_appearance/pedestal = mutable_appearance(icon, "pedestal_[material]") pedestal.pixel_y = -3 . += pedestal - var/datum/sprite_accessory/underwear/underwear = GLOB.underwear_list[underwear_name] + var/datum/sprite_accessory/underwear/underwear = SSaccessories.underwear_list[underwear_name] if(underwear) if(body_type == FEMALE && underwear.gender == MALE) . += wear_female_version(underwear.icon_state, underwear.icon, BODY_LAYER, FEMALE_UNIFORM_FULL) else . += mutable_appearance(underwear.icon, underwear.icon_state, -BODY_LAYER) - var/datum/sprite_accessory/undershirt/undershirt = GLOB.undershirt_list[undershirt_name] + var/datum/sprite_accessory/undershirt/undershirt = SSaccessories.undershirt_list[undershirt_name] if(undershirt) if(body_type == FEMALE) . += wear_female_version(undershirt.icon_state, undershirt.icon, BODY_LAYER) else . += mutable_appearance(undershirt.icon, undershirt.icon_state, -BODY_LAYER) - var/datum/sprite_accessory/socks/socks = GLOB.socks_list[socks_name] + var/datum/sprite_accessory/socks/socks = SSaccessories.socks_list[socks_name] if(socks) . += mutable_appearance(socks.icon, socks.icon_state, -BODY_LAYER) for(var/slot_flag in worn_items) @@ -168,15 +168,15 @@ return switch(choice) if("Underwear") - var/new_undies = tgui_input_list(user, "Select the mannequin's underwear", "Changing", GLOB.underwear_list) + var/new_undies = tgui_input_list(user, "Select the mannequin's underwear", "Changing", SSaccessories.underwear_list) if(new_undies) underwear_name = new_undies if("Undershirt") - var/new_undershirt = tgui_input_list(user, "Select the mannequin's undershirt", "Changing", GLOB.undershirt_list) + var/new_undershirt = tgui_input_list(user, "Select the mannequin's undershirt", "Changing", SSaccessories.undershirt_list) if(new_undershirt) undershirt_name = new_undershirt if("Socks") - var/new_socks = tgui_input_list(user, "Select the mannequin's socks", "Changing", GLOB.socks_list) + var/new_socks = tgui_input_list(user, "Select the mannequin's socks", "Changing", SSaccessories.socks_list) if(new_socks) socks_name = new_socks update_appearance() diff --git a/code/game/objects/structures/mirror.dm b/code/game/objects/structures/mirror.dm index f15cabd707e..7ea23302814 100644 --- a/code/game/objects/structures/mirror.dm +++ b/code/game/objects/structures/mirror.dm @@ -118,7 +118,7 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/structure/mirror/broken, 28) beard_dresser.set_facial_hairstyle("Shaved", update = TRUE) return TRUE - var/new_style = tgui_input_list(beard_dresser, "Select a facial hairstyle", "Grooming", GLOB.facial_hairstyles_list) + var/new_style = tgui_input_list(beard_dresser, "Select a facial hairstyle", "Grooming", SSaccessories.facial_hairstyles_list) if(isnull(new_style)) return TRUE @@ -131,7 +131,7 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/structure/mirror/broken, 28) beard_dresser.set_facial_hairstyle(new_style, update = TRUE) /obj/structure/mirror/proc/change_hair(mob/living/carbon/human/hairdresser) - var/new_style = tgui_input_list(hairdresser, "Select a hairstyle", "Grooming", GLOB.hairstyles_list) + var/new_style = tgui_input_list(hairdresser, "Select a hairstyle", "Grooming", SSaccessories.hairstyles_list) if(isnull(new_style)) return TRUE if(HAS_TRAIT(hairdresser, TRAIT_BALD)) @@ -331,7 +331,7 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/structure/mirror/broken, 28) selectable_races = sort_list(selectable_races) /obj/structure/mirror/magic/change_beard(mob/living/carbon/human/beard_dresser) // magical mirrors do nothing but give you the damn beard - var/new_style = tgui_input_list(beard_dresser, "Select a facial hairstyle", "Grooming", GLOB.facial_hairstyles_list) + var/new_style = tgui_input_list(beard_dresser, "Select a facial hairstyle", "Grooming", SSaccessories.facial_hairstyles_list) if(isnull(new_style)) return TRUE beard_dresser.set_facial_hairstyle(new_style, update = TRUE) diff --git a/code/modules/client/preferences/clothing.dm b/code/modules/client/preferences/clothing.dm index cf200ad1ffd..002a7f8c13a 100644 --- a/code/modules/client/preferences/clothing.dm +++ b/code/modules/client/preferences/clothing.dm @@ -95,7 +95,7 @@ should_generate_icons = TRUE /datum/preference/choiced/socks/init_possible_values() - return assoc_to_keys_features(GLOB.socks_list) + return assoc_to_keys_features(SSaccessories.socks_list) /datum/preference/choiced/socks/icon_for(value) var/static/icon/lower_half @@ -105,7 +105,7 @@ lower_half.Blend(icon('icons/mob/human/bodyparts_greyscale.dmi', "human_r_leg"), ICON_OVERLAY) lower_half.Blend(icon('icons/mob/human/bodyparts_greyscale.dmi', "human_l_leg"), ICON_OVERLAY) - return generate_underwear_icon(GLOB.socks_list[value], lower_half) + return generate_underwear_icon(SSaccessories.socks_list[value], lower_half) /datum/preference/choiced/socks/apply_to_human(mob/living/carbon/human/target, value) target.socks = value @@ -119,7 +119,7 @@ should_generate_icons = TRUE /datum/preference/choiced/undershirt/init_possible_values() - return assoc_to_keys_features(GLOB.undershirt_list) + return assoc_to_keys_features(SSaccessories.undershirt_list) /datum/preference/choiced/undershirt/icon_for(value) var/static/icon/body @@ -135,7 +135,7 @@ var/icon/icon_with_undershirt = icon(body) if (value != "Nude") - var/datum/sprite_accessory/accessory = GLOB.undershirt_list[value] + var/datum/sprite_accessory/accessory = SSaccessories.undershirt_list[value] icon_with_undershirt.Blend(icon('icons/mob/clothing/underwear.dmi', accessory.icon_state), ICON_OVERLAY) icon_with_undershirt.Crop(9, 9, 23, 23) @@ -154,7 +154,7 @@ should_generate_icons = TRUE /datum/preference/choiced/underwear/init_possible_values() - return assoc_to_keys_features(GLOB.underwear_list) + return assoc_to_keys_features(SSaccessories.underwear_list) /datum/preference/choiced/underwear/icon_for(value) var/static/icon/lower_half @@ -165,7 +165,7 @@ lower_half.Blend(icon('icons/mob/human/bodyparts_greyscale.dmi', "human_r_leg"), ICON_OVERLAY) lower_half.Blend(icon('icons/mob/human/bodyparts_greyscale.dmi', "human_l_leg"), ICON_OVERLAY) - return generate_underwear_icon(GLOB.underwear_list[value], lower_half, COLOR_ALMOST_BLACK) + return generate_underwear_icon(SSaccessories.underwear_list[value], lower_half, COLOR_ALMOST_BLACK) /datum/preference/choiced/underwear/apply_to_human(mob/living/carbon/human/target, value) target.underwear = value diff --git a/code/modules/client/preferences/species_features/basic.dm b/code/modules/client/preferences/species_features/basic.dm index abf4ea0e44e..3f101ad9e44 100644 --- a/code/modules/client/preferences/species_features/basic.dm +++ b/code/modules/client/preferences/species_features/basic.dm @@ -7,7 +7,7 @@ var/icon/final_icon = new(head_icon) if (!isnull(sprite_accessory)) ASSERT(istype(sprite_accessory)) - + var/icon/head_accessory_icon = icon(sprite_accessory.icon, sprite_accessory.icon_state) if(y_offset) head_accessory_icon.Shift(NORTH, y_offset) @@ -61,10 +61,10 @@ relevant_head_flag = HEAD_FACIAL_HAIR /datum/preference/choiced/facial_hairstyle/init_possible_values() - return assoc_to_keys_features(GLOB.facial_hairstyles_list) + return assoc_to_keys_features(SSaccessories.facial_hairstyles_list) /datum/preference/choiced/facial_hairstyle/icon_for(value) - return generate_icon_with_head_accessory(GLOB.facial_hairstyles_list[value]) + return generate_icon_with_head_accessory(SSaccessories.facial_hairstyles_list[value]) /datum/preference/choiced/facial_hairstyle/apply_to_human(mob/living/carbon/human/target, value) target.set_facial_hairstyle(value, update = FALSE) @@ -94,7 +94,7 @@ relevant_head_flag = HEAD_FACIAL_HAIR /datum/preference/choiced/facial_hair_gradient/init_possible_values() - return assoc_to_keys_features(GLOB.facial_hair_gradients_list) + return assoc_to_keys_features(SSaccessories.facial_hair_gradients_list) /datum/preference/choiced/facial_hair_gradient/apply_to_human(mob/living/carbon/human/target, value) target.set_facial_hair_gradient_style(new_style = value, update = FALSE) @@ -137,10 +137,10 @@ relevant_head_flag = HEAD_HAIR /datum/preference/choiced/hairstyle/init_possible_values() - return assoc_to_keys_features(GLOB.hairstyles_list) + return assoc_to_keys_features(SSaccessories.hairstyles_list) /datum/preference/choiced/hairstyle/icon_for(value) - var/datum/sprite_accessory/hair/hairstyle = GLOB.hairstyles_list[value] + var/datum/sprite_accessory/hair/hairstyle = SSaccessories.hairstyles_list[value] return generate_icon_with_head_accessory(hairstyle, hairstyle?.y_offset) /datum/preference/choiced/hairstyle/apply_to_human(mob/living/carbon/human/target, value) @@ -161,7 +161,7 @@ relevant_head_flag = HEAD_HAIR /datum/preference/choiced/hair_gradient/init_possible_values() - return assoc_to_keys_features(GLOB.hair_gradients_list) + return assoc_to_keys_features(SSaccessories.hair_gradients_list) /datum/preference/choiced/hair_gradient/apply_to_human(mob/living/carbon/human/target, value) target.set_hair_gradient_style(new_style = value, update = FALSE) diff --git a/code/modules/client/preferences/species_features/felinid.dm b/code/modules/client/preferences/species_features/felinid.dm index b9f3c7bfa33..a6d43736cf4 100644 --- a/code/modules/client/preferences/species_features/felinid.dm +++ b/code/modules/client/preferences/species_features/felinid.dm @@ -6,7 +6,7 @@ relevant_external_organ = /obj/item/organ/external/tail/cat /datum/preference/choiced/tail_human/init_possible_values() - return assoc_to_keys_features(GLOB.tails_list_human) + return assoc_to_keys_features(SSaccessories.tails_list_human) /datum/preference/choiced/tail_human/apply_to_human(mob/living/carbon/human/target, value) target.dna.features["tail_cat"] = value @@ -23,7 +23,7 @@ relevant_mutant_bodypart = "ears" /datum/preference/choiced/ears/init_possible_values() - return assoc_to_keys_features(GLOB.ears_list) + return assoc_to_keys_features(SSaccessories.ears_list) /datum/preference/choiced/ears/apply_to_human(mob/living/carbon/human/target, value) target.dna.features["ears"] = value diff --git a/code/modules/client/preferences/species_features/lizard.dm b/code/modules/client/preferences/species_features/lizard.dm index 4ce09715483..bee57300ec4 100644 --- a/code/modules/client/preferences/species_features/lizard.dm +++ b/code/modules/client/preferences/species_features/lizard.dm @@ -32,10 +32,10 @@ relevant_mutant_bodypart = "body_markings" /datum/preference/choiced/lizard_body_markings/init_possible_values() - return assoc_to_keys_features(GLOB.body_markings_list) + return assoc_to_keys_features(SSaccessories.body_markings_list) /datum/preference/choiced/lizard_body_markings/icon_for(value) - var/datum/sprite_accessory/sprite_accessory = GLOB.body_markings_list[value] + var/datum/sprite_accessory/sprite_accessory = SSaccessories.body_markings_list[value] var/icon/final_icon = icon('icons/mob/human/species/lizard/bodyparts.dmi', "lizard_chest_m") @@ -65,10 +65,10 @@ should_generate_icons = TRUE /datum/preference/choiced/lizard_frills/init_possible_values() - return assoc_to_keys_features(GLOB.frills_list) + return assoc_to_keys_features(SSaccessories.frills_list) /datum/preference/choiced/lizard_frills/icon_for(value) - return generate_lizard_side_shot(GLOB.frills_list[value], "frills") + return generate_lizard_side_shot(SSaccessories.frills_list[value], "frills") /datum/preference/choiced/lizard_frills/apply_to_human(mob/living/carbon/human/target, value) target.dna.features["frills"] = value @@ -81,10 +81,10 @@ should_generate_icons = TRUE /datum/preference/choiced/lizard_horns/init_possible_values() - return assoc_to_keys_features(GLOB.horns_list) + return assoc_to_keys_features(SSaccessories.horns_list) /datum/preference/choiced/lizard_horns/icon_for(value) - return generate_lizard_side_shot(GLOB.horns_list[value], "horns") + return generate_lizard_side_shot(SSaccessories.horns_list[value], "horns") /datum/preference/choiced/lizard_horns/apply_to_human(mob/living/carbon/human/target, value) target.dna.features["horns"] = value @@ -96,7 +96,7 @@ relevant_mutant_bodypart = "legs" /datum/preference/choiced/lizard_legs/init_possible_values() - return assoc_to_keys_features(GLOB.legs_list) + return assoc_to_keys_features(SSaccessories.legs_list) /datum/preference/choiced/lizard_legs/apply_to_human(mob/living/carbon/human/target, value) target.dna.features["legs"] = value @@ -109,10 +109,10 @@ should_generate_icons = TRUE /datum/preference/choiced/lizard_snout/init_possible_values() - return assoc_to_keys_features(GLOB.snouts_list) + return assoc_to_keys_features(SSaccessories.snouts_list) /datum/preference/choiced/lizard_snout/icon_for(value) - return generate_lizard_side_shot(GLOB.snouts_list[value], "snout", include_snout = FALSE) + return generate_lizard_side_shot(SSaccessories.snouts_list[value], "snout", include_snout = FALSE) /datum/preference/choiced/lizard_snout/apply_to_human(mob/living/carbon/human/target, value) target.dna.features["snout"] = value @@ -124,7 +124,7 @@ relevant_mutant_bodypart = "spines" /datum/preference/choiced/lizard_spines/init_possible_values() - return assoc_to_keys_features(GLOB.spines_list) + return assoc_to_keys_features(SSaccessories.spines_list) /datum/preference/choiced/lizard_spines/apply_to_human(mob/living/carbon/human/target, value) target.dna.features["spines"] = value @@ -136,7 +136,7 @@ relevant_external_organ = /obj/item/organ/external/tail/lizard /datum/preference/choiced/lizard_tail/init_possible_values() - return assoc_to_keys_features(GLOB.tails_list_lizard) + return assoc_to_keys_features(SSaccessories.tails_list_lizard) /datum/preference/choiced/lizard_tail/apply_to_human(mob/living/carbon/human/target, value) target.dna.features["tail_lizard"] = value diff --git a/code/modules/client/preferences/species_features/monkey.dm b/code/modules/client/preferences/species_features/monkey.dm index b25d2cdfab8..adf9e367723 100644 --- a/code/modules/client/preferences/species_features/monkey.dm +++ b/code/modules/client/preferences/species_features/monkey.dm @@ -5,7 +5,7 @@ relevant_external_organ = /obj/item/organ/external/tail/monkey /datum/preference/choiced/monkey_tail/init_possible_values() - return assoc_to_keys_features(GLOB.tails_list_monkey) + return assoc_to_keys_features(SSaccessories.tails_list_monkey) /datum/preference/choiced/monkey_tail/apply_to_human(mob/living/carbon/human/target, value) target.dna.features["tail_monkey"] = value diff --git a/code/modules/client/preferences/species_features/moth.dm b/code/modules/client/preferences/species_features/moth.dm index 120a7ea822b..745e6fb917b 100644 --- a/code/modules/client/preferences/species_features/moth.dm +++ b/code/modules/client/preferences/species_features/moth.dm @@ -6,7 +6,7 @@ should_generate_icons = TRUE /datum/preference/choiced/moth_antennae/init_possible_values() - return assoc_to_keys_features(GLOB.moth_antennae_list) + return assoc_to_keys_features(SSaccessories.moth_antennae_list) /datum/preference/choiced/moth_antennae/icon_for(value) var/static/icon/moth_head @@ -16,7 +16,7 @@ moth_head.Blend(icon('icons/mob/human/human_face.dmi', "motheyes_l"), ICON_OVERLAY) moth_head.Blend(icon('icons/mob/human/human_face.dmi', "motheyes_r"), ICON_OVERLAY) - var/datum/sprite_accessory/antennae = GLOB.moth_antennae_list[value] + var/datum/sprite_accessory/antennae = SSaccessories.moth_antennae_list[value] var/icon/icon_with_antennae = new(moth_head) icon_with_antennae.Blend(icon(antennae.icon, "m_moth_antennae_[antennae.icon_state]_FRONT"), ICON_OVERLAY) @@ -37,7 +37,7 @@ relevant_mutant_bodypart = "moth_markings" /datum/preference/choiced/moth_markings/init_possible_values() - return assoc_to_keys_features(GLOB.moth_markings_list) + return assoc_to_keys_features(SSaccessories.moth_markings_list) /datum/preference/choiced/moth_markings/icon_for(value) var/static/list/body_parts = list( @@ -59,7 +59,7 @@ moth_body.Blend(icon('icons/mob/human/human_face.dmi', "motheyes_l"), ICON_OVERLAY) moth_body.Blend(icon('icons/mob/human/human_face.dmi', "motheyes_r"), ICON_OVERLAY) - var/datum/sprite_accessory/markings = GLOB.moth_markings_list[value] + var/datum/sprite_accessory/markings = SSaccessories.moth_markings_list[value] var/icon/icon_with_markings = new(moth_body) if (value != "None") @@ -88,10 +88,10 @@ should_generate_icons = TRUE /datum/preference/choiced/moth_wings/init_possible_values() - return assoc_to_keys_features(GLOB.moth_wings_list) + return assoc_to_keys_features(SSaccessories.moth_wings_list) /datum/preference/choiced/moth_wings/icon_for(value) - var/datum/sprite_accessory/moth_wings = GLOB.moth_wings_list[value] + var/datum/sprite_accessory/moth_wings = SSaccessories.moth_wings_list[value] var/icon/final_icon = icon(moth_wings.icon, "m_moth_wings_[moth_wings.icon_state]_BEHIND") final_icon.Blend(icon(moth_wings.icon, "m_moth_wings_[moth_wings.icon_state]_FRONT"), ICON_OVERLAY) return final_icon diff --git a/code/modules/client/preferences/species_features/mushperson.dm b/code/modules/client/preferences/species_features/mushperson.dm index f5e6a08ac92..45bd9c4b726 100644 --- a/code/modules/client/preferences/species_features/mushperson.dm +++ b/code/modules/client/preferences/species_features/mushperson.dm @@ -5,7 +5,7 @@ relevant_mutant_bodypart = "cap" /datum/preference/choiced/mushroom_cap/init_possible_values() - return assoc_to_keys_features(GLOB.caps_list) + return assoc_to_keys_features(SSaccessories.caps_list) /datum/preference/choiced/mushroom_cap/apply_to_human(mob/living/carbon/human/target, value) target.dna.features["caps"] = value diff --git a/code/modules/client/preferences/species_features/pod.dm b/code/modules/client/preferences/species_features/pod.dm index 5280308fa89..de3d5221f7a 100644 --- a/code/modules/client/preferences/species_features/pod.dm +++ b/code/modules/client/preferences/species_features/pod.dm @@ -6,10 +6,10 @@ should_generate_icons = TRUE /datum/preference/choiced/pod_hair/init_possible_values() - return assoc_to_keys_features(GLOB.pod_hair_list) + return assoc_to_keys_features(SSaccessories.pod_hair_list) /datum/preference/choiced/pod_hair/icon_for(value) - var/datum/sprite_accessory/pod_hair = GLOB.pod_hair_list[value] + var/datum/sprite_accessory/pod_hair = SSaccessories.pod_hair_list[value] var/icon/icon_with_hair = icon('icons/mob/human/bodyparts_greyscale.dmi', "pod_head_m") @@ -24,7 +24,7 @@ return icon_with_hair /datum/preference/choiced/pod_hair/create_default_value() - return pick(assoc_to_keys_features(GLOB.pod_hair_list)) + return pick(assoc_to_keys_features(SSaccessories.pod_hair_list)) /datum/preference/choiced/pod_hair/apply_to_human(mob/living/carbon/human/target, value) target.dna.features["pod_hair"] = value diff --git a/code/modules/clothing/head/wig.dm b/code/modules/clothing/head/wig.dm index 5ab2bcad214..ecd70742ba8 100644 --- a/code/modules/clothing/head/wig.dm +++ b/code/modules/clothing/head/wig.dm @@ -25,7 +25,7 @@ item_flags &= ~EXAMINE_SKIP /obj/item/clothing/head/wig/update_icon_state() - var/datum/sprite_accessory/hair/hair_style = GLOB.hairstyles_list[hairstyle] + var/datum/sprite_accessory/hair/hair_style = SSaccessories.hairstyles_list[hairstyle] if(hair_style) icon = hair_style.icon icon_state = hair_style.icon_state @@ -36,7 +36,7 @@ if(isinhands) return - var/datum/sprite_accessory/hair/hair = GLOB.hairstyles_list[hairstyle] + var/datum/sprite_accessory/hair/hair = SSaccessories.hairstyles_list[hairstyle] if(!hair) return @@ -49,7 +49,7 @@ hair_overlay.overlays += emissive_blocker(hair_overlay.icon, hair_overlay.icon_state, src, alpha = hair_overlay.alpha) /obj/item/clothing/head/wig/attack_self(mob/user) - var/new_style = tgui_input_list(user, "Select a hairstyle", "Wig Styling", GLOB.hairstyles_list - "Bald") + var/new_style = tgui_input_list(user, "Select a hairstyle", "Wig Styling", SSaccessories.hairstyles_list - "Bald") var/newcolor = adjustablecolor ? input(usr,"","Choose Color",color) as color|null : null if(!user.can_perform_action(src)) return @@ -92,7 +92,7 @@ update_appearance() /obj/item/clothing/head/wig/random/Initialize(mapload) - hairstyle = pick(GLOB.hairstyles_list - "Bald") //Don't want invisible wig + hairstyle = pick(SSaccessories.hairstyles_list - "Bald") //Don't want invisible wig add_atom_colour("#[random_short_color()]", FIXED_COLOUR_PRIORITY) . = ..() @@ -104,7 +104,7 @@ custom_price = PAYCHECK_COMMAND /obj/item/clothing/head/wig/natural/Initialize(mapload) - hairstyle = pick(GLOB.hairstyles_list - "Bald") + hairstyle = pick(SSaccessories.hairstyles_list - "Bald") . = ..() /obj/item/clothing/head/wig/natural/visual_equipped(mob/living/carbon/human/user, slot) diff --git a/code/modules/food_and_drinks/restaurant/customers/_customer.dm b/code/modules/food_and_drinks/restaurant/customers/_customer.dm index 47bb843d755..15e4659338d 100644 --- a/code/modules/food_and_drinks/restaurant/customers/_customer.dm +++ b/code/modules/food_and_drinks/restaurant/customers/_customer.dm @@ -306,7 +306,7 @@ /datum/customer_data/moth/proc/get_wings(mob/living/basic/robot_customer/customer) var/customer_ref = WEAKREF(customer) if (!LAZYACCESS(wings_chosen, customer_ref)) - LAZYSET(wings_chosen, customer_ref, GLOB.moth_wings_list[pick(GLOB.moth_wings_list)]) + LAZYSET(wings_chosen, customer_ref, SSaccessories.moth_wings_list[pick(SSaccessories.moth_wings_list)]) return wings_chosen[customer_ref] /datum/customer_data/moth/get_underlays(mob/living/basic/robot_customer/customer) diff --git a/code/modules/hydroponics/grown/replicapod.dm b/code/modules/hydroponics/grown/replicapod.dm index c4e3b27673a..31c0b7f81df 100644 --- a/code/modules/hydroponics/grown/replicapod.dm +++ b/code/modules/hydroponics/grown/replicapod.dm @@ -197,7 +197,7 @@ if(!features["mcolor"]) features["mcolor"] = "#59CE00" if(!features["pod_hair"]) - features["pod_hair"] = pick(GLOB.pod_hair_list) + features["pod_hair"] = pick(SSaccessories.pod_hair_list) for(var/V in quirks) new V(podman) diff --git a/code/modules/mining/lavaland/tendril_loot.dm b/code/modules/mining/lavaland/tendril_loot.dm index c8d0f5580d7..8a90f0e548c 100644 --- a/code/modules/mining/lavaland/tendril_loot.dm +++ b/code/modules/mining/lavaland/tendril_loot.dm @@ -566,7 +566,7 @@ var/list/name2type = list() for(var/obj/item/organ/external/wings/functional/possible_type as anything in wing_types) var/datum/sprite_accessory/accessory = initial(possible_type.sprite_accessory_override) //get the type - accessory = GLOB.wings_list[initial(accessory.name)] //get the singleton instance + accessory = SSaccessories.wings_list[initial(accessory.name)] //get the singleton instance var/image/img = image(icon = accessory.icon, icon_state = "m_wingsopen_[accessory.icon_state]_BEHIND") //Process the HUD elements img.transform *= 0.5 img.pixel_x = -32 diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index 18b55cd6a5f..f7e4b56cab2 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -221,7 +221,7 @@ GLOBAL_VAR_INIT(observer_default_invisibility, INVISIBILITY_OBSERVER) if(ghost_accs == GHOST_ACCS_FULL && (icon_state in GLOB.ghost_forms_with_accessories_list)) //check if this form supports accessories and if the client wants to show them if(facial_hairstyle) - var/datum/sprite_accessory/S = GLOB.facial_hairstyles_list[facial_hairstyle] + var/datum/sprite_accessory/S = SSaccessories.facial_hairstyles_list[facial_hairstyle] if(S) facial_hair_overlay = mutable_appearance(S.icon, "[S.icon_state]", -HAIR_LAYER) if(facial_hair_color) @@ -229,7 +229,7 @@ GLOBAL_VAR_INIT(observer_default_invisibility, INVISIBILITY_OBSERVER) facial_hair_overlay.alpha = 200 add_overlay(facial_hair_overlay) if(hairstyle) - var/datum/sprite_accessory/hair/S = GLOB.hairstyles_list[hairstyle] + var/datum/sprite_accessory/hair/S = SSaccessories.hairstyles_list[hairstyle] if(S) hair_overlay = mutable_appearance(S.icon, "[S.icon_state]", -HAIR_LAYER) if(hair_color) diff --git a/code/modules/mob/living/basic/space_fauna/ghost.dm b/code/modules/mob/living/basic/space_fauna/ghost.dm index 7545f9cfea3..728c5ead9f4 100644 --- a/code/modules/mob/living/basic/space_fauna/ghost.dm +++ b/code/modules/mob/living/basic/space_fauna/ghost.dm @@ -71,7 +71,7 @@ ghost_facial_hair_color = ghost_hair_color if(!isnull(ghost_hairstyle) && ghost_hairstyle != "Bald") //Bald hairstyle and the Shaved facial hairstyle lack an associated sprite and will not properly generate hair, and just cause runtimes. - var/datum/sprite_accessory/hair/hair_style = GLOB.hairstyles_list[ghost_hairstyle] //We use the hairstyle name to get the sprite accessory, which we copy the icon_state from. + var/datum/sprite_accessory/hair/hair_style = SSaccessories.hairstyles_list[ghost_hairstyle] //We use the hairstyle name to get the sprite accessory, which we copy the icon_state from. ghost_hair = mutable_appearance('icons/mob/human/human_face.dmi', "[hair_style.icon_state]", -HAIR_LAYER) ghost_hair.alpha = 200 ghost_hair.color = ghost_hair_color @@ -79,7 +79,7 @@ add_overlay(ghost_hair) if(!isnull(ghost_facial_hairstyle) && ghost_facial_hairstyle != "Shaved") - var/datum/sprite_accessory/facial_hair_style = GLOB.facial_hairstyles_list[ghost_facial_hairstyle] + var/datum/sprite_accessory/facial_hair_style = SSaccessories.facial_hairstyles_list[ghost_facial_hairstyle] ghost_facial_hair = mutable_appearance('icons/mob/human/human_face.dmi', "[facial_hair_style.icon_state]", -HAIR_LAYER) ghost_facial_hair.alpha = 200 ghost_facial_hair.color = ghost_facial_hair_color diff --git a/code/modules/mob/living/carbon/human/_species.dm b/code/modules/mob/living/carbon/human/_species.dm index 26b0b1b8c22..adfe93d318d 100644 --- a/code/modules/mob/living/carbon/human/_species.dm +++ b/code/modules/mob/living/carbon/human/_species.dm @@ -595,8 +595,9 @@ GLOBAL_LIST_EMPTY(features_by_species) var/obj/item/bodypart/arm/left/left_arm = species_human.get_bodypart(BODY_ZONE_L_ARM) var/obj/item/bodypart/leg/right/right_leg = species_human.get_bodypart(BODY_ZONE_R_LEG) var/obj/item/bodypart/leg/left/left_leg = species_human.get_bodypart(BODY_ZONE_L_LEG) - var/datum/sprite_accessory/markings = GLOB.moth_markings_list[species_human.dna.features["moth_markings"]] + var/datum/sprite_accessory/markings = SSaccessories.moth_markings_list[species_human.dna.features["moth_markings"]] var/mutable_appearance/marking = mutable_appearance(layer = -BODY_LAYER, appearance_flags = KEEP_TOGETHER) + if(noggin && (IS_ORGANIC_LIMB(noggin))) var/mutable_appearance/markings_head_overlay = mutable_appearance(markings.icon, "[markings.icon_state]_head") marking.overlays += markings_head_overlay @@ -626,7 +627,7 @@ GLOBAL_LIST_EMPTY(features_by_species) //Underwear, Undershirts & Socks if(!HAS_TRAIT(species_human, TRAIT_NO_UNDERWEAR)) if(species_human.underwear) - var/datum/sprite_accessory/underwear/underwear = GLOB.underwear_list[species_human.underwear] + var/datum/sprite_accessory/underwear/underwear = SSaccessories.underwear_list[species_human.underwear] var/mutable_appearance/underwear_overlay if(underwear) if(species_human.dna.species.sexes && species_human.physique == FEMALE && (underwear.gender == MALE)) @@ -638,7 +639,7 @@ GLOBAL_LIST_EMPTY(features_by_species) standing += underwear_overlay if(species_human.undershirt) - var/datum/sprite_accessory/undershirt/undershirt = GLOB.undershirt_list[species_human.undershirt] + var/datum/sprite_accessory/undershirt/undershirt = SSaccessories.undershirt_list[species_human.undershirt] if(undershirt) var/mutable_appearance/working_shirt if(species_human.dna.species.sexes && species_human.physique == FEMALE) @@ -648,7 +649,7 @@ GLOBAL_LIST_EMPTY(features_by_species) standing += working_shirt if(species_human.socks && species_human.num_legs >= 2 && !(species_human.bodyshape & BODYSHAPE_DIGITIGRADE)) - var/datum/sprite_accessory/socks/socks = GLOB.socks_list[species_human.socks] + var/datum/sprite_accessory/socks/socks = SSaccessories.socks_list[species_human.socks] if(socks) standing += mutable_appearance(socks.icon, socks.icon_state, -BODY_LAYER) @@ -698,11 +699,11 @@ GLOBAL_LIST_EMPTY(features_by_species) var/datum/sprite_accessory/accessory switch(bodypart) if("ears") - accessory = GLOB.ears_list[source.dna.features["ears"]] + accessory = SSaccessories.ears_list[source.dna.features["ears"]] if("body_markings") - accessory = GLOB.body_markings_list[source.dna.features["body_markings"]] + accessory = SSaccessories.body_markings_list[source.dna.features["body_markings"]] if("legs") - accessory = GLOB.legs_list[source.dna.features["legs"]] + accessory = SSaccessories.legs_list[source.dna.features["legs"]] if(!accessory || accessory.icon_state == "none") continue diff --git a/code/modules/mob/living/carbon/human/dummy.dm b/code/modules/mob/living/carbon/human/dummy.dm index d17661cf562..627745cba92 100644 --- a/code/modules/mob/living/carbon/human/dummy.dm +++ b/code/modules/mob/living/carbon/human/dummy.dm @@ -103,19 +103,19 @@ INITIALIZE_IMMEDIATE(/mob/living/carbon/human/dummy) /proc/create_consistent_human_dna(mob/living/carbon/human/target) target.dna.features["mcolor"] = COLOR_VIBRANT_LIME target.dna.features["ethcolor"] = COLOR_WHITE - target.dna.features["body_markings"] = get_consistent_feature_entry(GLOB.body_markings_list) - target.dna.features["ears"] = get_consistent_feature_entry(GLOB.ears_list) - target.dna.features["frills"] = get_consistent_feature_entry(GLOB.frills_list) - target.dna.features["horns"] = get_consistent_feature_entry(GLOB.horns_list) - target.dna.features["moth_antennae"] = get_consistent_feature_entry(GLOB.moth_antennae_list) - target.dna.features["moth_markings"] = get_consistent_feature_entry(GLOB.moth_markings_list) - target.dna.features["moth_wings"] = get_consistent_feature_entry(GLOB.moth_wings_list) - target.dna.features["snout"] = get_consistent_feature_entry(GLOB.snouts_list) - target.dna.features["spines"] = get_consistent_feature_entry(GLOB.spines_list) - target.dna.features["tail_cat"] = get_consistent_feature_entry(GLOB.tails_list_human) // it's a lie - target.dna.features["tail_lizard"] = get_consistent_feature_entry(GLOB.tails_list_lizard) - target.dna.features["tail_monkey"] = get_consistent_feature_entry(GLOB.tails_list_monkey) - target.dna.features["pod_hair"] = get_consistent_feature_entry(GLOB.pod_hair_list) + target.dna.features["body_markings"] = get_consistent_feature_entry(SSaccessories.body_markings_list) + target.dna.features["ears"] = get_consistent_feature_entry(SSaccessories.ears_list) + target.dna.features["frills"] = get_consistent_feature_entry(SSaccessories.frills_list) + target.dna.features["horns"] = get_consistent_feature_entry(SSaccessories.horns_list) + target.dna.features["moth_antennae"] = get_consistent_feature_entry(SSaccessories.moth_antennae_list) + target.dna.features["moth_markings"] = get_consistent_feature_entry(SSaccessories.moth_markings_list) + target.dna.features["moth_wings"] = get_consistent_feature_entry(SSaccessories.moth_wings_list) + target.dna.features["snout"] = get_consistent_feature_entry(SSaccessories.snouts_list) + target.dna.features["spines"] = get_consistent_feature_entry(SSaccessories.spines_list) + target.dna.features["tail_cat"] = get_consistent_feature_entry(SSaccessories.tails_list_human) // it's a lie + target.dna.features["tail_lizard"] = get_consistent_feature_entry(SSaccessories.tails_list_lizard) + target.dna.features["tail_monkey"] = get_consistent_feature_entry(SSaccessories.tails_list_monkey) + target.dna.features["pod_hair"] = get_consistent_feature_entry(SSaccessories.pod_hair_list) target.dna.initialize_dna(create_mutation_blocks = FALSE, randomize_features = FALSE) // UF and UI are nondeterministic, even though the features are the same some blocks will randomize slightly // In practice this doesn't matter, but this is for the sake of 100%(ish) consistency diff --git a/code/modules/mob/living/carbon/human/species_types/lizardpeople.dm b/code/modules/mob/living/carbon/human/species_types/lizardpeople.dm index 93167cb689c..1b478162de4 100644 --- a/code/modules/mob/living/carbon/human/species_types/lizardpeople.dm +++ b/code/modules/mob/living/carbon/human/species_types/lizardpeople.dm @@ -61,7 +61,7 @@ /datum/species/lizard/randomize_features() var/list/features = ..() - features["body_markings"] = pick(GLOB.body_markings_list) + features["body_markings"] = pick(SSaccessories.body_markings_list) return features /datum/species/lizard/get_scream_sound(mob/living/carbon/human/lizard) diff --git a/code/modules/mob/living/carbon/human/species_types/mothmen.dm b/code/modules/mob/living/carbon/human/species_types/mothmen.dm index 86a9180ed07..e52a19b587b 100644 --- a/code/modules/mob/living/carbon/human/species_types/mothmen.dm +++ b/code/modules/mob/living/carbon/human/species_types/mothmen.dm @@ -61,7 +61,7 @@ /datum/species/moth/randomize_features() var/list/features = ..() - features["moth_markings"] = pick(GLOB.moth_markings_list) + features["moth_markings"] = pick(SSaccessories.moth_markings_list) return features /datum/species/moth/get_scream_sound(mob/living/carbon/human) diff --git a/code/modules/mob/living/carbon/human/species_types/mushpeople.dm b/code/modules/mob/living/carbon/human/species_types/mushpeople.dm index f3486f1342f..14d6c1437f0 100644 --- a/code/modules/mob/living/carbon/human/species_types/mushpeople.dm +++ b/code/modules/mob/living/carbon/human/species_types/mushpeople.dm @@ -83,7 +83,7 @@ feature_key = "caps" /datum/bodypart_overlay/mutant/mushroom_cap/get_global_feature_list() - return GLOB.caps_list + return SSaccessories.caps_list /datum/bodypart_overlay/mutant/mushroom_cap/can_draw_on_bodypart(mob/living/carbon/human/human) if((human.head?.flags_inv & HIDEHAIR) || (human.wear_mask?.flags_inv & HIDEHAIR)) diff --git a/code/modules/reagents/chemistry/reagents/other_reagents.dm b/code/modules/reagents/chemistry/reagents/other_reagents.dm index 991cd5d3098..9859617ce42 100644 --- a/code/modules/reagents/chemistry/reagents/other_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/other_reagents.dm @@ -2201,10 +2201,10 @@ var/mob/living/carbon/human/exposed_human = exposed_mob if(!HAS_TRAIT(exposed_human, TRAIT_SHAVED)) - var/datum/sprite_accessory/facial_hair/picked_beard = pick(GLOB.facial_hairstyles_list) + var/datum/sprite_accessory/facial_hair/picked_beard = pick(SSaccessories.facial_hairstyles_list) exposed_human.set_facial_hairstyle(picked_beard, update = FALSE) if(!HAS_TRAIT(exposed_human, TRAIT_BALD)) - var/datum/sprite_accessory/hair/picked_hair = pick(GLOB.hairstyles_list) + var/datum/sprite_accessory/hair/picked_hair = pick(SSaccessories.hairstyles_list) exposed_human.set_hairstyle(picked_hair, update = TRUE) to_chat(exposed_human, span_notice("Hair starts sprouting from your [HAS_TRAIT(exposed_human, TRAIT_BALD) ? "face" : "scalp"].")) diff --git a/code/modules/surgery/bodyparts/head_hair_and_lips.dm b/code/modules/surgery/bodyparts/head_hair_and_lips.dm index aa0196b187a..453bd79ee22 100644 --- a/code/modules/surgery/bodyparts/head_hair_and_lips.dm +++ b/code/modules/surgery/bodyparts/head_hair_and_lips.dm @@ -84,7 +84,7 @@ var/image/facial_hair_overlay if(!facial_hair_hidden && facial_hairstyle && (head_flags & HEAD_FACIAL_HAIR)) - sprite_accessory = GLOB.facial_hairstyles_list[facial_hairstyle] + sprite_accessory = SSaccessories.facial_hairstyles_list[facial_hairstyle] if(sprite_accessory) //Overlay facial_hair_overlay = image(sprite_accessory.icon, sprite_accessory.icon_state, -HAIR_LAYER, image_dir) @@ -99,12 +99,12 @@ var/facial_hair_gradient_style = LAZYACCESS(gradient_styles, GRADIENT_FACIAL_HAIR_KEY) if(facial_hair_gradient_style) var/facial_hair_gradient_color = LAZYACCESS(gradient_colors, GRADIENT_FACIAL_HAIR_KEY) - var/image/facial_hair_gradient_overlay = get_gradient_overlay(sprite_accessory.icon, sprite_accessory.icon_state, -HAIR_LAYER, GLOB.facial_hair_gradients_list[facial_hair_gradient_style], facial_hair_gradient_color, image_dir) + var/image/facial_hair_gradient_overlay = get_gradient_overlay(sprite_accessory.icon, sprite_accessory.icon_state, -HAIR_LAYER, SSaccessories.facial_hair_gradients_list[facial_hair_gradient_style], facial_hair_gradient_color, image_dir) . += facial_hair_gradient_overlay var/image/hair_overlay if(!(show_debrained && (head_flags & HEAD_DEBRAIN)) && !hair_hidden && hairstyle && (head_flags & HEAD_HAIR)) - var/datum/sprite_accessory/hair/hair_sprite_accessory = GLOB.hairstyles_list[hairstyle] + var/datum/sprite_accessory/hair/hair_sprite_accessory = SSaccessories.hairstyles_list[hairstyle] if(hair_sprite_accessory) //Overlay hair_overlay = image(hair_sprite_accessory.icon, hair_sprite_accessory.icon_state, -HAIR_LAYER, image_dir) @@ -120,7 +120,7 @@ var/hair_gradient_style = LAZYACCESS(gradient_styles, GRADIENT_HAIR_KEY) if(hair_gradient_style) var/hair_gradient_color = LAZYACCESS(gradient_colors, GRADIENT_HAIR_KEY) - var/image/hair_gradient_overlay = get_gradient_overlay(hair_sprite_accessory.icon, hair_sprite_accessory.icon_state, -HAIR_LAYER, GLOB.hair_gradients_list[hair_gradient_style], hair_gradient_color, image_dir) + var/image/hair_gradient_overlay = get_gradient_overlay(hair_sprite_accessory.icon, hair_sprite_accessory.icon_state, -HAIR_LAYER, SSaccessories.hair_gradients_list[hair_gradient_style], hair_gradient_color, image_dir) hair_gradient_overlay.pixel_y = hair_sprite_accessory.y_offset . += hair_gradient_overlay diff --git a/code/modules/surgery/organs/external/_external_organ.dm b/code/modules/surgery/organs/external/_external_organ.dm index b58f08fe97d..a054bc741e6 100644 --- a/code/modules/surgery/organs/external/_external_organ.dm +++ b/code/modules/surgery/organs/external/_external_organ.dm @@ -182,7 +182,7 @@ return TRUE /datum/bodypart_overlay/mutant/horns/get_global_feature_list() - return GLOB.horns_list + return SSaccessories.horns_list ///The frills of a lizard (like weird fin ears) /obj/item/organ/external/frills @@ -209,7 +209,7 @@ return FALSE /datum/bodypart_overlay/mutant/frills/get_global_feature_list() - return GLOB.frills_list + return SSaccessories.frills_list ///Guess what part of the lizard this is? /obj/item/organ/external/snout @@ -238,7 +238,7 @@ return FALSE /datum/bodypart_overlay/mutant/snout/get_global_feature_list() - return GLOB.snouts_list + return SSaccessories.snouts_list ///A moth's antennae /obj/item/organ/external/antennae @@ -315,7 +315,7 @@ burn_datum = fetch_sprite_datum(burn_datum) //turn the path into the singleton instance /datum/bodypart_overlay/mutant/antennae/get_global_feature_list() - return GLOB.moth_antennae_list + return SSaccessories.moth_antennae_list /datum/bodypart_overlay/mutant/antennae/get_base_icon_state() return burnt ? burn_datum.icon_state : sprite_datum.icon_state @@ -347,7 +347,7 @@ var/color_inverse_base = 255 /datum/bodypart_overlay/mutant/pod_hair/get_global_feature_list() - return GLOB.pod_hair_list + return SSaccessories.pod_hair_list /datum/bodypart_overlay/mutant/pod_hair/color_image(image/overlay, draw_layer, obj/item/bodypart/limb) if(draw_layer != bitflag_to_layer(color_swapped_layer)) diff --git a/code/modules/surgery/organs/external/spines.dm b/code/modules/surgery/organs/external/spines.dm index 743b7fa8d47..86bff9a7689 100644 --- a/code/modules/surgery/organs/external/spines.dm +++ b/code/modules/surgery/organs/external/spines.dm @@ -32,7 +32,7 @@ feature_key = "spines" /datum/bodypart_overlay/mutant/spines/get_global_feature_list() - return GLOB.spines_list + return SSaccessories.spines_list /datum/bodypart_overlay/mutant/spines/can_draw_on_bodypart(mob/living/carbon/human/human) . = ..() diff --git a/code/modules/surgery/organs/external/tails.dm b/code/modules/surgery/organs/external/tails.dm index ab71e3ac9f3..38b35bce45c 100644 --- a/code/modules/surgery/organs/external/tails.dm +++ b/code/modules/surgery/organs/external/tails.dm @@ -151,7 +151,7 @@ wag_flags = WAG_ABLE /datum/bodypart_overlay/mutant/tail/get_global_feature_list() - return GLOB.tails_list_human + return SSaccessories.tails_list_human /obj/item/organ/external/tail/cat/get_butt_sprite() return BUTT_SPRITE_CAT @@ -175,7 +175,7 @@ feature_key = "tail_monkey" /datum/bodypart_overlay/mutant/tail/monkey/get_global_feature_list() - return GLOB.tails_list_monkey + return SSaccessories.tails_list_monkey /obj/item/organ/external/tail/lizard name = "lizard tail" @@ -192,7 +192,7 @@ feature_key = "tail_lizard" /datum/bodypart_overlay/mutant/tail/lizard/get_global_feature_list() - return GLOB.tails_list_lizard + return SSaccessories.tails_list_lizard /obj/item/organ/external/tail/lizard/fake name = "fabricated lizard tail" @@ -208,7 +208,7 @@ var/tail_spine_key = NONE /datum/bodypart_overlay/mutant/tail_spines/get_global_feature_list() - return GLOB.tail_spines_list + return SSaccessories.tail_spines_list /datum/bodypart_overlay/mutant/tail_spines/get_base_icon_state() return (!isnull(tail_spine_key) ? "[tail_spine_key]_" : "") + (wagging ? "wagging_" : "") + sprite_datum.icon_state // Select the wagging state if appropriate diff --git a/code/modules/surgery/organs/external/wings/functional_wings.dm b/code/modules/surgery/organs/external/wings/functional_wings.dm index aacf6f08f6a..5f2851b4676 100644 --- a/code/modules/surgery/organs/external/wings/functional_wings.dm +++ b/code/modules/surgery/organs/external/wings/functional_wings.dm @@ -139,9 +139,9 @@ /datum/bodypart_overlay/mutant/wings/functional/get_global_feature_list() if(wings_open) - return GLOB.wings_open_list + return SSaccessories.wings_open_list else - return GLOB.wings_list + return SSaccessories.wings_list ///Update our wingsprite to the open wings variant /datum/bodypart_overlay/mutant/wings/functional/proc/open_wings() diff --git a/code/modules/surgery/organs/external/wings/moth_wings.dm b/code/modules/surgery/organs/external/wings/moth_wings.dm index f4e0f156e70..11aebf4e8f1 100644 --- a/code/modules/surgery/organs/external/wings/moth_wings.dm +++ b/code/modules/surgery/organs/external/wings/moth_wings.dm @@ -84,7 +84,7 @@ burn_datum = fetch_sprite_datum(burn_datum) /datum/bodypart_overlay/mutant/wings/moth/get_global_feature_list() - return GLOB.moth_wings_list + return SSaccessories.moth_wings_list /datum/bodypart_overlay/mutant/wings/moth/can_draw_on_bodypart(mob/living/carbon/human/human) if(!(human.wear_suit?.flags_inv & HIDEMUTWINGS)) diff --git a/tgstation.dme b/tgstation.dme index 3e6731b1801..7e6bf667f0c 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -690,6 +690,7 @@ #include "code\controllers\subsystem\sounds.dm" #include "code\controllers\subsystem\spatial_gridmap.dm" #include "code\controllers\subsystem\speech_controller.dm" +#include "code\controllers\subsystem\sprite_accessories.dm" #include "code\controllers\subsystem\statpanel.dm" #include "code\controllers\subsystem\stickyban.dm" #include "code\controllers\subsystem\stock_market.dm"