[Add] Bash script for checking outfit graphics usage.

This commit is contained in:
Allanis 2013-10-29 22:50:37 +00:00
parent 18e4d9088c
commit b7ee0eb32a

54
gfx/outfit/check.sh Executable file
View File

@ -0,0 +1,54 @@
#!/usr/bin/env bash
DATA="../../dat/outfit.xml"
echo "Checking for unused graphics.."
echo
# Check unused space gfx.
echo " Unused outfit store gfx."
cd store
for SPACE in *.png; do
if [ -z "`grep ${SPACE%.png} ../$DATA | grep "<gfx_store>"`" ]; then
echo " $SPACE"
fi
done
cd ..
# Check unused exteria gfx.
echo " Unused outfit gfx"
cd space
for SPACE in *.png; do
if [ -z "`grep ${SPACE%.png} ../$DATA | grep "<gfx>"`" ]; then
echo " $SPACE"
fi
done
cd ..
echo
echo
echo "Checking for overused graphics.."
echo
# Check overused.
echo " Overused outfit store gfx"
cd store
for SPACE in *.png; do
COUNT=`grep ${SPACE%.png} ../$DATA | grep -c "<gfx_store>"`
if [ $COUNT -gt 1 ]; then
echo " $SPACE => $COUNT times"
fi
done
cd ..
# Check unused exteria gfx.
echo " Overused outfit gfx"
cd space
for SPACE in *.png; do
COUNT=`grep ${SPACE%.png} ../$DATA | grep -c "<gfx>"`
if [ $COUNT -gt 1 ]; then
echo " $SPACE => $COUNT times"
fi
done
cd ..