diff options
Diffstat (limited to 'tools/edit-map-tileset-names.sh')
-rwxr-xr-x | tools/edit-map-tileset-names.sh | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tools/edit-map-tileset-names.sh b/tools/edit-map-tileset-names.sh new file mode 100755 index 00000000..6c359e29 --- /dev/null +++ b/tools/edit-map-tileset-names.sh @@ -0,0 +1,15 @@ +#!/bin/bash +for MAP in maps/*.tmx +do + grep '<tileset\|<image' "$MAP" | + while read TILESET && read IMAGE + do + LINE=$TILESET + TILESET=${TILESET#*name=\"} + TILESET=${TILESET%%\"*} + IMAGE=${IMAGE#*source=\"} + IMAGE=${IMAGE%%.png\"*} + IMAGE=${IMAGE##*/} + sed "/$LINE/s/$TILESET/$IMAGE/" -i "$MAP" + done +done |