forbid in-DMI icon state name dupes with CI (#22734)
* forbid in-DMI icon state name dupes with CI * remove final icon dupes * use shodancoat item_state
@@ -37,6 +37,7 @@ jobs:
|
||||
python tools/ci/unticked_files.py ${GITHUB_WORKSPACE}
|
||||
python tools/ci/illegal_dme_files.py ${GITHUB_WORKSPACE}
|
||||
python -m tools.ci.check_icon_conflicts
|
||||
python -m tools.ci.check_icon_dupenames
|
||||
python -m tools.maplint.source --github
|
||||
DREAMCHECKER_EXIT_CODE=0
|
||||
~/dreamchecker > ${GITHUB_WORKSPACE}/output-annotations.txt 2>&1 || DREAMCHECKER_EXIT_CODE=$?
|
||||
|
||||
@@ -929,6 +929,7 @@
|
||||
desc = "A black coat with gold trim and an old US Chevron printed on the back. Edgy."
|
||||
icon = 'icons/obj/custom_items.dmi'
|
||||
icon_state = "shodancoat"
|
||||
item_state = "shodancoat_item"
|
||||
|
||||
/obj/item/clothing/suit/storage/fluff/k3_webbing
|
||||
name = "vox tactical webbing"
|
||||
|
||||
|
Before Width: | Height: | Size: 262 KiB After Width: | Height: | Size: 268 KiB |
|
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 113 KiB After Width: | Height: | Size: 113 KiB |
|
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 25 KiB |
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 20 KiB |
@@ -0,0 +1,40 @@
|
||||
from collections import defaultdict
|
||||
import glob
|
||||
import sys
|
||||
import time
|
||||
|
||||
from ..dmi import Dmi
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
print("check_icon_dupenames started")
|
||||
|
||||
count = 0
|
||||
exit_code = 0
|
||||
start = time.time()
|
||||
|
||||
findings = defaultdict(list)
|
||||
|
||||
for dmi_path in glob.glob("**/*.dmi", recursive=True):
|
||||
dmi = Dmi.from_file(dmi_path)
|
||||
states = set()
|
||||
for state in dmi.states:
|
||||
# Movement states have the same name as their non-movement counterparts
|
||||
if (state.name, state.movement) in states:
|
||||
findings[dmi_path].append(state.name)
|
||||
states.add((state.name, state.movement))
|
||||
count += 1
|
||||
|
||||
if findings:
|
||||
exit_code = 1
|
||||
|
||||
for filename in sorted(findings.keys()):
|
||||
states = findings[filename]
|
||||
for state in sorted(states):
|
||||
print(f"{filename}: duplicate state name `{state}`")
|
||||
|
||||
|
||||
end = time.time()
|
||||
print(f"\ncheck_icon_dupenames checked {count} files in {end - start:.2f}s\n")
|
||||
|
||||
sys.exit(exit_code)
|
||||