GCI2012: Remove Quit Prompt On Mouse Click
authorDrew Gottlieb
Wed, 05 Dec 2012 18:12:07 +0100
changeset 8225 186229af4fc1
parent 8223 14d9a3c33650
child 8228 8cc5dc7f7ef9
GCI2012: Remove Quit Prompt On Mouse Click
hedgewars/hwengine.pas
hedgewars/uCursor.pas
share/hedgewars/Data/Locale/en.txt
--- a/hedgewars/hwengine.pas	Tue Dec 04 10:49:52 2012 +0100
+++ b/hedgewars/hwengine.pas	Wed Dec 05 18:12:07 2012 +0100
@@ -32,7 +32,7 @@
 uses SDLh, uMisc, uConsole, uGame, uConsts, uLand, uAmmos, uVisualGears, uGears, uStore, uWorld, uInputHandler
      , uSound, uScript, uTeams, uStats, uIO, uLocale, uChat, uAI, uAIMisc, uAILandMarks, uLandTexture, uCollisions
      , SysUtils, uTypes, uVariables, uCommands, uUtils, uCaptions, uDebug, uCommandHandlers, uLandPainted
-     , uPhysFSLayer
+     , uPhysFSLayer, uCursor
      {$IFDEF USE_VIDEO_RECORDING}, uVideoRec {$ENDIF}
      {$IFDEF USE_TOUCH_INTERFACE}, uTouch {$ENDIF}
      {$IFDEF ANDROID}, GLUnit{$ENDIF}
@@ -217,7 +217,13 @@
                         ProcessKey(event.key);
                     
                 SDL_MOUSEBUTTONDOWN:
-                    ProcessMouse(event.button, true);
+                    if GameState = gsConfirm then
+                    begin
+                        resetPosition();
+                        ParseCommand('quit', true);
+                    end
+                    else
+                        ProcessMouse(event.button, true);
                     
                 SDL_MOUSEBUTTONUP:
                     ProcessMouse(event.button, false); 
--- a/hedgewars/uCursor.pas	Tue Dec 04 10:49:52 2012 +0100
+++ b/hedgewars/uCursor.pas	Wed Dec 05 18:12:07 2012 +0100
@@ -3,6 +3,7 @@
 interface
 
 procedure init;
+procedure resetPosition;
 procedure updatePosition;
 
 implementation
@@ -11,6 +12,11 @@
 
 procedure init;
 begin
+    resetPosition();
+end;
+
+procedure resetPosition;
+begin
     SDL_WarpMouse(cScreenWidth div 2, cScreenHeight div 2);
 end;
 
--- a/share/hedgewars/Data/Locale/en.txt	Tue Dec 04 10:49:52 2012 +0100
+++ b/share/hedgewars/Data/Locale/en.txt	Wed Dec 05 18:12:07 2012 +0100
@@ -64,7 +64,7 @@
 01:02=%1 wins!
 01:03=Volume %1%
 01:04=Paused
-01:05=Really quit (Y/Esc)?
+01:05=Really quit? (Y/Esc) (Click to resume)
 01:06=Sudden Death!
 01:07=%1 remaining
 01:08=Fuel