Merge pull request #6888 from obrakmann/fix6887_crash_dialog_on_restart

Prevent crash dialog from popping up when the game restarts
This commit is contained in:
Paul Chote
2014-11-07 08:15:45 +13:00
6 changed files with 8 additions and 7 deletions

View File

@@ -26,6 +26,7 @@ Also thanks to:
* Andrew Perkins * Andrew Perkins
* Andrew Riedi * Andrew Riedi
* Andreas Beck (baxtor) * Andreas Beck (baxtor)
* Arik Lirette (Angusm3)
* Barnaby Smith (mvi) * Barnaby Smith (mvi)
* Bellator * Bellator
* Braxton Williams (Buddytex) * Braxton Williams (Buddytex)

View File

@@ -358,7 +358,7 @@ install-linux-scripts:
@echo "#!/bin/sh" > openra @echo "#!/bin/sh" > openra
@echo 'cd "$(gameinstalldir)"' >> openra @echo 'cd "$(gameinstalldir)"' >> openra
@echo 'mono OpenRA.Game.exe "$$@"' >> openra @echo 'mono OpenRA.Game.exe "$$@"' >> openra
@echo 'if [ $$? != 0 ]' >> openra @echo 'if [ $$? != 0 && $$? != 1 ]' >> openra
@echo 'then' >> openra @echo 'then' >> openra
@echo 'ZENITY=`which zenity` || echo "OpenRA needs zenity installed to display a graphical error dialog. See ~/.openra. for log files."' >> openra @echo 'ZENITY=`which zenity` || echo "OpenRA needs zenity installed to display a graphical error dialog. See ~/.openra. for log files."' >> openra
@echo '$$ZENITY --question --title "OpenRA" --text "OpenRA has encountered a fatal error.\nLog Files are available in ~/.openra." --ok-label "Quit" --cancel-label "View FAQ" || xdg-open https://github.com/OpenRA/OpenRA/wiki/FAQ' >> openra @echo '$$ZENITY --question --title "OpenRA" --text "OpenRA has encountered a fatal error.\nLog Files are available in ~/.openra." --ok-label "Quit" --cancel-label "View FAQ" || xdg-open https://github.com/OpenRA/OpenRA/wiki/FAQ' >> openra

View File

@@ -16,7 +16,7 @@ using System.Text;
namespace OpenRA namespace OpenRA
{ {
enum RunStatus public enum RunStatus
{ {
Error = -1, Error = -1,
Success = 0, Success = 0,

View File

@@ -105,7 +105,7 @@ namespace OpenRA
static void GameProcessExited(object sender, EventArgs e) static void GameProcessExited(object sender, EventArgs e)
{ {
if (gameProcess.ExitCode != 0) if (!(gameProcess.ExitCode == (int)RunStatus.Success || gameProcess.ExitCode == (int)RunStatus.Restart))
ShowErrorDialog(); ShowErrorDialog();
Exit(); Exit();

View File

@@ -1,9 +1,9 @@
#!/bin/sh #!/bin/sh
# launch script (executed by Desura) # launch script (executed by Desura)
mono OpenRA.Game.exe Server.Dedicated=False Server.DedicatedLoop=False "$@" mono OpenRA.Game.exe Server.Dedicated=False Server.DedicatedLoop=False "$@"
if [ $? != 0 ] if [ $? != 0 && $? != 1 ]
then then
ZENITY=`which zenity` || echo "OpenRA needs zenity installed to display a graphical error dialog. See ~/.openra. for log files." ZENITY=`which zenity` || echo "OpenRA needs zenity installed to display a graphical error dialog. See ~/.openra. for log files."
$ZENITY --question --title "OpenRA" --text "OpenRA has encountered a fatal error.\nLog Files are available in ~/.openra." --ok-label "Quit" --cancel-label "View FAQ" || xdg-open https://github.com/OpenRA/OpenRA/wiki/FAQ $ZENITY --question --title "OpenRA" --text "OpenRA has encountered a fatal error.\nLog Files are available in ~/.openra." --ok-label "Quit" --cancel-label "View FAQ" || xdg-open https://github.com/OpenRA/OpenRA/wiki/FAQ
exit 1 exit 1
fi fi

View File

@@ -42,7 +42,7 @@ fi
cd "$RESOURCES" && FONTCONFIG_PATH="." $MONO_BIN --debug OpenRA.Game.exe Graphics.Renderer=Sdl2 cd "$RESOURCES" && FONTCONFIG_PATH="." $MONO_BIN --debug OpenRA.Game.exe Graphics.Renderer=Sdl2
# Display an error dialog on game crash # Display an error dialog on game crash
if [ $? != 0 ] if [ $? != 0 && $? != 1 ]
then then
osascript \ osascript \
-e "set logsPath to ((path to application support folder from user domain) as text) & \"OpenRA:Logs:\"" \ -e "set logsPath to ((path to application support folder from user domain) as text) & \"OpenRA:Logs:\"" \
@@ -58,4 +58,4 @@ then
-e " end repeat" \ -e " end repeat" \
-e "end tell" -e "end tell"
exit 1 exit 1
fi fi