Merge
authorMitchell Kember <mk12360@gmail.com>
Wed, 05 Dec 2012 13:45:18 -0500
changeset 8234 d2207f22c5f2
parent 8231 a41d84553ae8 (current diff)
parent 8228 8cc5dc7f7ef9 (diff)
child 8249 9ffb156902f6
Merge
--- a/hedgewars/hwengine.pas	Tue Dec 04 17:57:18 2012 -0500
+++ b/hedgewars/hwengine.pas	Wed Dec 05 13:45:18 2012 -0500
@@ -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 17:57:18 2012 -0500
+++ b/hedgewars/uCursor.pas	Wed Dec 05 13:45:18 2012 -0500
@@ -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/hedgewars/uScript.pas	Tue Dec 04 17:57:18 2012 -0500
+++ b/hedgewars/uScript.pas	Wed Dec 05 13:45:18 2012 -0500
@@ -690,7 +690,7 @@
     else
         begin
         gear := GearByUID(lua_tointeger(L, 1));
-        if (gear <> nil) and (gear^.Kind = gtHedgehog) and (gear^.Hedgehog <> nil) then
+        if (gear <> nil) and ((gear^.Kind = gtHedgehog) or (gear^.Kind = gtGrave)) and (gear^.Hedgehog <> nil) then
             lua_pushinteger(L, gear^.Hedgehog^.BotLevel)
         else
             lua_pushnil(L);
@@ -723,7 +723,7 @@
     else
         begin
         gear:= GearByUID(lua_tointeger(L, 1));
-        if (gear <> nil) and (gear^.Kind = gtHedgehog) and (gear^.Hedgehog <> nil) then
+        if (gear <> nil) and ((gear^.Kind = gtHedgehog) or (gear^.Kind = gtGrave)) and (gear^.Hedgehog <> nil) then
             begin
             lua_pushinteger(L, gear^.Hedgehog^.Team^.Clan^.ClanIndex)
             end
@@ -805,7 +805,7 @@
     else
         begin
         gear:= GearByUID(lua_tointeger(L, 1));
-        if (gear <> nil) and (gear^.Kind = gtHedgehog) and (gear^.Hedgehog <> nil) then
+        if (gear <> nil) and ((gear^.Kind = gtHedgehog) or (gear^.Kind = gtGrave)) and (gear^.Hedgehog <> nil) then
             begin
             lua_pushstring(L, str2pchar(gear^.Hedgehog^.Team^.TeamName))
             end
@@ -826,7 +826,7 @@
     else
         begin
         gear:= GearByUID(lua_tointeger(L, 1));
-        if (gear <> nil) and (gear^.Kind = gtHedgehog) and (gear^.Hedgehog <> nil) then
+        if (gear <> nil) and ((gear^.Kind = gtHedgehog) or (gear^.Kind = gtGrave)) and (gear^.Hedgehog <> nil) then
             begin
             lua_pushstring(L, str2pchar(gear^.Hedgehog^.Name))
             end
@@ -1648,7 +1648,7 @@
         LuaError('Lua: Wrong number of parameters passed to GetHogHat!')
     else begin
         gear := GearByUID(lua_tointeger(L, 1));
-        if (gear <> nil) and (gear^.Kind = gtHedgehog) and (gear^.Hedgehog <> nil) then
+        if (gear <> nil) and ((gear^.Kind = gtHedgehog) or (gear^.Kind = gtGrave)) and (gear^.Hedgehog <> nil) then
             lua_pushstring(L, str2pchar(gear^.Hedgehog^.Hat))
         else
             lua_pushnil(L);
--- a/share/hedgewars/Data/Locale/en.txt	Tue Dec 04 17:57:18 2012 -0500
+++ b/share/hedgewars/Data/Locale/en.txt	Wed Dec 05 13:45:18 2012 -0500
@@ -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