Revert font system overhaul.
This commit is contained in:
parent
c3f57b41fa
commit
89042b7b49
39 changed files with 532 additions and 693 deletions
|
|
@ -67,6 +67,8 @@ Class DemolitionistMenu : GenericMenu
|
|||
Array<DemolitionistMenuTab> tabs;
|
||||
int curtab;
|
||||
int oldtab; // used for returning from help tab
|
||||
// fonts
|
||||
Font mSmallFont, mTinyFont;
|
||||
|
||||
int GenTUID()
|
||||
{
|
||||
|
|
@ -158,6 +160,8 @@ Class DemolitionistMenu : GenericMenu
|
|||
FrameTex = TexMan.CheckForTexture("graphics/KBase/FrameTex.png",TexMan.Type_MiscPatch);
|
||||
VSepTex = TexMan.CheckForTexture("graphics/KBase/VSepTex.png",TexMan.Type_MiscPatch);
|
||||
HSepTex = TexMan.CheckForTexture("graphics/KBase/HSepTex.png",TexMan.Type_MiscPatch);
|
||||
mSmallFont = Font.GetFont('TewiFont');
|
||||
mTinyFont = Font.GetFont('MiniwiFont');
|
||||
// note that we can assume 640x400 will always be the smallest resolution allowed by gzdoom, but we still need to handle widescreen
|
||||
hs = max(min(floor(Screen.GetWidth()/640.),floor(Screen.GetHeight()/266.)),1.);
|
||||
ss = (Screen.GetWidth(),Screen.GetHeight())/hs;
|
||||
|
|
@ -348,7 +352,7 @@ Class DemolitionistMenu : GenericMenu
|
|||
{
|
||||
if ( tabs[i].bHidden ) continue;
|
||||
str = tabs[i].title;
|
||||
len = smallfont.StringWidth(str)+10;
|
||||
len = mSmallFont.StringWidth(str)+10;
|
||||
if ( (mpos.x >= xx) && (mpos.x < xx+len) )
|
||||
{
|
||||
if ( curtab == i ) break;
|
||||
|
|
@ -521,23 +525,23 @@ Class DemolitionistMenu : GenericMenu
|
|||
{
|
||||
if ( tabs[i].bHidden ) continue;
|
||||
str = tabs[i].title;
|
||||
Screen.DrawText(smallfont,(curtab==i)?Font.CR_FIRE:Font.CR_DARKGRAY,origin.x+xx,origin.y+yy,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
xx += smallfont.StringWidth(str)+10;
|
||||
Screen.DrawText(mSmallFont,(curtab==i)?Font.CR_FIRE:Font.CR_DARKGRAY,origin.x+xx,origin.y+yy,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
xx += mSmallFont.StringWidth(str)+10;
|
||||
DrawVSeparator(xx-5,0,14);
|
||||
}
|
||||
// draw money
|
||||
xx = 637-smallfont.StringWidth(munstr);
|
||||
Screen.DrawText(smallfont,Font.CR_FIRE,origin.x+xx,origin.y+yy,munstr,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
xx = 637-mSmallFont.StringWidth(munstr);
|
||||
Screen.DrawText(mSmallFont,Font.CR_FIRE,origin.x+xx,origin.y+yy,munstr,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
yy = ws.y-13;
|
||||
// draw clock / messages
|
||||
if ( gametic < tmsgtic ) str = tmsg;
|
||||
else str = clockstr;
|
||||
xx = 4;
|
||||
Screen.DrawText(smallfont,Font.CR_WHITE,origin.x+xx,origin.y+yy,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
Screen.DrawText(mSmallFont,Font.CR_WHITE,origin.x+xx,origin.y+yy,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
// draw os version
|
||||
str = "DemolitionOS v1.0";
|
||||
xx = 637-smallfont.StringWidth(str);
|
||||
Screen.DrawText(smallfont,Font.CR_WHITE,origin.x+xx,origin.y+yy,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
xx = 637-mSmallFont.StringWidth(str);
|
||||
Screen.DrawText(mSmallFont,Font.CR_WHITE,origin.x+xx,origin.y+yy,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
// draw tab contents
|
||||
if ( (tabs.Size() <= 0) || (curtab == -1) || !tabs[curtab] ) return;
|
||||
tabs[curtab].Drawer();
|
||||
|
|
|
|||
|
|
@ -71,12 +71,12 @@ Class DemolitionistMenuListItem ui
|
|||
|
||||
virtual int GetWidth()
|
||||
{
|
||||
return smallfont.StringWidth(label);
|
||||
return master.mSmallFont.StringWidth(label);
|
||||
}
|
||||
|
||||
virtual int GetHeight()
|
||||
{
|
||||
return smallfont.GetHeight();
|
||||
return master.mSmallFont.GetHeight();
|
||||
}
|
||||
|
||||
virtual Vector2 GetDrawBounds()
|
||||
|
|
@ -102,6 +102,6 @@ Class DemolitionistMenuListItem ui
|
|||
|
||||
virtual void Drawer( Vector2 pos, bool selected, int cliptop, int clipbottom, int clipleft, int clipright )
|
||||
{
|
||||
Screen.DrawText(smallfont,selected?Font.CR_FIRE:Font.CR_WHITE,master.origin.x+pos.x,master.origin.y+pos.y,label,DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright);
|
||||
Screen.DrawText(master.mSmallFont,selected?Font.CR_FIRE:Font.CR_WHITE,master.origin.x+pos.x,master.origin.y+pos.y,label,DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -43,9 +43,9 @@ Class DemolitionistMenuTab ui abstract
|
|||
{
|
||||
// placeholder (so don't call super)
|
||||
String str = StringTable.Localize("$SWWM_COMINGSOON");
|
||||
double xx = int(master.ws.x-smallfont.StringWidth(str))/2;
|
||||
double yy = int(master.ws.y-smallfont.GetHeight())/2;
|
||||
Screen.DrawText(smallfont,Font.CR_FIRE,master.origin.x+xx,master.origin.y+yy,str,DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true);
|
||||
double xx = int(master.ws.x-master.mSmallFont.StringWidth(str))/2;
|
||||
double yy = int(master.ws.y-master.mSmallFont.GetHeight())/2;
|
||||
Screen.DrawText(master.mSmallFont,Font.CR_FIRE,master.origin.x+xx,master.origin.y+yy,str,DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -22,12 +22,12 @@ Class DemolitionistMenuTextBox ui
|
|||
else self.txt = txt;
|
||||
ofs = 0;
|
||||
// break lines
|
||||
l = smallfont.BreakLines(self.txt,self.w-12);
|
||||
l = master.mSmallFont.BreakLines(self.txt,self.w-12);
|
||||
int h = l.Count()*13;
|
||||
if ( h > (master.ws.y-34) )
|
||||
{
|
||||
l.Destroy();
|
||||
l = smallfont.BreakLines(self.txt,self.w-20);
|
||||
l = master.mSmallFont.BreakLines(self.txt,self.w-20);
|
||||
scrollbar = true;
|
||||
maxofs = int((l.Count()*13)-(master.ws.y-34));
|
||||
}
|
||||
|
|
@ -45,14 +45,14 @@ Class DemolitionistMenuTextBox ui
|
|||
// break lines again (if changed)
|
||||
if ( (self.w == oldw) && (self.txt == oldtxt) ) return;
|
||||
if ( l ) l.Destroy();
|
||||
l = smallfont.BreakLines(self.txt,self.w-12);
|
||||
l = master.mSmallFont.BreakLines(self.txt,self.w-12);
|
||||
int h = l.Count()*13;
|
||||
scrollbar = false;
|
||||
maxofs = 0;
|
||||
if ( h > (master.ws.y-34) )
|
||||
{
|
||||
l.Destroy();
|
||||
l = smallfont.BreakLines(self.txt,self.w-20);
|
||||
l = master.mSmallFont.BreakLines(self.txt,self.w-20);
|
||||
scrollbar = true;
|
||||
maxofs = int((l.Count()*13)-(master.ws.y-34));
|
||||
}
|
||||
|
|
@ -111,13 +111,13 @@ Class DemolitionistMenuTextBox ui
|
|||
// to save time, we skip lines that aren't visible
|
||||
if ( yy < 4 ) continue;
|
||||
if ( yy >= master.ws.y-19 ) continue;
|
||||
Screen.DrawText(smallfont,Font.CR_WHITE,master.origin.x+xx,master.origin.y+yy,l.StringAt(i),DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true,DTA_ColorOverlay,dark?Color(96,0,0,0):Color(0,0,0,0),DTA_ClipTop,miny,DTA_ClipBottom,maxy);
|
||||
Screen.DrawText(master.mSmallFont,Font.CR_WHITE,master.origin.x+xx,master.origin.y+yy,l.StringAt(i),DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true,DTA_ColorOverlay,dark?Color(96,0,0,0):Color(0,0,0,0),DTA_ClipTop,miny,DTA_ClipBottom,maxy);
|
||||
}
|
||||
if ( !scrollbar ) return;
|
||||
xx = x+(w-8);
|
||||
master.DrawVSeparator(xx,14,master.ws.y-28);
|
||||
xx += 2;
|
||||
yy = floor(smofs*((master.ws.y-39)/maxofs))+14;
|
||||
Screen.DrawText(smallfont,Font.CR_FIRE,master.origin.x+xx,master.origin.y+yy,"▮",DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true);
|
||||
Screen.DrawText(master.mSmallFont,Font.CR_FIRE,master.origin.x+xx,master.origin.y+yy,"▮",DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -142,9 +142,9 @@ Class DemolitionistChatTab : DemolitionistMenuTab
|
|||
if ( !hist || (msglist.items.Size() <= 0) )
|
||||
{
|
||||
String str = StringTable.Localize("$SWWM_NOCHAT");
|
||||
double xx = int(master.ws.x-smallfont.StringWidth(str))/2;
|
||||
double yy = int(master.ws.y-smallfont.GetHeight())/2;
|
||||
Screen.DrawText(smallfont,Font.CR_FIRE,master.origin.x+xx,master.origin.y+yy,str,DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true);
|
||||
double xx = int(master.ws.x-master.mSmallFont.StringWidth(str))/2;
|
||||
double yy = int(master.ws.y-master.mSmallFont.GetHeight())/2;
|
||||
Screen.DrawText(master.mSmallFont,Font.CR_FIRE,master.origin.x+xx,master.origin.y+yy,str,DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true);
|
||||
return;
|
||||
}
|
||||
double xx = 3;
|
||||
|
|
@ -159,7 +159,7 @@ Class DemolitionistChatTab : DemolitionistMenuTab
|
|||
master.DrawVSeparator(xx,14,master.ws.y-28);
|
||||
xx += 2;
|
||||
yy = floor(smofs*((master.ws.y-39)/maxofs))+14;
|
||||
Screen.DrawText(smallfont,Font.CR_FIRE,master.origin.x+xx,master.origin.y+yy,"▮",DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true);
|
||||
Screen.DrawText(master.mSmallFont,Font.CR_FIRE,master.origin.x+xx,master.origin.y+yy,"▮",DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -185,8 +185,8 @@ Class DemolitionistMenuChatItem : DemolitionistMenuListItem
|
|||
int tmin = (rtime/60)%60;
|
||||
int tsec = rtime%60;
|
||||
tstamp = String.Format("\cm[\c-%02d\cm:\c-%02d\cm:\c-%02d\cm]\c- ",thour,tmin,tsec);
|
||||
margin = smallfont.StringWidth(tstamp);
|
||||
l = smallfont.BreakLines(m.str,int(master.ws.x-14)-margin);
|
||||
margin = master.mSmallFont.StringWidth(tstamp);
|
||||
l = master.mSmallFont.BreakLines(m.str,int(master.ws.x-14)-margin);
|
||||
return self;
|
||||
}
|
||||
|
||||
|
|
@ -212,12 +212,12 @@ Class DemolitionistMenuChatItem : DemolitionistMenuListItem
|
|||
if ( !l )
|
||||
{
|
||||
// we'll assume this is a level change label
|
||||
double xx = int((master.ws.x-14)-smallfont.StringWidth(label))/2;
|
||||
Screen.DrawText(smallfont,Font.CR_GOLD,master.origin.x+pos.x+xx,master.origin.y+pos.y,label,DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright);
|
||||
double xx = int((master.ws.x-14)-master.mSmallFont.StringWidth(label))/2;
|
||||
Screen.DrawText(master.mSmallFont,Font.CR_GOLD,master.origin.x+pos.x+xx,master.origin.y+pos.y,label,DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright);
|
||||
return;
|
||||
}
|
||||
Screen.DrawText(smallfont,Font.CR_DARKGRAY,master.origin.x+pos.x,master.origin.y+pos.y,tstamp,DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright);
|
||||
Screen.DrawText(master.mSmallFont,Font.CR_DARKGRAY,master.origin.x+pos.x,master.origin.y+pos.y,tstamp,DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright);
|
||||
for ( int i=0; i<l.Count(); i++ )
|
||||
Screen.DrawText(smallfont,Font.CR_WHITE,master.origin.x+pos.x+margin,master.origin.y+pos.y+i*14,l.StringAt(i),DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright);
|
||||
Screen.DrawText(master.mSmallFont,Font.CR_WHITE,master.origin.x+pos.x+margin,master.origin.y+pos.y+i*14,l.StringAt(i),DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -454,9 +454,9 @@ Class DemolitionistInventoryTab : DemolitionistMenuTab
|
|||
if ( !invlist || (invlist.items.Size() <= 0) )
|
||||
{
|
||||
String str = StringTable.Localize("$SWWM_NOINV");
|
||||
double xx = int(master.ws.x-smallfont.StringWidth(str))/2;
|
||||
double yy = int(master.ws.y-smallfont.GetHeight())/2;
|
||||
Screen.DrawText(smallfont,Font.CR_FIRE,master.origin.x+xx,master.origin.y+yy,str,DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true);
|
||||
double xx = int(master.ws.x-master.mSmallFont.StringWidth(str))/2;
|
||||
double yy = int(master.ws.y-master.mSmallFont.GetHeight())/2;
|
||||
Screen.DrawText(master.mSmallFont,Font.CR_FIRE,master.origin.x+xx,master.origin.y+yy,str,DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true);
|
||||
return;
|
||||
}
|
||||
double xx = 9;
|
||||
|
|
@ -471,7 +471,7 @@ Class DemolitionistInventoryTab : DemolitionistMenuTab
|
|||
master.DrawHSeparator(0,yy,master.ws.x);
|
||||
yy -= 4;
|
||||
xx = floor(smofs*((master.ws.x-10)/maxofs))+2;
|
||||
Screen.DrawText(smallfont,Font.CR_FIRE,master.origin.x+xx,master.origin.y+yy,"▬",DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true);
|
||||
Screen.DrawText(master.mSmallFont,Font.CR_FIRE,master.origin.x+xx,master.origin.y+yy,"▬",DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -521,7 +521,7 @@ Class DemolitionistMenuInvItem : DemolitionistMenuListItem
|
|||
override void Drawer( Vector2 pos, bool selected, int cliptop, int clipbottom, int clipleft, int clipright )
|
||||
{
|
||||
// the simplest drawer
|
||||
Screen.DrawText(smallfont,col,master.origin.x+pos.x,master.origin.y+pos.y,label,DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright,DTA_ColorOverlay,selected?Color(0,0,0,0):Color(96,0,0,0));
|
||||
Screen.DrawText(master.mSmallFont,col,master.origin.x+pos.x,master.origin.y+pos.y,label,DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright,DTA_ColorOverlay,selected?Color(0,0,0,0):Color(96,0,0,0));
|
||||
}
|
||||
|
||||
void UseItem()
|
||||
|
|
|
|||
|
|
@ -297,9 +297,9 @@ Class DemolitionistKeychainTab : DemolitionistMenuTab
|
|||
if ( !invlist || (invlist.items.Size() <= 0) )
|
||||
{
|
||||
String str = StringTable.Localize("$SWWM_NOKEYS");
|
||||
double xx = int(master.ws.x-smallfont.StringWidth(str))/2;
|
||||
double yy = int(master.ws.y-smallfont.GetHeight())/2;
|
||||
Screen.DrawText(smallfont,Font.CR_FIRE,master.origin.x+xx,master.origin.y+yy,str,DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true);
|
||||
double xx = int(master.ws.x-master.mSmallFont.StringWidth(str))/2;
|
||||
double yy = int(master.ws.y-master.mSmallFont.GetHeight())/2;
|
||||
Screen.DrawText(master.mSmallFont,Font.CR_FIRE,master.origin.x+xx,master.origin.y+yy,str,DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true);
|
||||
return;
|
||||
}
|
||||
double xx = 9;
|
||||
|
|
@ -314,6 +314,6 @@ Class DemolitionistKeychainTab : DemolitionistMenuTab
|
|||
master.DrawHSeparator(0,yy,master.ws.x);
|
||||
yy -= 4;
|
||||
xx = floor(smofs*((master.ws.x-10)/maxofs))+2;
|
||||
Screen.DrawText(smallfont,Font.CR_FIRE,master.origin.x+xx,master.origin.y+yy,"▬",DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true);
|
||||
Screen.DrawText(master.mSmallFont,Font.CR_FIRE,master.origin.x+xx,master.origin.y+yy,"▬",DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ Class DemolitionistLibraryTab : DemolitionistMenuTab
|
|||
for ( int i=0; i<4; i++ )
|
||||
{
|
||||
sname[i] = StringTable.Localize("$SWWM_LORETAB"..i);
|
||||
lwidth = max(lwidth,smallfont.StringWidth("<‼ "..sname[i].." ‼>")+6);
|
||||
lwidth = max(lwidth,master.mSmallFont.StringWidth("<‼ "..sname[i].." ‼>")+6);
|
||||
lists[i] = new("DemolitionistMenuList");
|
||||
lists[i].master = master;
|
||||
}
|
||||
|
|
@ -62,7 +62,7 @@ Class DemolitionistLibraryTab : DemolitionistMenuTab
|
|||
let ent = lore.ent[i];
|
||||
let le = new("DemolitionistMenuLoreItem").Init(master,ent);
|
||||
lists[ent.tab].items.Push(le);
|
||||
lwidth = max(lwidth,smallfont.StringWidth("‼"..le.label)+6);
|
||||
lwidth = max(lwidth,master.mSmallFont.StringWidth("‼"..le.label)+6);
|
||||
}
|
||||
for ( int i=0; i<4; i++ )
|
||||
{
|
||||
|
|
@ -105,7 +105,7 @@ Class DemolitionistLibraryTab : DemolitionistMenuTab
|
|||
let ent = lore.ent[i];
|
||||
let le = new("DemolitionistMenuLoreItem").Init(master,ent);
|
||||
lists[ent.tab].items.Push(le);
|
||||
lwidth = max(lwidth,smallfont.StringWidth("‼"..le.label)+6);
|
||||
lwidth = max(lwidth,master.mSmallFont.StringWidth("‼"..le.label)+6);
|
||||
}
|
||||
// re-sort the lists, ensuring we are still selecting the same entry
|
||||
for ( int i=0; i<4; i++ )
|
||||
|
|
@ -359,7 +359,7 @@ Class DemolitionistLibraryTab : DemolitionistMenuTab
|
|||
String str = sname[section];
|
||||
master.DrawVSeparator(lwidth,14,master.ws.y-28);
|
||||
master.DrawHSeparator(0,28,lwidth);
|
||||
Screen.DrawText(smallfont,Font.CR_FIRE,master.origin.x+(lwidth-smallfont.StringWidth(str))/2,master.origin.y+yy,str,DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true);
|
||||
Screen.DrawText(master.mSmallFont,Font.CR_FIRE,master.origin.x+(lwidth-master.mSmallFont.StringWidth(str))/2,master.origin.y+yy,str,DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true);
|
||||
bool hasprev = false;
|
||||
bool hasunreadprev = false;
|
||||
for ( int i=0; i<section; i++ )
|
||||
|
|
@ -389,13 +389,13 @@ Class DemolitionistLibraryTab : DemolitionistMenuTab
|
|||
}
|
||||
}
|
||||
if ( hasprev )
|
||||
Screen.DrawText(smallfont,Font.CR_WHITE,master.origin.x+3,master.origin.y+yy,"<",DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true);
|
||||
Screen.DrawText(master.mSmallFont,Font.CR_WHITE,master.origin.x+3,master.origin.y+yy,"<",DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true);
|
||||
if ( hasunreadprev )
|
||||
Screen.DrawText(smallfont,Font.CR_GOLD,master.origin.x+9,master.origin.y+yy,"‼",DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true);
|
||||
Screen.DrawText(master.mSmallFont,Font.CR_GOLD,master.origin.x+9,master.origin.y+yy,"‼",DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true);
|
||||
if ( hasnext )
|
||||
Screen.DrawText(smallfont,Font.CR_WHITE,master.origin.x+lwidth-9,master.origin.y+yy,">",DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true);
|
||||
Screen.DrawText(master.mSmallFont,Font.CR_WHITE,master.origin.x+lwidth-9,master.origin.y+yy,">",DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true);
|
||||
if ( hasunreadnext )
|
||||
Screen.DrawText(smallfont,Font.CR_GOLD,master.origin.x+lwidth-15,master.origin.y+yy,"‼",DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true);
|
||||
Screen.DrawText(master.mSmallFont,Font.CR_GOLD,master.origin.x+lwidth-15,master.origin.y+yy,"‼",DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true);
|
||||
xx = 3;
|
||||
yy = 32;
|
||||
int cliptop = int((master.origin.y+32)*master.hs);
|
||||
|
|
@ -409,16 +409,16 @@ Class DemolitionistLibraryTab : DemolitionistMenuTab
|
|||
master.DrawVSeparator(xx+8,14,master.ws.y-28);
|
||||
xx += 2;
|
||||
yy = floor(smofs[section]*((master.ws.y-39)/maxofs[section]))+14;
|
||||
Screen.DrawText(smallfont,Font.CR_FIRE,master.origin.x+xx,master.origin.y+yy,"▮",DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true);
|
||||
Screen.DrawText(master.mSmallFont,Font.CR_FIRE,master.origin.x+xx,master.origin.y+yy,"▮",DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true);
|
||||
}
|
||||
if ( clore && ltext ) ltext.Drawer();
|
||||
else
|
||||
{
|
||||
str = StringTable.Localize("$SWWM_LOREUNSEL");
|
||||
int lwx = lwidth+((maxofs[section]>0)?8:0);
|
||||
xx = lwx+int((master.ws.x-lwx)-smallfont.StringWidth(str))/2;
|
||||
yy = int(master.ws.y-smallfont.GetHeight())/2;
|
||||
Screen.DrawText(smallfont,Font.CR_FIRE,master.origin.x+xx,master.origin.y+yy,str,DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true);
|
||||
xx = lwx+int((master.ws.x-lwx)-master.mSmallFont.StringWidth(str))/2;
|
||||
yy = int(master.ws.y-master.mSmallFont.GetHeight())/2;
|
||||
Screen.DrawText(master.mSmallFont,Font.CR_FIRE,master.origin.x+xx,master.origin.y+yy,str,DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -439,8 +439,8 @@ Class DemolitionistMenuLoreItem : DemolitionistMenuListItem
|
|||
|
||||
override int GetWidth()
|
||||
{
|
||||
if ( !ent.read ) return smallfont.StringWidth("‼"..label);
|
||||
return smallfont.StringWidth(label);
|
||||
if ( !ent.read ) return master.mSmallFont.StringWidth("‼"..label);
|
||||
return master.mSmallFont.StringWidth(label);
|
||||
}
|
||||
|
||||
// marks this entry as read
|
||||
|
|
@ -454,6 +454,6 @@ Class DemolitionistMenuLoreItem : DemolitionistMenuListItem
|
|||
{
|
||||
String str = label;
|
||||
if ( !ent.read ) str = "\cf‼\c-"..label;
|
||||
Screen.DrawText(smallfont,bActive?Font.CR_FIRE:Font.CR_WHITE,master.origin.x+pos.x,master.origin.y+pos.y,str,DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright,DTA_ColorOverlay,selected?Color(0,0,0,0):Color(96,0,0,0));
|
||||
Screen.DrawText(master.mSmallFont,bActive?Font.CR_FIRE:Font.CR_WHITE,master.origin.x+pos.x,master.origin.y+pos.y,str,DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright,DTA_ColorOverlay,selected?Color(0,0,0,0):Color(96,0,0,0));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -277,16 +277,16 @@ Class DemolitionistMissionTab : DemolitionistMenuTab
|
|||
else
|
||||
{
|
||||
String str = StringTable.Localize("$SWWM_MISSION_NONE");
|
||||
double xx = int(master.ws.x-smallfont.StringWidth(str))/2;
|
||||
double yy = int(master.ws.y-smallfont.GetHeight())/2;
|
||||
Screen.DrawText(smallfont,Font.CR_FIRE,master.origin.x+xx,master.origin.y+yy,str,DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true);
|
||||
double xx = int(master.ws.x-master.mSmallFont.StringWidth(str))/2;
|
||||
double yy = int(master.ws.y-master.mSmallFont.GetHeight())/2;
|
||||
Screen.DrawText(master.mSmallFont,Font.CR_FIRE,master.origin.x+xx,master.origin.y+yy,str,DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true);
|
||||
return;
|
||||
}
|
||||
if ( mtext.Size() <= 1 ) return;
|
||||
double xx = master.ws.x-(mtext[sel].scrollbar?11:3);
|
||||
double yy = master.ws.y-25;
|
||||
String str = String.Format("%d \cf/\c- %d",sel+1,mtext.Size());
|
||||
Screen.DrawText(smallfont2,Font.CR_FIRE,(master.origin.x+xx)-smallfont2.StringWidth(str),master.origin.y+yy,str,DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true);
|
||||
Screen.DrawText(master.mTinyFont,Font.CR_FIRE,(master.origin.x+xx)-master.mTinyFont.StringWidth(str),master.origin.y+yy,str,DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ Class DemolitionistSecretTab : DemolitionistMenuTab
|
|||
img = TexMan.CheckForTexture("graphics/KBase/Drawing_Kirin.png",TexMan.Type_Any);
|
||||
sub = StringTable.Localize("$SWWM_FROMKIRIN");
|
||||
String str = StringTable.Localize("$SWWM_KIRINPOEM");
|
||||
l = smallfont.BreakLines(str,600);
|
||||
l = master.mSmallFont.BreakLines(str,600);
|
||||
}
|
||||
else if ( (gameinfo.gametype&GAME_Heretic) || SWWMUtility.IsEviternity() )
|
||||
{
|
||||
|
|
@ -134,16 +134,16 @@ Class DemolitionistSecretTab : DemolitionistMenuTab
|
|||
{
|
||||
if ( l.StringWidth(i) > mxlen ) mxlen = l.StringWidth(i);
|
||||
xx = (i<l.Count()-1)?350:(350+mxlen-l.StringWidth(i));
|
||||
Screen.DrawText(smallfont,Font.CR_GOLD,master.origin.x+xx,master.origin.y+yy+4+i*14,l.StringAt(i),DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true,DTA_ClipTop,miny,DTA_ClipBottom,maxy);
|
||||
Screen.DrawText(master.mSmallFont,Font.CR_GOLD,master.origin.x+xx,master.origin.y+yy+4+i*14,l.StringAt(i),DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true,DTA_ClipTop,miny,DTA_ClipBottom,maxy);
|
||||
}
|
||||
yy += 306;
|
||||
xx = int(master.ws.x-smallfont.StringWidth(sub))/2;
|
||||
Screen.DrawText(smallfont,Font.CR_WHITE,master.origin.x+xx,master.origin.y+yy,sub,DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true,DTA_ClipTop,miny,DTA_ClipBottom,maxy);
|
||||
xx = int(master.ws.x-master.mSmallFont.StringWidth(sub))/2;
|
||||
Screen.DrawText(master.mSmallFont,Font.CR_WHITE,master.origin.x+xx,master.origin.y+yy,sub,DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true,DTA_ClipTop,miny,DTA_ClipBottom,maxy);
|
||||
if ( maxofs <= 0 ) return;
|
||||
xx = master.ws.x-8;
|
||||
master.DrawVSeparator(xx,14,master.ws.y-28);
|
||||
xx += 2;
|
||||
yy = floor(smofs*((master.ws.y-39)/maxofs))+14;
|
||||
Screen.DrawText(smallfont,Font.CR_FIRE,master.origin.x+xx,master.origin.y+yy,"▮",DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true);
|
||||
Screen.DrawText(master.mSmallFont,Font.CR_FIRE,master.origin.x+xx,master.origin.y+yy,"▮",DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ Class DemolitionistStatsTab : DemolitionistMenuTab
|
|||
for ( int i=0; i<4; i++ )
|
||||
{
|
||||
sname[i] = StringTable.Localize("$SWWM_STATTAB"..i);
|
||||
lwidth = max(lwidth,smallfont.StringWidth(sname[i]));
|
||||
lwidth = max(lwidth,master.mSmallFont.StringWidth(sname[i]));
|
||||
lists[i] = new("DemolitionistMenuList");
|
||||
lists[i].master = master;
|
||||
lists[i].selected = -1;
|
||||
|
|
@ -360,24 +360,24 @@ Class DemolitionistStatsTab : DemolitionistMenuTab
|
|||
// and calculate "max lengths"
|
||||
int sec = Thinker.Tics2Seconds(l.s.time);
|
||||
str = String.Format("T %02d:%02d:%02d",sec/3600,(sec%3600)/60,sec%60);
|
||||
len[0] = smallfont2.StringWidth(str);
|
||||
len[0] = master.mTinyFont.StringWidth(str);
|
||||
if ( len[0] > maxlen[0] ) maxlen[0] = len[0];
|
||||
if ( l.s.stotal > 0 )
|
||||
{
|
||||
str = String.Format("S %d/%d",l.s.scount,l.s.stotal);
|
||||
len[1] = smallfont2.StringWidth(str);
|
||||
len[1] = master.mTinyFont.StringWidth(str);
|
||||
if ( len[1] > maxlen[1] ) maxlen[1] = len[1];
|
||||
}
|
||||
if ( l.s.itotal > 0 )
|
||||
{
|
||||
str = String.Format("I %d/%d",l.s.icount,l.s.itotal);
|
||||
len[2] = smallfont2.StringWidth(str);
|
||||
len[2] = master.mTinyFont.StringWidth(str);
|
||||
if ( len[2] > maxlen[2] ) maxlen[2] = len[2];
|
||||
}
|
||||
if ( l.s.ktotal > 0 )
|
||||
{
|
||||
str = String.Format("K %d/%d",l.s.kcount,l.s.ktotal);
|
||||
len[3] = smallfont2.StringWidth(str);
|
||||
len[3] = master.mTinyFont.StringWidth(str);
|
||||
if ( len[3] > maxlen[3] ) maxlen[3] = len[3];
|
||||
}
|
||||
}
|
||||
|
|
@ -493,7 +493,7 @@ Class DemolitionistStatsTab : DemolitionistMenuTab
|
|||
for ( int i=0; i<4; i++ )
|
||||
{
|
||||
if ( pos.x < 9 ) continue;
|
||||
if ( pos.x > 9+smallfont.StringWidth(sname[i]) ) continue;
|
||||
if ( pos.x > 9+master.mSmallFont.StringWidth(sname[i]) ) continue;
|
||||
if ( pos.y < 23+16*i ) continue;
|
||||
if ( pos.y > 36+16*i ) continue;
|
||||
if ( section != i )
|
||||
|
|
@ -541,16 +541,16 @@ Class DemolitionistStatsTab : DemolitionistMenuTab
|
|||
double yy = 23;
|
||||
for ( int i=0; i<4; i++ )
|
||||
{
|
||||
Screen.DrawText(smallfont,(i==section)?Font.CR_FIRE:Font.CR_WHITE,master.origin.x+xx,master.origin.y+yy,sname[i],DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true);
|
||||
Screen.DrawText(master.mSmallFont,(i==section)?Font.CR_FIRE:Font.CR_WHITE,master.origin.x+xx,master.origin.y+yy,sname[i],DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true);
|
||||
yy += 16;
|
||||
}
|
||||
master.DrawVSeparator(lwidth,14,master.ws.y-28);
|
||||
if ( lists[section].items.Size() == 0 )
|
||||
{
|
||||
String str = StringTable.Localize("$SWWM_NOSTAT");
|
||||
xx = lwidth+int((master.ws.x-lwidth)-smallfont.StringWidth(str))/2;
|
||||
yy = int(master.ws.y-smallfont.GetHeight())/2;
|
||||
Screen.DrawText(smallfont,Font.CR_FIRE,master.origin.x+xx,master.origin.y+yy,str,DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true);
|
||||
xx = lwidth+int((master.ws.x-lwidth)-master.mSmallFont.StringWidth(str))/2;
|
||||
yy = int(master.ws.y-master.mSmallFont.GetHeight())/2;
|
||||
Screen.DrawText(master.mSmallFont,Font.CR_FIRE,master.origin.x+xx,master.origin.y+yy,str,DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true);
|
||||
return;
|
||||
}
|
||||
if ( section == 3 )
|
||||
|
|
@ -580,7 +580,7 @@ Class DemolitionistStatsTab : DemolitionistMenuTab
|
|||
master.DrawVSeparator(xx,14,master.ws.y-28);
|
||||
xx += 2;
|
||||
yy = floor(smofs[section]*((master.ws.y-39)/maxofs[section]))+14;
|
||||
Screen.DrawText(smallfont,Font.CR_FIRE,master.origin.x+xx,master.origin.y+yy,"▮",DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true);
|
||||
Screen.DrawText(master.mSmallFont,Font.CR_FIRE,master.origin.x+xx,master.origin.y+yy,"▮",DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -613,9 +613,9 @@ Class DemolitionistMenuKillItem : DemolitionistMenuListItem
|
|||
|
||||
override void Drawer( Vector2 pos, bool selected, int cliptop, int clipbottom, int clipleft, int clipright )
|
||||
{
|
||||
Screen.DrawText(smallfont,Font.CR_FIRE,master.origin.x+pos.x,master.origin.y+pos.y,label,DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright);
|
||||
Screen.DrawText(master.mSmallFont,Font.CR_FIRE,master.origin.x+pos.x,master.origin.y+pos.y,label,DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright);
|
||||
String str = String.Format("%d",s.kills);
|
||||
Screen.DrawText(smallfont,Font.CR_WHITE,master.origin.x+pos.x+width-smallfont.StringWidth(str),master.origin.y+pos.y,str,DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright);
|
||||
Screen.DrawText(master.mSmallFont,Font.CR_WHITE,master.origin.x+pos.x+width-master.mSmallFont.StringWidth(str),master.origin.y+pos.y,str,DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -644,34 +644,34 @@ Class DemolitionistMenuMapStatItem : DemolitionistMenuListItem
|
|||
{
|
||||
String str = label;
|
||||
if ( selected ) str = "\cd▸\c- "..str;
|
||||
bool smallname = smallfont.StringWidth(str)>(width-(maxlen[3]+maxlen[2]+maxlen[1]+maxlen[0]+24));
|
||||
Screen.DrawText(smallname?smallfont2:smallfont,Font.CR_FIRE,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,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright);
|
||||
bool smallname = master.mSmallFont.StringWidth(str)>(width-(maxlen[3]+maxlen[2]+maxlen[1]+maxlen[0]+24));
|
||||
Screen.DrawText(smallname?master.mTinyFont:master.mSmallFont,Font.CR_FIRE,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,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright);
|
||||
double xx = pos.x+width;
|
||||
double yy = pos.y+2;
|
||||
int sec = Thinker.Tics2Seconds(s.time);
|
||||
str = String.Format("%02d\cu:\c-%02d\cu:\c-%02d",sec/3600,(sec%3600)/60,sec%60);
|
||||
Screen.DrawText(smallfont2,((s.suck>0)&&(sec>=(s.suck*3600)))?Font.CR_RED:(sec<=s.par)?Font.CR_GOLD:Font.CR_WHITE,master.origin.x+xx-smallfont2.StringWidth(str),master.origin.y+yy,str,DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright);
|
||||
Screen.DrawText(smallfont2,Font.CR_FIRE,master.origin.x+xx-maxlen[0],master.origin.y+yy,"T",DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright);
|
||||
Screen.DrawText(master.mTinyFont,((s.suck>0)&&(sec>=(s.suck*3600)))?Font.CR_RED:(sec<=s.par)?Font.CR_GOLD:Font.CR_WHITE,master.origin.x+xx-master.mTinyFont.StringWidth(str),master.origin.y+yy,str,DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright);
|
||||
Screen.DrawText(master.mTinyFont,Font.CR_FIRE,master.origin.x+xx-maxlen[0],master.origin.y+yy,"T",DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright);
|
||||
if ( maxlen[0] > 0 ) xx -= maxlen[0]+8;
|
||||
if ( s.stotal > 0 )
|
||||
{
|
||||
str = String.Format("%d\cu/\c-%d",s.scount,s.stotal);
|
||||
Screen.DrawText(smallfont2,(s.scount>=s.stotal)?Font.CR_GOLD:Font.CR_WHITE,master.origin.x+xx-smallfont2.StringWidth(str),master.origin.y+yy,str,DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright);
|
||||
Screen.DrawText(smallfont2,Font.CR_FIRE,master.origin.x+xx-maxlen[1],master.origin.y+yy,"S",DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright);
|
||||
Screen.DrawText(master.mTinyFont,(s.scount>=s.stotal)?Font.CR_GOLD:Font.CR_WHITE,master.origin.x+xx-master.mTinyFont.StringWidth(str),master.origin.y+yy,str,DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright);
|
||||
Screen.DrawText(master.mTinyFont,Font.CR_FIRE,master.origin.x+xx-maxlen[1],master.origin.y+yy,"S",DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright);
|
||||
}
|
||||
if ( maxlen[1] > 0 ) xx -= maxlen[1]+8;
|
||||
if ( s.itotal > 0 )
|
||||
{
|
||||
str = String.Format("%d\cu/\c-%d",s.icount,s.itotal);
|
||||
Screen.DrawText(smallfont2,(s.icount>=s.itotal)?Font.CR_GOLD:Font.CR_WHITE,master.origin.x+xx-smallfont2.StringWidth(str),master.origin.y+yy,str,DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright);
|
||||
Screen.DrawText(smallfont2,Font.CR_FIRE,master.origin.x+xx-maxlen[2],master.origin.y+yy,"I",DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright);
|
||||
Screen.DrawText(master.mTinyFont,(s.icount>=s.itotal)?Font.CR_GOLD:Font.CR_WHITE,master.origin.x+xx-master.mTinyFont.StringWidth(str),master.origin.y+yy,str,DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright);
|
||||
Screen.DrawText(master.mTinyFont,Font.CR_FIRE,master.origin.x+xx-maxlen[2],master.origin.y+yy,"I",DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright);
|
||||
}
|
||||
if ( maxlen[2] > 0 ) xx -= maxlen[2]+8;
|
||||
if ( s.ktotal > 0 )
|
||||
{
|
||||
str = String.Format("%d\cu/\c-%d",s.kcount,s.ktotal);
|
||||
Screen.DrawText(smallfont2,(s.kcount>=s.ktotal)?Font.CR_GOLD:Font.CR_WHITE,master.origin.x+xx-smallfont2.StringWidth(str),master.origin.y+yy,str,DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright);
|
||||
Screen.DrawText(smallfont2,Font.CR_FIRE,master.origin.x+xx-maxlen[3],master.origin.y+yy,"K",DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright);
|
||||
Screen.DrawText(master.mTinyFont,(s.kcount>=s.ktotal)?Font.CR_GOLD:Font.CR_WHITE,master.origin.x+xx-master.mTinyFont.StringWidth(str),master.origin.y+yy,str,DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright);
|
||||
Screen.DrawText(master.mTinyFont,Font.CR_FIRE,master.origin.x+xx-maxlen[3],master.origin.y+yy,"K",DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -743,26 +743,26 @@ Class DemolitionistMenuAchievementItem : DemolitionistMenuListItem
|
|||
Screen.DrawTexture(BarTex[completed?2:1],false,xx,yy+35,DTA_DestWidthF,width*(val/double(a.maxval)),DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright);
|
||||
if ( completed ) str = String.Format("%s / %s",SWWMUtility.ThousandsNum(a.maxval),SWWMUtility.ThousandsNum(a.maxval));
|
||||
else str = String.Format("%s / %s",SWWMUtility.ThousandsNum(val),SWWMUtility.ThousandsNum(a.maxval));
|
||||
int ox = (width-smallfont2.StringWidth(str))/2;
|
||||
Screen.DrawText(smallfont2,completed?Font.CR_GREEN:Font.CR_WHITE,xx+ox,yy+37,str,DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright);
|
||||
int ox = (width-master.mTinyFont.StringWidth(str))/2;
|
||||
Screen.DrawText(master.mTinyFont,completed?Font.CR_GREEN:Font.CR_WHITE,xx+ox,yy+37,str,DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright);
|
||||
}
|
||||
else Screen.DrawTexture(BarTex[completed?2:0],false,xx,yy+35,DTA_DestWidthF,width,DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright);
|
||||
str = a.hasformat?String.Format(StringTable.Localize("$SWWM_ACHIEVEMENT_"..a.basename.."_TXT"),a.maxval):StringTable.Localize("$SWWM_ACHIEVEMENT_"..a.basename.."_TXT");
|
||||
if ( str != oldstr )
|
||||
{
|
||||
if ( l ) l.Destroy();
|
||||
l = smallfont2.BreakLines(str,width-40);
|
||||
l = master.mTinyFont.BreakLines(str,width-40);
|
||||
oldstr = str;
|
||||
}
|
||||
str = StringTable.Localize("$SWWM_ACHIEVEMENT_"..a.basename.."_TAG");
|
||||
if ( !completed && !hasprogress && ShouldObscure ) SWWMUtility.ObscureText(str,(gametic/3)+ypos*2+1);
|
||||
int oy = (32-(14+(9*l.Count())))/2;
|
||||
Screen.DrawText(smallfont,completed?Font.CR_GREEN:Font.CR_DARKGRAY,xx+36,yy+oy,str,DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright);
|
||||
Screen.DrawText(master.mSmallFont,completed?Font.CR_GREEN:Font.CR_DARKGRAY,xx+36,yy+oy,str,DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright);
|
||||
for ( int i=0; i<l.Count(); i++ )
|
||||
{
|
||||
str = l.StringAt(i);
|
||||
if ( !completed && !hasprogress && ShouldObscure ) SWWMUtility.ObscureText(str,(gametic/3)+ypos*2+2+i);
|
||||
Screen.DrawText(smallfont2,completed?Font.CR_WHITE:Font.CR_BLACK,xx+40,yy+oy+14+i*9,str,DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright);
|
||||
Screen.DrawText(master.mTinyFont,completed?Font.CR_WHITE:Font.CR_BLACK,xx+40,yy+oy+14+i*9,str,DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -377,9 +377,9 @@ Class DemolitionistStoreTab : DemolitionistMenuTab
|
|||
if ( !invlist[bSell] || (invlist[bSell].items.Size() <= 0) )
|
||||
{
|
||||
String str = StringTable.Localize(bSell?"$SWWM_NOSTORESELL":"$SWWM_NOSTORE");
|
||||
double xx = int(master.ws.x-smallfont.StringWidth(str))/2;
|
||||
double yy = int(master.ws.y-smallfont.GetHeight())/2;
|
||||
Screen.DrawText(smallfont,Font.CR_FIRE,master.origin.x+xx,master.origin.y+yy,str,DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true);
|
||||
double xx = int(master.ws.x-master.mSmallFont.StringWidth(str))/2;
|
||||
double yy = int(master.ws.y-master.mSmallFont.GetHeight())/2;
|
||||
Screen.DrawText(master.mSmallFont,Font.CR_FIRE,master.origin.x+xx,master.origin.y+yy,str,DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true);
|
||||
return;
|
||||
}
|
||||
double xx = 9;
|
||||
|
|
@ -394,7 +394,7 @@ Class DemolitionistStoreTab : DemolitionistMenuTab
|
|||
master.DrawHSeparator(0,yy,master.ws.x);
|
||||
yy -= 4;
|
||||
xx = floor(smofs*((master.ws.x-10)/maxofs))+2;
|
||||
Screen.DrawText(smallfont,Font.CR_FIRE,master.origin.x+xx,master.origin.y+yy,"▬",DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true);
|
||||
Screen.DrawText(master.mSmallFont,Font.CR_FIRE,master.origin.x+xx,master.origin.y+yy,"▬",DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -428,7 +428,7 @@ Class DemolitionistMenuStoreItem : DemolitionistMenuListItem
|
|||
// used for the store display calculation
|
||||
int GetFullWidth()
|
||||
{
|
||||
return smallfont.StringWidth(label)+96+smallfont.StringWidth(pricelabel);
|
||||
return master.mSmallFont.StringWidth(label)+96+master.mSmallFont.StringWidth(pricelabel);
|
||||
}
|
||||
|
||||
// so the prices don't get cut off
|
||||
|
|
@ -441,7 +441,7 @@ Class DemolitionistMenuStoreItem : DemolitionistMenuListItem
|
|||
override bool CheckBounds( double x, double y )
|
||||
{
|
||||
if ( Super.CheckBounds(x,y) ) return true;
|
||||
int ofs = (width-16)-smallfont.StringWidth(pricelabel);
|
||||
int ofs = (width-16)-master.mSmallFont.StringWidth(pricelabel);
|
||||
if ( x < xpos+ofs ) return false;
|
||||
if ( y < ypos ) return false;
|
||||
if ( x > xpos+width ) return false;
|
||||
|
|
@ -568,8 +568,8 @@ Class DemolitionistMenuStoreItem : DemolitionistMenuListItem
|
|||
|
||||
override void Drawer( Vector2 pos, bool selected, int cliptop, int clipbottom, int clipleft, int clipright )
|
||||
{
|
||||
Screen.DrawText(smallfont,col,master.origin.x+pos.x,master.origin.y+pos.y,label,DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright,DTA_ColorOverlay,selected?Color(0,0,0,0):Color(96,0,0,0));
|
||||
Screen.DrawText(smallfont,Font.CR_UNTRANSLATED,master.origin.x+pos.x+(width-16)-smallfont.StringWidth(pricelabel),master.origin.y+pos.y,pricelabel,DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright,DTA_ColorOverlay,selected?Color(0,0,0,0):Color(96,0,0,0));
|
||||
Screen.DrawText(master.mSmallFont,col,master.origin.x+pos.x,master.origin.y+pos.y,label,DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright,DTA_ColorOverlay,selected?Color(0,0,0,0):Color(96,0,0,0));
|
||||
Screen.DrawText(master.mSmallFont,Font.CR_UNTRANSLATED,master.origin.x+pos.x+(width-16)-master.mSmallFont.StringWidth(pricelabel),master.origin.y+pos.y,pricelabel,DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true,DTA_ClipTop,cliptop,DTA_ClipBottom,clipbottom,DTA_ClipLeft,clipleft,DTA_ClipRight,clipright,DTA_ColorOverlay,selected?Color(0,0,0,0):Color(96,0,0,0));
|
||||
}
|
||||
|
||||
void BuySellItem()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue