Backed out changeset f764394839b2
authorWuzzy <Wuzzy2@mail.ru>
Fri, 24 May 2019 22:17:36 +0200
changeset 15044 76003912e31d
parent 15043 35932896ce84
child 15045 9f6e3be10e96
Backed out changeset f764394839b2
hedgewars/uWorld.pas
--- a/hedgewars/uWorld.pas	Fri May 24 22:07:44 2019 +0200
+++ b/hedgewars/uWorld.pas	Fri May 24 22:17:36 2019 +0200
@@ -116,22 +116,6 @@
 {$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;
 
@@ -660,8 +644,6 @@
         begin
         AMShiftX:= 0;
         AMShiftY:= 0;
-        CursorPoint.X:= AmmoRect.x + AmmoRect.w - 3;
-        CursorPoint.Y:= cScreenHeight - AmmoRect.y - amNumOffsetY - 1;
         AMState:= AMShowing;
         end
     // "Appear" animation
@@ -677,8 +659,8 @@
             begin
             AMShiftX:= 0;
             AMShiftY:= 0;
-            CursorPoint.X:= AmmoRect.x + AmmoRect.w - 3;
-            CursorPoint.Y:= cScreenHeight - AmmoRect.y - amNumOffsetY - 1;
+            CursorPoint.X:= AmmoRect.x + AmmoRect.w;
+            CursorPoint.Y:= AmmoRect.y;
             AMState:= AMShowing;
             end;
     end;
@@ -689,7 +671,6 @@
         begin
         AMShiftX:= AMShiftTargetX;
         AMShiftY:= AMShiftTargetY;
-        prevPoint:= CursorPoint;
         AMState:= AMHidden;
         end
     // "Disappear" animation
@@ -706,6 +687,7 @@
             AMShiftX:= AMShiftTargetX;
             AMShiftY:= AMShiftTargetY;
             prevPoint:= CursorPoint;
+            //prevTargetPoint:= TargetCursorPoint;
             AMState:= AMHidden;
             end;
     end;
@@ -1992,7 +1974,7 @@
 var PrevSentPointTime: LongWord = 0;
 
 procedure MoveCamera;
-var EdgesDist, wdy, shs,z, dstX: LongInt;
+var EdgesDist, wdy, shs,z, amNumOffsetX, amNumOffsetY, dstX: LongInt;
     inbtwnTrgtAttks: Boolean;
 begin
 {$IFNDEF MOBILE}
@@ -2049,6 +2031,22 @@
 
 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