Restore Deep Impact charge numbers in HUD.

This commit is contained in:
Mari the Deer 2022-09-16 20:23:43 +02:00
commit 1b74e6b84d
5 changed files with 7 additions and 4 deletions

View file

@ -4,15 +4,18 @@
extend Class DeepImpact
{
ui TextureID WeaponBox, AmmoBar;
ui Font AmmoFont;
override void DrawWeapon( double TicFrac, double bx, double by, double hs, Vector2 ss )
{
if ( !WeaponBox ) WeaponBox = TexMan.CheckForTexture("graphics/HUD/DeepImpactDisplay.png",TexMan.Type_Any);
if ( !AmmoBar ) AmmoBar = TexMan.CheckForTexture("graphics/HUD/DeepImpactBar.png",TexMan.Type_Any);
Screen.DrawTexture(WeaponBox,false,bx-8,by-25,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
if ( !AmmoFont ) AmmoFont = Font.GetFont("MiniHudShadow");
Screen.DrawTexture(WeaponBox,false,bx-24,by-25,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
double chg = clamp(ChargeInter?ChargeInter.GetValue(TicFrac):clipcount,0.,100.);
double ch = chg*20./100.;
bool blinking = (failtime>gametic)&&((failtime-gametic)%8>=4);
Screen.DrawText(AmmoFont,Font.FindFontColor("MiniIce"),bx-22,by-8,String.Format("%3d",clamp(int(chg),0,100)),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_ColorOverlay,blinking?Color(128,0,0,0):Color(0,0,0,0));
double ch = chg*20./100.;
Screen.DrawTexture(AmmoBar,false,bx-5,by-(2+ch),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_SrcY,20.-ch,DTA_SrcHeight,ch,DTA_DestHeightF,ch,DTA_ColorOverlay,Color(255,0,0,0));
Screen.DrawTexture(AmmoBar,false,bx-6,by-(3+ch),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_SrcY,20.-ch,DTA_SrcHeight,ch,DTA_DestHeightF,ch,DTA_ColorOverlay,blinking?Color(128,0,0,0):Color(0,0,0,0));
}