# HG changeset patch # User Wuzzy # Date 1557981716 -7200 # Node ID 9939134b566da0af4a90bda5d7e6012cabe10888 # Parent 5a9d203f7c8204291aa247f8acb6ae910bfa24dc Show more health-related icons in top right corner diff -r 5a9d203f7c82 -r 9939134b566d hedgewars/uTypes.pas --- a/hedgewars/uTypes.pas Thu May 16 04:02:09 2019 +0200 +++ b/hedgewars/uTypes.pas Thu May 16 06:41:56 2019 +0200 @@ -93,7 +93,8 @@ sprCustom5, sprCustom6, sprCustom7, sprCustom8, sprFrozenAirMine, sprAirMine, sprHandAirMine, sprFlakeL, sprSDFlakeL, sprCloudL, sprSDCloudL, sprCreeper, sprHandCreeper, sprMinigun, sprSliderInverted, sprFingerBack, sprFingerBackInv, sprTargetPBack, sprTargetPBackInv, - sprHealthHud, sprHealthPoisonHud, sprVampHud + sprHealthHud, sprHealthPoisonHud, sprVampHud, sprKarmaHud, sprMedicHud, sprMedicPoisonHud, + sprHaloHud, sprInvulnHUD ); // Gears that interact with other Gears and/or Land diff -r 5a9d203f7c82 -r 9939134b566d hedgewars/uVariables.pas --- a/hedgewars/uVariables.pas Thu May 16 04:02:09 2019 +0200 +++ b/hedgewars/uVariables.pas Thu May 16 06:41:56 2019 +0200 @@ -829,7 +829,17 @@ (FileName: 'HealthPoisonHUD'; Path: ptGraphics; AltPath: ptNone; Texture: nil; Surface: nil; Width: 18; Height: 18; imageWidth: 0; imageHeight: 0; saveSurf: false; critical: true; checkSum: false; priority: tpMedium; getDimensions: false; getImageDimensions: true),// sprHealthPoisonHud (FileName: 'VampHUD'; Path: ptGraphics; AltPath: ptNone; Texture: nil; Surface: nil; - Width: 24; Height: 18; imageWidth: 0; imageHeight: 0; saveSurf: false; critical: true; checkSum: false; priority: tpMedium; getDimensions: false; getImageDimensions: true)// sprVampHUD + Width: 24; Height: 18; imageWidth: 0; imageHeight: 0; saveSurf: false; critical: true; checkSum: false; priority: tpMedium; getDimensions: false; getImageDimensions: true),// sprVampHUD + (FileName: 'KarmaHUD'; Path: ptGraphics; AltPath: ptNone; Texture: nil; Surface: nil; + Width: 18; Height: 18; imageWidth: 0; imageHeight: 0; saveSurf: false; critical: true; checkSum: false; priority: tpMedium; getDimensions: false; getImageDimensions: true),// sprKarmaHUD + (FileName: 'MedicHUD'; Path: ptGraphics; AltPath: ptNone; Texture: nil; Surface: nil; + Width: 18; Height: 18; imageWidth: 0; imageHeight: 0; saveSurf: false; critical: true; checkSum: false; priority: tpMedium; getDimensions: false; getImageDimensions: true),// sprMedicHud + (FileName: 'MedicPoisonHUD'; Path: ptGraphics; AltPath: ptNone; Texture: nil; Surface: nil; + Width: 18; Height: 18; imageWidth: 0; imageHeight: 0; saveSurf: false; critical: true; checkSum: false; priority: tpMedium; getDimensions: false; getImageDimensions: true),// sprMedicPoisonHud + (FileName: 'HaloHUD'; Path: ptGraphics; AltPath: ptNone; Texture: nil; Surface: nil; + Width: 22; Height: 11; imageWidth: 0; imageHeight: 0; saveSurf: false; critical: true; checkSum: false; priority: tpMedium; getDimensions: false; getImageDimensions: true),// sprHaloHUD + (FileName: 'InvulnHUD'; Path: ptGraphics; AltPath: ptNone; Texture: nil; Surface: nil; + Width: 18; Height: 18; imageWidth: 0; imageHeight: 0; saveSurf: false; critical: true; checkSum: false; priority: tpMedium; getDimensions: false; getImageDimensions: true)// sprInvulnHUD ); diff -r 5a9d203f7c82 -r 9939134b566d hedgewars/uWorld.pas --- a/hedgewars/uWorld.pas Thu May 16 04:02:09 2019 +0200 +++ b/hedgewars/uWorld.pas Thu May 16 06:41:56 2019 +0200 @@ -1591,20 +1591,51 @@ (CurrentHedgehog^.HealthTagTex <> nil) and ((CurrentHedgehog^.Gear^.State and gstHHDriven) <> 0) then begin - t:= 10; + t:= 11; i:= t; {$IFDEF USE_TOUCH_INTERFACE} i:= t + pauseButton.frame.y + pauseButton.frame.h; {$ENDIF} DrawTexture(cScreenWidth div 2 - CurrentHedgehog^.HealthTagTex^.w - 16, i, CurrentHedgehog^.HealthTagTex); - if (CurrentHedgehog^.Effects[hePoisoned] > 0) then - DrawSprite(sprHealthPoisonHud, (cScreenWidth div 2 - CurrentHedgehog^.HealthTagTex^.w - 36), i, 0) - else - DrawSprite(sprHealthHud, (cScreenWidth div 2 - CurrentHedgehog^.HealthTagTex^.w - 36), i, 0); - if cVampiric then - DrawSprite(sprVampHud, (cScreenWidth div 2 - CurrentHedgehog^.HealthTagTex^.w - 62), i, 0); inc(t, CurrentHedgehog^.HealthTagTex^.h); cDemoClockFPSOffsetY:= t; + + t:= SpritesData[sprHealthHud].Width + 18; + // Main health icon. Appearance depends on game mode and poisoning state + if ((GameFlags and gfResetHealth) = 0) then + if (CurrentHedgehog^.Effects[hePoisoned] <> 0) then + DrawSprite(sprHealthPoisonHud, (cScreenWidth div 2 - CurrentHedgehog^.HealthTagTex^.w - t), i, 0) + else + DrawSprite(sprHealthHud, (cScreenWidth div 2 - CurrentHedgehog^.HealthTagTex^.w - t), i, 0) + else + if (CurrentHedgehog^.Effects[hePoisoned] <> 0) then + DrawSprite(sprMedicPoisonHud, (cScreenWidth div 2 - CurrentHedgehog^.HealthTagTex^.w - t), i, 0) + else + DrawSprite(sprMedicHud, (cScreenWidth div 2 - CurrentHedgehog^.HealthTagTex^.w - t), i, 0); + // Put halo above health icon for resurrectable hog + if (CurrentHedgehog^.Effects[heResurrectable] <> 0) then + DrawSprite(sprHaloHud, (cScreenWidth div 2 - CurrentHedgehog^.HealthTagTex^.w - t - 2), i - SpritesData[sprHaloHud].Height + 1, 0); + + // Additional health-related states + inc(t, 2); + // Invulnerable + if (CurrentHedgehog^.Effects[heInvulnerable] <> 0) then + begin + inc(t, SpritesData[sprInvulnHud].Width + 2); + DrawSprite(sprInvulnHud, (cScreenWidth div 2 - CurrentHedgehog^.HealthTagTex^.w - t), i, 0) + end + // Karma + else if ((GameFlags and gfKarma) <> 0) then + begin + inc(t, SpritesData[sprKarmaHud].Width + 2); + DrawSprite(sprKarmaHud, (cScreenWidth div 2 - CurrentHedgehog^.HealthTagTex^.w - t), i, 0) + end; + // Vampirism + if cVampiric then + begin + inc(t, SpritesData[sprVampHud].Width + 2); + DrawSprite(sprVampHud, (cScreenWidth div 2 - CurrentHedgehog^.HealthTagTex^.w - t), i, 0); + end; end else cDemoClockFPSOffsetY:= 0; diff -r 5a9d203f7c82 -r 9939134b566d share/hedgewars/Data/Graphics/HaloHUD.png Binary file share/hedgewars/Data/Graphics/HaloHUD.png has changed diff -r 5a9d203f7c82 -r 9939134b566d share/hedgewars/Data/Graphics/InvulnHUD.png Binary file share/hedgewars/Data/Graphics/InvulnHUD.png has changed diff -r 5a9d203f7c82 -r 9939134b566d share/hedgewars/Data/Graphics/KarmaHUD.png Binary file share/hedgewars/Data/Graphics/KarmaHUD.png has changed diff -r 5a9d203f7c82 -r 9939134b566d share/hedgewars/Data/Graphics/MedicHUD.png Binary file share/hedgewars/Data/Graphics/MedicHUD.png has changed diff -r 5a9d203f7c82 -r 9939134b566d share/hedgewars/Data/Graphics/MedicPoisonHUD.png Binary file share/hedgewars/Data/Graphics/MedicPoisonHUD.png has changed