hedgewars/uWorld.pas
changeset 6802 8701007d58c0
parent 6799 b45c38282566
child 6806 cdfb6c7099e5
equal deleted inserted replaced
6801:b42bdf470b84 6802:8701007d58c0
   500         AmmoRect.x:= (cScreenWidth shr 1) - AmmoRect.w - AMSlotSize;
   500         AmmoRect.x:= (cScreenWidth shr 1) - AmmoRect.w - AMSlotSize;
   501         AmmoRect.y:= cScreenHeight - (AmmoRect.h + AMSlotSize);
   501         AmmoRect.y:= cScreenHeight - (AmmoRect.h + AMSlotSize);
   502 {$ENDIF}
   502 {$ENDIF}
   503     AMShiftTargetX:= (cScreenWidth shr 1) - AmmoRect.x;
   503     AMShiftTargetX:= (cScreenWidth shr 1) - AmmoRect.x;
   504     AMShiftTargetY:= cScreenHeight        - AmmoRect.y;
   504     AMShiftTargetY:= cScreenHeight        - AmmoRect.y;
   505 (*
   505 
   506     if (AMAnimType and AMTypeMaskX) <> 0 then AMShiftTargetX:= (cScreenWidth shr 1) - AmmoRect.x
   506     if (AMAnimType and AMTypeMaskX) <> 0 then AMShiftTargetX:= (cScreenWidth shr 1) - AmmoRect.x
   507     else AMShiftTargetX:= 0;
   507     else AMShiftTargetX:= 0;
   508     if (AMAnimType and AMTypeMaskY) <> 0 then AMShiftTargetY:= cScreenHeight        - AmmoRect.y
   508     if (AMAnimType and AMTypeMaskY) <> 0 then AMShiftTargetY:= cScreenHeight        - AmmoRect.y
   509     else AMShiftTargetY:= 0;
   509     else AMShiftTargetY:= 0;
   510 *)
   510 
   511     AMShiftX:= AMShiftTargetX;
   511     AMShiftX:= AMShiftTargetX;
   512     AMShiftY:= AMShiftTargetY;
   512     AMShiftY:= AMShiftTargetY;
   513 end;
   513 end;
   514 
   514 
   515 AMAnimState:= (RealTicks - AMAnimStartTime) / AMAnimDuration;
   515 AMAnimState:= (RealTicks - AMAnimStartTime) / AMAnimDuration;
       
   516 
       
   517 if AMState = AMShowing then
       
   518     begin
       
   519     FollowGear:=nil;
       
   520     end;
       
   521 
   516 if AMState = AMShowingUp then // show ammo menu
   522 if AMState = AMShowingUp then // show ammo menu
   517     begin
   523     begin
   518     FollowGear:= nil;
       
   519     if (cReducedQuality and rqSlowMenu) <> 0 then
   524     if (cReducedQuality and rqSlowMenu) <> 0 then
   520         begin
   525         begin
   521         AMShiftX:= 0;
   526         AMShiftX:= 0;
   522         AMShiftY:= 0;
   527         AMShiftY:= 0;
   523         AMState:= AMShowing;
   528         AMState:= AMShowing;
  1553     WorldDy:= wdy;
  1558     WorldDy:= wdy;
  1554 
  1559 
  1555 if ((CursorPoint.X = prevPoint.X) and (CursorPoint.Y = prevpoint.Y)) then
  1560 if ((CursorPoint.X = prevPoint.X) and (CursorPoint.Y = prevpoint.Y)) then
  1556     exit;
  1561     exit;
  1557 
  1562 
  1558 if (AMShiftX <> AMShiftTargetX) and (AMShiftY <> AMShiftTargetY) then
  1563 if (AMState = AMShowingUp) or (AMState = AMShowing) then
  1559 begin
  1564 begin
  1560     if CursorPoint.X < AmmoRect.x then//check left 
  1565     if CursorPoint.X < AmmoRect.x then//check left 
  1561         CursorPoint.X:= AmmoRect.x;
  1566         CursorPoint.X:= AmmoRect.x;
  1562     if CursorPoint.X > AmmoRect.x + AmmoRect.w then//check right
  1567     if CursorPoint.X > AmmoRect.x + AmmoRect.w then//check right
  1563         CursorPoint.X:= AmmoRect.x + AmmoRect.w;
  1568         CursorPoint.X:= AmmoRect.x + AmmoRect.w;