hedgewars/uWorld.pas
changeset 3967 5b9bc77acd04
parent 3966 cbec77b5f706
child 3976 abaf741a4e21
equal deleted inserted replaced
3966:cbec77b5f706 3967:5b9bc77acd04
   266                     if STurns < 100 then DrawSprite(sprTurnsLeft, x + (g + 1) * AMSlotSize - 16, y + AMSlotSize - 16, STurns);
   266                     if STurns < 100 then DrawSprite(sprTurnsLeft, x + (g + 1) * AMSlotSize - 16, y + AMSlotSize - 16, STurns);
   267                     end else
   267                     end else
   268                     DrawSprite(sprAMAmmos, x + g * AMSlotSize, y + 1, LongInt(Ammo^[i, t].AmmoType)-1);
   268                     DrawSprite(sprAMAmmos, x + g * AMSlotSize, y + 1, LongInt(Ammo^[i, t].AmmoType)-1);
   269                 if (Slot = i)
   269                 if (Slot = i)
   270                 and (CursorPoint.X >= x + g * AMSlotSize)
   270                 and (CursorPoint.X >= x + g * AMSlotSize)
   271                 and (CursorPoint.X < x + (g + 1) * AMSlotSize) then
   271                 and (CursorPoint.X <= x + (g + 1) * AMSlotSize) then
   272                     begin
   272                     begin
   273                     if (STurns < 0) then DrawSprite(sprAMSlot, x + g * AMSlotSize, y, 0);
   273                     if (STurns < 0) then DrawSprite(sprAMSlot, x + g * AMSlotSize, y, 0);
   274                     Pos:= t;
   274                     Pos:= t;
   275                     end;
   275                     end;
   276                 inc(g)
   276                 inc(g)
   325                     if STurns < 100 then DrawSprite(sprTurnsLeft, x + (g + 1) * AMSlotSize - 16, y + AMSlotSize - 16, STurns);
   325                     if STurns < 100 then DrawSprite(sprTurnsLeft, x + (g + 1) * AMSlotSize - 16, y + AMSlotSize - 16, STurns);
   326                     end else
   326                     end else
   327                     DrawSprite(sprAMAmmos, x + g * AMSlotSize, y + 1, LongInt(Ammo^[i, t].AmmoType)-1);
   327                     DrawSprite(sprAMAmmos, x + g * AMSlotSize, y + 1, LongInt(Ammo^[i, t].AmmoType)-1);
   328                 if (Slot = i)
   328                 if (Slot = i)
   329                 and (CursorPoint.X >= x + g * AMSlotSize)
   329                 and (CursorPoint.X >= x + g * AMSlotSize)
   330                 and (CursorPoint.X < x + (g + 1) * AMSlotSize) then
   330                 and (CursorPoint.X <= x + (g + 1) * AMSlotSize) then
   331                     begin
   331                     begin
   332                     if (STurns < 0) then DrawSprite(sprAMSlot, x + g * AMSlotSize, y, 0);
   332                     if (STurns < 0) then DrawSprite(sprAMSlot, x + g * AMSlotSize, y, 0);
   333                     Pos:= t;
   333                     Pos:= t;
   334                     end;
   334                     end;
   335                 inc(g)
   335                 inc(g)
   349 {$ENDIF}
   349 {$ENDIF}
   350 
   350 
   351 if (Pos >= 0) then
   351 if (Pos >= 0) then
   352     begin
   352     begin
   353     if (Ammo^[Slot, Pos].Count > 0) and (Ammo^[Slot, Pos].AmmoType <> amNothing) then
   353     if (Ammo^[Slot, Pos].Count > 0) and (Ammo^[Slot, Pos].AmmoType <> amNothing) then
       
   354         begin
   354         if (amSel <> Ammo^[Slot, Pos].AmmoType) or (WeaponTooltipTex = nil) then
   355         if (amSel <> Ammo^[Slot, Pos].AmmoType) or (WeaponTooltipTex = nil) then
   355             begin
   356             begin
   356             amSel:= Ammo^[Slot, Pos].AmmoType;
   357             amSel:= Ammo^[Slot, Pos].AmmoType;
   357             RenderWeaponTooltip(amSel)
   358             RenderWeaponTooltip(amSel)
   358             end;
   359             end;
   362 
   363 
   363         if Ammo^[Slot, Pos].Count < AMMO_INFINITE then
   364         if Ammo^[Slot, Pos].Count < AMMO_INFINITE then
   364             DrawTexture(cScreenWidth div 2 + AMxOffset - 45, AMyOffset - 25, CountTexz[Ammo^[Slot, Pos].Count]);
   365             DrawTexture(cScreenWidth div 2 + AMxOffset - 45, AMyOffset - 25, CountTexz[Ammo^[Slot, Pos].Count]);
   365 {$ELSE}
   366 {$ELSE}
   366         DrawTexture(cScreenWidth div 2 - (AMWidth - 10) + AMxShift, cScreenHeight - AMyOffset - 25, Ammoz[Ammo^[Slot, Pos].AmmoType].NameTex);
   367         DrawTexture(cScreenWidth div 2 - (AMWidth - 10) + AMxShift, cScreenHeight - AMyOffset - 25, Ammoz[Ammo^[Slot, Pos].AmmoType].NameTex);
   367 
       
   368         if Ammo^[Slot, Pos].Count < AMMO_INFINITE then
   368         if Ammo^[Slot, Pos].Count < AMMO_INFINITE then
   369             DrawTexture(cScreenWidth div 2 + AMxOffset - 45, cScreenHeight - AMyOffset - 25, CountTexz[Ammo^[Slot, Pos].Count]);
   369             DrawTexture(cScreenWidth div 2 + AMxOffset - 45, cScreenHeight - AMyOffset - 25, CountTexz[Ammo^[Slot, Pos].Count]);
   370 {$ENDIF}
   370 {$ENDIF}
   371 
   371 
   372         if bSelected and (Ammoz[Ammo^[Slot, Pos].AmmoType].SkipTurns - CurrentTeam^.Clan^.TurnNumber < 0) then
   372         if bSelected and (Ammoz[Ammo^[Slot, Pos].AmmoType].SkipTurns - CurrentTeam^.Clan^.TurnNumber < 0) then
   375             SetWeapon(Ammo^[Slot, Pos].AmmoType);
   375             SetWeapon(Ammo^[Slot, Pos].AmmoType);
   376             bSelected:= false;
   376             bSelected:= false;
   377             FreeWeaponTooltip;
   377             FreeWeaponTooltip;
   378             exit
   378             exit
   379             end;
   379             end;
       
   380        end
   380     end
   381     end
   381 else
   382 else
   382     FreeWeaponTooltip;
   383     FreeWeaponTooltip;
   383 if (WeaponTooltipTex <> nil) and (AMxShift = 0) then
   384 if (WeaponTooltipTex <> nil) and (AMxShift = 0) then
   384 {$IFDEF IPHONEOS}
   385 {$IFDEF IPHONEOS}