-
Notifications
You must be signed in to change notification settings - Fork 305
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
023cc05
commit 27ba4a4
Showing
18 changed files
with
127 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
code/modules/mob/living/silicon/robot/subtypes/thinktank/_thinktank.dm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
/datum/unit_test/robot_module_icons_shall_be_valid | ||
name = "ICONS: Robot module icons shall be valid" | ||
var/list/check_module_categories = list( | ||
ROBOT_MODULE_TYPE_GROUNDED, | ||
ROBOT_MODULE_TYPE_FLYING | ||
) | ||
var/list/panel_overlays = list( | ||
"ov-openpanel +w", | ||
"ov-openpanel +c", | ||
"ov-openpanel -c" | ||
) | ||
var/list/gear_to_check = list( | ||
/obj/item/borg/combat/shield = "-shield", | ||
/obj/item/borg/combat/mobility = "-roll" | ||
) | ||
|
||
/datum/unit_test/robot_module_icons_shall_be_valid/start_test() | ||
|
||
var/list/failures = list() | ||
// fetch our icon states to check against | ||
var/list/icon_state_cache = list( | ||
ROBOT_MODULE_TYPE_GROUNDED = icon_states('icons/mob/robots/robots_grounded.dmi'), | ||
ROBOT_MODULE_TYPE_FLYING = icon_states('icons/mob/robots/robots_flying.dmi') | ||
) | ||
|
||
// We need a robot to properly initialize the module, which is somewhat unfortunate. | ||
var/list/found_states = list() // Keep track of this for checking for unused states later. | ||
for(var/module_type in subtypesof(/obj/item/robot_module)) | ||
|
||
// Skip abstract modules and think-tanks as they do icon gen differently. | ||
var/obj/item/robot_module/module = module_type | ||
if(!initial(module.display_name) || !(initial(module.module_category) in check_module_categories)) | ||
continue | ||
|
||
module = new module // this will automatically qdelete, but we just want the sprites. | ||
|
||
// Check that the expected states are actually in the icon file. | ||
LAZYINITLIST(found_states[module.module_category]) | ||
var/check_states = icon_state_cache[module.module_category] | ||
for(var/sprite in module.sprites) | ||
|
||
// Basic sprite. | ||
var/check_state = module.sprites[sprite] | ||
if(check_state in check_states) | ||
found_states[module.module_category] |= check_state | ||
else | ||
failures += "missing base state '[check_state]' for [module.display_name] ([module.module_category])" | ||
|
||
// Eyes overlay. | ||
var/eye_check_state = "eyes-[check_state]" | ||
if(eye_check_state in check_states) | ||
found_states[module.module_category] |= eye_check_state | ||
else | ||
failures += "missing eyes state '[eye_check_state]' for [module.display_name] ([module.module_category])" | ||
|
||
// Equipment overlays. | ||
for(var/geartype in gear_to_check) | ||
var/suffix = gear_to_check[geartype] | ||
for(var/gear in module.modules) | ||
if(!istype(gear, geartype)) | ||
continue | ||
var/gear_check_state = "[check_state][suffix]" | ||
if(gear_check_state in check_states) | ||
found_states[module.module_category] |= gear_check_state | ||
else | ||
failures += "missing gear state '[gear_check_state]' for [module.display_name] ([module.module_category])" | ||
break | ||
|
||
// Check for missing panel states. | ||
for(var/module_category in icon_state_cache) | ||
var/list/check_states = icon_state_cache[module_category] | ||
for(var/panel_state in panel_overlays) | ||
if(panel_state in check_states) | ||
found_states[module_category] |= panel_state | ||
else | ||
failures += "missing panel state '[panel_state]' for [module_category]" | ||
|
||
// Check that there aren't any unexpected states. | ||
for(var/module_category in icon_state_cache) | ||
for(var/check_state in icon_state_cache[module_category]) | ||
if(check_state in found_states[module_category]) | ||
continue | ||
failures += "unexpected state '[check_state]' for [module_category]" | ||
|
||
if(length(failures)) | ||
fail("Some robot module sprites are invalid:\n" + failures.Join("\n")) | ||
else | ||
pass("All robot module sprites are valid.") | ||
return 1 |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File renamed without changes.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters