Skip to content

Commit

Permalink
Overlay/underlay testing!
Browse files Browse the repository at this point in the history
  • Loading branch information
Drulikar committed Nov 26, 2024
1 parent ea1e01d commit 8872388
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion code/modules/unit_tests/missing_icons.dm
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,17 @@
check_atom(mob_path, spawned)
qdel(spawned)

/datum/unit_test/missing_icons/proc/check_atom(atom_path, atom/thing, note)
/datum/unit_test/missing_icons/proc/check_atom(atom_path, atom/thing, note, skip_overlays_underlays=FALSE)
check(atom_path, thing.icon, thing.icon_state, note)

if(!skip_overlays_underlays)
var/overlay_note = note ? note + " - Overlay" : "Overlay"
var/underlay_note = note ? note + " - Underlay" : "Underlay"
for(var/mutable_appearance/layer as anything in thing.overlays)
check(atom_path, layer.icon || thing.icon, layer.icon_state, overlay_note)
for(var/mutable_appearance/layer as anything in thing.underlays)
check(atom_path, layer.icon || thing.icon, layer.icon_state, underlay_note)

/datum/unit_test/missing_icons/proc/check(thing_path, icon, icon_state, note, variable_name="icon_state", check_null=TRUE, warning_only=FALSE)
if(check_null)
if(isnull(icon))
Expand Down

0 comments on commit 8872388

Please sign in to comment.