add individual hog healths to team health bar
authornemo
Sun, 05 Feb 2012 15:20:49 -0500
changeset 6627 18cbb75aba59
parent 6626 a447993f2ad7
child 6628 0e6615c10a8a
add individual hog healths to team health bar
hedgewars/uTypes.pas
hedgewars/uVariables.pas
hedgewars/uWorld.pas
share/hedgewars/Data/Graphics/AmmoMenu/CMakeLists.txt
share/hedgewars/Data/Graphics/slider.png
--- a/hedgewars/uTypes.pas	Sun Feb 05 23:24:43 2012 +0400
+++ b/hedgewars/uTypes.pas	Sun Feb 05 15:20:49 2012 -0500
@@ -53,8 +53,8 @@
             sprMineOn, sprMineDead, sprCase, sprFAid, sprDynamite, sprPower,
             sprClusterBomb, sprClusterParticle, sprFlame,
             sprHorizont, sprHorizontL, sprHorizontR, sprSky, sprSkyL, sprSkyR,
-            sprAMBorderHorizontal, sprAMBorderVertical, sprAMSlot,
-            sprAMAmmos, sprAMAmmosBW, sprAMSlotKeys, sprAMCorners,
+//    sprAMBorderHorizontal, sprAMBorderVertical, 
+            sprAMSlot, sprAMAmmos, sprAMAmmosBW, sprAMSlotKeys, sprAMCorners,
             sprFinger, sprAirBomb, sprAirplane, sprAmAirplane, sprAmGirder,
             sprHHTelepMask, sprSwitch, sprParachute, sprTarget, sprRopeNode,
             sprQuestion, sprPowerBar, sprWindBar, sprWindL, sprWindR,
@@ -83,7 +83,7 @@
             sprHandResurrector, sprCross, sprAirDrill, sprNapalmBomb,
             sprBulletHit, sprSnowball, sprHandSnowball, sprSnow,
             sprSDFlake, sprSDWater, sprSDCloud, sprSDSplash, sprSDDroplet, sprTardis,
-            sprFireButton
+            sprFireButton, sprSlider
             );
 
     // Gears that interact with other Gears and/or Land
--- a/hedgewars/uVariables.pas	Sun Feb 05 23:24:43 2012 +0400
+++ b/hedgewars/uVariables.pas	Sun Feb 05 15:20:49 2012 -0500
@@ -334,10 +334,12 @@
             Width:   0; Height:  0; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpHigh; getDimensions: true; getImageDimensions: true),// sprSky
             (FileName:       'SkyR'; Path: ptCurrTheme;AltPath: ptNone; Texture: nil; Surface: nil;
             Width:   0; Height:  0; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpHigh; getDimensions: true; getImageDimensions: true),// sprSky
+(*
             (FileName:  'BorderHorizontal'; Path: ptAmmoMenu; AltPath: ptNone; Texture: nil; Surface: nil;
             Width: 32; Height:  2; imageWidth: 0; imageHeight: 0; saveSurf: true; priority: tpLow; getDimensions: false; getImageDimensions: true),// sprAMBorderHorizontal
             (FileName:  'BorderVertical'; Path: ptAmmoMenu; AltPath: ptNone; Texture: nil; Surface: nil;
             Width: 2; Height: 32; imageWidth: 0; imageHeight: 0; saveSurf: true; priority: tpLow; getDimensions: false; getImageDimensions: true),// sprAMBorderVertical
+*)
             (FileName:   'Slot'; Path: ptAmmoMenu; AltPath: ptNone; Texture: nil; Surface: nil;
             Width: 32; Height: 32; imageWidth: 0; imageHeight: 0; saveSurf: true; priority: tpMedium; getDimensions: false; getImageDimensions: true),// sprAMSlot
             (FileName:      'Ammos'; Path: ptAmmoMenu; AltPath: ptNone; Texture: nil; Surface: nil;
@@ -585,7 +587,7 @@
             (FileName:   'amSMine'; Path: ptHedgehog; AltPath: ptNone; Texture: nil; Surface: nil;
             Width:  64; Height: 64; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpMedium; getDimensions: false; getImageDimensions: true),// sprHandSMine
             (FileName:  'amHammer'; Path: ptHedgehog; AltPath: ptNone; Texture: nil; Surface: nil;
-            Width: 128; Height: 64; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpMedium; getDimensions: false; getImageDimensions: true), // sprWhip
+            Width: 128; Height: 64; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpMedium; getDimensions: false; getImageDimensions: true), // sprHammer
             (FileName: 'amResurrector'; Path: ptHedgehog; AltPath: ptNone;
                 Texture: nil; Surface: nil; Width: 32; Height: 32;
                 imageWidth: 0; imageHeight: 0; saveSurf: false; priority:
@@ -630,7 +632,9 @@
             (FileName:  'TARDIS'; Path: ptGraphics; AltPath: ptNone; Texture: nil; Surface: nil;
             Width:  0; Height: 0; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpMedium; getDimensions: true; getImageDimensions: true),// sprTardis
             (FileName: 'firebutton'; Path: ptButtons; AltPath: ptNone; Texture: nil; Surface: nil;
-            Width: 450; Height: 150; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpHigh; getDimensions: false; getImageDimensions: true) // sprFireButton
+            Width: 450; Height: 150; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpHigh; getDimensions: false; getImageDimensions: true), // sprFireButton
+            (FileName:  'slider'; Path: ptGraphics; AltPath: ptNone; Texture: nil; Surface: nil;
+            Width: 5; Height: 17; imageWidth: 5; imageHeight: 15; saveSurf: false; priority: tpLow; getDimensions: false; getImageDimensions: false) // sprSlider
             );
 
 
--- a/hedgewars/uWorld.pas	Sun Feb 05 23:24:43 2012 +0400
+++ b/hedgewars/uWorld.pas	Sun Feb 05 15:20:49 2012 -0500
@@ -877,7 +877,7 @@
 end;
  
 procedure DrawWorldStereo(Lag: LongInt; RM: TRenderMode);
-var i, t: LongInt;
+var i, t, h: LongInt;
     r: TSDL_Rect;
     tdx, tdy: Double;
     s: string[15];
@@ -1065,6 +1065,7 @@
 for t:= 0 to Pred(TeamsCount) do
     with TeamsArray[t]^ do
         begin
+        h:= 0;
         highlight:= bShowFinger and (CurrentTeam = TeamsArray[t]) and ((RealTicks mod 1000) < 500);
 
         if highlight then
@@ -1088,6 +1089,14 @@
         r.w:= 3;
         DrawFromRect(TeamHealthBarWidth + 16, cScreenHeight + DrawHealthY + smallScreenOffset, @r, HealthTex);
 
+        if not highlight and not hasGone then
+            for i:= 0 to cMaxHHIndex do
+                if Hedgehogs[i].Gear <> nil then
+                    begin
+                    inc(h,round(Hedgehogs[i].Gear^.Health*(TeamHealthBarWidth/TeamHealth)));
+                    if h < TeamHealthBarWidth-1 then DrawTexture(14 + h, cScreenHeight + DrawHealthY + smallScreenOffset + 1, SpritesData[sprSlider].Texture);
+                    end;
+
         // draw ai kill counter for gfAISurvival
         if (GameFlags and gfAISurvival) <> 0 then
             begin
--- a/share/hedgewars/Data/Graphics/AmmoMenu/CMakeLists.txt	Sun Feb 05 23:24:43 2012 +0400
+++ b/share/hedgewars/Data/Graphics/AmmoMenu/CMakeLists.txt	Sun Feb 05 15:20:49 2012 -0500
@@ -1,5 +1,5 @@
 file(GLOB AmmoMenuSprites *.png)
-list(REMOVE_ITEM AmmoMenuSprites *@2x.png)
+list(REMOVE_ITEM AmmoMenuSprites *@2x.png Border*.png)
 
 install(FILES
 	${AmmoMenuSprites}
Binary file share/hedgewars/Data/Graphics/slider.png has changed