about summary refs log tree commit diff
path: root/pkgs/games/openra/mod-launch-game.sh
diff options
context:
space:
mode:
authorMatthijs Steen <emailmatthijs@gmail.com>2019-01-02 01:05:51 +0100
committerMatthijs Steen <emailmatthijs@gmail.com>2019-01-09 20:57:29 +0100
commit1ae7384ddb3419330ab134da548dd8769b9f3d11 (patch)
treec3f3c1cea85037c6309f90beb5f2c8c66f2f577c /pkgs/games/openra/mod-launch-game.sh
parentde6d70f52e2acbc08d1e9db8c0f9af0a671d2137 (diff)
openra with extra mods
Diffstat (limited to 'pkgs/games/openra/mod-launch-game.sh')
-rw-r--r--pkgs/games/openra/mod-launch-game.sh25
1 files changed, 25 insertions, 0 deletions
diff --git a/pkgs/games/openra/mod-launch-game.sh b/pkgs/games/openra/mod-launch-game.sh
new file mode 100644
index 0000000000000..ec03353bee546
--- /dev/null
+++ b/pkgs/games/openra/mod-launch-game.sh
@@ -0,0 +1,25 @@
+#!/bin/sh
+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@'
+if [ -n "$assetsError" -a ! -d "$HOME/.openra/Content/@name@" ]; then
+  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
+if [ $? -ne 0 -a $? -ne 1 ]; then
+  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"
+fi