Use turnsleft sprites to indicate turns left to activate ammo
authorunc0rr
Wed, 28 May 2008 19:18:02 +0000
changeset 961 a9a349b2b3fa
parent 960 e9200bdeaccc
child 962 f2f3aa499548
Use turnsleft sprites to indicate turns left to activate ammo
hedgewars/uConsts.pas
hedgewars/uWorld.pas
share/hedgewars/Data/Graphics/AmmoMenu/TurnsLeft.png
--- a/hedgewars/uConsts.pas	Wed May 28 18:58:37 2008 +0000
+++ b/hedgewars/uConsts.pas	Wed May 28 19:18:02 2008 +0000
@@ -44,7 +44,7 @@
                    sprFlake, sprHandRope, sprHandBazooka, sprHandShotgun,
                    sprHandDEagle, sprHandAirAttack, sprHandBaseball, sprPHammer,
                    sprHandBlowTorch, sprBlowTorch, sprTeleport, sprHHDeath,
-                   sprShotgun, sprDEagle, sprHHIdle, sprMortar);
+                   sprShotgun, sprDEagle, sprHHIdle, sprMortar, sprTurnsLeft);
 
      TGearType  = (gtAmmo_Bomb, gtHedgehog, gtAmmo_Grenade, gtHealthTag,
                    gtGrave, gtUFO, gtShotgunShot, gtPickHammer, gtRope,
@@ -387,7 +387,9 @@
                      (FileName:       'Idle'; Path: ptHedgehog; AltPath: ptNone; Texture: nil; Surface: nil;
                       Width:  32; Height: 32; saveSurf: false),// sprHHIdle
                      (FileName:     'Mortar'; Path: ptGraphics; AltPath: ptNone; Texture: nil; Surface: nil;
-                      Width:  16; Height: 16; saveSurf: false) // sprMortar
+                      Width:  16; Height: 16; saveSurf: false),// sprMortar
+                     (FileName:  'TurnsLeft'; Path: ptAmmoMenu; AltPath: ptNone; Texture: nil; Surface: nil;
+                      Width:  16; Height: 16; saveSurf: false) // sprTurnsLeft
                      );
 
       Soundz: array[TSound] of record
--- a/hedgewars/uWorld.pas	Wed May 28 18:58:37 2008 +0000
+++ b/hedgewars/uWorld.pas	Wed May 28 19:18:02 2008 +0000
@@ -71,7 +71,7 @@
 
 procedure ShowAmmoMenu;
 const MENUSPEED = 15;
-var x, y, i, t: LongInt;
+var x, y, i, t, l: LongInt;
     Slot, Pos: LongInt;
 begin
 if (TurnTimeLeft = 0) or KbdKeyPressed then bShowAmmoMenu:= false;
@@ -118,6 +118,11 @@
             while (t <= cMaxSlotAmmoIndex) and (Ammo^[i, t].Count > 0) do
                   begin
                   DrawSprite(sprAMAmmos, x + t * 33 + 35, y + 1, LongInt(Ammo^[i, t].AmmoType));
+                  l:= Ammoz[Ammo^[i, t].AmmoType].SkipTurns - CurrentTeam^.Clan^.TurnNumber;
+
+                  if l >= 0 then
+                     DrawSprite(sprTurnsLeft, x + t * 33 + 51, y + 17, l);
+
                   if (Slot = i) and (CursorPoint.X >= x + t * 33 + 35) and (CursorPoint.X < x + t * 33 + 68) then
                      begin
                      DrawSprite(sprAMSelection, x + t * 33 + 35, y + 1, 0);
Binary file share/hedgewars/Data/Graphics/AmmoMenu/TurnsLeft.png has changed