Files
neoLegacy/tools/patch_death_message.sh
T
Tranqlmao ff562d1644 TU46 Test content and patches
TU46 Test content, added missing commits by amending commit and cherry-picking to new branch, ready for iggy guis and tu46 bug fixes
2026-10-22 13:55:39 -04:00

23 lines
935 B
Bash

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/.death_message_work"
rm -rf "$WORK"
javac -cp "$FFDEC_DIR/lib/*" -d "$TOOLS" "$TOOLS/AddDeathMessageLabel.java"
for name in DeathMenu1080 DeathMenu720 DeathMenu480 DeathMenuSplit1080 DeathMenuSplit720; do
swf="$MEDIA/$name.swf"
out="$WORK/$name"
mkdir -p "$out"
java -cp "$FFDEC_DIR/lib/*;$TOOLS" AddDeathMessageLabel "$swf" "$out/step1.swf"
"$FFDEC_DIR/ffdec-cli.exe" -export script "$out/as" "$out/step1.swf" > /dev/null
doc="$out/as/scripts/fourj/documents/DeathMenu.as"
perl -0pi -e 's/(\n(\s*)public var Title:(\w+);)/$1\n$2\n$2public var DeathMessage:$3;/ or die "Title member not found\n"' "$doc"
"$FFDEC_DIR/ffdec-cli.exe" -importScript "$out/step1.swf" "$swf" "$out/as/scripts"
done
rm -rf "$WORK"
echo "Done."