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