hedgewars/uWorld.pas
changeset 15067 0730c68fdf97
parent 15065 76003912e31d
child 15073 1a754860b0e5
--- a/hedgewars/uWorld.pas	Fri May 24 22:26:47 2019 +0200
+++ b/hedgewars/uWorld.pas	Fri May 24 22:27:19 2019 +0200
@@ -116,6 +116,22 @@
 {$ENDIF}
       AMSlotPadding = (AMSlotSize - 32) shr 1;
 
+{$IFDEF USE_LANDSCAPE_AMMOMENU}
+      amNumOffsetX = 0;
+      {$IFDEF USE_AM_NUMCOLUMN}
+      amNumOffsetY = AMSlotSize;
+      {$ELSE}
+      amNumOffsetY = 0;
+      {$ENDIF}
+{$ELSE}
+      amNumOffsetY = 0;
+      {$IFDEF USE_AM_NUMCOLUMN}
+      amNumOffsetX = AMSlotSize;
+      {$ELSE}
+      amNumOffsetX = 0;
+      {$ENDIF}
+{$ENDIF}
+
       cSendCursorPosTime = 50;
       cCursorEdgesDist   = 100;
 
@@ -644,6 +660,8 @@
         begin
         AMShiftX:= 0;
         AMShiftY:= 0;
+        CursorPoint.X:= AmmoRect.x + AmmoRect.w - 3;
+        CursorPoint.Y:= cScreenHeight - AmmoRect.y - amNumOffsetY - 1;
         AMState:= AMShowing;
         end
     // "Appear" animation
@@ -659,8 +677,8 @@
             begin
             AMShiftX:= 0;
             AMShiftY:= 0;
-            CursorPoint.X:= AmmoRect.x + AmmoRect.w;
-            CursorPoint.Y:= AmmoRect.y;
+            CursorPoint.X:= AmmoRect.x + AmmoRect.w - 3;
+            CursorPoint.Y:= cScreenHeight - AmmoRect.y - amNumOffsetY - 1;
             AMState:= AMShowing;
             end;
     end;
@@ -671,6 +689,7 @@
         begin
         AMShiftX:= AMShiftTargetX;
         AMShiftY:= AMShiftTargetY;
+        prevPoint:= CursorPoint;
         AMState:= AMHidden;
         end
     // "Disappear" animation
@@ -687,7 +706,6 @@
             AMShiftX:= AMShiftTargetX;
             AMShiftY:= AMShiftTargetY;
             prevPoint:= CursorPoint;
-            //prevTargetPoint:= TargetCursorPoint;
             AMState:= AMHidden;
             end;
     end;
@@ -1974,7 +1992,7 @@
 var PrevSentPointTime: LongWord = 0;
 
 procedure MoveCamera;
-var EdgesDist, wdy, shs,z, amNumOffsetX, amNumOffsetY, dstX: LongInt;
+var EdgesDist, wdy, shs,z, dstX: LongInt;
     inbtwnTrgtAttks: Boolean;
 begin
 {$IFNDEF MOBILE}
@@ -2031,22 +2049,6 @@
 
 if (AMState = AMShowingUp) or (AMState = AMShowing) then
 begin
-{$IFDEF USE_LANDSCAPE_AMMOMENU}
-    amNumOffsetX:= 0;
-    {$IFDEF USE_AM_NUMCOLUMN}
-    amNumOffsetY:= AMSlotSize;
-    {$ELSE}
-    amNumOffsetY:= 0;
-    {$ENDIF}
-{$ELSE}
-    amNumOffsetY:= 0;
-    {$IFDEF USE_AM_NUMCOLUMN}
-    amNumOffsetX:= AMSlotSize;
-    {$ELSE}
-    amNumOffsetX:= 0;
-    {$ENDIF}
-
-{$ENDIF}
     if CursorPoint.X < AmmoRect.x + amNumOffsetX + 3 then//check left
         CursorPoint.X:= AmmoRect.x + amNumOffsetX + 3;
     if CursorPoint.X > AmmoRect.x + AmmoRect.w - 3 then//check right