RnD design spritesheet ignores designs with an 'ignored' ID (#72227)

## About The Pull Request

We have a define to ignore certain designs to be ignored from RND,
except they aren't excluded from the spritesheet, this fixes that,
making it work as it's supposed to.

## Why It's Good For The Game

Currently it's only used for the base design, but if we ever want to
make base subtypes (like biogenerator so we don't have to re-define
build_type and category every single time like we currently do) then
this will let us do it without causing runtime errors for
non-functional/double sprites.

## Changelog

Nothing player-facing.
This commit is contained in:
John Willard
2023-01-06 20:25:54 +00:00
committed by GitHub
parent 7d47fbef42
commit 27a4dceecc
@@ -3,29 +3,30 @@
name = "design"
/datum/asset/spritesheet/research_designs/create_spritesheets()
for (var/path in subtypesof(/datum/design))
var/datum/design/D = path
for (var/datum/design/path as anything in subtypesof(/datum/design))
if(initial(path.id) == DESIGN_ID_IGNORE)
continue
var/icon_file
var/icon_state
var/icon/I
if(initial(D.research_icon) && initial(D.research_icon_state)) //If the design has an icon replacement skip the rest
icon_file = initial(D.research_icon)
icon_state = initial(D.research_icon_state)
if(initial(path.research_icon) && initial(path.research_icon_state)) //If the design has an icon replacement skip the rest
icon_file = initial(path.research_icon)
icon_state = initial(path.research_icon_state)
if (PERFORM_ALL_TESTS(focus_only/invalid_research_designs))
if(!(icon_state in icon_states(icon_file)))
stack_trace("design [D] with icon '[icon_file]' missing state '[icon_state]'")
stack_trace("design [path] with icon '[icon_file]' missing state '[icon_state]'")
continue
I = icon(icon_file, icon_state, SOUTH)
else
// construct the icon and slap it into the resource cache
var/atom/item = initial(D.build_path)
var/atom/item = initial(path.build_path)
if (!ispath(item, /atom))
// biogenerator reagent designs display their default container
if(initial(D.make_reagent))
var/datum/reagent/reagent = initial(D.make_reagent)
if(initial(path.make_reagent))
var/datum/reagent/reagent = initial(path.make_reagent)
item = initial(reagent.default_container)
else
continue // shouldn't happen, but just in case
@@ -48,7 +49,7 @@
icon_state = initial(item.icon_state)
if (PERFORM_ALL_TESTS(focus_only/invalid_research_designs))
if(!(icon_state in icon_states(icon_file)))
stack_trace("design [D] with icon '[icon_file]' missing state '[icon_state]'")
stack_trace("design [path] with icon '[icon_file]' missing state '[icon_state]'")
continue
I = icon(icon_file, icon_state, SOUTH)
@@ -63,4 +64,4 @@
if (keyboard && (keyboard in all_states))
I.Blend(icon(icon_file, keyboard, SOUTH), ICON_OVERLAY)
Insert(initial(D.id), I)
Insert(initial(path.id), I)