--- 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;