From b7ee0eb32a1685d1b1524cce956fe4c1a88eb918 Mon Sep 17 00:00:00 2001
From: Allanis <allanis@saracraft.net>
Date: Tue, 29 Oct 2013 22:50:37 +0000
Subject: [PATCH] [Add] Bash script for checking outfit graphics usage.

---
 gfx/outfit/check.sh | 54 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 54 insertions(+)
 create mode 100755 gfx/outfit/check.sh

diff --git a/gfx/outfit/check.sh b/gfx/outfit/check.sh
new file mode 100755
index 0000000..0f824dc
--- /dev/null
+++ b/gfx/outfit/check.sh
@@ -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 ..
+