1#!/usr/bin/env bash
2show_error() {
3 if command -v zenity > /dev/null; then
4 zenity --no-wrap --no-markup --error --title "OpenRA - @title@" --text "$1" 2>/dev/null
5 else
6 printf "$1\n" >&2
7 fi
8 exit 1
9}
10
11pushd "@out@/lib/openra_2019-@name@" > /dev/null
12
13# Check for missing assets
14assetsError='@assetsError@'
15if [[ -n "$assetsError" && ! -d "$HOME/.openra/Content/@name@" ]]; then
16 show_error "$assetsError"
17fi
18
19# Run the game
20mono --debug OpenRA.Game.exe Game.Mod=@name@ Engine.LaunchPath="@out@/bin/openra-@name@" Engine.ModSearchPaths="@out@/lib/openra_2019-@name@/mods" "$@"
21
22# Show a crash dialog if something went wrong
23if (( $? != 0 && $? != 1 )); then
24 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'
25fi