summaryrefslogtreecommitdiff
path: root/appimage
diff options
context:
space:
mode:
authorqurious-pixel <62252937+qurious-pixel@users.noreply.github.com>2022-07-18 16:34:08 -0700
committerGitHub <noreply@github.com>2022-07-18 19:34:08 -0400
commitdabb83fccff975d5de410bb36fb87d59aaa57299 (patch)
treeed2a19b921d63ffccb70215c4f3a4c973b98957a /appimage
parent046b7e8949ada491054d38a63d4e28c444b9dbf7 (diff)
[APPIMAGE] Use GUI dialog boxes (#829)
* [APPIMAGE] Use GUI dialog boxes * [APPIMAGE] Adjust timing
Diffstat (limited to 'appimage')
-rw-r--r--appimage/soh.sh23
1 files changed, 19 insertions, 4 deletions
diff --git a/appimage/soh.sh b/appimage/soh.sh
index 21ddcd5aa..f3b563cc7 100644
--- a/appimage/soh.sh
+++ b/appimage/soh.sh
@@ -3,6 +3,7 @@ HERE="$(dirname "$(readlink -f "${0}")")"/../..
export PATH="$HERE"/bin:"$HERE"/usr/bin:"$PATH"
export LD_LIBRARY_PATH="$HERE"/usr/lib:"$LD_LIBRARY_PATH"
+export ZENITY=$(command -v zenity)
while [[ ! -e "$PWD"/oot.otr ]]; do
export ASSETDIR="$(mktemp -d /tmp/assets-XXXXX)"
@@ -14,16 +15,26 @@ while [[ ! -e "$PWD"/oot.otr ]]; do
ln -s "$OLDPWD"/*.*64 "$ASSETDIR"/tmp/rom.z64
cp -r "$ASSETDIR"/assets/game/ship_of_harkinian "$ASSETDIR"/Extract/assets/
cd "$ASSETDIR"
- case $(sha1sum -b "$ASSETDIR"/tmp/rom.z64 | awk '{ print $1 }') in
+ ROMHASH=$(sha1sum -b "$ASSETDIR"/tmp/rom.z64 | awk '{ print $1 }')
+ case "$ROMHASH" in
cee6bc3c2a634b41728f2af8da54d9bf8cc14099)
ROM=GC_NMQ_D;;
0227d7c0074f2d0ac935631990da8ec5914597b4)
ROM=GC_NMQ_PAL_F;;
*)
- echo -e "\nrom hash does not match\n"
+ if [ -n "$ZENITY" ]; then
+ zenity --error --timeout=10 --text="ROM hash <b>$ROMHASH</b> does not match" --title="Incorrect ROM file" --width=500 --width=200
+ else
+ echo -e "\nrom hash does not match\n"
+ fi
exit;;
esac
- echo "Processing..."
+ if [ -n "$ZENITY" ]; then
+ (echo "# 25%"; echo "25"; sleep 2; echo "# 50%"; echo "50"; sleep 3; echo "# 75%"; echo "75"; sleep 2; echo "# 100%"; echo "100"; sleep 3) |
+ zenity --progress --title="OTR Generating..." --timeout=10 --percentage=0 --icon-name=soh --window-icon=soh.png --height=80 --width=400 &
+ else
+ echo "Processing..."
+ fi
assets/extractor/ZAPD.out ed -eh -i assets/extractor/xmls/"${ROM}" -b tmp/rom.z64 -fl assets/extractor/filelists -o placeholder -osf placeholder -gsf 1 -rconf assets/extractor/Config_"${ROM}".xml -se OTR > /dev/null 2>&1
cp "$ASSETDIR"/oot.otr "$OLDPWD"
echo "Restart $APPIMAGE to play!"
@@ -31,7 +42,11 @@ while [[ ! -e "$PWD"/oot.otr ]]; do
rm -r "$ASSETDIR"
break
else
- echo -e "\nPlace ROM in this folder\n"
+ if [ -n "$ZENITY" ]; then
+ zenity --error --timeout=5 --text="Place ROM in $OWD" --title="Missing ROM file" --width=500 --width=200
+ else
+ echo -e "\nPlace ROM in this folder\n"
+ fi
exit
fi
done