Fixes the body designer [WIP] (#17062)

* designer

* finished off remaining body designer stuff, name etc

* merged _vr file, added note to use this

* harddel fix

* this one too

* unifies subtabs, adds search and improves layout

* fixes a longstanding issue with marking color appearance changer

It was feeding a /list (The object) to the color picker and the color picker just rolled with it and said 'sure'.

Now with actual sanity TGUI color picker freaks out and goes 'wtf'

This makes it actually feed a color input into the color picker.

* quick push

* adds hair grad to body designer

* push

* color works again

* hair gradient for body designer

* deconf

* Gets rid of duplicate datum

* no test tonight

* spotty fat

* Condenses hair_extras. Fixes a few missing.

Also adds a new cosmetics_tests unit test.

* fixes the rest of the sprites

* lets try this test

* why did that test compile

* another test ENHANCEMENT(fix)

* More aggressive unittest

* fixie

* invisible tail has snowflake handling

* fix for invis check

* oops

* validate existence of icon in unit test

* unittest checks marking and hair icons properly

* fixing bad unit testing again

* fixed marking icon check

* get rid of unused datum, markings show

* fixes things

* you too

---------

Co-authored-by: Willburd <7099514+Willburd@users.noreply.github.com>
Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
Cameron Lennox
2025-02-07 20:57:25 -05:00
committed by GitHub
co-authored by Willburd Kashargul
parent bb6a263e2f
commit eeefd4ef3f
37 changed files with 1593 additions and 2235 deletions
+87
View File
@@ -0,0 +1,87 @@
/datum/unit_test/sprite_accessories_shall_be_unique
name = "COSMETICS: Entries shall have unique name."
/datum/unit_test/sprite_accessories_shall_be_unique/start_test()
var/failed = 0
failed += validate_accessory_list( /datum/sprite_accessory/ears)
failed += validate_accessory_list( /datum/sprite_accessory/facial_hair)
failed += validate_accessory_list( /datum/sprite_accessory/hair)
failed += validate_accessory_list( /datum/sprite_accessory/hair_accessory)
failed += validate_accessory_list( /datum/sprite_accessory/marking)
failed += validate_accessory_list( /datum/sprite_accessory/tail)
failed += validate_accessory_list( /datum/sprite_accessory/wing)
if(failed)
fail("One or more /datum/sprite_accessory definitions had invalid names, icon_states, or names were reused definitions")
else
pass("All /datum/sprite_accessory definitions had correct settings.")
return 1
/datum/unit_test/sprite_accessories_shall_be_unique/proc/validate_accessory_list(var/path)
var/failed = 0
var/total_good = 0
var/total_all = 0
var/list/collection = list()
for(var/SP in subtypesof(path))
total_all++
var/datum/sprite_accessory/A = new SP()
if(!A)
log_unit_test("[SP]: Cosmetic - Path resolved to null in list.")
continue
if(!A.name)
log_unit_test("[A] - [A.type]: Cosmetic - Missing name.")
failed = 1
if(A.name == DEVELOPER_WARNING_NAME)
continue
if(collection[A.name])
log_unit_test("[A] - [A.type]: Cosmetic - Name defined twice. Original def [collection[A.name]]")
failed = 1
else
collection[A.name] = A.type
if(istype(A,text2path("[path]/invisible")))
if(A.icon_state)
log_unit_test("[A] - [A.type]: Cosmetic - Invisible subtype has icon_state.")
failed = 1
else if(!A.icon_state)
log_unit_test("[A] - [A.type]: Cosmetic - Has no icon_state.")
failed = 1
else
// Check if valid icon
failed += validate_icons(A)
total_good++
qdel(A)
log_unit_test("[path]: Cosmetic - Total valid count: [total_good]/[total_all].")
return failed
/datum/unit_test/sprite_accessories_shall_be_unique/proc/validate_icons(var/datum/sprite_accessory/A)
var/failed = 0
var/actual_icon_state = A.icon_state
if(istype(A,/datum/sprite_accessory/hair))
actual_icon_state = "[A.icon_state]_s"
if(!(actual_icon_state in cached_icon_states(A.icon)))
log_unit_test("[A] - [A.type]: Cosmetic - Icon_state \"[actual_icon_state]\" is not present in [A.icon].")
failed = 1
if(istype(A,/datum/sprite_accessory/facial_hair))
actual_icon_state = "[A.icon_state]_s"
if(!(actual_icon_state in cached_icon_states(A.icon)))
log_unit_test("[A] - [A.type]: Cosmetic - Icon_state \"[actual_icon_state]\" is not present in [A.icon].")
failed = 1
if(istype(A,/datum/sprite_accessory/marking))
var/datum/sprite_accessory/marking/MA = A
for(var/BP in MA.body_parts)
actual_icon_state = "[A.icon_state]-[BP]"
if(!(actual_icon_state in cached_icon_states(A.icon)))
log_unit_test("[A] - [A.type]: Cosmetic - Icon_state \"[actual_icon_state]\" is not present in [A.icon].")
failed = 1
return failed