Show icon for resurrectable hog
authorWuzzy <Wuzzy2@mail.ru>
Thu, 16 May 2019 06:50:34 +0200
changeset 14973 b4f83570c514
parent 14972 9939134b566d
child 14974 65be598c64b9
Show icon for resurrectable hog
hedgewars/uWorld.pas
--- a/hedgewars/uWorld.pas	Thu May 16 06:41:56 2019 +0200
+++ b/hedgewars/uWorld.pas	Thu May 16 06:50:34 2019 +0200
@@ -1586,7 +1586,6 @@
 
 // Current hedgehog health in top left corner
 if ((UIDisplay = uiAll) or (UIDisplay = uiNoTeams)) and (isNotHiddenByCinematic) and
-        ((GameFlags and gfInvulnerable) = 0) and
         (CurrentHedgehog <> nil) and (CurrentHedgehog^.Gear <> nil) and
         (CurrentHedgehog^.HealthTagTex <> nil) and
         ((CurrentHedgehog^.Gear^.State and gstHHDriven) <> 0) then
@@ -1596,6 +1595,11 @@
 {$IFDEF USE_TOUCH_INTERFACE}
     i:= t + pauseButton.frame.y + pauseButton.frame.h;
 {$ENDIF}
+
+    // Hide health and healh icons in gfInvulnerable mode (except heResurrectable)
+    if ((GameFlags and gfInvulnerable) = 0) then
+    begin
+    // Health tag
     DrawTexture(cScreenWidth div 2 - CurrentHedgehog^.HealthTagTex^.w - 16, i, CurrentHedgehog^.HealthTagTex);
     inc(t, CurrentHedgehog^.HealthTagTex^.h);
     cDemoClockFPSOffsetY:= t;
@@ -1637,6 +1641,11 @@
         DrawSprite(sprVampHud, (cScreenWidth div 2 - CurrentHedgehog^.HealthTagTex^.w - t), i, 0);
         end;
     end
+    // in gfInvulnerable mode ...
+    else if (CurrentHedgehog^.Effects[heResurrectable] <> 0) then
+        // show halo for resurrectable hog
+        DrawSprite(sprHaloHud, (cScreenWidth div 2 - CurrentHedgehog^.HealthTagTex^.w - t - 2), i, 0);
+    end
 else
     cDemoClockFPSOffsetY:= 0;