-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild_brushes.sh
99 lines (89 loc) · 2.12 KB
/
build_brushes.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
BBDir="${1-"c:\\Steam\\steamapps\\common\\Battle Brothers\\data"}"
RepoDir="${2-"battlebrothers"}"
source "./buildscript/lib.sh"
current_dir=$(pwd)
function checkForError() {
if [[ $1 == *"ERROR"* ]]; then
while read -r line; do
echo "$line"
done <<< "$1"
echo "Failed to build Legends brush $2"
exit 1;
fi
}
echo "Building helmets..."
rm -rf helmet_scripts
handleExit
mkdir -p "helmet_scripts"
handleExit
python "$current_dir\\buildscript\\python\\make_legend_helmets.py" "$current_dir"
handleExit
mkdir -p "$BBDir\\scripts\\items\\legend_helmets"
cp -R helmet_scripts/. "$BBDir\\scripts\\items\\legend_helmets"
handleExit
echo "Building armors..."
rm -rf legend_armor_scripts
handleExit
mkdir -p "legend_armor_scripts"
handleExit
python "$current_dir\\buildscript\\python\\make_legend_armor.py" "$current_dir"
handleExit
mkdir -p "$BBDir\scripts\\items\\legend_armor"
cp -R legend_armor_scripts/. "$BBDir\\scripts\\items\\legend_armor"
handleExit
echo "Building enemies..."
python "$current_dir\\buildscript\\python\\make_legend_enemies.py" "$current_dir"
handleExit
declare -a BRUSHES=(
"entity_blood"
"legend_characters"
"legend_enemies"
"legend_weapons"
"legend_world"
"world_tiles"
"legend_horses"
"legend_detail"
"terrain"
"ui"
"orientation"
"legend_objects"
"legend_helmets"
"legend_helmets/0"
"legend_helmets/1"
"legend_helmets/2"
"legend_helmets/3"
"legend_helmets/4"
"legend_helmets/5"
"legend_helmets/6"
"legend_helmets/7"
"legend_helmets/8"
"legend_helmets/9"
"legend_helmets/10"
"legend_helmets/11"
"legend_helmets/12"
"legend_helmets/13"
"legend_helmets/14"
"legend_helmets/15"
"legend_armor/0"
"legend_armor/1"
"legend_armor/2"
"legend_armor/3"
"legend_armor/4"
)
mkdir -p brushes
for i in "${BRUSHES[@]}"
do
echo "Building $i brush..."
cd ../bin
brush=${i//[\/]/_}
o=$(./bbrusher.exe pack --gfxPath "../$RepoDir/" ../$RepoDir/brushes/$brush.brush ../$RepoDir/unpacked/$i)
cd ../"$RepoDir"
checkForError "$o" "$i"
done
echo "Copying brushes to $BBDir\\brushes ..."
mkdir -p "$BBDir\\brushes"
cp -R brushes/. "$BBDir\\brushes"
handleExit
mkdir -p "$BBDir\\gfx"
cp -R gfx/*.png "$BBDir\\gfx"
handleExit