Sheen HMG sounds.

This commit is contained in:
Mari the Deer 2022-06-30 16:48:24 +02:00
commit 459b55fe03
12 changed files with 77 additions and 51 deletions

View file

@ -480,43 +480,6 @@ extend Class SWWMStatusBar
void Alt_DrawWeapons()
{
if ( CPlayer.ReadyWeapon is 'SWWMWeapon' ) SWWMWeapon(CPlayer.ReadyWeapon).DrawWeaponAlt(FracTic,ss.x-(margin+56),ss.y-(margin+12),hs,ss);
else if ( CPlayer.ReadyWeapon )
{
// generic display
double xx = ss.x-(margin+58), yy = ss.y-(margin+22);
String str;
int len;
if ( CPlayer.ReadyWeapon.Ammo2 && (CPlayer.ReadyWeapon.Ammo2 != CPlayer.ReadyWeapon.Ammo1) )
{
str = String.Format("%d",CPlayer.ReadyWeapon.Ammo2.Amount);
len = str.Length();
yy -= 12;
Screen.DrawTexture(AltGenericAmmoTex[2],false,xx,yy,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
for ( int i=0; i<len; i++ )
{
xx -= 4;
Screen.DrawTexture(AltGenericAmmoTex[1],false,xx,yy,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
}
Screen.DrawTexture(AltGenericAmmoTex[0],false,xx-2,yy,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
Screen.DrawText(MiniHUDFont,mhudfontcol[(CPlayer.ReadyWeapon.Ammo2.Amount<=0)?MCR_RED:MCR_BRASS],xx,yy+2,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
yy += 12;
}
xx = ss.x-(margin+58);
if ( CPlayer.ReadyWeapon.Ammo1 )
{
str = String.Format("%d",CPlayer.ReadyWeapon.Ammo1.Amount);
len = str.Length();
Screen.DrawTexture(AltGenericAmmoTex[2],false,xx,yy,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
for ( int i=0; i<len; i++ )
{
xx -= 4;
Screen.DrawTexture(AltGenericAmmoTex[1],false,xx,yy,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
}
Screen.DrawTexture(AltGenericAmmoTex[0],false,xx-2,yy,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
Screen.DrawText(MiniHUDFont,mhudfontcol[(CPlayer.ReadyWeapon.Ammo1.Amount<=0)?MCR_RED:MCR_BRASS],xx,yy+2,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
}
}
Screen.DrawTexture(AltWeaponTex,false,ss.x-(margin+80),ss.y-(margin+10),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
double xx = ss.x-(margin+78), yy = ss.y-(margin+8);
for ( int i=1; i<=10; i++,xx+=8 )
@ -584,14 +547,37 @@ extend Class SWWMStatusBar
}
xx = ss.x-(margin+54);
yy = ss.y-(margin+14);
Screen.DrawTexture(AltAmmoTex[2],false,xx,yy,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
bool bDrewAmmo = false;
bool checkowned = swwm_althud_trimammo;
Array<SWWMWeapon> OwnedWeapons;
if ( checkowned ) for ( Inventory i=CPlayer.mo.inv; i; i=i.inv )
{
if ( !(i is 'SWWMWeapon') ) continue;
OwnedWeapons.Push(SWWMWeapon(i));
}
String str;
for ( int i=25; i>=0; i-- )
{
let a = AmmoSlots[i];
// check if owned
if ( checkowned )
{
bool owned = false;
for ( int j=0; j<OwnedWeapons.Size(); j++ )
{
if ( OwnedWeapons[j].UsesAmmo(a) )
owned = true;
}
if ( !owned ) continue;
}
if ( !bDrewAmmo )
{
Screen.DrawTexture(AltAmmoTex[2],false,xx,yy,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
bDrewAmmo = true;
}
yy -= 6;
Screen.DrawTexture(AltAmmoTex[1],false,xx,yy,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
xx += 2;
let a = AmmoSlots[i];
let cur = SWWMAmmo(CPlayer.mo.FindInventory(a));
int amt, amax;
if ( !cur )
@ -624,14 +610,10 @@ extend Class SWWMStatusBar
}
}
bool selected = false, used = false;
if ( CPlayer.ReadyWeapon )
if ( CPlayer.ReadyWeapon && (CPlayer.ReadyWeapon is 'SWWMWeapon') )
{
if ( CPlayer.ReadyWeapon is 'SWWMWeapon' )
{
selected = SWWMWeapon(CPlayer.ReadyWeapon).IsCurrentAmmo(a);
used = SWWMWeapon(CPlayer.ReadyWeapon).UsesAmmo(a);
}
else used = selected = (CPlayer.ReadyWeapon.AmmoType1 == a)||(CPlayer.ReadyWeapon.AmmoType2 == a);
selected = SWWMWeapon(CPlayer.ReadyWeapon).IsCurrentAmmo(a);
used = SWWMWeapon(CPlayer.ReadyWeapon).UsesAmmo(a);
}
int scol = mhudfontcol[selected?MCR_BRASS:MCR_WHITE];
int ncolor = (amt>0)?scol:mhudfontcol[MCR_RED];
@ -663,16 +645,59 @@ extend Class SWWMStatusBar
}
xx -= 2;
}
yy -= 2;
Screen.DrawTexture(AltAmmoTex[0],false,xx,yy,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
if ( bDrewAmmo )
{
yy -= 2;
Screen.DrawTexture(AltAmmoTex[0],false,xx,yy,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
}
// score
String sstr = String.Format("%09d",ScoreInter.GetValue());
xx = ss.x-(margin+48);
yy -= 12;
if ( bDrewAmmo ) yy -= 12;
else yy = ss.y-(margin+22);
Screen.DrawTexture(AltScoreTex,false,xx,yy,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
xx += 10;
yy += 2;
Screen.DrawText(MiniHUDFont,mhudfontcol[MCR_BRASS],xx,yy,sstr,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
int bx = bDrewAmmo?56:50;
// ammo display
if ( CPlayer.ReadyWeapon is 'SWWMWeapon' ) SWWMWeapon(CPlayer.ReadyWeapon).DrawWeaponAlt(FracTic,ss.x-(margin+bx),ss.y-(margin+12),hs,ss);
else if ( CPlayer.ReadyWeapon )
{
// generic display
double xx = ss.x-(margin+bx+2), yy = ss.y-(margin+22);
String str;
int len;
if ( CPlayer.ReadyWeapon.Ammo2 && (CPlayer.ReadyWeapon.Ammo2 != CPlayer.ReadyWeapon.Ammo1) )
{
str = String.Format("%d",CPlayer.ReadyWeapon.Ammo2.Amount);
len = str.Length();
yy -= 12;
Screen.DrawTexture(AltGenericAmmoTex[2],false,xx,yy,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
for ( int i=0; i<len; i++ )
{
xx -= 4;
Screen.DrawTexture(AltGenericAmmoTex[1],false,xx,yy,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
}
Screen.DrawTexture(AltGenericAmmoTex[0],false,xx-2,yy,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
Screen.DrawText(MiniHUDFont,mhudfontcol[(CPlayer.ReadyWeapon.Ammo2.Amount<=0)?MCR_RED:MCR_BRASS],xx,yy+2,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
yy += 12;
}
xx = ss.x-(margin+bx+2);
if ( CPlayer.ReadyWeapon.Ammo1 )
{
str = String.Format("%d",CPlayer.ReadyWeapon.Ammo1.Amount);
len = str.Length();
Screen.DrawTexture(AltGenericAmmoTex[2],false,xx,yy,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
for ( int i=0; i<len; i++ )
{
xx -= 4;
Screen.DrawTexture(AltGenericAmmoTex[1],false,xx,yy,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
}
Screen.DrawTexture(AltGenericAmmoTex[0],false,xx-2,yy,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
Screen.DrawText(MiniHUDFont,mhudfontcol[(CPlayer.ReadyWeapon.Ammo1.Amount<=0)?MCR_RED:MCR_BRASS],xx,yy+2,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
}
}
}
void Alt_DrawStatus()