mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-18 19:44:58 +01:00
Adds unit test to check for spritesheet issues (#70351)
* Adds a new spritesheet unit test to catch edge-cases that caused problems in the past.
This commit is contained in:
@@ -169,6 +169,7 @@
|
||||
#include "spell_mindswap.dm"
|
||||
#include "spell_names.dm"
|
||||
#include "spell_shapeshift.dm"
|
||||
#include "spritesheets.dm"
|
||||
#include "stack_singular_name.dm"
|
||||
#include "stomach.dm"
|
||||
#include "strippable.dm"
|
||||
|
||||
@@ -9,3 +9,5 @@
|
||||
var/init_icon = initial(award.icon)
|
||||
if(!init_icon || !(init_icon in award_icons))
|
||||
TEST_FAIL("Award [initial(award.name)] has an unexistent icon: \"[init_icon || "null"]\"")
|
||||
if(length(initial(award.database_id)) > 32) //sql schema limit
|
||||
TEST_FAIL("Award [initial(award.name)] database id is is too long")
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
///Checks if spritesheet assets contain icon states with invalid names
|
||||
/datum/unit_test/spritesheets
|
||||
|
||||
/datum/unit_test/spritesheets/Run()
|
||||
for(var/datum/asset/spritesheet/sheet as anything in subtypesof(/datum/asset/spritesheet))
|
||||
if(!initial(sheet.name)) //Ignore abstract types
|
||||
continue
|
||||
sheet = get_asset_datum(sheet)
|
||||
for(var/sprite_name in sheet.sprites)
|
||||
if(!sprite_name)
|
||||
TEST_FAIL("Spritesheet [sheet.type] has a nameless icon state.")
|
||||
Reference in New Issue
Block a user