diff --git a/code/__DEFINES/components.dm b/code/__DEFINES/components.dm index ff0750a28c..85a8d7a37d 100644 --- a/code/__DEFINES/components.dm +++ b/code/__DEFINES/components.dm @@ -255,7 +255,7 @@ #define COMSIG_ITEM_IMBUE_SOUL "item_imbue_soul" //return a truthy value to prevent ensouling, checked in /obj/effect/proc_holder/spell/targeted/lichdom/cast(): (mob/user) #define COMSIG_ITEM_HIT_REACT "item_hit_react" //from base of obj/item/hit_reaction(): (list/args) #define COMSIG_ITEM_WEARERCROSSED "wearer_crossed" //called on item when crossed by something (): (/atom/movable) -#define COMSIG_ITEM_WORN_OVERLAYS "item_worn_overlays" //from base of obj/item/worn_overlays(): (isinhands, icon_file, style_flags, list/overlays) +#define COMSIG_ITEM_WORN_OVERLAYS "item_worn_overlays" //from base of obj/item/worn_overlays(): (isinhands, icon_file, used_state, style_flags, list/overlays) // /obj/item/clothing signals #define COMSIG_SHOES_STEP_ACTION "shoes_step_action" //from base of obj/item/clothing/shoes/proc/step_action(): () diff --git a/code/datums/elements/polychromic.dm b/code/datums/elements/polychromic.dm index 4301a280f3..d7057cfdf7 100644 --- a/code/datums/elements/polychromic.dm +++ b/code/datums/elements/polychromic.dm @@ -6,8 +6,8 @@ /datum/element/polychromic element_flags = ELEMENT_BESPOKE|ELEMENT_DETACH id_arg_index = 3 - var/list/overlays_by_atom = list() - var/list/overlays_states //also used for worn/held overlsays + var/overlays_states //A list or a number of states. In the latter case, the atom icon_state/item_state will be used followed by a number for the overlays. + var/list/colors_by_atom = list() //list of color strings or mutable appearance depending on the above variable. var/icon_file var/list/overlays_names //wrap numbers into text strings please. var/list/actions_by_atom = list() @@ -15,7 +15,7 @@ //item variables var/worn_file //used for boths held and worn overlays if present. -/datum/element/polychromic/Attach(datum/target, list/colors, list/states, _icon, _flags = POLYCHROMIC_ALTCLICK|POLYCHROMIC_NO_HELD, _worn, list/names = list("Primary", "Secondary", "Tertiary", "Quaternary", "Quinary", "Senary")) +/datum/element/polychromic/Attach(datum/target, list/colors, states, _icon, _flags = POLYCHROMIC_ALTCLICK|POLYCHROMIC_NO_HELD, _worn, list/names = list("Primary", "Secondary", "Tertiary", "Quaternary", "Quinary", "Senary")) . = ..() var/states_len = length(overlays_states) var/names_len = length(names) @@ -30,11 +30,17 @@ var/mut_icon = icon_file || A.icon var/list/L = list() - for(var/I in overlays_states) - var/col = popleft(colors) || "#FFFFFF" - L += mutable_appearance(mut_icon, I, color = col) - A.add_overlay(L) - overlays_by_atom[A] = L + if(islist(overlays_states)) + for(var/I in overlays_states) + var/col = popleft(colors) || "#FFFFFF" + L += mutable_appearance(mut_icon, I, color = col) + else + for(var/I in 1 to overlays_states) + var/col = LAZYACCESS(colors, I) || "#FFFFFF" + L += col + colors_by_atom[A] = L + + RegisterSignal(A, COMSIG_ATOM_UPDATE_OVERLAYS, .proc/apply_overlays) if(_flags & POLYCHROMIC_ALTCLICK) RegisterSignal(A, COMSIG_PARENT_EXAMINE, .proc/on_examine) @@ -61,40 +67,57 @@ actions_by_atom[A] = P P.Grant(A) + A.update_icon() + /datum/element/polychromic/Detach(atom/A) . = ..() - A.cut_overlay(overlays_by_atom[A]) - overlays_by_atom -= A + A.cut_overlay(colors_by_atom[A]) + colors_by_atom -= A var/datum/action/polychromic/P = actions_by_atom[A] if(P) qdel(P) actions_by_atom -= A if(poly_flags & POLYCHROMIC_ALTCLICK) - UnregisterSignal(A, list(COMSIG_PARENT_EXAMINE, COMSIG_CLICK_ALT)) + UnregisterSignal(A, list(COMSIG_PARENT_EXAMINE, COMSIG_CLICK_ALT, COMSIG_ATOM_UPDATE_OVERLAYS, COMSIG_ITEM_EQUIPPED, COMSIG_ITEM_DROPPED)) -/datum/element/polychromic/proc/apply_worn_overlays(obj/item/source, isinhands, icon_file, style_flags, list/overlays) +/datum/element/polychromic/proc/apply_overlays(atom/source, list/overlays) + var/list/L = colors_by_atom[source] + if(isnum(overlays_states)) + for(var/i in 1 to overlays_states) + overlays += mutable_appearance(source.icon, "[source.icon_state]-[i]", color = L[i]) + else + overlays += colors_by_atom[source] + +/datum/element/polychromic/proc/apply_worn_overlays(obj/item/source, isinhands, icon_file, used_state, style_flags, list/overlays) if(poly_flags & (isinhands ? POLYCHROMIC_NO_HELD : POLYCHROMIC_NO_WORN)) return var/f_icon = worn_file || icon_file - var/list/L = overlays_by_atom[source] + var/list/L = colors_by_atom[source] - for(var/I in 1 to length(overlays_states)) - var/mutable_appearance/M = L[I] - overlays += mutable_appearance(f_icon, overlays_states[I], color = M.color) + if(isnum(overlays_states)) + for(var/i in 1 to overlays_states) + overlays += mutable_appearance(f_icon, "[used_state]-[i]", color = L[i]) + else + for(var/I in 1 to length(overlays_states)) + var/mutable_appearance/M = L[I] + overlays += mutable_appearance(f_icon, overlays_states[I], color = M.color) /datum/element/polychromic/proc/set_color(atom/source, mob/user) var/choice = input(user,"Polychromic options", "Recolor [source]") as null|anything in overlays_names if(!choice || QDELETED(source) || !user.canUseTopic(src, BE_CLOSE, NO_DEXTERY)) return - choice = overlays_names.Find(choice) var/ncolor = input(user, "Polychromic options", "Choose [choice] Color") as color|null if(!ncolor || QDELETED(source) || !user.canUseTopic(src, BE_CLOSE, NO_DEXTERY)) return - var/list/L = overlays_by_atom[source] + var/list/L = colors_by_atom[source] if(!L) // Ummmmmh. return - var/mutable_appearance/M = L[choice] - M.color = sanitize_hexcolor(ncolor, 6, TRUE, M.color) + var/K = L[overlays_names.Find(choice)] + if(istext(K)) + K = sanitize_hexcolor(ncolor, 6, TRUE, K) + else + var/mutable_appearance/M = K + M.color = sanitize_hexcolor(ncolor, 6, TRUE, M.color) source.update_icon() return TRUE @@ -105,7 +128,7 @@ if(!P) P = new (source) actions_by_atom[source] = P - P.check_flags = AB_CHECK_RESTRAINED|AB_CHECK_STUN|AB_CHECK_LYING|AB_CHECK_CONSCIOUS + P.check_flags = AB_CHECK_RESTRAINED|AB_CHECK_STUN|AB_CHECK_CONSCIOUS RegisterSignal(P, COMSIG_ACTION_TRIGGER, .proc/activate_action) P.Grant(user) diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index 7a155ca932..5d3725200c 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -428,9 +428,9 @@ GLOBAL_VAR_INIT(rpg_loot_items, FALSE) //Overlays for the worn overlay so you can overlay while you overlay //eg: ammo counters, primed grenade flashing, etc. //"icon_file" is used automatically for inhands etc. to make sure it gets the right inhand file -/obj/item/proc/worn_overlays(isinhands = FALSE, icon_file, style_flags = NONE) +/obj/item/proc/worn_overlays(isinhands = FALSE, icon_file, used_state, style_flags = NONE) . = list() - SEND_SIGNAL(src, COMSIG_ITEM_WORN_OVERLAYS, isinhands, icon_file, style_flags, .) + SEND_SIGNAL(src, COMSIG_ITEM_WORN_OVERLAYS, isinhands, icon_file, used_state, style_flags, .) //sometimes we only want to grant the item's action if it's equipped in a specific slot. /obj/item/proc/item_action_slot_check(slot, mob/user, datum/action/A) diff --git a/code/game/objects/items/RCL.dm b/code/game/objects/items/RCL.dm index 9513519fa9..5444b0c557 100644 --- a/code/game/objects/items/RCL.dm +++ b/code/game/objects/items/RCL.dm @@ -113,7 +113,7 @@ cable_overlay.color = GLOB.cable_colors[colors[current_color_index]] . += cable_overlay -/obj/item/twohanded/rcl/worn_overlays(isinhands, icon_file, style_flags = NONE) +/obj/item/twohanded/rcl/worn_overlays(isinhands, icon_file, used_state, style_flags = NONE) . = ..() if(!isinhands || !(loaded?.amount)) return diff --git a/code/game/objects/items/holy_weapons.dm b/code/game/objects/items/holy_weapons.dm index 4d275e2034..65c188918f 100644 --- a/code/game/objects/items/holy_weapons.dm +++ b/code/game/objects/items/holy_weapons.dm @@ -309,7 +309,7 @@ block_chance = 50 var/shield_icon = "shield-red" -/obj/item/nullrod/staff/worn_overlays(isinhands, icon_file, style_flags = NONE) +/obj/item/nullrod/staff/worn_overlays(isinhands, icon_file, used_state, style_flags = NONE) . = list() if(isinhands) . += mutable_appearance('icons/effects/effects.dmi', shield_icon, MOB_LAYER + 0.01) diff --git a/code/game/objects/items/melee/energy.dm b/code/game/objects/items/melee/energy.dm index aba07c9120..83d7ec1b6d 100644 --- a/code/game/objects/items/melee/energy.dm +++ b/code/game/objects/items/melee/energy.dm @@ -337,7 +337,7 @@ . = ..() . += "Alt-click to recolor it." -/obj/item/melee/transforming/energy/sword/cx/worn_overlays(isinhands, icon_file, style_flags = NONE) +/obj/item/melee/transforming/energy/sword/cx/worn_overlays(isinhands, icon_file, used_state, style_flags = NONE) . = ..() if(active) if(isinhands) diff --git a/code/game/objects/items/storage/belt.dm b/code/game/objects/items/storage/belt.dm index 4e03d029a8..3ee4fbead8 100755 --- a/code/game/objects/items/storage/belt.dm +++ b/code/game/objects/items/storage/belt.dm @@ -22,7 +22,7 @@ for(var/obj/item/I in contents) . += I.get_belt_overlay() -/obj/item/storage/belt/worn_overlays(isinhands, icon_file, style_flags = NONE) +/obj/item/storage/belt/worn_overlays(isinhands, icon_file, used_state, style_flags = NONE) . = ..() if(!isinhands && onmob_overlays) for(var/obj/item/I in contents) diff --git a/code/game/objects/items/tanks/watertank.dm b/code/game/objects/items/tanks/watertank.dm index c1cbf534ca..5210f00e99 100644 --- a/code/game/objects/items/tanks/watertank.dm +++ b/code/game/objects/items/tanks/watertank.dm @@ -376,7 +376,7 @@ filling.color = mix_color_from_reagents(reagents.reagent_list) add_overlay(filling) -/obj/item/reagent_containers/chemtank/worn_overlays(isinhands = FALSE, icon_file, style_flags = NONE) //apply chemcolor and level +/obj/item/reagent_containers/chemtank/worn_overlays(isinhands = FALSE, icon_file, used_state, style_flags = NONE) //apply chemcolor and level . = list() //inhands + reagent_filling if(!isinhands && reagents.total_volume) diff --git a/code/game/objects/items/tools/screwdriver.dm b/code/game/objects/items/tools/screwdriver.dm index 0d2892cb4a..24fe73ba12 100644 --- a/code/game/objects/items/tools/screwdriver.dm +++ b/code/game/objects/items/tools/screwdriver.dm @@ -53,7 +53,7 @@ base_overlay.appearance_flags = RESET_COLOR . += base_overlay -/obj/item/screwdriver/worn_overlays(isinhands = FALSE, icon_file, style_flags = NONE) +/obj/item/screwdriver/worn_overlays(isinhands = FALSE, icon_file, used_state, style_flags = NONE) . = list() if(isinhands && random_color) var/mutable_appearance/M = mutable_appearance(icon_file, "screwdriver_head") diff --git a/code/game/objects/items/toys.dm b/code/game/objects/items/toys.dm index ba51fa3d65..08b87fe1d6 100644 --- a/code/game/objects/items/toys.dm +++ b/code/game/objects/items/toys.dm @@ -352,7 +352,7 @@ update_light() return TRUE -/obj/item/toy/sword/cx/worn_overlays(isinhands, icon_file, style_flags = NONE) +/obj/item/toy/sword/cx/worn_overlays(isinhands, icon_file, used_state, style_flags = NONE) . = ..() if(active) if(isinhands) diff --git a/code/game/objects/items/twohanded.dm b/code/game/objects/items/twohanded.dm index 11a06e149d..7f2e322c69 100644 --- a/code/game/objects/items/twohanded.dm +++ b/code/game/objects/items/twohanded.dm @@ -530,7 +530,7 @@ update_light() return TRUE -/obj/item/twohanded/dualsaber/hypereutactic/worn_overlays(isinhands, icon_file, style_flags = NONE) +/obj/item/twohanded/dualsaber/hypereutactic/worn_overlays(isinhands, icon_file, used_state, style_flags = NONE) . = ..() if(isinhands) var/mutable_appearance/gem_inhand = mutable_appearance(icon_file, "hypereutactic_gem") diff --git a/code/game/objects/structures/bedsheet_bin.dm b/code/game/objects/structures/bedsheet_bin.dm index 8dc7caa5ad..7859b888f2 100644 --- a/code/game/objects/structures/bedsheet_bin.dm +++ b/code/game/objects/structures/bedsheet_bin.dm @@ -252,7 +252,7 @@ LINEN BINS add_overlay(g_mouth) add_overlay(g_eyes) -/obj/item/bedsheet/gondola/worn_overlays(isinhands = FALSE, icon_file, style_flags = NONE) +/obj/item/bedsheet/gondola/worn_overlays(isinhands = FALSE, icon_file, used_state, style_flags = NONE) . = ..() if(!isinhands) . += mutable_appearance(icon_file, g_mouth) diff --git a/code/modules/antagonists/clockcult/clock_items/clockwork_slab.dm b/code/modules/antagonists/clockcult/clock_items/clockwork_slab.dm index b12c72b4af..b0ba3ccaaa 100644 --- a/code/modules/antagonists/clockcult/clock_items/clockwork_slab.dm +++ b/code/modules/antagonists/clockcult/clock_items/clockwork_slab.dm @@ -103,7 +103,7 @@ . = ..() addtimer(CALLBACK(src, .proc/check_on_mob, user), 1) //dropped is called before the item is out of the slot, so we need to check slightly later -/obj/item/clockwork/slab/worn_overlays(isinhands = FALSE, icon_file, style_flags = NONE) +/obj/item/clockwork/slab/worn_overlays(isinhands = FALSE, icon_file, used_state, style_flags = NONE) . = list() if(isinhands && item_state && inhand_overlay) var/mutable_appearance/M = mutable_appearance(icon_file, "slab_[inhand_overlay]") diff --git a/code/modules/antagonists/cult/cult_items.dm b/code/modules/antagonists/cult/cult_items.dm index 3dc199b56d..888e99f1ad 100644 --- a/code/modules/antagonists/cult/cult_items.dm +++ b/code/modules/antagonists/cult/cult_items.dm @@ -425,7 +425,7 @@ return 1 return 0 -/obj/item/clothing/suit/hooded/cultrobes/cult_shield/worn_overlays(isinhands, icon_file, style_flags = NONE) +/obj/item/clothing/suit/hooded/cultrobes/cult_shield/worn_overlays(isinhands, icon_file, used_state, style_flags = NONE) . = list() if(!isinhands && current_charges) . += mutable_appearance('icons/effects/cult_effects.dmi', "shield-cult", MOB_LAYER + 0.01) diff --git a/code/modules/clothing/glasses/_glasses.dm b/code/modules/clothing/glasses/_glasses.dm index 5ae86636d6..2b6036498e 100644 --- a/code/modules/clothing/glasses/_glasses.dm +++ b/code/modules/clothing/glasses/_glasses.dm @@ -333,7 +333,7 @@ add_atom_colour("#[user.eye_color]", FIXED_COLOUR_PRIORITY) colored_before = TRUE -/obj/item/clothing/glasses/sunglasses/blindfold/white/worn_overlays(isinhands = FALSE, icon_file, style_flags = NONE) +/obj/item/clothing/glasses/sunglasses/blindfold/white/worn_overlays(isinhands = FALSE, icon_file, used_state, style_flags = NONE) . = list() if(!isinhands && ishuman(loc) && !colored_before) var/mob/living/carbon/human/H = loc diff --git a/code/modules/clothing/gloves/_gloves.dm b/code/modules/clothing/gloves/_gloves.dm index 0729317eac..21ebeaa2bb 100644 --- a/code/modules/clothing/gloves/_gloves.dm +++ b/code/modules/clothing/gloves/_gloves.dm @@ -26,7 +26,7 @@ user.visible_message("\the [src] are forcing [user]'s hands around [user.p_their()] neck! It looks like the gloves are possessed!") return OXYLOSS -/obj/item/clothing/gloves/worn_overlays(isinhands = FALSE, icon_file, style_flags = NONE) +/obj/item/clothing/gloves/worn_overlays(isinhands = FALSE, icon_file, used_state, style_flags = NONE) . = list() if(!isinhands) if(damaged_clothes) diff --git a/code/modules/clothing/head/_head.dm b/code/modules/clothing/head/_head.dm index d599fbf6f7..121217c128 100644 --- a/code/modules/clothing/head/_head.dm +++ b/code/modules/clothing/head/_head.dm @@ -48,7 +48,7 @@ -/obj/item/clothing/head/worn_overlays(isinhands = FALSE, icon_file, style_flags = NONE) +/obj/item/clothing/head/worn_overlays(isinhands = FALSE, icon_file, used_state, style_flags = NONE) . = list() if(!isinhands) if(damaged_clothes) diff --git a/code/modules/clothing/head/hardhat.dm b/code/modules/clothing/head/hardhat.dm index e7a8243889..9715709e00 100644 --- a/code/modules/clothing/head/hardhat.dm +++ b/code/modules/clothing/head/hardhat.dm @@ -125,7 +125,7 @@ playsound(src, 'sound/mecha/mechmove03.ogg', 50, TRUE) //Visors don't just come from nothing update_icon() -/obj/item/clothing/head/hardhat/weldhat/worn_overlays(isinhands, icon_file, style_flags = NONE) +/obj/item/clothing/head/hardhat/weldhat/worn_overlays(isinhands, icon_file, used_state, style_flags = NONE) . = ..() if(!isinhands) . += mutable_appearance('icons/mob/head.dmi', "weldhelmet") diff --git a/code/modules/clothing/head/misc_special.dm b/code/modules/clothing/head/misc_special.dm index 4be949a65e..ec5573e4d7 100644 --- a/code/modules/clothing/head/misc_special.dm +++ b/code/modules/clothing/head/misc_special.dm @@ -208,7 +208,7 @@ M.color = hair_color add_overlay(M) -/obj/item/clothing/head/wig/worn_overlays(isinhands = FALSE, icon_file, style_flags = NONE) +/obj/item/clothing/head/wig/worn_overlays(isinhands = FALSE, icon_file, used_state, style_flags = NONE) . = list() if(!isinhands) var/datum/sprite_accessory/S = GLOB.hair_styles_list[hair_style] diff --git a/code/modules/clothing/masks/_masks.dm b/code/modules/clothing/masks/_masks.dm index 5019633cf0..ac087fd9e2 100644 --- a/code/modules/clothing/masks/_masks.dm +++ b/code/modules/clothing/masks/_masks.dm @@ -28,7 +28,7 @@ /obj/item/clothing/mask/proc/handle_speech() -/obj/item/clothing/mask/worn_overlays(isinhands = FALSE, icon_file, style_flags = NONE) +/obj/item/clothing/mask/worn_overlays(isinhands = FALSE, icon_file, used_state, style_flags = NONE) . = list() if(!isinhands) if(body_parts_covered & HEAD) diff --git a/code/modules/clothing/neck/_neck.dm b/code/modules/clothing/neck/_neck.dm index 2b43460257..cfc806b4db 100644 --- a/code/modules/clothing/neck/_neck.dm +++ b/code/modules/clothing/neck/_neck.dm @@ -6,7 +6,7 @@ strip_delay = 40 equip_delay_other = 40 -/obj/item/clothing/neck/worn_overlays(isinhands = FALSE, icon_flag, style_flags = NONE) +/obj/item/clothing/neck/worn_overlays(isinhands = FALSE, icon_file, used_state, style_flags = NONE) . = list() if(!isinhands) if(body_parts_covered & HEAD) @@ -192,7 +192,7 @@ tagname = stripped_input(user, "Would you like to change the name on the tag?", "Name your new pet", "Spot", MAX_NAME_LEN) name = "[initial(name)] - [tagname]" -/obj/item/clothing/neck/petcollar/worn_overlays(isinhands, icon_file, style_flags = NONE) +/obj/item/clothing/neck/petcollar/worn_overlays(isinhands, icon_file, used_state, style_flags = NONE) . = ..() if(hasprimary | hassecondary | hastertiary) if(!isinhands) //prevents the worn sprites from showing up if you're just holding them diff --git a/code/modules/clothing/shoes/_shoes.dm b/code/modules/clothing/shoes/_shoes.dm index 4c6d3a8f88..7ac4f062f3 100644 --- a/code/modules/clothing/shoes/_shoes.dm +++ b/code/modules/clothing/shoes/_shoes.dm @@ -49,7 +49,7 @@ last_bloodtype = blood_dna[blood_dna[blood_dna.len]]//trust me this works last_blood_DNA = blood_dna[blood_dna.len] -/obj/item/clothing/shoes/worn_overlays(isinhands = FALSE, icon_file, style_flags = NONE) +/obj/item/clothing/shoes/worn_overlays(isinhands = FALSE, icon_file, used_state, style_flags = NONE) . = list() if(!isinhands) var/bloody = FALSE diff --git a/code/modules/clothing/spacesuits/hardsuit.dm b/code/modules/clothing/spacesuits/hardsuit.dm index d9e4f17649..a391a3807f 100644 --- a/code/modules/clothing/spacesuits/hardsuit.dm +++ b/code/modules/clothing/spacesuits/hardsuit.dm @@ -793,7 +793,7 @@ var/mob/living/carbon/human/C = loc C.update_inv_wear_suit() -/obj/item/clothing/suit/space/hardsuit/shielded/worn_overlays(isinhands, icon_file, style_flags = NONE) +/obj/item/clothing/suit/space/hardsuit/shielded/worn_overlays(isinhands, icon_file, used_state, style_flags = NONE) . = ..() if(!isinhands) var/file2use = style_flags & STYLE_ALL_TAURIC ? 'modular_citadel/icons/mob/64x32_effects.dmi' : 'icons/effects/effects.dmi' @@ -956,7 +956,7 @@ add_overlay(helm_overlay) -/obj/item/clothing/head/helmet/space/hardsuit/lavaknight/worn_overlays(isinhands = FALSE, icon_file, style_flags = NONE) +/obj/item/clothing/head/helmet/space/hardsuit/lavaknight/worn_overlays(isinhands = FALSE, icon_file, used_state, style_flags = NONE) . = ..() if(!isinhands) var/mutable_appearance/energy_overlay = mutable_appearance(icon_file, "knight_cydonia_overlay", ABOVE_LIGHTING_LAYER) @@ -993,7 +993,7 @@ add_overlay(suit_overlay) -/obj/item/clothing/suit/space/hardsuit/lavaknight/worn_overlays(isinhands = FALSE, icon_file, style_flags = NONE) +/obj/item/clothing/suit/space/hardsuit/lavaknight/worn_overlays(isinhands = FALSE, icon_file, used_state, style_flags = NONE) . = ..() if(!isinhands) var/mutable_appearance/energy_overlay = mutable_appearance(icon_file, "knight_cydonia_overlay", ABOVE_LIGHTING_LAYER) diff --git a/code/modules/clothing/spacesuits/plasmamen.dm b/code/modules/clothing/spacesuits/plasmamen.dm index fee8dbce33..f17eb91b74 100644 --- a/code/modules/clothing/spacesuits/plasmamen.dm +++ b/code/modules/clothing/spacesuits/plasmamen.dm @@ -67,7 +67,7 @@ var/datum/action/A=X A.UpdateButtonIcon() -/obj/item/clothing/head/helmet/space/plasmaman/worn_overlays(isinhands, icon_file, style_flags = NONE) +/obj/item/clothing/head/helmet/space/plasmaman/worn_overlays(isinhands, icon_file, used_state, style_flags = NONE) . = ..() if(!isinhands && on) . += mutable_appearance(icon_file, light_overlay) diff --git a/code/modules/clothing/suits/_suits.dm b/code/modules/clothing/suits/_suits.dm index 1b2080feb1..3d312e260a 100644 --- a/code/modules/clothing/suits/_suits.dm +++ b/code/modules/clothing/suits/_suits.dm @@ -11,7 +11,7 @@ var/suittoggled = FALSE mutantrace_variation = STYLE_DIGITIGRADE -/obj/item/clothing/suit/worn_overlays(isinhands = FALSE, icon_file, style_flags = NONE) +/obj/item/clothing/suit/worn_overlays(isinhands = FALSE, icon_file, used_state, style_flags = NONE) . = ..() if(!isinhands) if(damaged_clothes) diff --git a/code/modules/clothing/suits/miscellaneous.dm b/code/modules/clothing/suits/miscellaneous.dm index 6f61bf56cb..febecd9f71 100644 --- a/code/modules/clothing/suits/miscellaneous.dm +++ b/code/modules/clothing/suits/miscellaneous.dm @@ -987,7 +987,7 @@ item_color = "winterhood_poly" item_state = "winterhood_poly" -/obj/item/clothing/head/hooded/winterhood/polychromic/worn_overlays(isinhands, icon_file, style_flags = NONE) //this is where the main magic happens. +/obj/item/clothing/head/hooded/winterhood/polychromic/worn_overlays(isinhands, icon_file, used_state, style_flags = NONE) //this is where the main magic happens. . = ..() if(suit.hasprimary | suit.hassecondary) if(!isinhands) //prevents the worn sprites from showing up if you're just holding them @@ -1000,7 +1000,7 @@ secondary_worn.color = suit.secondary_color . += secondary_worn -/obj/item/clothing/suit/hooded/wintercoat/polychromic/worn_overlays(isinhands, icon_file, style_flags = NONE) //this is where the main magic happens. +/obj/item/clothing/suit/hooded/wintercoat/polychromic/worn_overlays(isinhands, icon_file, used_state, style_flags = NONE) //this is where the main magic happens. . = ..() if(hasprimary | hassecondary | hastertiary) if(!isinhands) //prevents the worn sprites from showing up if you're just holding them diff --git a/code/modules/clothing/under/_under.dm b/code/modules/clothing/under/_under.dm index 63e3a63968..d0cfef4f71 100644 --- a/code/modules/clothing/under/_under.dm +++ b/code/modules/clothing/under/_under.dm @@ -16,7 +16,7 @@ var/mutable_appearance/accessory_overlay mutantrace_variation = STYLE_DIGITIGRADE -/obj/item/clothing/under/worn_overlays(isinhands = FALSE, icon_file, style_flags = NONE) +/obj/item/clothing/under/worn_overlays(isinhands = FALSE, icon_file, used_state, style_flags = NONE) . = list() if(!isinhands) if(damaged_clothes) diff --git a/code/modules/clothing/under/polychromic_clothes.dm b/code/modules/clothing/under/polychromic_clothes.dm index 53011d42d1..e56e1eb265 100644 --- a/code/modules/clothing/under/polychromic_clothes.dm +++ b/code/modules/clothing/under/polychromic_clothes.dm @@ -27,7 +27,7 @@ can_adjust = FALSE mutantrace_variation = NONE //Not all clothes are currently digi-compatible (only the shorts are as of time of writing) -/obj/item/clothing/under/polychromic/worn_overlays(isinhands, icon_file, style_flags = NONE) //this is where the main magic happens. +/obj/item/clothing/under/polychromic/worn_overlays(isinhands, icon_file, used_state, style_flags = NONE) //this is where the main magic happens. . = ..() if(hasprimary | hassecondary | hastertiary) if(!isinhands) //prevents the worn sprites from showing up if you're just holding them diff --git a/code/modules/food_and_drinks/pizzabox.dm b/code/modules/food_and_drinks/pizzabox.dm index b163c6ba97..3505a35487 100644 --- a/code/modules/food_and_drinks/pizzabox.dm +++ b/code/modules/food_and_drinks/pizzabox.dm @@ -86,7 +86,7 @@ tag_overlay.pixel_y = boxes.len * 3 add_overlay(tag_overlay) -/obj/item/pizzabox/worn_overlays(isinhands, icon_file, style_flags = NONE) +/obj/item/pizzabox/worn_overlays(isinhands, icon_file, used_state, style_flags = NONE) . = list() var/current_offset = 2 if(isinhands) diff --git a/code/modules/mining/equipment/explorer_gear.dm b/code/modules/mining/equipment/explorer_gear.dm index 5165d95340..d3bf4368f7 100644 --- a/code/modules/mining/equipment/explorer_gear.dm +++ b/code/modules/mining/equipment/explorer_gear.dm @@ -117,7 +117,7 @@ glass_overlay.appearance_flags = RESET_COLOR add_overlay(glass_overlay) -/obj/item/clothing/head/helmet/space/hostile_environment/worn_overlays(isinhands, icon_file, style_flags = NONE) +/obj/item/clothing/head/helmet/space/hostile_environment/worn_overlays(isinhands, icon_file, used_state, style_flags = NONE) . = ..() if(!isinhands) var/mutable_appearance/M = mutable_appearance('icons/mob/head.dmi', "hostile_env_glass") diff --git a/code/modules/mob/living/carbon/human/update_icons.dm b/code/modules/mob/living/carbon/human/update_icons.dm index f1b1570e24..fa138e38f8 100644 --- a/code/modules/mob/living/carbon/human/update_icons.dm +++ b/code/modules/mob/living/carbon/human/update_icons.dm @@ -593,7 +593,7 @@ generate/load female uniform sprites matching all previously decided variables //Get the overlays for this item when it's being worn //eg: ammo counters, primed grenade flashes, etc. - var/list/worn_overlays = worn_overlays(isinhands, file2use, style_flags) + var/list/worn_overlays = worn_overlays(isinhands, file2use, state, style_flags) if(worn_overlays && worn_overlays.len) standing.overlays.Add(worn_overlays) diff --git a/modular_citadel/code/modules/clothing/suits/polychromic_cloaks.dm b/modular_citadel/code/modules/clothing/suits/polychromic_cloaks.dm index ade6cee3ba..ac7d2e80b0 100644 --- a/modular_citadel/code/modules/clothing/suits/polychromic_cloaks.dm +++ b/modular_citadel/code/modules/clothing/suits/polychromic_cloaks.dm @@ -13,7 +13,7 @@ secondary_color = "#FFFFFF" tertiary_color = "#808080" -/obj/item/clothing/neck/cloak/polychromic/worn_overlays(isinhands, icon_file, style_flags = NONE) //this is where the main magic happens. Also mandates that ALL polychromic stuff MUST USE alternate_worn_icon +/obj/item/clothing/neck/cloak/polychromic/worn_overlays(isinhands, icon_file, used_state, style_flags = NONE) //this is where the main magic happens. Also mandates that ALL polychromic stuff MUST USE alternate_worn_icon . = ..() if(hasprimary | hassecondary | hastertiary) if(!isinhands) //prevents the worn sprites from showing up if you're just holding them diff --git a/modular_citadel/code/modules/projectiles/guns/energy/energy_gun.dm b/modular_citadel/code/modules/projectiles/guns/energy/energy_gun.dm index 49a8a26f35..49d48e0000 100644 --- a/modular_citadel/code/modules/projectiles/guns/energy/energy_gun.dm +++ b/modular_citadel/code/modules/projectiles/guns/energy/energy_gun.dm @@ -39,7 +39,7 @@ obj/item/gun/energy/e_gun/cx/AltClick(mob/living/user) body_color = sanitize_hexcolor(body_color_input, desired_format=6, include_crunch=1) update_icon() -obj/item/gun/energy/e_gun/cx/worn_overlays(isinhands, icon_file, style_flags = NONE) +obj/item/gun/energy/e_gun/cx/worn_overlays(isinhands, icon_file, used_state, style_flags = NONE) . = ..() if(isinhands) var/mutable_appearance/body_inhand = mutable_appearance(icon_file, "cxe_body") diff --git a/modular_citadel/code/modules/projectiles/guns/pumpenergy.dm b/modular_citadel/code/modules/projectiles/guns/pumpenergy.dm index f7c0b343c3..fcead7f179 100644 --- a/modular_citadel/code/modules/projectiles/guns/pumpenergy.dm +++ b/modular_citadel/code/modules/projectiles/guns/pumpenergy.dm @@ -87,7 +87,7 @@ . = ..() . += "Alt-click to change firing modes." -/obj/item/gun/energy/pumpaction/worn_overlays(isinhands, icon_file, style_flags = NONE) //ammo counter for inhands +/obj/item/gun/energy/pumpaction/worn_overlays(isinhands, icon_file, used_state, style_flags = NONE) //ammo counter for inhands . = ..() var/ratio = CEILING((cell.charge / cell.maxcharge) * charge_sections, 1) var/obj/item/ammo_casing/energy/shot = ammo_type[current_firemode_index]