]> git.plutz.net Git - flarejs/blobdiff - data.sh
obey stacking order when drawing hero layers
[flarejs] / data.sh
diff --git a/data.sh b/data.sh
index be6b3fb6cd366cd8f89f17e0d64e6af81944a06e..1ba13706f975cf909af1d3f3c0d34e03582ef128 100755 (executable)
--- a/data.sh
+++ b/data.sh
@@ -2,7 +2,7 @@
 
 printf 'gamedata = {\n'
 for base in mods/fantasycore mods/empyrean_campaign; do
-  find $base/animations -name '*.txt' |while read -r file; do
+  find $base/animations $base/engine -name '*.txt' |while read -r file; do
     file="${file#"${base}"}"
     printf '"%s": {\n' "$file"
     sed -E '
@@ -45,6 +45,19 @@ for base in mods/fantasycore mods/empyrean_campaign; do
       # frame list end
       s;("frames": []\n,0-9 [-]+),;\1\n],;g;
 
+      # layer group (in engine/hero_layers.txt)
+      s;\nlayer=[0-9],([^\n]+)\n;\nlayers: [\1]\n;;
+      :layer_1
+      s;(\nlayers: [^\n]+)\nlayer=[0-9]+,([^\n]+)\n;\1,[\2]\n;;
+      tlayer_1;
+      :layer_2
+      s;(\nlayers: [^\n"]*)([],[])([^\n]*\n);\1"\2"\3;;
+      tlayer_2; 
+      :layer_3
+      s;(\nlayers: [^\n]+)""([^\n]+\n);\1\2;;
+      tlayer_3
+      s;\nlayers: "([^\n]+)"\n;\nlayers: [\1],\n;;
+
       # animation duration
       s;\n(duration)=([0-9]+)ms\n;\n"\1": \2,\n;g
       s;\n(duration)=([0-9]+)s\n;\n"\1": \2000,\n;g