Fix some HUD icon issues in gfInvulnerable
authorWuzzy <Wuzzy2@mail.ru>
Tue, 07 Jul 2020 00:07:40 +0200
changeset 15717 eeab5b90c082
parent 15716 2a69c6693fbb
child 15718 50dc9d0191d1
Fix some HUD icon issues in gfInvulnerable - Missing vampirism icon - FPS text overlapped
hedgewars/uWorld.pas
--- a/hedgewars/uWorld.pas	Mon Jul 06 22:48:20 2020 +0200
+++ b/hedgewars/uWorld.pas	Tue Jul 07 00:07:40 2020 +0200
@@ -1543,13 +1543,14 @@
     i:= t + pauseButton.frame.y + pauseButton.frame.h;
 {$ENDIF}
 
+    inc(t, CurrentHedgehog^.HealthTagTex^.h);
+    cDemoClockFPSOffsetY:= t;
+
     // 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;
 
     t:= SpritesData[sprHealthHud].Width + 18;
     // Main health icon. Appearance depends on game mode and poisoning state
@@ -1591,10 +1592,18 @@
     // in gfInvulnerable mode ...
     else
         begin
-        DrawSprite(sprInvulnHud, cScreenWidth div 2 - 28, i, 0);
+        // Invulnerable
+        inc(t, 8);
+        DrawSprite(sprInvulnHud, cScreenWidth div 2 - t, i, 0);
         if (CurrentHedgehog^.Effects[heResurrectable] <> 0) then
             // show halo for resurrectable hog
             DrawSprite(sprHaloHud, cScreenWidth div 2 - 30, i - SpritesData[sprHaloHud].Height + 1, 0);
+        // Vampirism
+        if cVampiric then
+            begin
+            inc(t, SpritesData[sprVampHud].Width + 2);
+            DrawSprite(sprVampHud, (cScreenWidth div 2 - t), i, 0);
+            end;
         end;
     end
 else