Re-style level stats tab.

This commit is contained in:
Mari the Deer 2023-12-24 15:34:12 +01:00
commit 24f4b7ce65
2 changed files with 30 additions and 9 deletions

View file

@ -567,7 +567,7 @@ Class DemolitionistMenuMapStatItem : DemolitionistMenuListItem
Super.Init(master,"");
self.s = s;
self.width = width;
self.label = s.hub?s.levelname:String.Format("%s - %s",s.mapname.MakeUpper(),s.levelname);
self.label = s.levelname;
return self;
}
@ -628,13 +628,34 @@ Class DemolitionistMenuMapStatItem : DemolitionistMenuListItem
override void Drawer( Vector2 pos, bool selected )
{
String str = label;
if ( selected ) str = "\cd▸\c- "..str;
bool smallname = master.mSmallFont.StringWidth(str)>(width-(maxlen[3]+maxlen[2]+maxlen[1]+maxlen[0]+24));
Screen.DrawText(smallname?master.mTinyFont:master.mSmallFont,(selected||s.visited)?Font.CR_FIRE:Font.CR_DARKGRAY,master.origin.x+pos.x,master.origin.y+pos.y+smallname*2,str,DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true);
String str = s.mapname..": ";
if ( selected ) str = "\cd> \c-"..str;
int nlen = master.mTinyFont.StringWidth(str);
double xx = pos.x;
double yy = pos.y;
Screen.DrawText(master.mTinyFont,(selected||s.visited)?Font.CR_FIRE:Font.CR_DARKGRAY,master.origin.x+xx,master.origin.y+yy+2,str,DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true);
xx += nlen;
str = s.levelname;
if ( !s.visited && !selected ) SWWMUtility.ObscureText(str,(Menu.MenuTime()/3)+ypos*2);
bool smallname = (nlen+master.mSmallFont.StringWidth(str))>(width-(maxlen[3]+maxlen[2]+maxlen[1]+maxlen[0]+24));
bool allclear = true;
if ( selected )
{
if ( (level.total_secrets > 0) && (level.found_secrets < level.total_secrets) ) allclear = false;
if ( (level.total_items > 0) && (level.found_items < level.total_items) ) allclear = false;
if ( (level.total_monsters > 0) && (level.killed_monsters < level.total_monsters) ) allclear = false;
}
else if ( s.visited )
{
if ( (s.stotal > 0) && (s.scount < s.stotal) ) allclear = false;
if ( (s.itotal > 0) && (s.icount < s.itotal) ) allclear = false;
if ( (s.ktotal > 0) && (s.kcount < s.ktotal) ) allclear = false;
}
else allclear = false;
Screen.DrawText(smallname?master.mTinyFont:master.mSmallFont,(selected||s.visited)?allclear?Font.CR_GOLD:Font.CR_WHITE:Font.CR_BLACK,master.origin.x+xx,master.origin.y+yy+smallname*2,str,DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true);
if ( !selected && !s.visited ) return;
double xx = pos.x+width;
double yy = pos.y+2;
xx = pos.x+width;
yy = pos.y+2;
int time, par, suck, stotal, scount, itotal, icount, ktotal, kcount;
if ( selected )
{