diff --git a/code/game/objects/structures/crates_lockers/closets/_closet_appearance_definitions.dm b/code/game/objects/structures/crates_lockers/closets/_closet_appearance_definitions.dm index f1c172c761ceb..7703057772adf 100644 --- a/code/game/objects/structures/crates_lockers/closets/_closet_appearance_definitions.dm +++ b/code/game/objects/structures/crates_lockers/closets/_closet_appearance_definitions.dm @@ -25,6 +25,9 @@ if(isnull(decals[thing])) decals[thing] = color + // Create a list of valid icon states for decals + var/list/icon_states = icon_states(decal_icon) + // Declare storage vars for icons. var/icon/open_icon var/icon/closed_emagged_icon @@ -39,12 +42,17 @@ open_icon = icon(base_icon, "base") open_icon.Blend(icon(base_icon, "open"), ICON_OVERLAY) open_icon.Blend(color, BLEND_ADD) - open_icon.Blend(icon(base_icon, "interior"), ICON_OVERLAY) if(decal_icon) for(var/thing in decals) - var/icon/this_decal_icon = icon(decal_icon, "[thing]_open") - this_decal_icon.Blend(decals[thing], BLEND_ADD) - open_icon.Blend(this_decal_icon, ICON_OVERLAY) + var/icon/this_decal_icon + if (icon_states.Find("[thing]_open")) + this_decal_icon = icon(decal_icon, "[thing]_open") + else if (icon_states.Find(thing)) + this_decal_icon = icon(decal_icon, thing) + if(this_decal_icon) + this_decal_icon.Blend(decals[thing], BLEND_ADD) + open_icon.Blend(this_decal_icon, ICON_OVERLAY) + open_icon.Blend(icon(base_icon, "interior"), ICON_OVERLAY) // Generate basic closed icons. closed_emagged_icon = icon(base_icon, "base") @@ -53,9 +61,14 @@ closed_emagged_icon.Blend(color, BLEND_ADD) if(decal_icon) for(var/thing in decals) - var/icon/this_decal_icon = icon(decal_icon, thing) - this_decal_icon.Blend(decals[thing], BLEND_ADD) - closed_emagged_icon.Blend(this_decal_icon, ICON_OVERLAY) + var/icon/this_decal_icon + if (icon_states.Find("[thing]_closed")) + this_decal_icon = icon(decal_icon, "[thing]_closed") + else if (icon_states.Find(thing)) + this_decal_icon = icon(decal_icon, thing) + if(this_decal_icon) + this_decal_icon.Blend(decals[thing], BLEND_ADD) + closed_emagged_icon.Blend(this_decal_icon, ICON_OVERLAY) closed_locked_icon = icon(closed_emagged_icon) closed_unlocked_icon = icon(closed_emagged_icon) diff --git a/code/unit_tests/closets.dm b/code/unit_tests/closets.dm index 84daec10bd521..7a3831af5e211 100644 --- a/code/unit_tests/closets.dm +++ b/code/unit_tests/closets.dm @@ -38,7 +38,7 @@ for(var/thing in closet.decals) if(isnull(closet.decals[thing])) LAZYADD(bad_decal_colour, "[check_appearance] - [thing]") - if(!(thing in decal_states)) + if(!(thing in decal_states) && !("[thing]_open" in decal_states) && !("[thing]_closed" in decal_states)) LAZYADD(bad_decal_state, "[check_appearance] - [thing] - [closet.decal_icon]") if( \ diff --git a/icons/obj/closets/bases/closet.dmi b/icons/obj/closets/bases/closet.dmi index 551435629e435..562d49494d15b 100644 Binary files a/icons/obj/closets/bases/closet.dmi and b/icons/obj/closets/bases/closet.dmi differ diff --git a/icons/obj/closets/decals/closet.dmi b/icons/obj/closets/decals/closet.dmi index 7adcad37d554d..d0cfcfe618c83 100644 Binary files a/icons/obj/closets/decals/closet.dmi and b/icons/obj/closets/decals/closet.dmi differ diff --git a/icons/obj/closets/decals/crate.dmi b/icons/obj/closets/decals/crate.dmi index 9ed7b7af82618..7abcbbf4b91e8 100644 Binary files a/icons/obj/closets/decals/crate.dmi and b/icons/obj/closets/decals/crate.dmi differ diff --git a/icons/obj/closets/decals/wall.dmi b/icons/obj/closets/decals/wall.dmi index eb8a4885dffd4..c3a78f5a1329c 100644 Binary files a/icons/obj/closets/decals/wall.dmi and b/icons/obj/closets/decals/wall.dmi differ diff --git a/mods/_master_files/icons/obj/closets/bases/closet.dmi b/mods/_master_files/icons/obj/closets/bases/closet.dmi index 0f7b71d006977..7f294b4591118 100644 Binary files a/mods/_master_files/icons/obj/closets/bases/closet.dmi and b/mods/_master_files/icons/obj/closets/bases/closet.dmi differ