2019-05-12 19:10:11 +00:00
#!/usr/bin/env bash
2019-01-02 00:05:51 +00:00
show_error( ) {
if command -v zenity > /dev/null; then
zenity --no-wrap --no-markup --error --title "OpenRA - @title@" --text " $1 " 2>/dev/null
else
printf " $1 \n " >& 2
fi
exit 1
}
cd "@out@/lib/openra-@name@"
# Check for missing assets
assetsError = '@assetsError@'
2019-05-12 19:10:11 +00:00
if [ [ -n " $assetsError " && ! -d " $HOME /.openra/Content/@name@ " ] ] ; then
2019-01-02 00:05:51 +00:00
show_error " $assetsError "
fi
# Run the game
mono --debug OpenRA.Game.exe Game.Mod= @name@ Engine.LaunchPath= "@out@/bin/openra-@name@" Engine.ModSearchPaths= "@out@/lib/openra-@name@/mods" " $@ "
# Show a crash dialog if something went wrong
2019-05-12 19:10:11 +00:00
if ( ( $? != 0 && $? != 1 ) ) ; then
2019-01-29 00:33:21 +00:00
show_error $'OpenRA - @title@ has encountered a fatal error.\nPlease refer to the crash logs for more information.\n\nLog files are located in ~/.openra/Logs'
2019-01-02 00:05:51 +00:00
fi