set -e TOOLS="$(cd "$(dirname "$0")" && pwd -W)" MEDIA="$TOOLS/../Minecraft.Client/Common/Media/MediaWindows64" FFDEC_DIR="${FFDEC_DIR:-C:/Program Files (x86)/FFDec}" WORK="$TOOLS/.reset_end_work" rm -rf "$WORK" javac -cp "$FFDEC_DIR/lib/*" -d "$TOOLS" "$TOOLS/AddResetEndCheckbox.java" for res in 1080 720 480; do swf="$MEDIA/LaunchMoreOptionsMenu$res.swf" out="$WORK/$res" mkdir -p "$out" java -cp "$FFDEC_DIR/lib/*;$TOOLS" AddResetEndCheckbox "$swf" "$out/step1.swf" "$FFDEC_DIR/ffdec-cli.exe" -export script "$out/as" "$out/step1.swf" > /dev/null perl "$TOOLS/patch_reset_end_as.pl" "$out/as/scripts" "$FFDEC_DIR/ffdec-cli.exe" -importScript "$out/step1.swf" "$swf" "$out/as/scripts" done rm -rf "$WORK" echo "Done."