Alt HUD tweaks.

This commit is contained in:
Mari the Deer 2022-06-09 11:35:24 +02:00
commit 958a32c28e
49 changed files with 83 additions and 46 deletions

BIN
fonts/MiniHUD/0025.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 103 B

View file

Before

Width:  |  Height:  |  Size: 108 B

After

Width:  |  Height:  |  Size: 108 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 89 B

After

Width:  |  Height:  |  Size: 89 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 91 B

After

Width:  |  Height:  |  Size: 91 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 101 B

After

Width:  |  Height:  |  Size: 101 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 98 B

After

Width:  |  Height:  |  Size: 98 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 90 B

After

Width:  |  Height:  |  Size: 90 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 86 B

After

Width:  |  Height:  |  Size: 86 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 101 B

After

Width:  |  Height:  |  Size: 101 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 89 B

After

Width:  |  Height:  |  Size: 89 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 100 B

After

Width:  |  Height:  |  Size: 100 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 92 B

After

Width:  |  Height:  |  Size: 92 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 100 B

After

Width:  |  Height:  |  Size: 100 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 90 B

After

Width:  |  Height:  |  Size: 90 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 93 B

After

Width:  |  Height:  |  Size: 93 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 101 B

After

Width:  |  Height:  |  Size: 101 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 87 B

After

Width:  |  Height:  |  Size: 87 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 92 B

After

Width:  |  Height:  |  Size: 92 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 100 B

After

Width:  |  Height:  |  Size: 100 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 86 B

After

Width:  |  Height:  |  Size: 86 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 91 B

After

Width:  |  Height:  |  Size: 91 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 99 B

After

Width:  |  Height:  |  Size: 99 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 102 B

After

Width:  |  Height:  |  Size: 102 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 98 B

After

Width:  |  Height:  |  Size: 98 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 101 B

After

Width:  |  Height:  |  Size: 101 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 102 B

After

Width:  |  Height:  |  Size: 102 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 93 B

After

Width:  |  Height:  |  Size: 93 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 100 B

After

Width:  |  Height:  |  Size: 100 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 100 B

After

Width:  |  Height:  |  Size: 100 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 101 B

After

Width:  |  Height:  |  Size: 101 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 95 B

After

Width:  |  Height:  |  Size: 95 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 97 B

After

Width:  |  Height:  |  Size: 97 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 97 B

After

Width:  |  Height:  |  Size: 97 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 95 B

After

Width:  |  Height:  |  Size: 95 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 97 B

After

Width:  |  Height:  |  Size: 97 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 103 B

After

Width:  |  Height:  |  Size: 103 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 100 B

After

Width:  |  Height:  |  Size: 100 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 106 B

After

Width:  |  Height:  |  Size: 106 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 100 B

After

Width:  |  Height:  |  Size: 100 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 100 B

After

Width:  |  Height:  |  Size: 100 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 91 B

After

Width:  |  Height:  |  Size: 91 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 113 B

After

Width:  |  Height:  |  Size: 113 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 89 B

After

Width:  |  Height:  |  Size: 89 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 117 B

After

Width:  |  Height:  |  Size: 117 B

Before After
Before After

Binary file not shown.

After

Width:  |  Height:  |  Size: 126 B

View file

@ -1,3 +1,3 @@
[default]
SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r108 \cu(Thu 9 Jun 10:51:16 CEST 2022)\c-";
SWWM_SHORTVER="\cw1.3pre r108 \cu(2022-06-09 10:51:16)\c-";
SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r109 \cu(Thu 9 Jun 11:35:24 CEST 2022)\c-";
SWWM_SHORTVER="\cw1.3pre r109 \cu(2022-06-09 11:35:24)\c-";

View file

@ -237,7 +237,7 @@ extend Class SWWMStatusBar
AltAmmoTex[0] = TexMan.CheckForTexture("graphics/AltHUD/AmmoBoxT.png",TexMan.Type_Any);
AltAmmoTex[1] = TexMan.CheckForTexture("graphics/AltHUD/AmmoBoxM.png",TexMan.Type_Any);
AltAmmoTex[2] = TexMan.CheckForTexture("graphics/AltHUD/AmmoBoxB.png",TexMan.Type_Any);
MiniHudFont = Font.GetFont("MiniHUDFlat");
MiniHudFont = Font.GetFont("MiniHUD");
MiniHudFontOutline = Font.GetFont("MiniHUDOutline");
mhudfontcol[MCR_DEMOHUD] = Font.FindFontColor("MiniDemoHUD");
mhudfontcol[MCR_IBUKIHUD] = Font.FindFontColor("MiniIbukiHUD");
@ -584,36 +584,46 @@ extend Class SWWMStatusBar
yy = ss.y-(margin+12);
Screen.DrawTexture(AltAmmoTex[2],false,xx,yy,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
String str;
bool drewammo = false;
for ( int i=0; i<26; i++ )
for ( int i=25; i>=0; i-- )
{
let a = AmmoSlots[i];
let cur = Ammo(CPlayer.mo.FindInventory(a));
if ( !cur ) continue;
drewammo = 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 = Ammo(CPlayer.mo.FindInventory(a));
int amt, amax;
bool selected = false, used = false;
amt = cur.Amount;
amax = cur.MaxAmount;
if ( (cur is 'SWWMAmmo') && SWWMAmmo(cur).MagAmmoType )
if ( !cur )
{
let mag = MagAmmo(CPlayer.mo.FindInventory(SWWMAmmo(cur).MagAmmoType));
// theoretically this should never be null, but nevertheless...
if ( mag )
amt = 0;
amax = GetDefaultByType(a).MaxAmount;
if ( a is 'SWWMAmmo' )
{
amt = amt*mag.ClipSize+mag.Amount;
amax = amax*mag.ClipSize+mag.MaxAmount;
}
else
{
let def = GetDefaultByType(SWWMAmmo(cur).MagAmmoType);
amt = amt*def.ClipSize;
amax = amax*def.ClipSize+def.MaxAmount;
let def = GetDefaultByType((Class<SWWMAmmo>)(a));
if ( def.MagAmmoType ) amax *= GetDefaultByType(def.MagAmmoType).ClipSize;
}
}
else
{
amt = cur.Amount;
amax = cur.MaxAmount;
if ( (cur is 'SWWMAmmo') && SWWMAmmo(cur).MagAmmoType )
{
let mag = MagAmmo(CPlayer.mo.FindInventory(SWWMAmmo(cur).MagAmmoType));
// theoretically this should never be null, but nevertheless...
if ( mag )
{
amt = amt*mag.ClipSize+mag.Amount;
amax = amax*mag.ClipSize+mag.MaxAmount;
}
else
{
let def = GetDefaultByType(SWWMAmmo(cur).MagAmmoType);
amt = amt*def.ClipSize;
amax = amax*def.ClipSize+def.MaxAmount;
}
}
}
bool selected = false, used = false;
if ( CPlayer.ReadyWeapon )
{
if ( CPlayer.ReadyWeapon is 'SWWMWeapon' )
@ -627,8 +637,8 @@ extend Class SWWMStatusBar
int ncolor = (amt>0)?scol:mhudfontcol[MCR_RED];
int dcnt1 = 2-int(Log10(clamp(amt,1,999)));
int dcnt2 = 2-int(Log10(clamp(amax,1,999)));
for ( int i=0; i<dcnt1; i++ ) Screen.DrawChar(MiniHUDFont,ncolor,xx+20+i*4,yy,0x30,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_ColorOverlay,Color(used?160:192,0,0,0));
for ( int i=0; i<dcnt2; i++ ) Screen.DrawChar(MiniHUDFont,scol,xx+38+i*4,yy,0x30,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_ColorOverlay,Color(used?160:192,0,0,0));
for ( int j=0; j<dcnt1; j++ ) Screen.DrawChar(MiniHUDFont,ncolor,xx+20+j*4,yy,0x30,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_ColorOverlay,Color(used?160:192,0,0,0));
for ( int j=0; j<dcnt2; j++ ) Screen.DrawChar(MiniHUDFont,scol,xx+38+j*4,yy,0x30,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_ColorOverlay,Color(used?160:192,0,0,0));
str = AmmoNames[i];
Screen.DrawText(MiniHUDFont,scol,xx,yy,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_ColorOverlay,Color(used?0:96,0,0,0));
str = "/";
@ -653,13 +663,6 @@ extend Class SWWMStatusBar
}
xx -= 2;
}
if ( !drewammo )
{
yy -= 6;
Screen.DrawTexture(AltAmmoTex[1],false,xx,yy,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
String str = "NO AMMO";
Screen.DrawText(MiniHUDFont,mhudfontcol[MCR_RED],xx+13,yy,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_ColorOverlay,Color(64,0,0,0));
}
yy -= 2;
Screen.DrawTexture(AltAmmoTex[0],false,xx,yy,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
// score

View file

@ -68,6 +68,7 @@ Class SWWMStatusBar : BaseStatusBar
bool camhidden;
int pausetime;
Vector2 pausepos, pausedir;
bool isalthud;
// shared from renderunderlay, needed for proper interpolation of some things
Vector3 viewpos, viewrot;
@ -2363,7 +2364,7 @@ Class SWWMStatusBar : BaseStatusBar
}
}
private bool DrawInvIcon( Inventory i, double xx, double yy, double alpha = 1., bool forceamt = false, bool aspowerup = false )
private bool DrawInvIcon( Inventory i, double xx, double yy, double alpha = 1., bool forceamt = false, bool selected = false, bool aspowerup = false )
{
if ( !i || !i.Icon.IsValid() ) return false;
Vector2 scl = TexMan.GetScaledSize(i.Icon);
@ -2374,24 +2375,48 @@ Class SWWMStatusBar : BaseStatusBar
{
Screen.DrawTexture(i.Icon,false,dx,dy,DTA_VirtualWidthF,dw,DTA_VirtualHeightF,dh,DTA_KeepRatio,true,DTA_Alpha,Powerup(i).IsBlinking()?alpha*.5:alpha,DTA_TopOffset,0,DTA_LeftOffset,0);
String nstr = String.Format("%ds",Powerup(i).EffectTics/GameTicRate);
int len = mSmallFont.StringWidth(nstr);
Screen.DrawText(mSmallFont,Font.CR_FIRE,(xx+30)-len,(yy+30)-10,nstr,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Alpha,Powerup(i).IsBlinking()?alpha*.5:alpha);
if ( isalthud )
{
int len = MiniHudFontOutline.StringWidth(nstr);
Screen.DrawText(MiniHudFontOutline,mhudfontcol[MCR_BRASS],(xx+30)-len,(yy+30)-6,nstr,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Alpha,Powerup(i).IsBlinking()?alpha*.5:alpha);
}
else
{
int len = mSmallFont.StringWidth(nstr);
Screen.DrawText(mSmallFont,Font.CR_FIRE,(xx+30)-len,(yy+30)-10,nstr,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Alpha,Powerup(i).IsBlinking()?alpha*.5:alpha);
}
return true;
}
if ( (i is 'SWWMLamp') && aspowerup )
{
Screen.DrawTexture(i.Icon,false,dx,dy,DTA_VirtualWidthF,dw,DTA_VirtualHeightF,dh,DTA_KeepRatio,true,DTA_Alpha,SWWMLamp(i).isBlinking()?alpha*.5:alpha,DTA_TopOffset,0,DTA_LeftOffset,0);
String nstr = String.Format("%d%%",SWWMLamp(i).Charge);
int len = mSmallFont.StringWidth(nstr);
Screen.DrawText(mSmallFont,Font.CR_FIRE,(xx+30)-len,(yy+30)-10,nstr,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Alpha,SWWMLamp(i).isBlinking()?alpha*.5:alpha);
if ( isalthud )
{
int len = MiniHudFontOutline.StringWidth(nstr);
Screen.DrawText(MiniHudFontOutline,mhudfontcol[SWWMLamp(i).bActive?MCR_BRASS:MCR_WHITE],(xx+30)-len,(yy+30)-6,nstr,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Alpha,SWWMLamp(i).isBlinking()?alpha*.5:alpha);
}
else
{
int len = mSmallFont.StringWidth(nstr);
Screen.DrawText(mSmallFont,SWWMLamp(i).bActive?Font.CR_FIRE:Font.CR_WHITE,(xx+30)-len,(yy+30)-10,nstr,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Alpha,SWWMLamp(i).isBlinking()?alpha*.5:alpha);
}
return true;
}
if ( (i is 'DivineSpriteEffect') && aspowerup )
{
Screen.DrawTexture(i.Icon,false,dx,dy,DTA_VirtualWidthF,dw,DTA_VirtualHeightF,dh,DTA_KeepRatio,true,DTA_Alpha,DivineSpriteEffect(i).isBlinking()?alpha*.5:alpha,DTA_TopOffset,0,DTA_LeftOffset,0);
String nstr = String.Format("%ds",DivineSpriteEffect(i).healtim/GameTicRate);
int len = mSmallFont.StringWidth(nstr);
Screen.DrawText(mSmallFont,Font.CR_FIRE,(xx+30)-len,(yy+30)-10,nstr,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Alpha,DivineSpriteEffect(i).isBlinking()?alpha*.5:alpha);
if ( isalthud )
{
int len = MiniHudFontOutline.StringWidth(nstr);
Screen.DrawText(MiniHudFontOutline,mhudfontcol[MCR_BRASS],(xx+30)-len,(yy+30)-6,nstr,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Alpha,DivineSpriteEffect(i).isBlinking()?alpha*.5:alpha);
}
else
{
int len = mSmallFont.StringWidth(nstr);
Screen.DrawText(mSmallFont,Font.CR_FIRE,(xx+30)-len,(yy+30)-10,nstr,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Alpha,DivineSpriteEffect(i).isBlinking()?alpha*.5:alpha);
}
return true;
}
Screen.DrawTexture(i.Icon,false,dx,dy,DTA_VirtualWidthF,dw,DTA_VirtualHeightF,dh,DTA_KeepRatio,true,DTA_Alpha,alpha,DTA_TopOffset,0,DTA_LeftOffset,0);
@ -2400,8 +2425,16 @@ Class SWWMStatusBar : BaseStatusBar
String nstr;
if ( (i.Amount > 99999) && !forceamt ) nstr = "99999";
else nstr = String.Format("%d",i.Amount);
int len = mSmallFont.StringWidth(nstr);
Screen.DrawText(mSmallFont,Font.CR_FIRE,(xx+30)-len,(yy+30)-10,nstr,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Alpha,alpha);
if ( isalthud )
{
int len = MiniHudFontOutline.StringWidth(nstr);
Screen.DrawText(MiniHudFontOutline,mhudfontcol[(i.Amount<=0)?MCR_RED:selected?MCR_BRASS:MCR_WHITE],(xx+30)-len,(yy+30)-6,nstr,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Alpha,alpha);
}
else
{
int len = mSmallFont.StringWidth(nstr);
Screen.DrawText(mSmallFont,(i.Amount<=0)?Font.CR_RED:selected?Font.CR_FIRE:Font.CR_WHITE,(xx+30)-len,(yy+30)-10,nstr,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Alpha,alpha);
}
}
return true;
}
@ -2416,7 +2449,7 @@ Class SWWMStatusBar : BaseStatusBar
for ( Inventory i=CPlayer.mo.Inv; i; i=i.Inv )
{
if ( (i.Amount <= 0) || (!(i is 'SWWMArmor') && !(i is 'BasicArmor')) ) continue;
if ( !DrawInvIcon(i,xx,yy,forceamt:true) ) continue;
if ( !DrawInvIcon(i,xx,yy,forceamt:true,selected:true) ) continue;
yy -= 34;
drewarmor = true;
}
@ -2427,13 +2460,13 @@ Class SWWMStatusBar : BaseStatusBar
{
if ( (i is 'SWWMLamp') && SWWMLamp(i).bActivated )
{
DrawInvIcon(i,xx,yy,aspowerup:true);
DrawInvIcon(i,xx,yy,selected:true,aspowerup:true);
yy -= 34;
continue;
}
if ( (i is 'DivineSpriteEffect') && !DivineSpriteEffect(i).bHealDone )
{
DrawInvIcon(i,xx,yy,aspowerup:true);
DrawInvIcon(i,xx,yy,selected:true,aspowerup:true);
yy -= 34;
continue;
}
@ -2467,7 +2500,7 @@ Class SWWMStatusBar : BaseStatusBar
xx = (ss.x-34)/2;
yy = (ss.y+64)/2;
Screen.DrawTexture(InventoryTex,false,xx,yy,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
DrawInvIcon(CPlayer.mo.InvSel,xx+2,yy+2);
DrawInvIcon(CPlayer.mo.InvSel,xx+2,yy+2,selected:true);
DrawInvIcon(prev[0],xx-32,yy+2,2./3.);
DrawInvIcon(prev[1],xx-66,yy+2,1./3.);
DrawInvIcon(next[0],xx+36,yy+2,2./3.);
@ -2475,7 +2508,7 @@ Class SWWMStatusBar : BaseStatusBar
return;
}
Screen.DrawTexture(InventoryTex,false,margin,ss.y-(margin+invy+2),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
DrawInvIcon(CPlayer.mo.InvSel,margin+2,ss.y-(margin+invy));
DrawInvIcon(CPlayer.mo.InvSel,margin+2,ss.y-(margin+invy),selected:true);
}
private void DrawWeapons()
@ -2906,6 +2939,7 @@ Class SWWMStatusBar : BaseStatusBar
ssi = (Screen.GetWidth()/hsi,Screen.GetHeight()/hsi);
ssd = (Screen.GetWidth()/hsd,Screen.GetHeight()/hsd);
FracTic = TicFrac;
isalthud = swwm_althud;
if ( camhidden )
{
if ( hnd ) hnd.DrawBossBar(self);
@ -2916,7 +2950,7 @@ Class SWWMStatusBar : BaseStatusBar
else
{
DrawTarget();
if ( swwm_althud )
if ( isalthud )
{
DrawTopStuff(true);
Alt_DrawTopStuff();