hedgewars/uWorld.pas
branchhedgeroid
changeset 5530 25d4118056e1
parent 5502 0d1a1aeed00a
parent 5523 9ac5acc4f3e5
child 5619 2ec22ebeb6f5
--- a/hedgewars/uWorld.pas	Tue Aug 09 21:31:49 2011 +0200
+++ b/hedgewars/uWorld.pas	Tue Aug 09 21:41:52 2011 +0200
@@ -33,6 +33,7 @@
 procedure HideMission;
 procedure ShakeCamera(amount: LongWord);
 procedure MoveCamera;
+procedure onFocusStateChanged;
 
 implementation
 uses
@@ -51,7 +52,8 @@
     uTextures,
     uRender,
     uCaptions,
-    uCursor
+    uCursor,
+    uCommands
     ;
 
 var cWaveWidth, cWaveHeight: LongInt;
@@ -1175,7 +1177,7 @@
     PrevSentPointTime: LongWord = 0;
 begin
 {$IFNDEF MOBILE}
-if (not (CurrentTeam^.ExtDriven and isCursorVisible and not bShowAmmoMenu)) and cHasFocus then
+if (not (CurrentTeam^.ExtDriven and isCursorVisible and not bShowAmmoMenu)) and cHasFocus and (GameState <> gsConfirm) then
     uCursor.updatePosition();
 {$ENDIF}
 
@@ -1312,6 +1314,14 @@
     WorldDy:= WorldDy - amount + LongInt(getRandom(1 + amount * 2));
 end;
 
+
+procedure onFocusStateChanged;
+begin
+if (not cHasFocus) and (GameState <> gsConfirm) then
+    ParseCommand('quit', true);
+end;
+
+
 procedure initModule;
 begin
     fpsTexture:= nil;