Several adjustments, some fixes, just stuff.

This commit is contained in:
Mari the Deer 2023-12-13 18:17:42 +01:00
commit 894ecc665b
25 changed files with 91 additions and 80 deletions

View file

@ -66,7 +66,7 @@ Enum EMiniHUDFontColor
MCR_AQUA,
MCR_MAGENTA,
MCR_PINK,
MCR_CRYSTAL,
MCR_SKIN,
MCR_FIRE,
MCR_SULFUR,
MCR_WITCH,
@ -351,7 +351,7 @@ Class SWWMStatusBar : BaseStatusBar
mhudfontcol[MCR_AQUA] = Font.FindFontColor("MiniAqua");
mhudfontcol[MCR_MAGENTA] = Font.FindFontColor("MiniMagenta");
mhudfontcol[MCR_PINK] = Font.FindFontColor("MiniPink");
mhudfontcol[MCR_CRYSTAL] = Font.FindFontColor("MiniCrystal");
mhudfontcol[MCR_SKIN] = Font.FindFontColor("MiniSkin");
mhudfontcol[MCR_FIRE] = Font.FindFontColor("MiniFire");
mhudfontcol[MCR_SULFUR] = Font.FindFontColor("MiniSulfur");
mhudfontcol[MCR_WITCH] = Font.FindFontColor("MiniWitch");

View file

@ -101,33 +101,44 @@ extend Class SWWMStatusBar
if ( !CPlayer.mo.InvSel ) return;
if ( isInventoryBarVisible() )
{
Array<Inventory> bar;
bar.Clear();
for ( Inventory i=CPlayer.mo.FirstInv(); i; i=i.NextInv() ) bar.Push(i);
int ps = bar.Find(CPlayer.mo.InvSel);
Inventory prev[2], next[2];
if ( bar.Size() > 1 )
int invcount = 0;
Inventory FirstInv = CPlayer.mo.FirstInv();
Inventory LastInv = CPlayer.mo.InvSel;
for ( Inventory i=FirstInv; i; i=i.NextInv() )
{
if ( ps+1 >= bar.Size() ) next[0] = bar[0];
else next[0] = bar[ps+1];
if ( ps-1 < 0 ) prev[0] = bar[bar.Size()-1];
else prev[0] = bar[ps-1];
LastInv = i;
invcount++;
}
if ( bar.Size() > 2 )
{
if ( ps+2 >= bar.Size() ) next[1] = bar[(ps+2)-bar.Size()];
else next[1] = bar[ps+2];
if ( ps-2 < 0 ) prev[1] = bar[bar.Size()+(ps-2)];
else prev[1] = bar[ps-2];
}
xx = (ss.x-34)/2;
yy = (ss.y+64)/2;
bool bSmol = (ss.x<640);
int maxj = bSmol?4:6;
double alphstep = clamp(invcount,1,maxj+1);
double xx = (ss.x-34)/2;
double yy = (ss.y+64)/2;
Screen.DrawTexture(InventoryTex,false,xx,yy,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
// previous entries
int j = 1;
Inventory i = CPlayer.mo.InvSel.PrevInv()?CPlayer.mo.InvSel.PrevInv():LastInv;
while ( i )
{
if ( i == CPlayer.mo.InvSel ) break; // ensure we only loop around once
DrawInvIcon(i,(xx+2)-j*34,yy+2,(alphstep-j)/alphstep);
j++;
if ( j > maxj ) break;
i = i.PrevInv()?i.PrevInv():LastInv;
}
// next entries
j = 1;
i = CPlayer.mo.InvSel.NextInv()?CPlayer.mo.InvSel.NextInv():FirstInv;
while ( i )
{
if ( i == CPlayer.mo.InvSel ) break; // ensure we only loop around once
DrawInvIcon(i,(xx+2)+j*34,yy+2,(alphstep-j)/alphstep);
j++;
if ( j > maxj ) break;
i = i.NextInv()?i.NextInv():FirstInv;
}
// current
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.);
DrawInvIcon(next[1],xx+70,yy+2,1./3.);
return;
}
Screen.DrawTexture(InventoryTex,false,xmargin+36,ss.y-(ymargin+invy+2),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);

View file

@ -278,7 +278,7 @@ extend Class SWWMStatusBar
}
Screen.DrawTexture(GenericAmmoTex[0],false,xx-2,yy,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
dcnt = (dlen-1)-int(Log10(max(1,CPlayer.ReadyWeapon.Ammo2.Amount)));
for ( int i=0; i<dlen; i++ ) Screen.DrawChar(MiniHUDFont,mhudfontcol[(CPlayer.ReadyWeapon.Ammo2.Amount<=0)?MCR_RED:MCR_BRASS],xx+i*4,yy+2,0x30,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_ColorOverlay,0xA0000000);
for ( int i=0; i<dcnt; i++ ) Screen.DrawChar(MiniHUDFont,mhudfontcol[(CPlayer.ReadyWeapon.Ammo2.Amount<=0)?MCR_RED:MCR_BRASS],xx+i*4,yy+2,0x30,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_ColorOverlay,0xA0000000);
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;
}
@ -295,7 +295,7 @@ extend Class SWWMStatusBar
}
Screen.DrawTexture(GenericAmmoTex[0],false,xx-2,yy,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
dcnt = (dlen-1)-int(Log10(max(1,CPlayer.ReadyWeapon.Ammo1.Amount)));
for ( int i=0; i<dlen; i++ ) Screen.DrawChar(MiniHUDFont,mhudfontcol[(CPlayer.ReadyWeapon.Ammo1.Amount<=0)?MCR_RED:MCR_BRASS],xx+i*4,yy+2,0x30,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_ColorOverlay,0xA0000000);
for ( int i=0; i<dcnt; i++ ) Screen.DrawChar(MiniHUDFont,mhudfontcol[(CPlayer.ReadyWeapon.Ammo1.Amount<=0)?MCR_RED:MCR_BRASS],xx+i*4,yy+2,0x30,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_ColorOverlay,0xA0000000);
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);
}
}

View file

@ -75,15 +75,15 @@ Class SWWMStatScreen : StatusScreen
topheight = (statheight+lfheight+elheight+32);
mtipheight = (4*TewiFont.GetHeight()+32); // most tips don't generally go past 4 lines in height
// defaults
lnamecolor = Font.CR_WHITE;
lauthcolor = Font.CR_DARKGRAY;
lsubcolor = Font.CR_SAPPHIRE;
statbasecolor = Font.CR_SAPPHIRE;
statcolor0 = Font.CR_WHITE;
statcolor1 = Font.CR_GOLD;
statcolor2 = Font.CR_RED;
tipcolor0 = Font.CR_SAPPHIRE;
tipcolor1 = Font.CR_WHITE;
lnamecolor = Font.FindFontColor('MiniWhite');
lauthcolor = Font.FindFontColor('MiniIbukiHUD');
lsubcolor = Font.FindFontColor('MiniCyanblu');
statbasecolor = Font.FindFontColor('MiniCyanblu');
statcolor0 = Font.FindFontColor('MiniWhite');
statcolor1 = Font.FindFontColor('MiniBrass');
statcolor2 = Font.FindFontColor('MiniRed');
tipcolor0 = Font.FindFontColor('MiniCyanblu');
tipcolor1 = Font.FindFontColor('MiniWhite');
flashcolor = Font.FindFontColor('MiniFlash');
tipflashcolor = Font.FindFontColor('MiniWhiteFlash');
glarecolor = 0xFF4080FF;
@ -96,7 +96,7 @@ Class SWWMStatScreen : StatusScreen
private String StatCnt( int a, int b )
{
if ( b <= 0 ) return "N/A";
return String.Format("%s \cu/\c- %s \cu(\c-%3d%%\cu)",SWWMUtility.ThousandsNum(max(a,0)),SWWMUtility.ThousandsNum(b),GetPct(a,b));
return String.Format("%s \c[MiniIbukiHUD]/\c- %s \c[MiniIbukiHUD](\c-%3d%%\c[MiniIbukiHUD])",SWWMUtility.ThousandsNum(max(a,0)),SWWMUtility.ThousandsNum(b),GetPct(a,b));
}
private String TimeStr( int secs )
@ -105,8 +105,8 @@ Class SWWMStatScreen : StatusScreen
int h = secs/3600;
int m = (secs/60)%60;
int s = secs%60;
if ( h ) return String.Format("%02d\cu:\c-%02d\cu:\c-%02d",h,m,s);
return String.Format("%02d\cu:\c-%02d",m,s);
if ( h ) return String.Format("%02d\c[MiniIbukiHUD]:\c-%02d\c[MiniIbukiHUD]:\c-%02d",h,m,s);
return String.Format("%02d\c[MiniIbukiHUD]:\c-%02d",m,s);
}
private int GetPct( int a, int b )