Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MIRROR] Fix decals on open closets #1153

Merged
merged 2 commits into from
Oct 18, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.