-
Notifications
You must be signed in to change notification settings - Fork 0
/
extract_map_folder_icons.sh
executable file
·45 lines (37 loc) · 1.09 KB
/
extract_map_folder_icons.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/bash
#set -x #echo on
FOLDER="./wowr.w3x"
echo "Folder: $FOLDER"
if [ ! -d "$FOLDER" ]; then
echo "Folder does not exist."
exit 1
fi
for p in "$FOLDER/ReplaceableTextures/CommandButtons/"*
do
OUTPUT="../$(realpath --relative-to="$FOLDER" "$p")"
if [ ! -f "$OUTPUT" ] ; then
extension="${p##*.}"
echo "$p with extension $extension into $OUTPUT"
if [ "$extension" = "dds" ]; then
# DDS is not yet supported by wc3lib.
convert "$p" "png:$OUTPUT" &
else
./wc3converter --oformat png --outputo "\"$OUTPUT\"" -i "$p" &
fi
fi
done
for p in "$FOLDER/ReplaceableTextures/PassiveButtons/"*
do
OUTPUT="../$(realpath --relative-to="$FOLDER" "$p")"
if [ ! -f "$OUTPUT" ] ; then
extension="${p##*.}"
echo "$p with extension $extension into $OUTPUT"
if [ "$extension" = "dds" ]; then
# DDS is not yet supported by wc3lib.
convert "$p" "png:$OUTPUT" &
else
./wc3converter --oformat png --outputo "\"$OUTPUT\"" -i "$p" &
fi
fi
done
wait