hedgewars/uWorld.pas
changeset 3966 cbec77b5f706
parent 3952 d6412423da45
parent 3961 cf0ca1ff6c1a
child 3967 5b9bc77acd04
equal deleted inserted replaced
3952:d6412423da45 3966:cbec77b5f706
   246 inc(y, BORDERSIZE);
   246 inc(y, BORDERSIZE);
   247 
   247 
   248 for i:= 0 to cMaxSlotIndex do
   248 for i:= 0 to cMaxSlotIndex do
   249     if ((i = 0) and (Ammo^[i, 1].Count > 0)) or ((i <> 0) and (Ammo^[i, 0].Count > 0)) then
   249     if ((i = 0) and (Ammo^[i, 1].Count > 0)) or ((i <> 0) and (Ammo^[i, 0].Count > 0)) then
   250         begin
   250         begin
   251         if (cScreenHeight - CursorPoint.Y >= y) and (cScreenHeight - CursorPoint.Y < y + AMSlotSize) then Slot:= i;
   251         if (cScreenHeight - CursorPoint.Y >= y) and (cScreenHeight - CursorPoint.Y <= y + AMSlotSize) then Slot:= i;
   252         inc(SlotsNum);
   252         inc(SlotsNum);
   253         DrawSprite(sprAMBorderVertical, x - BORDERSIZE, y, 0);
   253         DrawSprite(sprAMBorderVertical, x - BORDERSIZE, y, 0);
   254         t:= 0;
   254         t:= 0;
   255         g:= 0;
   255         g:= 0;
   256         while (t <= cMaxSlotAmmoIndex) and (Ammo^[i, t].Count > 0) do
   256         while (t <= cMaxSlotAmmoIndex) and (Ammo^[i, t].Count > 0) do
   302 DrawSprite(sprAMBorderVertical, x + AMWidth - AMxOffset, y, 1);
   302 DrawSprite(sprAMBorderVertical, x + AMWidth - AMxOffset, y, 1);
   303 
   303 
   304 for i:= cMaxSlotIndex downto 0 do
   304 for i:= cMaxSlotIndex downto 0 do
   305     if ((i = 0) and (Ammo^[i, 1].Count > 0)) or ((i <> 0) and (Ammo^[i, 0].Count > 0)) then
   305     if ((i = 0) and (Ammo^[i, 1].Count > 0)) or ((i <> 0) and (Ammo^[i, 0].Count > 0)) then
   306         begin
   306         begin
   307         if (cScreenHeight - CursorPoint.Y >= y - AMSlotSize) and (cScreenHeight - CursorPoint.Y < y) then Slot:= i;
   307         if (cScreenHeight - CursorPoint.Y >= y - AMSlotSize) and (cScreenHeight - CursorPoint.Y <= y) then Slot:= i;
   308         dec(y, AMSlotSize);
   308         dec(y, AMSlotSize);
   309         inc(SlotsNum);
   309         inc(SlotsNum);
   310         DrawSprite(sprAMBorderVertical, x - BORDERSIZE, y, 0);
   310         DrawSprite(sprAMBorderVertical, x - BORDERSIZE, y, 0);
   311         DrawSprite(sprAMSlot, x, y, 1);
   311         DrawSprite(sprAMSlot, x, y, 1);
   312         DrawSprite(sprAMSlotKeys, x, y + 1, i);
   312         DrawSprite(sprAMSlotKeys, x, y + 1, i);