mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-01-10 17:04:36 +00:00
## About The Pull Request See title. ## Why It's Good For The Game Calling this var `icon` is confusing and illogical. It will be applied to the barsign's `icon_state`, and is not an actual icon itself. Renaming to `icon_state` makes this var consistent with `name` and `desc`, which are also applied the same named vars on the sign. ## Changelog Not player facing
38 lines
1.1 KiB
Plaintext
38 lines
1.1 KiB
Plaintext
/**
|
|
* Test if icon states for each datum actually exist in the DMI.
|
|
*/
|
|
/datum/unit_test/barsigns_icon
|
|
|
|
/datum/unit_test/barsigns_icon/Run()
|
|
var/obj/machinery/barsign_type = /obj/machinery/barsign
|
|
var/icon/barsign_icon = initial(barsign_type.icon)
|
|
var/list/barsign_icon_states = icon_states(barsign_icon)
|
|
|
|
// Check every datum real bar sign
|
|
for(var/sign_type in (subtypesof(/datum/barsign) - /datum/barsign/hiddensigns))
|
|
var/datum/barsign/sign = new sign_type()
|
|
|
|
if(!(sign.icon_state in barsign_icon_states))
|
|
TEST_FAIL("Icon state for [sign_type] does not exist in [barsign_icon].")
|
|
|
|
/**
|
|
* Check that bar signs have a name and desc, and that the name is unique.
|
|
*/
|
|
/datum/unit_test/barsigns_name
|
|
|
|
/datum/unit_test/barsigns_name/Run()
|
|
var/list/existing_names = list()
|
|
|
|
for(var/sign_type in subtypesof(/datum/barsign) - /datum/barsign/hiddensigns)
|
|
var/datum/barsign/sign = new sign_type()
|
|
|
|
if(!sign.name)
|
|
TEST_FAIL("[sign_type] does not have a name.")
|
|
if(!sign.desc)
|
|
TEST_FAIL("[sign_type] does not have a desc.")
|
|
|
|
if(sign.name in existing_names)
|
|
TEST_FAIL("[sign_type] does not have a unique name.")
|
|
|
|
existing_names += sign.name
|