From 36b0fb1d9fe113a5f740f81a815ab52fdceea16e Mon Sep 17 00:00:00 2001 From: Verkister Date: Thu, 10 Nov 2022 15:24:47 +0200 Subject: [PATCH] Adds a verb to toggle headset icon visibility. Adds a verb to IC tab that lets you hide/show headset sprite on your char. (Hella eyesore on large chars looking like someone stapled a whole-ass parking ticket on their cheek lmao) Also fixes an indentation crime while at it. --- .../mob/living/carbon/human/update_icons.dm | 26 +++++++++++-- .../modules/mob/living/carbon/human/human.dm | 37 +++++++++++-------- .../mob/living/carbon/human/human_defines.dm | 1 + 3 files changed, 45 insertions(+), 19 deletions(-) diff --git a/code/modules/mob/living/carbon/human/update_icons.dm b/code/modules/mob/living/carbon/human/update_icons.dm index d37920baf2..5f63f1d757 100644 --- a/code/modules/mob/living/carbon/human/update_icons.dm +++ b/code/modules/mob/living/carbon/human/update_icons.dm @@ -739,16 +739,34 @@ var/global/list/damage_icon_parts = list() //see UpdateDamageIcon() if(!l_ear && !r_ear) return //Why bother, if no ear sprites + if(hide_headset) //CHOMPEdit Start + if(l_ear && istype(l_ear, /obj/item/device/radio/headset)) //No need to generate blank images if only headsets are present. + if(!r_ear || istype(r_ear, /obj/item/device/radio/headset)) + return + if(r_ear && istype(r_ear, /obj/item/device/radio/headset)) + if(!l_ear || istype(l_ear, /obj/item/device/radio/headset)) + return + // 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) if(l_ear) - var/image/standing = l_ear.make_worn_icon(body_type = species.get_bodytype(src), slot_name = slot_l_ear_str, default_icon = INV_EARS_DEF_ICON, default_layer = EARS_LAYER) - both.add_overlay(standing) + if(istype(l_ear, /obj/item/device/radio/headset)) + if(!hide_headset) + var/image/standing = l_ear.make_worn_icon(body_type = species.get_bodytype(src), slot_name = slot_l_ear_str, default_icon = INV_EARS_DEF_ICON, default_layer = EARS_LAYER) + both.add_overlay(standing) + else + var/image/standing = l_ear.make_worn_icon(body_type = species.get_bodytype(src), slot_name = slot_l_ear_str, default_icon = INV_EARS_DEF_ICON, default_layer = EARS_LAYER) + both.add_overlay(standing) if(r_ear) - var/image/standing = r_ear.make_worn_icon(body_type = species.get_bodytype(src), slot_name = slot_r_ear_str, default_icon = INV_EARS_DEF_ICON, default_layer = EARS_LAYER) - both.add_overlay(standing) + if(istype(r_ear, /obj/item/device/radio/headset)) + if(!hide_headset) + var/image/standing = r_ear.make_worn_icon(body_type = species.get_bodytype(src), slot_name = slot_r_ear_str, default_icon = INV_EARS_DEF_ICON, default_layer = EARS_LAYER) + both.add_overlay(standing) + else + var/image/standing = r_ear.make_worn_icon(body_type = species.get_bodytype(src), slot_name = slot_r_ear_str, default_icon = INV_EARS_DEF_ICON, default_layer = EARS_LAYER) + both.add_overlay(standing) //CHOMPEdit End overlays_standing[EARS_LAYER] = both apply_layer(EARS_LAYER) diff --git a/modular_chomp/code/modules/mob/living/carbon/human/human.dm b/modular_chomp/code/modules/mob/living/carbon/human/human.dm index cfad50726f..9ff23f5dd6 100644 --- a/modular_chomp/code/modules/mob/living/carbon/human/human.dm +++ b/modular_chomp/code/modules/mob/living/carbon/human/human.dm @@ -1,18 +1,25 @@ /mob/living/carbon/human/update_fullness() - var/previous_stomach_fullness = vore_fullness_ex["stomach"] - var/previous_taur_fullness = vore_fullness_ex["taur belly"] - //update_vore_tail_sprite() - //update_vore_belly_sprite() - . = ..() - if(vore_fullness_ex["stomach"] != previous_stomach_fullness) - update_vore_belly_sprite() - if(vore_fullness_ex["taur belly"] != previous_taur_fullness) - update_vore_tail_sprite() + var/previous_stomach_fullness = vore_fullness_ex["stomach"] + var/previous_taur_fullness = vore_fullness_ex["taur belly"] + //update_vore_tail_sprite() + //update_vore_belly_sprite() + . = ..() + if(vore_fullness_ex["stomach"] != previous_stomach_fullness) + update_vore_belly_sprite() + if(vore_fullness_ex["taur belly"] != previous_taur_fullness) + update_vore_tail_sprite() /mob/living/carbon/human/vs_animate(var/belly_to_animate) - if(belly_to_animate == "stomach") - vore_belly_animation() - else if(belly_to_animate == "taur belly") - vore_tail_animation() - else - return \ No newline at end of file + if(belly_to_animate == "stomach") + vore_belly_animation() + else if(belly_to_animate == "taur belly") + vore_tail_animation() + else + return + +/mob/living/carbon/human/verb/hide_headset() + set name = "Show/Hide Headset" + set category = "IC" + set desc = "Toggle headset worn icon visibility." + hide_headset = !hide_headset + update_inv_ears() \ No newline at end of file diff --git a/modular_chomp/code/modules/mob/living/carbon/human/human_defines.dm b/modular_chomp/code/modules/mob/living/carbon/human/human_defines.dm index 11eae0dc7b..e487bf278b 100644 --- a/modular_chomp/code/modules/mob/living/carbon/human/human_defines.dm +++ b/modular_chomp/code/modules/mob/living/carbon/human/human_defines.dm @@ -9,3 +9,4 @@ vore_icon_bellies = list("stomach", "taur belly") var/struggle_anim_stomach = FALSE var/struggle_anim_taur = FALSE + var/hide_headset = FALSE \ No newline at end of file