hedgewars/uWorld.pas
changeset 2357 babe1a55e284
parent 2330 ba46dcda3676
child 2359 76d853f22afa
equal deleted inserted replaced
2356:b756432fd422 2357:babe1a55e284
   121 	dec(y);
   121 	dec(y);
   122 	DrawSprite(sprAMBorders, x, y, 1);
   122 	DrawSprite(sprAMBorders, x, y, 1);
   123 	dec(y, 33);
   123 	dec(y, 33);
   124 	DrawSprite(sprAMSlotName, x, y, 0);
   124 	DrawSprite(sprAMSlotName, x, y, 0);
   125 	for i:= cMaxSlotIndex downto 0 do
   125 	for i:= cMaxSlotIndex downto 0 do
   126 		if Ammo^[i, 0].Count > 0 then
   126 		if (Ammo^[i, 0].Count > 0) and (Ammo^[i, 0].AmmoType <> amNothing) then
   127 			begin
   127 			begin
   128 			if (cScreenHeight - CursorPoint.Y >= y - 33) and (cScreenHeight - CursorPoint.Y < y) then Slot:= i;
   128 			if (cScreenHeight - CursorPoint.Y >= y - 33) and (cScreenHeight - CursorPoint.Y < y) then Slot:= i;
   129 			dec(y, 33);
   129 			dec(y, 33);
   130 			inc(SlotsNum);
   130 			inc(SlotsNum);
   131 			DrawSprite(sprAMSlot, x, y, 0);
   131 			DrawSprite(sprAMSlot, x, y, 0);
   135 				begin
   135 				begin
   136 				l:= Ammoz[Ammo^[i, t].AmmoType].SkipTurns - CurrentTeam^.Clan^.TurnNumber;
   136 				l:= Ammoz[Ammo^[i, t].AmmoType].SkipTurns - CurrentTeam^.Clan^.TurnNumber;
   137 
   137 
   138 				if l >= 0 then
   138 				if l >= 0 then
   139 					begin
   139 					begin
   140 					DrawSprite(sprAMAmmosBW, x + t * 33 + 35, y + 1, LongInt(Ammo^[i, t].AmmoType));
   140 					DrawSprite(sprAMAmmosBW, x + t * 33 + 35, y + 1, LongInt(Ammo^[i, t].AmmoType)-1);
   141 					DrawSprite(sprTurnsLeft, x + t * 33 + 51, y + 17, l);
   141 					DrawSprite(sprTurnsLeft, x + t * 33 + 51, y + 17, l);
   142 					end else
   142 					end else
   143 					DrawSprite(sprAMAmmos, x + t * 33 + 35, y + 1, LongInt(Ammo^[i, t].AmmoType));
   143 					DrawSprite(sprAMAmmos, x + t * 33 + 35, y + 1, LongInt(Ammo^[i, t].AmmoType)-1);
   144 
   144 
   145 				if (Slot = i)
   145 				if (Slot = i)
   146 				and (CursorPoint.X >= x + t * 33 + 35)
   146 				and (CursorPoint.X >= x + t * 33 + 35)
   147 				and (CursorPoint.X < x + t * 33 + 68) then
   147 				and (CursorPoint.X < x + t * 33 + 68) then
   148 					begin
   148 					begin
   154 			end;
   154 			end;
   155 	dec(y, 1);
   155 	dec(y, 1);
   156 	DrawSprite(sprAMBorders, x, y, 0);
   156 	DrawSprite(sprAMBorders, x, y, 0);
   157 
   157 
   158 	if (Pos >= 0) then
   158 	if (Pos >= 0) then
   159 		if Ammo^[Slot, Pos].Count > 0 then
   159 		if (Ammo^[Slot, Pos].Count > 0) and (Ammo^[Slot, Pos].AmmoType <> amNothing) then
   160 		begin
   160 		begin
   161 		DrawTexture(cScreenWidth div 2 - 200 + AMxShift, cScreenHeight - 68, Ammoz[Ammo^[Slot, Pos].AmmoType].NameTex);
   161 		DrawTexture(cScreenWidth div 2 - 200 + AMxShift, cScreenHeight - 68, Ammoz[Ammo^[Slot, Pos].AmmoType].NameTex);
   162 		
   162 		
   163 		if Ammo^[Slot, Pos].Count < AMMO_INFINITE then
   163 		if Ammo^[Slot, Pos].Count < AMMO_INFINITE then
   164 			DrawTexture(cScreenWidth div 2 + AMxShift - 35, cScreenHeight - 68, CountTexz[Ammo^[Slot, Pos].Count]);
   164 			DrawTexture(cScreenWidth div 2 + AMxShift - 35, cScreenHeight - 68, CountTexz[Ammo^[Slot, Pos].Count]);