From 41dccddbef8523afc1c2efc66dd14f5c686d64be Mon Sep 17 00:00:00 2001 From: Loganbacca Date: Sat, 1 Feb 2014 02:09:49 +1300 Subject: [PATCH 1/3] Suit collars Adds a collar overlay above the helmet layer if the suit has one Suit needs an identically named sprite in icons/mob/collar.dmi Suit also needs 'collar = 1' set in utility.dm Trenchcoats are go! --- code/modules/clothing/clothing.dm | 1 + code/modules/clothing/suits/utility.dm | 1 + .../mob/living/carbon/human/update_icons.dm | 34 ++++++++++++++---- icons/mob/collar.dmi | Bin 0 -> 310 bytes 4 files changed, 29 insertions(+), 7 deletions(-) create mode 100644 icons/mob/collar.dmi diff --git a/code/modules/clothing/clothing.dm b/code/modules/clothing/clothing.dm index 7d734339bb4..fcabee7b2e3 100644 --- a/code/modules/clothing/clothing.dm +++ b/code/modules/clothing/clothing.dm @@ -186,6 +186,7 @@ BLIND // can't see anything slot_flags = SLOT_OCLOTHING var/blood_overlay_type = "suit" siemens_coefficient = 0.9 + var/collar = 0 //Spacesuit //Note: Everything in modules/clothing/spacesuits should have the entire suit grouped together. diff --git a/code/modules/clothing/suits/utility.dm b/code/modules/clothing/suits/utility.dm index f888a6c7134..49e91c1ca07 100644 --- a/code/modules/clothing/suits/utility.dm +++ b/code/modules/clothing/suits/utility.dm @@ -80,6 +80,7 @@ icon_state = "bombsuitsec" item_state = "bombsuitsec" allowed = list(/obj/item/weapon/gun/energy,/obj/item/weapon/melee/baton,/obj/item/weapon/handcuffs) + collar = 1 /* * Radiation protection diff --git a/code/modules/mob/living/carbon/human/update_icons.dm b/code/modules/mob/living/carbon/human/update_icons.dm index 6063f544d62..4e676ec3ee2 100644 --- a/code/modules/mob/living/carbon/human/update_icons.dm +++ b/code/modules/mob/living/carbon/human/update_icons.dm @@ -113,13 +113,14 @@ Please contact me on #coderbus IRC. ~Carn x #define HAIR_LAYER 14 //TODO: make part of head layer? #define FACEMASK_LAYER 15 #define HEAD_LAYER 16 -#define HANDCUFF_LAYER 17 -#define LEGCUFF_LAYER 18 -#define L_HAND_LAYER 19 -#define R_HAND_LAYER 20 -#define TAIL_LAYER 21 //bs12 specific. this hack is probably gonna come back to haunt me -#define TARGETED_LAYER 22 //BS12: Layer for the target overlay from weapon targeting system -#define TOTAL_LAYERS 22 +#define COLLAR_LAYER 17 +#define HANDCUFF_LAYER 18 +#define LEGCUFF_LAYER 19 +#define L_HAND_LAYER 20 +#define R_HAND_LAYER 21 +#define TAIL_LAYER 22 //bs12 specific. this hack is probably gonna come back to haunt me +#define TARGETED_LAYER 23 //BS12: Layer for the target overlay from weapon targeting system +#define TOTAL_LAYERS 24 ////////////////////////////////// /mob/living/carbon/human @@ -620,6 +621,8 @@ proc/get_damage_icon_part(damage_state, body_part) update_tail_showing(0) + update_collar(0) + if(update_icons) update_icons() /mob/living/carbon/human/update_inv_pockets(var/update_icons=1) @@ -714,6 +717,22 @@ proc/get_damage_icon_part(damage_state, body_part) if(update_icons) update_icons() + +//Adds a collar overlay above the helmet layer if the suit has one +// Suit needs an identically named sprite in icons/mob/collar.dmi +// Suit also needs 'collar = 1' set +/mob/living/carbon/human/proc/update_collar(var/update_icons=1) + if(wear_suit) + if(wear_suit:collar) //hackish - but checks before getting to this point anyway + overlays_standing[COLLAR_LAYER] = image("icon" = 'icons/mob/collar.dmi', "icon_state" = "[wear_suit.icon_state]") + else + overlays_standing[COLLAR_LAYER] = null + else + overlays_standing[COLLAR_LAYER] = null + + if(update_icons) update_icons() + + // Used mostly for creating head items /mob/living/carbon/human/proc/generate_head_icon() //gender no longer matters for the mouth, although there should probably be seperate base head icons. @@ -766,6 +785,7 @@ proc/get_damage_icon_part(damage_state, body_part) #undef BACK_LAYER #undef HAIR_LAYER #undef HEAD_LAYER +#undef COLLAR_LAYER #undef HANDCUFF_LAYER #undef LEGCUFF_LAYER #undef L_HAND_LAYER diff --git a/icons/mob/collar.dmi b/icons/mob/collar.dmi new file mode 100644 index 0000000000000000000000000000000000000000..fccfe6dd53bd03f5de77312e063c25cbebc65dbd GIT binary patch literal 310 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0L3?#3!&-4XSJOMr-t_Kbr2n@HJIxjQ7%&#<9 z>KssGvS zI(O!L@P<%>i^dNg>74h`Jjqbh)4RjMILP?2v6sS}N0W|B3Q-8w)U-EWxx-}h5)0GF z&TeDX%_}69Ozk#at6^v^dc^EWP*}m&Vn%5`29}*N>#CNf901xKNi9D^1)(s4g|Nl>5`~CkvpTN?O@dtU1{aF8{ Date: Sat, 1 Feb 2014 13:25:09 +1300 Subject: [PATCH 2/3] Cleaned collar rendering code Removed colon Removed need for collar variable Corrected TOTAL_LAYERS define --- code/modules/clothing/clothing.dm | 1 - code/modules/clothing/suits/utility.dm | 1 - .../mob/living/carbon/human/update_icons.dm | 16 ++++++++-------- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/code/modules/clothing/clothing.dm b/code/modules/clothing/clothing.dm index fcabee7b2e3..7d734339bb4 100644 --- a/code/modules/clothing/clothing.dm +++ b/code/modules/clothing/clothing.dm @@ -186,7 +186,6 @@ BLIND // can't see anything slot_flags = SLOT_OCLOTHING var/blood_overlay_type = "suit" siemens_coefficient = 0.9 - var/collar = 0 //Spacesuit //Note: Everything in modules/clothing/spacesuits should have the entire suit grouped together. diff --git a/code/modules/clothing/suits/utility.dm b/code/modules/clothing/suits/utility.dm index 49e91c1ca07..f888a6c7134 100644 --- a/code/modules/clothing/suits/utility.dm +++ b/code/modules/clothing/suits/utility.dm @@ -80,7 +80,6 @@ icon_state = "bombsuitsec" item_state = "bombsuitsec" allowed = list(/obj/item/weapon/gun/energy,/obj/item/weapon/melee/baton,/obj/item/weapon/handcuffs) - collar = 1 /* * Radiation protection diff --git a/code/modules/mob/living/carbon/human/update_icons.dm b/code/modules/mob/living/carbon/human/update_icons.dm index 4e676ec3ee2..f109f7e38bd 100644 --- a/code/modules/mob/living/carbon/human/update_icons.dm +++ b/code/modules/mob/living/carbon/human/update_icons.dm @@ -120,7 +120,7 @@ Please contact me on #coderbus IRC. ~Carn x #define R_HAND_LAYER 21 #define TAIL_LAYER 22 //bs12 specific. this hack is probably gonna come back to haunt me #define TARGETED_LAYER 23 //BS12: Layer for the target overlay from weapon targeting system -#define TOTAL_LAYERS 24 +#define TOTAL_LAYERS 23 ////////////////////////////////// /mob/living/carbon/human @@ -720,15 +720,15 @@ proc/get_damage_icon_part(damage_state, body_part) //Adds a collar overlay above the helmet layer if the suit has one // Suit needs an identically named sprite in icons/mob/collar.dmi -// Suit also needs 'collar = 1' set /mob/living/carbon/human/proc/update_collar(var/update_icons=1) + var/icon/C = new('icons/mob/collar.dmi') + var/image/standing = null + if(wear_suit) - if(wear_suit:collar) //hackish - but checks before getting to this point anyway - overlays_standing[COLLAR_LAYER] = image("icon" = 'icons/mob/collar.dmi', "icon_state" = "[wear_suit.icon_state]") - else - overlays_standing[COLLAR_LAYER] = null - else - overlays_standing[COLLAR_LAYER] = null + if(wear_suit.icon_state in C.IconStates()) + standing = image("icon" = C, "icon_state" = "[wear_suit.icon_state]") + + overlays_standing[COLLAR_LAYER] = standing if(update_icons) update_icons() From 44498dc5eb9859d9fae10ba559163cb0b376eff8 Mon Sep 17 00:00:00 2001 From: Loganbacca Date: Sat, 1 Feb 2014 13:30:18 +1300 Subject: [PATCH 3/3] Tail rendering fix Spotted this while working on collars code Moved tail layer before hand layers, so tails don't render over held items --- code/modules/mob/living/carbon/human/update_icons.dm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/code/modules/mob/living/carbon/human/update_icons.dm b/code/modules/mob/living/carbon/human/update_icons.dm index f109f7e38bd..636273993b6 100644 --- a/code/modules/mob/living/carbon/human/update_icons.dm +++ b/code/modules/mob/living/carbon/human/update_icons.dm @@ -116,9 +116,9 @@ Please contact me on #coderbus IRC. ~Carn x #define COLLAR_LAYER 17 #define HANDCUFF_LAYER 18 #define LEGCUFF_LAYER 19 -#define L_HAND_LAYER 20 -#define R_HAND_LAYER 21 -#define TAIL_LAYER 22 //bs12 specific. this hack is probably gonna come back to haunt me +#define TAIL_LAYER 20 //bs12 specific. this hack is probably gonna come back to haunt me +#define L_HAND_LAYER 21 +#define R_HAND_LAYER 22 #define TARGETED_LAYER 23 //BS12: Layer for the target overlay from weapon targeting system #define TOTAL_LAYERS 23 //////////////////////////////////