Thanks
@bossapplesauce for telling me about this. Thanks
@jimmy5 for making it (since I'm to lazy to do it myself!
).
Some comments:
You're assuming the user's default shell is /bin/sh. That's not always the case. Add this line to the top of the script:
#! /bin/sh
---------------
You should let the user specify the app directory on the command line. Something like:
if [ "$#" -ne 1 ]; then
read appdir
else
appdir = $1
fi
---------------
The main menu doesn't have an exit command.
---------------
In function extract, this code:
for f in $game/*.rpa; do
python "/tmp/rpatool.txt" -x "$f" -o ${f%".rpa"}
done
will extract the files in archive.rpa into the folder "archive", for example. But this gives 2 locations for the scripts - one in game/archive.rpa and one in game/archive/, which will cause errors when the game is launched. Remove the -o option and have rpatool extract in place.
That's what unren 0.7 does:
for %%f in (*.rpa) do (
echo + Unpacking "%%~nf%%~xf" - %%~zf bytes
"%pythondir%python.exe" -O "%rpatool%" -x "%%f"
)
---------------
Extracting packages can take a long time. You should print out something like "Extracting <package>" as you extract each package, so the user isn't staring at a blank screen. See the previous code from unren 0.7 - it prints the package as it extracts it.
---------------
The decompile option installs a decompiler. Instead of that, how about doing the same thing the rpa extract does, and run the decompile now? I use unrpyc from
You must be registered to see the links
to do that when I want to look at script sources.
Again, that's what unren 0.7 does:
for /r %%f in (*.rpyc) do (
if not %%~nf == un (
echo + Decompiling "%%~nf%%~xf" - %%~zf bytes
"%pythondir%python.exe" -O "%unrpycpy%" "%%f"
)
The game won't launch for me with the decompiler installed. It immediately quits. Also, I can't decompile un.rpyc. If you stick with a decompiler, you should install the .rpy instead of the .rpyc.
---------------
Function finish has this code:
"2")
osascript -e 'tell application "Terminal" to close (every window whose name contains "UnRen Mac v0.1")' & exit
;;
If I'm running from the command line I don't want to close my terminal window!