mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-10 01:34:01 +00:00
* Adds support for different achievement dmis (#81471) ## About The Pull Request I am back to pushing my code improvements upstream, sorry in advance. As the title says, this adds support for achievement icons to be in different dmi files than the default, pretty much the exact same way that Language icons (for chat assets) do. ## Why It's Good For The Game It is one of the few things in game (the only other thing i can think of that does this rn is barsigns) that cannot have their icon changed when trying to make a subtype, this is very limiting and very annoying, especially since dmi conflicts are one of the worst types to deal with, this would make my life a lot easier. ## Changelog No player-facing changes. * Adds support for different achievement dmis --------- Co-authored-by: John Willard <53777086+JohnFulpWillard@users.noreply.github.com>
17 lines
940 B
Plaintext
17 lines
940 B
Plaintext
///Checks that all achievements have an existing icon state in the achievements icon file.
|
|
/datum/unit_test/achievements
|
|
|
|
/datum/unit_test/achievements/Run()
|
|
for(var/datum/award/award as anything in subtypesof(/datum/award))
|
|
if(!initial(award.name)) //Skip abstract achievements types
|
|
continue
|
|
var/init_icon = initial(award.icon)
|
|
var/init_icon_state = initial(award.icon_state)
|
|
if(!init_icon_state || !icon_exists(init_icon, init_icon_state))
|
|
TEST_FAIL("Award [initial(award.name)] has a non-existent icon in [init_icon]: \"[init_icon_state || "null"]\"")
|
|
if(length(initial(award.database_id)) > 32) //sql schema limit
|
|
TEST_FAIL("Award [initial(award.name)] database id is too long")
|
|
var/init_category = initial(award.category)
|
|
if(!(init_category in GLOB.achievement_categories))
|
|
TEST_FAIL("Award [initial(award.name)] has unsupported category: \"[init_category || "null"]\". Update GLOB.achievement_categories")
|