Skip to content

Commit

Permalink
[MIRROR] Fix decals on open closets
Browse files Browse the repository at this point in the history
  • Loading branch information
Qlonever authored and SierraHelper committed Oct 18, 2023
1 parent de5a38e commit 339a8c7
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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")
Expand All @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion code/unit_tests/closets.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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( \
Expand Down
Binary file modified icons/obj/closets/bases/closet.dmi
Binary file not shown.
Binary file modified icons/obj/closets/decals/closet.dmi
Binary file not shown.
Binary file modified icons/obj/closets/decals/crate.dmi
Binary file not shown.
Binary file modified icons/obj/closets/decals/wall.dmi
Binary file not shown.

0 comments on commit 339a8c7

Please sign in to comment.