hedgewars/uWorld.pas
changeset 961 a9a349b2b3fa
parent 956 19003f7fc174
child 965 a4d5fc8eec7a
equal deleted inserted replaced
960:e9200bdeaccc 961:a9a349b2b3fa
    69 AMxCurr:= cScreenWidth
    69 AMxCurr:= cScreenWidth
    70 end;
    70 end;
    71 
    71 
    72 procedure ShowAmmoMenu;
    72 procedure ShowAmmoMenu;
    73 const MENUSPEED = 15;
    73 const MENUSPEED = 15;
    74 var x, y, i, t: LongInt;
    74 var x, y, i, t, l: LongInt;
    75     Slot, Pos: LongInt;
    75     Slot, Pos: LongInt;
    76 begin
    76 begin
    77 if (TurnTimeLeft = 0) or KbdKeyPressed then bShowAmmoMenu:= false;
    77 if (TurnTimeLeft = 0) or KbdKeyPressed then bShowAmmoMenu:= false;
    78 if bShowAmmoMenu then
    78 if bShowAmmoMenu then
    79    begin
    79    begin
   116             DrawSprite(sprAMSlotKeys, x + 2, y + 1, i);
   116             DrawSprite(sprAMSlotKeys, x + 2, y + 1, i);
   117             t:= 0;
   117             t:= 0;
   118             while (t <= cMaxSlotAmmoIndex) and (Ammo^[i, t].Count > 0) do
   118             while (t <= cMaxSlotAmmoIndex) and (Ammo^[i, t].Count > 0) do
   119                   begin
   119                   begin
   120                   DrawSprite(sprAMAmmos, x + t * 33 + 35, y + 1, LongInt(Ammo^[i, t].AmmoType));
   120                   DrawSprite(sprAMAmmos, x + t * 33 + 35, y + 1, LongInt(Ammo^[i, t].AmmoType));
       
   121                   l:= Ammoz[Ammo^[i, t].AmmoType].SkipTurns - CurrentTeam^.Clan^.TurnNumber;
       
   122 
       
   123                   if l >= 0 then
       
   124                      DrawSprite(sprTurnsLeft, x + t * 33 + 51, y + 17, l);
       
   125 
   121                   if (Slot = i) and (CursorPoint.X >= x + t * 33 + 35) and (CursorPoint.X < x + t * 33 + 68) then
   126                   if (Slot = i) and (CursorPoint.X >= x + t * 33 + 35) and (CursorPoint.X < x + t * 33 + 68) then
   122                      begin
   127                      begin
   123                      DrawSprite(sprAMSelection, x + t * 33 + 35, y + 1, 0);
   128                      DrawSprite(sprAMSelection, x + t * 33 + 35, y + 1, 0);
   124                      Pos:= t;
   129                      Pos:= t;
   125                      end;
   130                      end;