- Pause game when it goes background (do not show anymore annoying 'confirm quit') ios-develop
authorantonc27 <antonc27@mail.ru>
Thu, 15 Mar 2018 23:59:20 +0100
branchios-develop
changeset 13224 01ab48b253ef
parent 13223 915abf27ae5a
child 13225 8667e9e63896
- Pause game when it goes background (do not show anymore annoying 'confirm quit')
hedgewars/uWorld.pas
--- a/hedgewars/uWorld.pas	Thu Mar 15 23:24:48 2018 +0100
+++ b/hedgewars/uWorld.pas	Thu Mar 15 23:59:20 2018 +0100
@@ -1995,12 +1995,14 @@
 
 procedure onFocusStateChanged;
 begin
-if (not cHasFocus) and (GameState <> gsConfirm) then
-    ParseCommand('quit', true);
 {$IFDEF MOBILE}
+if (not cHasFocus) and (not isPaused) then
+    ParseCommand('pause', true);
 // when created SDL receives an exposure event that calls UndampenAudio at full power, muting audio
 exit;
 {$ENDIF}
+if (not cHasFocus) and (GameState <> gsConfirm) then
+    ParseCommand('quit', true);
 
 {$IFDEF USE_VIDEO_RECORDING}
 // do not change volume during prerecording as it will affect sound in video file