Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

missing icon unit test #2530

Merged
merged 87 commits into from
Mar 27, 2024
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
6a14d4b
missing icon unit test
FalloutFalcon Nov 26, 2023
c74c477
prob the issue
FalloutFalcon Nov 26, 2023
83aacf4
what about this?
FalloutFalcon Nov 26, 2023
750f6b3
log world for now
FalloutFalcon Nov 26, 2023
746ea31
what about worn states
FalloutFalcon Nov 26, 2023
53d50b2
not this pr.. need to wewrite most of that
FalloutFalcon Nov 26, 2023
a7c1cf7
Merge branch 'master' into missing-icon
FalloutFalcon Dec 6, 2023
2d9496c
lets see if this works for body parts?
FalloutFalcon Dec 6, 2023
b92efde
alot
FalloutFalcon Dec 6, 2023
11ff1c6
more
FalloutFalcon Dec 6, 2023
32024a4
mostly body parts
FalloutFalcon Dec 6, 2023
b14c364
shrug
FalloutFalcon Dec 6, 2023
8406cec
idk
FalloutFalcon Dec 6, 2023
f2fa27d
testing out some other missing icon unit tests?
FalloutFalcon Dec 6, 2023
16a7d77
forgot the include
FalloutFalcon Dec 6, 2023
fc24500
fixing merge conflict
FalloutFalcon Dec 6, 2023
df5235f
Merge branch 'master' into missing-icon
FalloutFalcon Dec 6, 2023
84d0aa7
Commiting to the goal. No missing sprites, 2025
FalloutFalcon Dec 6, 2023
0fb8640
sort them?
FalloutFalcon Dec 6, 2023
2388e6b
how bout dis
FalloutFalcon Dec 6, 2023
bf5c7b6
shifts drinks. Will seperate it into pieces later
FalloutFalcon Dec 6, 2023
b0d9291
hmmm
FalloutFalcon Dec 7, 2023
f9f2d98
shrug
FalloutFalcon Dec 7, 2023
9c20a83
hm
FalloutFalcon Dec 7, 2023
42ee582
mabye
FalloutFalcon Dec 7, 2023
53e6aba
inhandicon to item
FalloutFalcon Dec 7, 2023
5071860
drinks?
FalloutFalcon Dec 7, 2023
33f1223
i will write this for glass_icon_states later
FalloutFalcon Dec 7, 2023
ae3621d
idk
FalloutFalcon Dec 7, 2023
8929cc3
Fixing some fake fails i think
FalloutFalcon Dec 7, 2023
29af592
pointless and fake
FalloutFalcon Dec 7, 2023
216f0ec
make it just for clothing. Will prb xpand bck latr
FalloutFalcon Dec 7, 2023
ae1abd3
commenting out really slow test frn
FalloutFalcon Dec 7, 2023
1394888
minor fixes
FalloutFalcon Dec 7, 2023
e9cf6da
so many items states
FalloutFalcon Dec 7, 2023
38fee94
inhand clothing misc
FalloutFalcon Dec 7, 2023
cc0926d
headset and some others
FalloutFalcon Dec 7, 2023
e9bb935
Merge remote-tracking branch 'upstream/master' into missing-icon
FalloutFalcon Dec 18, 2023
6be40d3
Want to see how this works
FalloutFalcon Dec 18, 2023
b6f8e24
That makes sense
FalloutFalcon Dec 18, 2023
4565a89
Not worth
FalloutFalcon Dec 18, 2023
ce34774
poor owl suit
FalloutFalcon Dec 18, 2023
18de1d1
does .. nothing?
FalloutFalcon Dec 18, 2023
117d062
some stuff
FalloutFalcon Dec 19, 2023
693f59a
more
FalloutFalcon Dec 19, 2023
c904328
ports the clothing inhands folder from tg
FalloutFalcon Dec 19, 2023
0fe754a
test his
FalloutFalcon Dec 19, 2023
d00a322
yea?
FalloutFalcon Dec 19, 2023
c7564ab
earmuffs, crazy
FalloutFalcon Dec 19, 2023
1ed6d04
i hate inhands so much now
FalloutFalcon Dec 19, 2023
9519959
outfit names
FalloutFalcon Dec 19, 2023
b7f02b8
Killed a bit of LT stuff
FalloutFalcon Dec 19, 2023
bf2fe3e
yea
FalloutFalcon Dec 19, 2023
8d45611
some more fixes
FalloutFalcon Dec 20, 2023
6d99ea2
Merge branch 'master' into missing-icon
FalloutFalcon Dec 20, 2023
0122905
so much cruft
FalloutFalcon Dec 20, 2023
4832fa2
more!
FalloutFalcon Dec 20, 2023
c409bcd
gonna ignore nothings for now
FalloutFalcon Dec 20, 2023
d089077
a few more
FalloutFalcon Dec 20, 2023
00ce931
hm?
FalloutFalcon Dec 20, 2023
5578ed7
Merge branch 'master' into missing-icon
FalloutFalcon Dec 24, 2023
612e43f
ahj
FalloutFalcon Dec 28, 2023
a059a6f
Merge branch 'master' into missing-icon
FalloutFalcon Jan 11, 2024
2ff1d34
trailing newline
FalloutFalcon Jan 11, 2024
81037a6
random sprite fixes
FalloutFalcon Jan 11, 2024
e6b6206
small
FalloutFalcon Jan 11, 2024
3a259df
Fix #2619
FalloutFalcon Jan 11, 2024
8eebc07
#1275
FalloutFalcon Jan 11, 2024
71e11eb
#1275
FalloutFalcon Jan 11, 2024
08436bf
generic wall locker
FalloutFalcon Jan 11, 2024
85542cf
idk man
FalloutFalcon Jan 11, 2024
eacd085
Merge branch 'master' into missing-icon
FalloutFalcon Jan 12, 2024
4d3a577
Merge branch 'master' of https://github.com/shiptest-ss13/Shiptest in…
FalloutFalcon Jan 22, 2024
0543031
Merge branch 'master' into missing-icon
FalloutFalcon Jan 30, 2024
dc70fdb
Merge branch 'master' of https://github.com/shiptest-ss13/Shiptest in…
FalloutFalcon Feb 14, 2024
ea2df88
Merge branch 'master' into missing-icon
FalloutFalcon Feb 20, 2024
f441fd9
Merge branch 'master' of https://github.com/shiptest-ss13/Shiptest in…
FalloutFalcon Mar 5, 2024
7128c84
aughhhh
FalloutFalcon Mar 5, 2024
8021f4d
yea
FalloutFalcon Mar 5, 2024
507a9be
wooo
FalloutFalcon Mar 5, 2024
4187b4b
wha eva
FalloutFalcon Mar 5, 2024
b6f4b5e
wehar
FalloutFalcon Mar 5, 2024
c7a9c17
Merge branch 'master' of https://github.com/shiptest-ss13/Shiptest in…
FalloutFalcon Mar 16, 2024
73e8c51
Merge branch 'master' into missing-icon
FalloutFalcon Mar 18, 2024
32e8ae0
yea
FalloutFalcon Mar 21, 2024
b0e041e
why are my tests playing
FalloutFalcon Mar 22, 2024
3f32d74
Merge remote-tracking branch 'upstream/master' into missing-icon
MarkSuckerberg Mar 27, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions code/modules/unit_tests/_unit_tests.dm
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
#include "emoting.dm"
#include "keybinding_init.dm"
#include "machine_disassembly.dm"
#include "missing_icons.dm"
#include "open_air.dm"
#include "outfit_sanity.dm"
#include "overmap.dm"
Expand Down
60 changes: 60 additions & 0 deletions code/modules/unit_tests/missing_icons.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/// Makes sure objects actually have icons that exist!
/datum/unit_test/missing_icons
var/static/list/possible_icon_states = list()
/// additional_icon_location is for downstream modularity support.
/// Make sure this location is also present in tools/deploy.sh
/// If you need additional paths ontop of this second one, you can add another generate_possible_icon_states_list("your/folder/path/") below the if(additional_icon_location) block in Run(), and make sure to add that path to tools/deploy.sh as well.
var/additional_icon_location = null

/datum/unit_test/missing_icons/proc/generate_possible_icon_states_list(directory_path)
if(!directory_path)
directory_path = "icons/obj/"
for(var/file_path in flist(directory_path))
if(findtext(file_path, ".dmi"))
for(var/sprite_icon in icon_states("[directory_path][file_path]", 1)) //2nd arg = 1 enables 64x64+ icon support, otherwise you'll end up with "sword0_1" instead of "sword"
possible_icon_states[sprite_icon] += list("[directory_path][file_path]")
else
possible_icon_states += generate_possible_icon_states_list("[directory_path][file_path]")

/datum/unit_test/missing_icons/Run()
generate_possible_icon_states_list()
generate_possible_icon_states_list("icons/effects/")
if(additional_icon_location)
generate_possible_icon_states_list(additional_icon_location)

//Add EVEN MORE paths if needed here!
//generate_possible_icon_states_list("your/folder/path/")
var/list/bad_list = list()
for(var/obj/obj_path as anything in subtypesof(/obj))
if(ispath(obj_path, /obj/item))
var/obj/item/item_path = obj_path
if(initial(item_path.item_flags) & ABSTRACT)
continue
/*
if(initial(obj_path.greyscale_colors) && initial(obj_path.greyscale_config)) //GAGS has its own unit test.
continue
*/

var/icon = initial(obj_path.icon)
if(isnull(icon))
continue
var/icon_state = initial(obj_path.icon_state)
if(isnull(icon_state))
continue

if(length(bad_list) && (icon_state in bad_list[icon]))
continue

if(icon_exists(icon, icon_state))
continue

bad_list[icon] += list(icon_state)

var/match_message
if(icon_state in possible_icon_states)
for(var/file_place in possible_icon_states[icon_state])
match_message += (match_message ? " & '[file_place]'" : " - Matching sprite found in: '[file_place]'")
//log should be swapped to test fail once the master branch doesn't have any missing icons.
log_world("Missing icon_state for [obj_path] in '[icon]'.\n\ticon_state = \"[icon_state]\"[match_message]")
//TEST_FAIL("Missing icon_state for [obj_path] in '[icon]'.\n\ticon_state = \"[icon_state]\"[match_message]")

Loading