From a910c9be1582b14e073e57304f1d3f9857fd18f0 Mon Sep 17 00:00:00 2001 From: Verkister Date: Mon, 19 Mar 2018 13:19:12 +0200 Subject: [PATCH 1/4] Adds a verb to switch tail layer. --- .../mob/living/carbon/human/emote_vr.dm | 7 + .../mob/living/carbon/human/update_icons.dm | 176 +++++++++++------- code/modules/vore/eating/living_vr.dm | 1 + 3 files changed, 116 insertions(+), 68 deletions(-) diff --git a/code/modules/mob/living/carbon/human/emote_vr.dm b/code/modules/mob/living/carbon/human/emote_vr.dm index 0b6b9ea7af..46a12d0d8c 100644 --- a/code/modules/mob/living/carbon/human/emote_vr.dm +++ b/code/modules/mob/living/carbon/human/emote_vr.dm @@ -104,3 +104,10 @@ return 0 change_gender_identity(new_gender_identity) return 1 + +/mob/living/carbon/human/verb/switch_tail_layer() + set name = "Switch tail layer" + set category = "IC" + set desc = "Switch tail layer on top." + tail_alt = !tail_alt + update_tail_showing() \ No newline at end of file diff --git a/code/modules/mob/living/carbon/human/update_icons.dm b/code/modules/mob/living/carbon/human/update_icons.dm index 0db94400c5..07c76f79c0 100644 --- a/code/modules/mob/living/carbon/human/update_icons.dm +++ b/code/modules/mob/living/carbon/human/update_icons.dm @@ -10,10 +10,10 @@ var/global/list/damage_icon_parts = list() //see UpdateDamageIcon() //////////////////////////////////////////////////////////////////////////////////////////////// // # Human Icon Updating System // -// This system takes care of the "icon" for human mobs. Of course humans don't just have a single -// icon+icon_state, but a combination of dozens of little sprites including including the body, +// This system takes care of the "icon" for human mobs. Of course humans don't just have a single +// icon+icon_state, but a combination of dozens of little sprites including including the body, // clothing, equipment, in-universe HUD images, etc. -// +// // # Basic Operation // Whenever you do something that should update the on-mob appearance of a worn or held item, You // will need to call the relevant update_inv_* proc. All of these are named after the variable they @@ -25,14 +25,14 @@ var/global/list/damage_icon_parts = list() //see UpdateDamageIcon() // only get assigned to the mob once per tick.) // As a corrolary, this means users of this system do NOT need to tell the system when you're done // making changes. -// +// // There are also these special cases: // update_icons_body() //Handles updating your mob's icon to reflect their gender/race/complexion etc // UpdateDamageIcon() //Handles damage overlays for brute/burn damage //(will rename this when I geta round to it) ~Carn // update_skin() //Handles updating skin for species that have a skin overlay. // update_bloodied() //Handles adding/clearing the blood overlays for hands & feet. Call when bloodied or cleaned. // update_underwear() //Handles updating the sprite for underwear. -// update_hair() //Handles updating your hair and eyes overlay +// update_hair() //Handles updating your hair and eyes overlay // update_mutations() //Handles updating your appearance for certain mutations. e.g TK head-glows // update_fire() //Handles overlay from being on fire. // update_water() //Handles overlay from being submerged. @@ -87,11 +87,12 @@ var/global/list/damage_icon_parts = list() //see UpdateDamageIcon() #define L_HAND_LAYER 26 //Left-hand item #define R_HAND_LAYER 27 //Right-hand item #define WING_LAYER 28 //VOREStation edit. Simply move this up a number if things are added. -#define MODIFIER_EFFECTS_LAYER 29 //Effects drawn by modifiers -#define FIRE_LAYER 30 //'Mob on fire' overlay layer -#define WATER_LAYER 31 //'Mob submerged' overlay layer -#define TARGETED_LAYER 32 //'Aimed at' overlay layer -#define TOTAL_LAYERS 32 //VOREStation edit. <---- KEEP THIS UPDATED, should always equal the highest number here, used to initialize a list. +#define TAIL_LAYER_ALT 29 //VOREStation edit. Simply move this up a number if things are added. +#define MODIFIER_EFFECTS_LAYER 30 //Effects drawn by modifiers +#define FIRE_LAYER 31 //'Mob on fire' overlay layer +#define WATER_LAYER 32 //'Mob submerged' overlay layer +#define TARGETED_LAYER 33 //'Aimed at' overlay layer +#define TOTAL_LAYERS 33 //VOREStation edit. <---- KEEP THIS UPDATED, should always equal the highest number here, used to initialize a list. ////////////////////////////////// /mob/living/carbon/human @@ -137,11 +138,11 @@ var/global/list/damage_icon_parts = list() //see UpdateDamageIcon() // Regular stuff again. var/matrix/M = matrix() var/anim_time = 3 - + //Due to some involuntary means, you're laying now if(lying && !resting && !sleeping) anim_time = 1 //Thud - + if(lying && !species.prone_icon) //Only rotate them if we're not drawing a specific icon for being prone. M.Turn(90) M.Scale(desired_scale) @@ -337,7 +338,7 @@ var/global/list/damage_icon_parts = list() //see UpdateDamageIcon() return remove_layer(SKIN_LAYER) - + var/image/skin = species.update_skin(src) if(skin) skin.layer = BODY_LAYER+SKIN_LAYER @@ -353,7 +354,7 @@ var/global/list/damage_icon_parts = list() //see UpdateDamageIcon() return var/image/both = image(icon = 'icons/effects/effects.dmi', icon_state = "nothing", layer = BODY_LAYER+BLOOD_LAYER) - + //Bloody hands if(blood_DNA) var/image/bloodsies = image(icon = species.get_blood_mask(src), icon_state = "bloodyhands", layer = BODY_LAYER+BLOOD_LAYER) @@ -484,7 +485,7 @@ var/global/list/damage_icon_parts = list() //see UpdateDamageIcon() return remove_layer(MUTATIONS_LAYER) - + if(!LAZYLEN(mutations)) return //No mutations, no icons. @@ -495,7 +496,7 @@ var/global/list/damage_icon_parts = list() //see UpdateDamageIcon() var/image/standing = image(icon = 'icons/effects/genetics.dmi', layer = BODY_LAYER+MUTATIONS_LAYER) var/g = gender == FEMALE ? "f" : "m" - + for(var/datum/dna/gene/gene in dna_genes) if(!gene.block) continue @@ -558,7 +559,7 @@ var/global/list/damage_icon_parts = list() //see UpdateDamageIcon() //Shoes can be affected by uniform being drawn onto them update_inv_shoes() - + if(!w_uniform) return @@ -574,7 +575,7 @@ var/global/list/damage_icon_parts = list() //see UpdateDamageIcon() return remove_layer(ID_LAYER) - + if(!wear_id) return //Not wearing an ID @@ -583,7 +584,7 @@ var/global/list/damage_icon_parts = list() //see UpdateDamageIcon() var/obj/item/clothing/under/U = w_uniform if(U.displays_id) overlays_standing[ID_LAYER] = wear_id.make_worn_icon(body_type = species.get_bodytype(), slot_name = slot_wear_id_str, default_icon = INV_WEAR_ID_DEF_ICON, default_layer = ID_LAYER) - + apply_layer(ID_LAYER) /mob/living/carbon/human/update_inv_gloves() @@ -596,7 +597,7 @@ var/global/list/damage_icon_parts = list() //see UpdateDamageIcon() return //No gloves, no reason to be here. overlays_standing[GLOVES_LAYER] = gloves.make_worn_icon(body_type = species.get_bodytype(), slot_name = slot_gloves_str, default_icon = INV_GLOVES_DEF_ICON, default_layer = GLOVES_LAYER) - + apply_layer(GLOVES_LAYER) /mob/living/carbon/human/update_inv_glasses() @@ -609,7 +610,7 @@ var/global/list/damage_icon_parts = list() //see UpdateDamageIcon() return //Not wearing glasses, no need to update anything. overlays_standing[GLASSES_LAYER] = glasses.make_worn_icon(body_type = species.get_bodytype(), slot_name = slot_gloves_str, default_icon = INV_EYES_DEF_ICON, default_layer = GLASSES_LAYER) - + apply_layer(GLASSES_LAYER) /mob/living/carbon/human/update_inv_ears() @@ -623,7 +624,7 @@ var/global/list/damage_icon_parts = list() //see UpdateDamageIcon() if(!l_ear && !r_ear) return //Why bother, if no ear sprites - + // Blank image upon which to layer left & right overlays. var/image/both = image(icon = 'icons/effects/effects.dmi', icon_state = "nothing", layer = BODY_LAYER+EARS_LAYER) @@ -657,10 +658,10 @@ var/global/list/damage_icon_parts = list() //see UpdateDamageIcon() //NB: the use of a var for the layer on this one overlays_standing[shoe_layer] = shoes.make_worn_icon(body_type = species.get_bodytype(), slot_name = slot_shoes_str, default_icon = INV_FEET_DEF_ICON, default_layer = shoe_layer) - + apply_layer(SHOES_LAYER) apply_layer(SHOES_LAYER_ALT) - + /mob/living/carbon/human/update_inv_s_store() if(QDESTROYING(src)) return @@ -669,14 +670,14 @@ var/global/list/damage_icon_parts = list() //see UpdateDamageIcon() if(!s_store) return //Why bother, nothing there. - + //TODO, this is unlike the rest of the things //Basically has no variety in slot icon choices at all. WHY SPECIES ONLY?? var/t_state = s_store.item_state if(!t_state) t_state = s_store.icon_state overlays_standing[SUIT_STORE_LAYER] = image(icon = species.suit_storage_icon, icon_state = t_state, layer = BODY_LAYER+SUIT_STORE_LAYER) - + apply_layer(SUIT_STORE_LAYER) /mob/living/carbon/human/update_inv_head() @@ -684,12 +685,12 @@ var/global/list/damage_icon_parts = list() //see UpdateDamageIcon() return remove_layer(HEAD_LAYER) - + if(!head) return //No head item, why bother. overlays_standing[HEAD_LAYER] = head.make_worn_icon(body_type = species.get_bodytype(), slot_name = slot_head_str, default_icon = INV_HEAD_DEF_ICON, default_layer = HEAD_LAYER) - + apply_layer(HEAD_LAYER) /mob/living/carbon/human/update_inv_belt() @@ -701,7 +702,7 @@ var/global/list/damage_icon_parts = list() //see UpdateDamageIcon() if(!belt) return //No belt, why bother. - + //Toggle for belt layering with uniform var/belt_layer = BELT_LAYER if(istype(belt, /obj/item/weapon/storage/belt)) @@ -711,7 +712,7 @@ var/global/list/damage_icon_parts = list() //see UpdateDamageIcon() //NB: this uses a var from above overlays_standing[belt_layer] = belt.make_worn_icon(body_type = species.get_bodytype(), slot_name = slot_belt_str, default_icon = INV_BELT_DEF_ICON, default_layer = belt_layer) - + apply_layer(belt_layer) /mob/living/carbon/human/update_inv_wear_suit() @@ -730,7 +731,7 @@ var/global/list/damage_icon_parts = list() //see UpdateDamageIcon() return //No point, no suit. overlays_standing[SUIT_LAYER] = wear_suit.make_worn_icon(body_type = species.get_bodytype(), slot_name = slot_wear_suit_str, default_icon = INV_SUIT_DEF_ICON, default_layer = SUIT_LAYER) - + apply_layer(SUIT_LAYER) /mob/living/carbon/human/update_inv_pockets() @@ -744,9 +745,9 @@ var/global/list/damage_icon_parts = list() //see UpdateDamageIcon() if(!wear_mask || (head && head.flags_inv & HIDEMASK)) return //Why bother, nothing in mask slot. - + overlays_standing[FACEMASK_LAYER] = wear_mask.make_worn_icon(body_type = species.get_bodytype(), slot_name = slot_wear_mask_str, default_icon = INV_MASK_DEF_ICON, default_layer = FACEMASK_LAYER) - + apply_layer(FACEMASK_LAYER) /mob/living/carbon/human/update_inv_back() @@ -759,7 +760,7 @@ var/global/list/damage_icon_parts = list() //see UpdateDamageIcon() return //Why do anything overlays_standing[BACK_LAYER] = back.make_worn_icon(body_type = species.get_bodytype(), slot_name = slot_back_str, default_icon = INV_BACK_DEF_ICON, default_layer = BACK_LAYER) - + apply_layer(BACK_LAYER) //TODO: Carbon procs in my human update_icons?? @@ -792,7 +793,7 @@ var/global/list/damage_icon_parts = list() //see UpdateDamageIcon() return //Not cuffed, why bother overlays_standing[HANDCUFF_LAYER] = handcuffed.make_worn_icon(body_type = species.get_bodytype(), slot_name = slot_handcuffed_str, default_icon = INV_HCUFF_DEF_ICON, default_layer = HANDCUFF_LAYER) - + apply_layer(HANDCUFF_LAYER) /mob/living/carbon/human/update_inv_legcuffed() @@ -805,7 +806,7 @@ var/global/list/damage_icon_parts = list() //see UpdateDamageIcon() return //Not legcuffed, why bother. overlays_standing[LEGCUFF_LAYER] = handcuffed.make_worn_icon(body_type = species.get_bodytype(), slot_name = slot_legcuffed_str, default_icon = INV_LCUFF_DEF_ICON, default_layer = LEGCUFF_LAYER) - + apply_layer(LEGCUFF_LAYER) /mob/living/carbon/human/update_inv_r_hand() @@ -818,7 +819,7 @@ var/global/list/damage_icon_parts = list() //see UpdateDamageIcon() return //No hand, no bother. overlays_standing[R_HAND_LAYER] = r_hand.make_worn_icon(body_type = species.get_bodytype(), inhands = TRUE, slot_name = slot_r_hand_str, default_icon = INV_R_HAND_DEF_ICON, default_layer = R_HAND_LAYER) - + apply_layer(R_HAND_LAYER) /mob/living/carbon/human/update_inv_l_hand() @@ -841,11 +842,17 @@ var/global/list/damage_icon_parts = list() //see UpdateDamageIcon() remove_layer(TAIL_LAYER) // VOREStation Edit - START + remove_layer(TAIL_LAYER_ALT) var/image/vr_tail_image = get_tail_image() if(vr_tail_image) - vr_tail_image.layer = BODY_LAYER+TAIL_LAYER - overlays_standing[TAIL_LAYER] = vr_tail_image - apply_layer(TAIL_LAYER) + if(tail_alt) + vr_tail_image.layer = BODY_LAYER+TAIL_LAYER_ALT + overlays_standing[TAIL_LAYER_ALT] = vr_tail_image + apply_layer(TAIL_LAYER_ALT) + else + vr_tail_image.layer = BODY_LAYER+TAIL_LAYER + overlays_standing[TAIL_LAYER] = vr_tail_image + apply_layer(TAIL_LAYER) return // VOREStation Edit - END @@ -854,8 +861,12 @@ var/global/list/damage_icon_parts = list() //see UpdateDamageIcon() //This one is actually not that bad I guess. if(species_tail && !(wear_suit && wear_suit.flags_inv & HIDETAIL)) var/icon/tail_s = get_tail_icon() - overlays_standing[TAIL_LAYER] = image(icon = tail_s, icon_state = "[species_tail]_s", layer = BODY_LAYER+TAIL_LAYER) - animate_tail_reset() + if(tail_alt)// VOREStation Edit - START + overlays_standing[TAIL_LAYER_ALT] = image(icon = tail_s, icon_state = "[species_tail]_s", layer = BODY_LAYER+TAIL_LAYER_ALT) + animate_tail_reset() + else + overlays_standing[TAIL_LAYER] = image(icon = tail_s, icon_state = "[species_tail]_s", layer = BODY_LAYER+TAIL_LAYER) + animate_tail_reset()// VOREStation Edit - END //TODO: Is this the appropriate place for this, and not on species...? /mob/living/carbon/human/proc/get_tail_icon() @@ -879,17 +890,32 @@ var/global/list/damage_icon_parts = list() //see UpdateDamageIcon() return tail_icon /mob/living/carbon/human/proc/set_tail_state(var/t_state) - var/image/tail_overlay = overlays_standing[TAIL_LAYER] - - remove_layer(TAIL_LAYER) - - if(tail_overlay) - overlays_standing[TAIL_LAYER] = tail_overlay - if(species.get_tail_animation(src)) - tail_overlay.icon_state = t_state - . = tail_overlay - - apply_layer(TAIL_LAYER) + // VOREStation Edit - START + if(tail_alt) + var/image/tail_overlay = overlays_standing[TAIL_LAYER_ALT] + remove_layer(TAIL_LAYER_ALT) + + if(tail_overlay) + overlays_standing[TAIL_LAYER_ALT] = tail_overlay + if(species.get_tail_animation(src)) + tail_overlay.icon_state = t_state + . = tail_overlay + + apply_layer(TAIL_LAYER_ALT) + + else + var/image/tail_overlay = overlays_standing[TAIL_LAYER] + + remove_layer(TAIL_LAYER) + + if(tail_overlay) + overlays_standing[TAIL_LAYER] = tail_overlay + if(species.get_tail_animation(src)) + tail_overlay.icon_state = t_state + . = tail_overlay + + apply_layer(TAIL_LAYER) + // VOREStation Edit - END //Not really once, since BYOND can't do that. //Update this if the ability to flick() images or make looping animation start at the first frame is ever added. @@ -900,16 +926,30 @@ var/global/list/damage_icon_parts = list() //see UpdateDamageIcon() var/t_state = "[species.get_tail(src)]_once" - var/image/tail_overlay = overlays_standing[TAIL_LAYER] - if(tail_overlay && tail_overlay.icon_state == t_state) - return //let the existing animation finish + // VOREStation Edit - START + if(tail_alt) + var/image/tail_overlay = overlays_standing[TAIL_LAYER_ALT] + if(tail_overlay && tail_overlay.icon_state == t_state) + return //let the existing animation finish - tail_overlay = set_tail_state(t_state) // Calls remove_layer & apply_layer - if(tail_overlay) - spawn(20) - //check that the animation hasn't changed in the meantime - if(overlays_standing[TAIL_LAYER] == tail_overlay && tail_overlay.icon_state == t_state) - animate_tail_stop() + tail_overlay = set_tail_state(t_state) // Calls remove_layer & apply_layer + if(tail_overlay) + spawn(20) + //check that the animation hasn't changed in the meantime + if(overlays_standing[TAIL_LAYER_ALT] == tail_overlay && tail_overlay.icon_state == t_state) + animate_tail_stop() + else + var/image/tail_overlay = overlays_standing[TAIL_LAYER] + if(tail_overlay && tail_overlay.icon_state == t_state) + return //let the existing animation finish + + tail_overlay = set_tail_state(t_state) // Calls remove_layer & apply_layer + if(tail_overlay) + spawn(20) + //check that the animation hasn't changed in the meantime + if(overlays_standing[TAIL_LAYER] == tail_overlay && tail_overlay.icon_state == t_state) + animate_tail_stop() + // VOREStation Edit - END /mob/living/carbon/human/proc/animate_tail_start() if(QDESTROYING(src)) @@ -950,7 +990,7 @@ var/global/list/damage_icon_parts = list() //see UpdateDamageIcon() if(vr_wing_image) vr_wing_image.layer = BODY_LAYER+WING_LAYER overlays_standing[WING_LAYER] = vr_wing_image - + apply_layer(WING_LAYER) // VOREStation Edit end @@ -970,7 +1010,7 @@ var/global/list/damage_icon_parts = list() //see UpdateDamageIcon() effects.overlays += I //TODO, this compositing is annoying. overlays_standing[MODIFIER_EFFECTS_LAYER] = effects - + apply_layer(MODIFIER_EFFECTS_LAYER) /mob/living/carbon/human/update_fire() @@ -978,12 +1018,12 @@ var/global/list/damage_icon_parts = list() //see UpdateDamageIcon() return remove_layer(FIRE_LAYER) - + if(!on_fire) return - + overlays_standing[FIRE_LAYER] = image(icon = 'icons/mob/OnFire.dmi', icon_state = get_fire_icon_state(), layer = BODY_LAYER+FIRE_LAYER) - + apply_layer(FIRE_LAYER) /mob/living/carbon/human/update_water() @@ -997,7 +1037,7 @@ var/global/list/damage_icon_parts = list() //see UpdateDamageIcon() return overlays_standing[WATER_LAYER] = image(icon = 'icons/mob/submerged.dmi', icon_state = "human_swimming_[depth]", layer = BODY_LAYER+WATER_LAYER) //TODO: Improve - + apply_layer(WATER_LAYER) /mob/living/carbon/human/proc/update_surgery() diff --git a/code/modules/vore/eating/living_vr.dm b/code/modules/vore/eating/living_vr.dm index 5eeedd3ef5..9ac35b4d5b 100644 --- a/code/modules/vore/eating/living_vr.dm +++ b/code/modules/vore/eating/living_vr.dm @@ -19,6 +19,7 @@ var/absorbing_prey = 0 // Determines if the person is using the succubus drain or not. See station_special_abilities_vr. var/drain_finalized = 0 // Determines if the succubus drain will be KO'd/absorbed. Can be toggled on at any time. var/fuzzy = 1 // Preference toggle for sharp/fuzzy icon. + var/tail_alt = 0 // Tail layer toggle. var/can_be_drop_prey = 0 var/can_be_drop_pred = 1 //Mobs are pred by default. From e090487e3ad55c5f254a538d026fe010b63d529e Mon Sep 17 00:00:00 2001 From: Verkister Date: Mon, 19 Mar 2018 16:58:17 +0200 Subject: [PATCH 2/4] manually adding back void shit autoremoved by DM Holy shit can't even add them back with editor because it refuses to take it as a change so I'm forced to use github web editor fsghjs --- .../mob/living/carbon/human/update_icons.dm | 78 +++++++++---------- 1 file changed, 39 insertions(+), 39 deletions(-) diff --git a/code/modules/mob/living/carbon/human/update_icons.dm b/code/modules/mob/living/carbon/human/update_icons.dm index 07c76f79c0..0fe2fb63b9 100644 --- a/code/modules/mob/living/carbon/human/update_icons.dm +++ b/code/modules/mob/living/carbon/human/update_icons.dm @@ -10,10 +10,10 @@ var/global/list/damage_icon_parts = list() //see UpdateDamageIcon() //////////////////////////////////////////////////////////////////////////////////////////////// // # Human Icon Updating System // -// This system takes care of the "icon" for human mobs. Of course humans don't just have a single -// icon+icon_state, but a combination of dozens of little sprites including including the body, +// This system takes care of the "icon" for human mobs. Of course humans don't just have a single +// icon+icon_state, but a combination of dozens of little sprites including including the body, // clothing, equipment, in-universe HUD images, etc. -// +// // # Basic Operation // Whenever you do something that should update the on-mob appearance of a worn or held item, You // will need to call the relevant update_inv_* proc. All of these are named after the variable they @@ -25,14 +25,14 @@ var/global/list/damage_icon_parts = list() //see UpdateDamageIcon() // only get assigned to the mob once per tick.) // As a corrolary, this means users of this system do NOT need to tell the system when you're done // making changes. -// +// // There are also these special cases: // update_icons_body() //Handles updating your mob's icon to reflect their gender/race/complexion etc // UpdateDamageIcon() //Handles damage overlays for brute/burn damage //(will rename this when I geta round to it) ~Carn // update_skin() //Handles updating skin for species that have a skin overlay. // update_bloodied() //Handles adding/clearing the blood overlays for hands & feet. Call when bloodied or cleaned. // update_underwear() //Handles updating the sprite for underwear. -// update_hair() //Handles updating your hair and eyes overlay +// update_hair() //Handles updating your hair and eyes overlay // update_mutations() //Handles updating your appearance for certain mutations. e.g TK head-glows // update_fire() //Handles overlay from being on fire. // update_water() //Handles overlay from being submerged. @@ -138,11 +138,11 @@ var/global/list/damage_icon_parts = list() //see UpdateDamageIcon() // Regular stuff again. var/matrix/M = matrix() var/anim_time = 3 - + //Due to some involuntary means, you're laying now if(lying && !resting && !sleeping) anim_time = 1 //Thud - + if(lying && !species.prone_icon) //Only rotate them if we're not drawing a specific icon for being prone. M.Turn(90) M.Scale(desired_scale) @@ -338,7 +338,7 @@ var/global/list/damage_icon_parts = list() //see UpdateDamageIcon() return remove_layer(SKIN_LAYER) - + var/image/skin = species.update_skin(src) if(skin) skin.layer = BODY_LAYER+SKIN_LAYER @@ -354,7 +354,7 @@ var/global/list/damage_icon_parts = list() //see UpdateDamageIcon() return var/image/both = image(icon = 'icons/effects/effects.dmi', icon_state = "nothing", layer = BODY_LAYER+BLOOD_LAYER) - + //Bloody hands if(blood_DNA) var/image/bloodsies = image(icon = species.get_blood_mask(src), icon_state = "bloodyhands", layer = BODY_LAYER+BLOOD_LAYER) @@ -485,7 +485,7 @@ var/global/list/damage_icon_parts = list() //see UpdateDamageIcon() return remove_layer(MUTATIONS_LAYER) - + if(!LAZYLEN(mutations)) return //No mutations, no icons. @@ -496,7 +496,7 @@ var/global/list/damage_icon_parts = list() //see UpdateDamageIcon() var/image/standing = image(icon = 'icons/effects/genetics.dmi', layer = BODY_LAYER+MUTATIONS_LAYER) var/g = gender == FEMALE ? "f" : "m" - + for(var/datum/dna/gene/gene in dna_genes) if(!gene.block) continue @@ -559,7 +559,7 @@ var/global/list/damage_icon_parts = list() //see UpdateDamageIcon() //Shoes can be affected by uniform being drawn onto them update_inv_shoes() - + if(!w_uniform) return @@ -575,7 +575,7 @@ var/global/list/damage_icon_parts = list() //see UpdateDamageIcon() return remove_layer(ID_LAYER) - + if(!wear_id) return //Not wearing an ID @@ -584,7 +584,7 @@ var/global/list/damage_icon_parts = list() //see UpdateDamageIcon() var/obj/item/clothing/under/U = w_uniform if(U.displays_id) overlays_standing[ID_LAYER] = wear_id.make_worn_icon(body_type = species.get_bodytype(), slot_name = slot_wear_id_str, default_icon = INV_WEAR_ID_DEF_ICON, default_layer = ID_LAYER) - + apply_layer(ID_LAYER) /mob/living/carbon/human/update_inv_gloves() @@ -597,7 +597,7 @@ var/global/list/damage_icon_parts = list() //see UpdateDamageIcon() return //No gloves, no reason to be here. overlays_standing[GLOVES_LAYER] = gloves.make_worn_icon(body_type = species.get_bodytype(), slot_name = slot_gloves_str, default_icon = INV_GLOVES_DEF_ICON, default_layer = GLOVES_LAYER) - + apply_layer(GLOVES_LAYER) /mob/living/carbon/human/update_inv_glasses() @@ -610,7 +610,7 @@ var/global/list/damage_icon_parts = list() //see UpdateDamageIcon() return //Not wearing glasses, no need to update anything. overlays_standing[GLASSES_LAYER] = glasses.make_worn_icon(body_type = species.get_bodytype(), slot_name = slot_gloves_str, default_icon = INV_EYES_DEF_ICON, default_layer = GLASSES_LAYER) - + apply_layer(GLASSES_LAYER) /mob/living/carbon/human/update_inv_ears() @@ -624,7 +624,7 @@ var/global/list/damage_icon_parts = list() //see UpdateDamageIcon() if(!l_ear && !r_ear) return //Why bother, if no ear sprites - + // Blank image upon which to layer left & right overlays. var/image/both = image(icon = 'icons/effects/effects.dmi', icon_state = "nothing", layer = BODY_LAYER+EARS_LAYER) @@ -658,10 +658,10 @@ var/global/list/damage_icon_parts = list() //see UpdateDamageIcon() //NB: the use of a var for the layer on this one overlays_standing[shoe_layer] = shoes.make_worn_icon(body_type = species.get_bodytype(), slot_name = slot_shoes_str, default_icon = INV_FEET_DEF_ICON, default_layer = shoe_layer) - + apply_layer(SHOES_LAYER) apply_layer(SHOES_LAYER_ALT) - + /mob/living/carbon/human/update_inv_s_store() if(QDESTROYING(src)) return @@ -670,14 +670,14 @@ var/global/list/damage_icon_parts = list() //see UpdateDamageIcon() if(!s_store) return //Why bother, nothing there. - + //TODO, this is unlike the rest of the things //Basically has no variety in slot icon choices at all. WHY SPECIES ONLY?? var/t_state = s_store.item_state if(!t_state) t_state = s_store.icon_state overlays_standing[SUIT_STORE_LAYER] = image(icon = species.suit_storage_icon, icon_state = t_state, layer = BODY_LAYER+SUIT_STORE_LAYER) - + apply_layer(SUIT_STORE_LAYER) /mob/living/carbon/human/update_inv_head() @@ -685,12 +685,12 @@ var/global/list/damage_icon_parts = list() //see UpdateDamageIcon() return remove_layer(HEAD_LAYER) - + if(!head) return //No head item, why bother. overlays_standing[HEAD_LAYER] = head.make_worn_icon(body_type = species.get_bodytype(), slot_name = slot_head_str, default_icon = INV_HEAD_DEF_ICON, default_layer = HEAD_LAYER) - + apply_layer(HEAD_LAYER) /mob/living/carbon/human/update_inv_belt() @@ -702,7 +702,7 @@ var/global/list/damage_icon_parts = list() //see UpdateDamageIcon() if(!belt) return //No belt, why bother. - + //Toggle for belt layering with uniform var/belt_layer = BELT_LAYER if(istype(belt, /obj/item/weapon/storage/belt)) @@ -712,7 +712,7 @@ var/global/list/damage_icon_parts = list() //see UpdateDamageIcon() //NB: this uses a var from above overlays_standing[belt_layer] = belt.make_worn_icon(body_type = species.get_bodytype(), slot_name = slot_belt_str, default_icon = INV_BELT_DEF_ICON, default_layer = belt_layer) - + apply_layer(belt_layer) /mob/living/carbon/human/update_inv_wear_suit() @@ -731,7 +731,7 @@ var/global/list/damage_icon_parts = list() //see UpdateDamageIcon() return //No point, no suit. overlays_standing[SUIT_LAYER] = wear_suit.make_worn_icon(body_type = species.get_bodytype(), slot_name = slot_wear_suit_str, default_icon = INV_SUIT_DEF_ICON, default_layer = SUIT_LAYER) - + apply_layer(SUIT_LAYER) /mob/living/carbon/human/update_inv_pockets() @@ -745,9 +745,9 @@ var/global/list/damage_icon_parts = list() //see UpdateDamageIcon() if(!wear_mask || (head && head.flags_inv & HIDEMASK)) return //Why bother, nothing in mask slot. - + overlays_standing[FACEMASK_LAYER] = wear_mask.make_worn_icon(body_type = species.get_bodytype(), slot_name = slot_wear_mask_str, default_icon = INV_MASK_DEF_ICON, default_layer = FACEMASK_LAYER) - + apply_layer(FACEMASK_LAYER) /mob/living/carbon/human/update_inv_back() @@ -760,7 +760,7 @@ var/global/list/damage_icon_parts = list() //see UpdateDamageIcon() return //Why do anything overlays_standing[BACK_LAYER] = back.make_worn_icon(body_type = species.get_bodytype(), slot_name = slot_back_str, default_icon = INV_BACK_DEF_ICON, default_layer = BACK_LAYER) - + apply_layer(BACK_LAYER) //TODO: Carbon procs in my human update_icons?? @@ -793,7 +793,7 @@ var/global/list/damage_icon_parts = list() //see UpdateDamageIcon() return //Not cuffed, why bother overlays_standing[HANDCUFF_LAYER] = handcuffed.make_worn_icon(body_type = species.get_bodytype(), slot_name = slot_handcuffed_str, default_icon = INV_HCUFF_DEF_ICON, default_layer = HANDCUFF_LAYER) - + apply_layer(HANDCUFF_LAYER) /mob/living/carbon/human/update_inv_legcuffed() @@ -806,7 +806,7 @@ var/global/list/damage_icon_parts = list() //see UpdateDamageIcon() return //Not legcuffed, why bother. overlays_standing[LEGCUFF_LAYER] = handcuffed.make_worn_icon(body_type = species.get_bodytype(), slot_name = slot_legcuffed_str, default_icon = INV_LCUFF_DEF_ICON, default_layer = LEGCUFF_LAYER) - + apply_layer(LEGCUFF_LAYER) /mob/living/carbon/human/update_inv_r_hand() @@ -819,7 +819,7 @@ var/global/list/damage_icon_parts = list() //see UpdateDamageIcon() return //No hand, no bother. overlays_standing[R_HAND_LAYER] = r_hand.make_worn_icon(body_type = species.get_bodytype(), inhands = TRUE, slot_name = slot_r_hand_str, default_icon = INV_R_HAND_DEF_ICON, default_layer = R_HAND_LAYER) - + apply_layer(R_HAND_LAYER) /mob/living/carbon/human/update_inv_l_hand() @@ -990,7 +990,7 @@ var/global/list/damage_icon_parts = list() //see UpdateDamageIcon() if(vr_wing_image) vr_wing_image.layer = BODY_LAYER+WING_LAYER overlays_standing[WING_LAYER] = vr_wing_image - + apply_layer(WING_LAYER) // VOREStation Edit end @@ -1010,7 +1010,7 @@ var/global/list/damage_icon_parts = list() //see UpdateDamageIcon() effects.overlays += I //TODO, this compositing is annoying. overlays_standing[MODIFIER_EFFECTS_LAYER] = effects - + apply_layer(MODIFIER_EFFECTS_LAYER) /mob/living/carbon/human/update_fire() @@ -1018,12 +1018,12 @@ var/global/list/damage_icon_parts = list() //see UpdateDamageIcon() return remove_layer(FIRE_LAYER) - + if(!on_fire) return - + overlays_standing[FIRE_LAYER] = image(icon = 'icons/mob/OnFire.dmi', icon_state = get_fire_icon_state(), layer = BODY_LAYER+FIRE_LAYER) - + apply_layer(FIRE_LAYER) /mob/living/carbon/human/update_water() @@ -1037,7 +1037,7 @@ var/global/list/damage_icon_parts = list() //see UpdateDamageIcon() return overlays_standing[WATER_LAYER] = image(icon = 'icons/mob/submerged.dmi', icon_state = "human_swimming_[depth]", layer = BODY_LAYER+WATER_LAYER) //TODO: Improve - + apply_layer(WATER_LAYER) /mob/living/carbon/human/proc/update_surgery() @@ -1088,4 +1088,4 @@ var/global/list/damage_icon_parts = list() //see UpdateDamageIcon() #undef FIRE_LAYER #undef WATER_LAYER #undef TARGETED_LAYER -#undef TOTAL_LAYERS \ No newline at end of file +#undef TOTAL_LAYERS From e6b9d09e1217fae03864499c25d9542b50b8b78d Mon Sep 17 00:00:00 2001 From: Leshana Date: Mon, 19 Mar 2018 21:31:41 -0400 Subject: [PATCH 3/4] Eliminate duplication of code when putting tails on different layer. --- .../mob/living/carbon/human/update_icons.dm | 96 ++++++------------- 1 file changed, 31 insertions(+), 65 deletions(-) diff --git a/code/modules/mob/living/carbon/human/update_icons.dm b/code/modules/mob/living/carbon/human/update_icons.dm index 0fe2fb63b9..e888bb3c4f 100644 --- a/code/modules/mob/living/carbon/human/update_icons.dm +++ b/code/modules/mob/living/carbon/human/update_icons.dm @@ -840,19 +840,16 @@ var/global/list/damage_icon_parts = list() //see UpdateDamageIcon() return remove_layer(TAIL_LAYER) + remove_layer(TAIL_LAYER_ALT) // VOREStation Edit - Alt Tail Layer + + var/used_tail_layer = tail_alt ? TAIL_LAYER_ALT : TAIL_LAYER // VOREStation Edit - Alt Tail Layer // VOREStation Edit - START - remove_layer(TAIL_LAYER_ALT) var/image/vr_tail_image = get_tail_image() if(vr_tail_image) - if(tail_alt) - vr_tail_image.layer = BODY_LAYER+TAIL_LAYER_ALT - overlays_standing[TAIL_LAYER_ALT] = vr_tail_image - apply_layer(TAIL_LAYER_ALT) - else - vr_tail_image.layer = BODY_LAYER+TAIL_LAYER - overlays_standing[TAIL_LAYER] = vr_tail_image - apply_layer(TAIL_LAYER) + vr_tail_image.layer = BODY_LAYER+used_tail_layer + overlays_standing[used_tail_layer] = vr_tail_image + apply_layer(used_tail_layer) return // VOREStation Edit - END @@ -861,12 +858,8 @@ var/global/list/damage_icon_parts = list() //see UpdateDamageIcon() //This one is actually not that bad I guess. if(species_tail && !(wear_suit && wear_suit.flags_inv & HIDETAIL)) var/icon/tail_s = get_tail_icon() - if(tail_alt)// VOREStation Edit - START - overlays_standing[TAIL_LAYER_ALT] = image(icon = tail_s, icon_state = "[species_tail]_s", layer = BODY_LAYER+TAIL_LAYER_ALT) - animate_tail_reset() - else - overlays_standing[TAIL_LAYER] = image(icon = tail_s, icon_state = "[species_tail]_s", layer = BODY_LAYER+TAIL_LAYER) - animate_tail_reset()// VOREStation Edit - END + overlays_standing[used_tail_layer] = image(icon = tail_s, icon_state = "[species_tail]_s", layer = BODY_LAYER+used_tail_layer) // VOREStation Edit - Alt Tail Layer + animate_tail_reset() //TODO: Is this the appropriate place for this, and not on species...? /mob/living/carbon/human/proc/get_tail_icon() @@ -890,32 +883,18 @@ var/global/list/damage_icon_parts = list() //see UpdateDamageIcon() return tail_icon /mob/living/carbon/human/proc/set_tail_state(var/t_state) - // VOREStation Edit - START - if(tail_alt) - var/image/tail_overlay = overlays_standing[TAIL_LAYER_ALT] - remove_layer(TAIL_LAYER_ALT) - - if(tail_overlay) - overlays_standing[TAIL_LAYER_ALT] = tail_overlay - if(species.get_tail_animation(src)) - tail_overlay.icon_state = t_state - . = tail_overlay - - apply_layer(TAIL_LAYER_ALT) - - else - var/image/tail_overlay = overlays_standing[TAIL_LAYER] - - remove_layer(TAIL_LAYER) - - if(tail_overlay) - overlays_standing[TAIL_LAYER] = tail_overlay - if(species.get_tail_animation(src)) - tail_overlay.icon_state = t_state - . = tail_overlay - - apply_layer(TAIL_LAYER) - // VOREStation Edit - END + var/used_tail_layer = tail_alt ? TAIL_LAYER_ALT : TAIL_LAYER // VOREStation Edit - Alt Tail Layer + var/image/tail_overlay = overlays_standing[used_tail_layer] // VOREStation Edit - Alt Tail Layer + + remove_layer(used_tail_layer) // VOREStation Edit - Alt Tail Layer + + if(tail_overlay) + overlays_standing[used_tail_layer] = tail_overlay // VOREStation Edit - Alt Tail Layer + if(species.get_tail_animation(src)) + tail_overlay.icon_state = t_state + . = tail_overlay + + apply_layer(used_tail_layer) // VOREStation Edit - Alt Tail Layer //Not really once, since BYOND can't do that. //Update this if the ability to flick() images or make looping animation start at the first frame is ever added. @@ -925,31 +904,18 @@ var/global/list/damage_icon_parts = list() //see UpdateDamageIcon() return var/t_state = "[species.get_tail(src)]_once" + var/used_tail_layer = tail_alt ? TAIL_LAYER_ALT : TAIL_LAYER // VOREStation Edit - Alt Tail Layer + + var/image/tail_overlay = overlays_standing[used_tail_layer] // VOREStation Edit - Alt Tail Layer + if(tail_overlay && tail_overlay.icon_state == t_state) + return //let the existing animation finish - // VOREStation Edit - START - if(tail_alt) - var/image/tail_overlay = overlays_standing[TAIL_LAYER_ALT] - if(tail_overlay && tail_overlay.icon_state == t_state) - return //let the existing animation finish - - tail_overlay = set_tail_state(t_state) // Calls remove_layer & apply_layer - if(tail_overlay) - spawn(20) - //check that the animation hasn't changed in the meantime - if(overlays_standing[TAIL_LAYER_ALT] == tail_overlay && tail_overlay.icon_state == t_state) - animate_tail_stop() - else - var/image/tail_overlay = overlays_standing[TAIL_LAYER] - if(tail_overlay && tail_overlay.icon_state == t_state) - return //let the existing animation finish - - tail_overlay = set_tail_state(t_state) // Calls remove_layer & apply_layer - if(tail_overlay) - spawn(20) - //check that the animation hasn't changed in the meantime - if(overlays_standing[TAIL_LAYER] == tail_overlay && tail_overlay.icon_state == t_state) - animate_tail_stop() - // VOREStation Edit - END + tail_overlay = set_tail_state(t_state) // Calls remove_layer & apply_layer + if(tail_overlay) + spawn(20) + //check that the animation hasn't changed in the meantime + if(overlays_standing[used_tail_layer] == tail_overlay && tail_overlay.icon_state == t_state) // VOREStation Edit - Alt Tail Layer + animate_tail_stop() /mob/living/carbon/human/proc/animate_tail_start() if(QDESTROYING(src)) From 972c6b549ef74a5ed0316f7637d10cdb306f7bf3 Mon Sep 17 00:00:00 2001 From: Verkister Date: Wed, 21 Mar 2018 08:49:20 +0200 Subject: [PATCH 4/4] remove both layers --- .../mob/living/carbon/human/update_icons.dm | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/code/modules/mob/living/carbon/human/update_icons.dm b/code/modules/mob/living/carbon/human/update_icons.dm index e888bb3c4f..b2c9a0e221 100644 --- a/code/modules/mob/living/carbon/human/update_icons.dm +++ b/code/modules/mob/living/carbon/human/update_icons.dm @@ -840,11 +840,10 @@ var/global/list/damage_icon_parts = list() //see UpdateDamageIcon() return remove_layer(TAIL_LAYER) - remove_layer(TAIL_LAYER_ALT) // VOREStation Edit - Alt Tail Layer + remove_layer(TAIL_LAYER_ALT) // VOREStation Edit - START - Alt Tail Layer - var/used_tail_layer = tail_alt ? TAIL_LAYER_ALT : TAIL_LAYER // VOREStation Edit - Alt Tail Layer + var/used_tail_layer = tail_alt ? TAIL_LAYER_ALT : TAIL_LAYER - // VOREStation Edit - START var/image/vr_tail_image = get_tail_image() if(vr_tail_image) vr_tail_image.layer = BODY_LAYER+used_tail_layer @@ -883,18 +882,19 @@ var/global/list/damage_icon_parts = list() //see UpdateDamageIcon() return tail_icon /mob/living/carbon/human/proc/set_tail_state(var/t_state) - var/used_tail_layer = tail_alt ? TAIL_LAYER_ALT : TAIL_LAYER // VOREStation Edit - Alt Tail Layer - var/image/tail_overlay = overlays_standing[used_tail_layer] // VOREStation Edit - Alt Tail Layer + var/used_tail_layer = tail_alt ? TAIL_LAYER_ALT : TAIL_LAYER // VOREStation Edit - START - Alt Tail Layer + var/image/tail_overlay = overlays_standing[used_tail_layer] - remove_layer(used_tail_layer) // VOREStation Edit - Alt Tail Layer + remove_layer(TAIL_LAYER) + remove_layer(TAIL_LAYER_ALT) if(tail_overlay) - overlays_standing[used_tail_layer] = tail_overlay // VOREStation Edit - Alt Tail Layer + overlays_standing[used_tail_layer] = tail_overlay if(species.get_tail_animation(src)) tail_overlay.icon_state = t_state . = tail_overlay - apply_layer(used_tail_layer) // VOREStation Edit - Alt Tail Layer + apply_layer(used_tail_layer) // VOREStation Edit - END //Not really once, since BYOND can't do that. //Update this if the ability to flick() images or make looping animation start at the first frame is ever added.