Revert font system overhaul.
This commit is contained in:
parent
c3f57b41fa
commit
89042b7b49
39 changed files with 532 additions and 693 deletions
|
|
@ -8,9 +8,11 @@ Class SWWMCreditsEntry ui
|
|||
BrokenLines btext;
|
||||
int width, height;
|
||||
int titlecol, btextcol;
|
||||
Font mSmallFont;
|
||||
|
||||
SWWMCreditsEntry Init( String t, String b = "", int c1 = Font.CR_SAPPHIRE, int c2 = Font.CR_WHITE, bool mari = false )
|
||||
{
|
||||
mSmallFont = Font.GetFont('TewiFont');
|
||||
if ( mari )
|
||||
{
|
||||
MariHack = true;
|
||||
|
|
@ -29,7 +31,7 @@ Class SWWMCreditsEntry ui
|
|||
return self;
|
||||
}
|
||||
String b2 = StringTable.Localize(b);
|
||||
btext = smallfont.BreakLines(b2,320);
|
||||
btext = mSmallFont.BreakLines(b2,320);
|
||||
width = CalcWidth();
|
||||
height = CalcHeight();
|
||||
return self;
|
||||
|
|
@ -43,7 +45,7 @@ Class SWWMCreditsEntry ui
|
|||
|
||||
private int CalcWidth()
|
||||
{
|
||||
int len = smallfont.StringWidth(title);
|
||||
int len = mSmallFont.StringWidth(title);
|
||||
if ( !btext ) return len;
|
||||
for ( int i=0; i<btext.Count(); i++ )
|
||||
{
|
||||
|
|
@ -57,10 +59,10 @@ Class SWWMCreditsEntry ui
|
|||
{
|
||||
int h = 0;
|
||||
if ( MariHack ) h = 148;
|
||||
h += smallfont.GetHeight();
|
||||
h += mSmallFont.GetHeight();
|
||||
if ( !btext ) return h;
|
||||
h += 6;
|
||||
h += smallfont.GetHeight()*btext.Count();
|
||||
h += mSmallFont.GetHeight()*btext.Count();
|
||||
return h;
|
||||
}
|
||||
|
||||
|
|
@ -85,21 +87,21 @@ Class SWWMCreditsEntry ui
|
|||
yy += 148;
|
||||
Screen.DrawTexture(MariSprite[cur],false,x,yy,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
}
|
||||
int w = smallfont.StringWidth(title);
|
||||
int w = mSmallFont.StringWidth(title);
|
||||
double xx = x-w/2;
|
||||
Screen.DrawText(smallfont,titlecol,xx,yy,title,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
Screen.DrawText(mSmallFont,titlecol,xx,yy,title,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
if ( !btext ) return height;
|
||||
// underline
|
||||
int cw = int(ceil((w+8)/6.))*6;
|
||||
xx = x-cw/2;
|
||||
for ( int i=0; i<cw; i+=6 )
|
||||
Screen.DrawChar(smallfont,titlecol,xx+i,yy+6,0x5F,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
yy += smallfont.GetHeight()+6;
|
||||
Screen.DrawChar(mSmallFont,titlecol,xx+i,yy+6,0x5F,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
yy += mSmallFont.GetHeight()+6;
|
||||
for ( int i=0; i<btext.Count(); i++ )
|
||||
{
|
||||
xx = x-(btext.StringWidth(i))/2;
|
||||
Screen.DrawText(smallfont,btextcol,xx,yy,btext.StringAt(i),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
yy += smallfont.GetHeight();
|
||||
Screen.DrawText(mSmallFont,btextcol,xx,yy,btext.StringAt(i),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
yy += mSmallFont.GetHeight();
|
||||
}
|
||||
return height;
|
||||
}
|
||||
|
|
@ -117,6 +119,7 @@ Class SWWMCreditsMenu : GenericMenu
|
|||
double hs;
|
||||
Vector2 logosz;
|
||||
double logow, logoh;
|
||||
Font mSmallFont, mBigFont;
|
||||
|
||||
String oldmus;
|
||||
int oldorder;
|
||||
|
|
@ -138,6 +141,8 @@ Class SWWMCreditsMenu : GenericMenu
|
|||
override void Init( Menu parent )
|
||||
{
|
||||
Super.Init(parent);
|
||||
mSmallFont = Font.GetFont('TewiFont');
|
||||
mBigFont = Font.GetFont('TewiFontOutline');
|
||||
bgtex = TexMan.CheckForTexture("graphics/tempbg.png",TexMan.Type_Any);
|
||||
UpdateSize();
|
||||
logo = TexMan.CheckForTexture(swwm_oldlogo?"graphics/M_SWWM.png":"graphics/M_DEMOLITIONIST.png",TexMan.Type_Any);
|
||||
|
|
@ -221,7 +226,7 @@ Class SWWMCreditsMenu : GenericMenu
|
|||
spos = ss.y-logosz.y;
|
||||
// calc total height
|
||||
theight = int(logosz.y);
|
||||
theight += 8*(SECTION_PAD+bigfont.GetHeight());
|
||||
theight += 8*(SECTION_PAD+mBigFont.GetHeight()*2);
|
||||
for ( int i=0; i<cdev.Size(); i++ )
|
||||
{
|
||||
theight += ENTRY_PAD;
|
||||
|
|
@ -274,23 +279,23 @@ Class SWWMCreditsMenu : GenericMenu
|
|||
if ( (y+logosz.y < 0) || (y > ss.y) ) return logosz.y;
|
||||
if ( swwm_oldlogo ) Screen.DrawTexture(logo,true,x-logosz.x/2,y,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
else Screen.DrawTexture(logo,true,x-logosz.x/2,y,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_ScaleX,(2./3.),DTA_ScaleY,(2./3.));
|
||||
Screen.DrawText(smallfont,Font.CR_SAPPHIRE,x-smallfont.StringWidth(stitle)/2,y+(logosz.y-28),stitle,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
Screen.DrawText(mSmallFont,Font.CR_SAPPHIRE,x-mSmallFont.StringWidth(stitle)/2,y+(logosz.y-28),stitle,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
// underline
|
||||
int w = max(smallfont.StringWidth(stitle),smallfont.StringWidth(stitle2));
|
||||
int w = max(mSmallFont.StringWidth(stitle),mSmallFont.StringWidth(stitle2));
|
||||
int cw = int(ceil((w+8)/6.))*6;
|
||||
double xx = x-cw/2;
|
||||
for ( int i=0; i<cw; i+=6 )
|
||||
Screen.DrawChar(smallfont,Font.CR_SAPPHIRE,xx+i,y+(logosz.y-22),0x5F,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
Screen.DrawText(smallfont,Font.CR_WHITE,x-smallfont.StringWidth(stitle2)/2,y+(logosz.y-9),stitle2,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
Screen.DrawChar(mSmallFont,Font.CR_SAPPHIRE,xx+i,y+(logosz.y-22),0x5F,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
Screen.DrawText(mSmallFont,Font.CR_WHITE,x-mSmallFont.StringWidth(stitle2)/2,y+(logosz.y-9),stitle2,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
return logosz.y;
|
||||
}
|
||||
double DrawSection( double x, double y, String txt )
|
||||
{
|
||||
// don't draw if we're offscreen, saves time
|
||||
y += SECTION_SHIFT;
|
||||
if ( (y+bigfont.GetHeight() < 0) || (y > ss.y) ) return bigfont.GetHeight();
|
||||
Screen.DrawText(bigfont,Font.CR_BLUE,x-bigfont.StringWidth(txt)/2,y,txt,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
return bigfont.GetHeight();
|
||||
if ( (y+mBigFont.GetHeight()*2 < 0) || (y > ss.y) ) return mBigFont.GetHeight()*2;
|
||||
Screen.DrawText(mBigFont,Font.CR_BLUE,x-mBigFont.StringWidth(txt),y,txt,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_ScaleX,2,DTA_ScaleY,2);
|
||||
return mBigFont.GetHeight()*2;
|
||||
}
|
||||
override void Drawer()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ Class SWWMHelpMenu : GenericMenu
|
|||
TextureID bgtex;
|
||||
bool isrclick;
|
||||
int pagedir;
|
||||
Font mSmallFont, mSmallFont2;
|
||||
|
||||
enum EHelpPage
|
||||
{
|
||||
|
|
@ -32,44 +33,46 @@ Class SWWMHelpMenu : GenericMenu
|
|||
fadetic = gametic;
|
||||
pagedir = 0;
|
||||
bgtex = TexMan.CheckForTexture("graphics/tempbg.png",TexMan.Type_Any);
|
||||
mSmallFont = Font.GetFont('TewiFont');
|
||||
mSmallFont2 = Font.GetFont('TewiFontOutline');
|
||||
for ( int i=0; i<NUM_HELP_PAGES; i++ )
|
||||
{
|
||||
switch ( i )
|
||||
{
|
||||
case PAGE_STORY:
|
||||
pagehdr[i] = StringTable.Localize("$SWWM_HELP_STORY");
|
||||
if ( gameinfo.gametype&GAME_Heretic ) pagetxt[i] = SmallFont.BreakLines(StringTable.Localize("$SWWM_HELP_STORYHERETIC"),600);
|
||||
else if ( gameinfo.gametype&GAME_Hexen ) pagetxt[i] = SmallFont.BreakLines(StringTable.Localize("$SWWM_HELP_STORYHEXEN"),600);
|
||||
else if ( SWWMUtility.IsEviternity() ) pagetxt[i] = SmallFont.BreakLines(StringTable.Localize("$SWWM_HELP_STORYEVITERNITY"),600);
|
||||
else pagetxt[i] = SmallFont.BreakLines(StringTable.Localize("$SWWM_HELP_STORYDOOM"),600);
|
||||
if ( gameinfo.gametype&GAME_Heretic ) pagetxt[i] = mSmallFont.BreakLines(StringTable.Localize("$SWWM_HELP_STORYHERETIC"),600);
|
||||
else if ( gameinfo.gametype&GAME_Hexen ) pagetxt[i] = mSmallFont.BreakLines(StringTable.Localize("$SWWM_HELP_STORYHEXEN"),600);
|
||||
else if ( SWWMUtility.IsEviternity() ) pagetxt[i] = mSmallFont.BreakLines(StringTable.Localize("$SWWM_HELP_STORYEVITERNITY"),600);
|
||||
else pagetxt[i] = mSmallFont.BreakLines(StringTable.Localize("$SWWM_HELP_STORYDOOM"),600);
|
||||
break;
|
||||
case PAGE_DEMO:
|
||||
pagehdr[i] = StringTable.Localize("$SWWM_HELP_DEMO");
|
||||
pagetxt[i] = SmallFont.BreakLines(StringTable.Localize("$SWWM_HELP_DEMOTXT"),600);
|
||||
pagetxt[i] = mSmallFont.BreakLines(StringTable.Localize("$SWWM_HELP_DEMOTXT"),600);
|
||||
break;
|
||||
case PAGE_ARSENAL1:
|
||||
pagehdr[i] = StringTable.Localize("$SWWM_HELP_ARSE1");
|
||||
pagetxt[i] = SmallFont.BreakLines(StringTable.Localize("$SWWM_HELP_ARSE1TXT"),600);
|
||||
pagetxt[i] = mSmallFont.BreakLines(StringTable.Localize("$SWWM_HELP_ARSE1TXT"),600);
|
||||
break;
|
||||
case PAGE_ARSENAL2:
|
||||
pagehdr[i] = StringTable.Localize("$SWWM_HELP_ARSE2");
|
||||
pagetxt[i] = SmallFont.BreakLines(StringTable.Localize("$SWWM_HELP_ARSE2TXT"),600);
|
||||
pagetxt[i] = mSmallFont.BreakLines(StringTable.Localize("$SWWM_HELP_ARSE2TXT"),600);
|
||||
break;
|
||||
case PAGE_ARSENAL3:
|
||||
pagehdr[i] = StringTable.Localize("$SWWM_HELP_ARSE3");
|
||||
pagetxt[i] = SmallFont.BreakLines(StringTable.Localize("$SWWM_HELP_ARSE3TXT"),600);
|
||||
pagetxt[i] = mSmallFont.BreakLines(StringTable.Localize("$SWWM_HELP_ARSE3TXT"),600);
|
||||
break;
|
||||
case PAGE_KBASE:
|
||||
pagehdr[i] = StringTable.Localize("$SWWM_HELP_KBASE");
|
||||
pagetxt[i] = SmallFont.BreakLines(StringTable.Localize("$SWWM_HELP_KBASETXT"),600);
|
||||
pagetxt[i] = mSmallFont.BreakLines(StringTable.Localize("$SWWM_HELP_KBASETXT"),600);
|
||||
break;
|
||||
case PAGE_TECH:
|
||||
pagehdr[i] = StringTable.Localize("$SWWM_HELP_TECH");
|
||||
pagetxt[i] = SmallFont.BreakLines(StringTable.Localize("$SWWM_HELP_TECHTXT"),600);
|
||||
pagetxt[i] = mSmallFont.BreakLines(StringTable.Localize("$SWWM_HELP_TECHTXT"),600);
|
||||
break;
|
||||
case PAGE_TIPS:
|
||||
pagehdr[i] = StringTable.Localize("$SWWM_HELP_TIPS");
|
||||
pagetxt[i] = SmallFont.BreakLines(StringTable.Localize("$SWWM_HELP_TIPSTXT"),600);
|
||||
pagetxt[i] = mSmallFont.BreakLines(StringTable.Localize("$SWWM_HELP_TIPSTXT"),600);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -164,7 +167,7 @@ Class SWWMHelpMenu : GenericMenu
|
|||
// big bulk of code
|
||||
private void DrawPage( int page, double xofs = 0., double alpha = 1. )
|
||||
{
|
||||
int h = smallfont.GetHeight();
|
||||
int h = mSmallFont.GetHeight();
|
||||
int maxlen = 0, lh;
|
||||
double y = 0;
|
||||
if ( (page < 0) || (page >= NUM_HELP_PAGES) )
|
||||
|
|
@ -172,7 +175,7 @@ Class SWWMHelpMenu : GenericMenu
|
|||
let hdr = pagehdr[page];
|
||||
let l = pagetxt[page];
|
||||
lh = l.Count()*h;
|
||||
Screen.DrawText(smallfont,Font.CR_FIRE,xofs+(Screen.GetWidth()-smallfont.StringWidth(hdr)*CleanXFac_1)/2,(Screen.GetHeight()-(h*3+lh)*CleanYFac_1)/2,hdr,DTA_CleanNoMove_1,true,DTA_Alpha,alpha);
|
||||
Screen.DrawText(mSmallFont2,Font.CR_FIRE,xofs+(Screen.GetWidth()-mSmallFont2.StringWidth(hdr)*CleanXFac_1)/2,(Screen.GetHeight()-(h*3+lh)*CleanYFac_1)/2,hdr,DTA_CleanNoMove_1,true,DTA_Alpha,alpha);
|
||||
for ( int i=0; i<l.Count(); i++ )
|
||||
{
|
||||
int len = l.StringWidth(i);
|
||||
|
|
@ -180,7 +183,7 @@ Class SWWMHelpMenu : GenericMenu
|
|||
}
|
||||
for ( int i=0; i<l.Count(); i++ )
|
||||
{
|
||||
Screen.DrawText(smallfont,Font.CR_WHITE,xofs+(Screen.GetWidth()-maxlen*CleanXFac_1)/2,(Screen.GetHeight()-lh*CleanYFac_1)/2+y,l.StringAt(i),DTA_CleanNoMove_1,true,DTA_Alpha,alpha);
|
||||
Screen.DrawText(mSmallFont,Font.CR_WHITE,xofs+(Screen.GetWidth()-maxlen*CleanXFac_1)/2,(Screen.GetHeight()-lh*CleanYFac_1)/2+y,l.StringAt(i),DTA_CleanNoMove_1,true,DTA_Alpha,alpha);
|
||||
y += h*CleanYFac_1;
|
||||
}
|
||||
}
|
||||
|
|
@ -202,14 +205,14 @@ Class SWWMHelpMenu : GenericMenu
|
|||
DrawPage(prevpage,-(pagedir*alph*32)*CleanXFac_1,(1.-alph)**3);
|
||||
DrawPage(curpage,(pagedir*(1.-alph)*32)*CleanXFac_1,alph**3);
|
||||
}
|
||||
int h = smallfont.GetHeight();
|
||||
int h = mSmallFont.GetHeight();
|
||||
double y = Screen.GetHeight()/2-(h*2)*CleanYFac_1;
|
||||
for ( int i=0; i<4; i++ )
|
||||
{
|
||||
if ( curpage > 0 )
|
||||
Screen.DrawText(smallfont,Font.CR_GOLD,12*CleanXFac_1,y,"<",DTA_CleanNoMove_1,true);
|
||||
Screen.DrawText(mSmallFont,Font.CR_GOLD,12*CleanXFac_1,y,"<",DTA_CleanNoMove_1,true);
|
||||
if ( curpage < NUM_HELP_PAGES-1 )
|
||||
Screen.DrawText(smallfont,Font.CR_GOLD,Screen.GetWidth()-18*CleanXFac_1,y,">",DTA_CleanNoMove_1,true);
|
||||
Screen.DrawText(mSmallFont,Font.CR_GOLD,Screen.GetWidth()-18*CleanXFac_1,y,">",DTA_CleanNoMove_1,true);
|
||||
y += h*CleanYFac_1;
|
||||
}
|
||||
Super.Drawer();
|
||||
|
|
|
|||
|
|
@ -12,12 +12,14 @@ Class SWWMStatScreen : StatusScreen abstract
|
|||
double hs, hs2;
|
||||
Vector2 ss, ss2, origin, origin2;
|
||||
double bgfade;
|
||||
Font mSmallFont;
|
||||
String tipstr;
|
||||
transient BrokenLines tipl;
|
||||
|
||||
override void Start( wbstartstruct wbstartstruct )
|
||||
{
|
||||
Super.Start(wbstartstruct);
|
||||
mSmallFont = Font.GetFont('TewiFont');
|
||||
// support for old author text style
|
||||
int iof = lnametexts[0].IndexOf(" - by: ");
|
||||
if ( iof != -1 )
|
||||
|
|
@ -108,10 +110,10 @@ Class SWWMStatScreen : StatusScreen abstract
|
|||
if ( semic != -1 )
|
||||
{
|
||||
String bstr = String.Format("\cx%s\c- %s",StringTable.Localize("$SWWM_FANART"),artstr.Mid(semic+1));
|
||||
int len = smallfont.StringWidth(bstr);
|
||||
int bw = int((len+8)*hs), bh = int((smallfont.GetHeight()+4)*hs);
|
||||
int len = mSmallFont.StringWidth(bstr);
|
||||
int bw = int((len+8)*hs), bh = int((mSmallFont.GetHeight()+4)*hs);
|
||||
Screen.Dim("Black",.8,Screen.GetWidth()-bw,Screen.GetHeight()-bh,bw,bh);
|
||||
Screen.DrawText(smallfont,Font.CR_GOLD,ss.x-(len+4),ss.y-(smallfont.GetHeight()+2),bstr,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
Screen.DrawText(mSmallFont,Font.CR_GOLD,ss.x-(len+4),ss.y-(mSmallFont.GetHeight()+2),bstr,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
}
|
||||
}
|
||||
// intermission tips at the bottom
|
||||
|
|
@ -151,42 +153,42 @@ Class SWWMStatScreen : StatusScreen abstract
|
|||
}
|
||||
if ( swwm_nointertips ) return;
|
||||
int lw = 0;
|
||||
if ( !tipl ) tipl = smallfont.BreakLines(tipstr,400);
|
||||
if ( !tipl ) tipl = mSmallFont.BreakLines(tipstr,400);
|
||||
for ( int i=0; i<tipl.Count(); i++ )
|
||||
if ( tipl.StringWidth(i) > lw )
|
||||
lw = tipl.StringWidth(i);
|
||||
int bw = int((lw+12)*hs), bh = int((smallfont.GetHeight()*tipl.Count()+8)*hs);
|
||||
double xx = 8, yy = (ss.y-8)-(smallfont.GetHeight()*tipl.Count());
|
||||
int bw = int((lw+12)*hs), bh = int((mSmallFont.GetHeight()*tipl.Count()+8)*hs);
|
||||
double xx = 8, yy = (ss.y-8)-(mSmallFont.GetHeight()*tipl.Count());
|
||||
Screen.Dim("Black",.8,int((xx-4)*hs),int((yy-4)*hs),bw,bh);
|
||||
for ( int i=0; i<tipl.Count(); i++ )
|
||||
{
|
||||
Screen.DrawText(smallfont,Font.CR_WHITE,xx,yy,tipl.StringAt(i),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
yy += smallfont.GetHeight();
|
||||
Screen.DrawText(mSmallFont,Font.CR_WHITE,xx,yy,tipl.StringAt(i),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
yy += mSmallFont.GetHeight();
|
||||
xx = 12;
|
||||
}
|
||||
}
|
||||
override int DrawLF()
|
||||
{
|
||||
int len[2];
|
||||
len[0] = smallfont.StringWidth(lnametexts[0]);
|
||||
len[1] = smallfont.StringWidth(authortexts[0]);
|
||||
len[0] = mSmallFont.StringWidth(lnametexts[0]);
|
||||
len[1] = mSmallFont.StringWidth(authortexts[0]);
|
||||
int dimlen = max(int((len[0]+8)*hs2),int((len[1]+8)*hs));
|
||||
bool auth = (authortexts[0].Length()>0);
|
||||
Screen.Dim("Black",.8,int((Screen.GetWidth()-dimlen)/2.),int(4*hs2),dimlen,int((smallfont.GetHeight()+(auth?2:4))*hs2));
|
||||
Screen.DrawText(smallfont,Font.CR_GREEN,int((ss2.x-len[0])/2.),6,lnametexts[0],DTA_VirtualWidthF,ss2.x,DTA_VirtualHeightF,ss2.y,DTA_KeepRatio,true);
|
||||
double foy = smallfont.GetHeight()+(auth?6:8);
|
||||
Screen.Dim("Black",.8,int((Screen.GetWidth()-dimlen)/2.),int(4*hs2),dimlen,int((mSmallFont.GetHeight()+(auth?2:4))*hs2));
|
||||
Screen.DrawText(mSmallFont,Font.CR_GREEN,int((ss2.x-len[0])/2.),6,lnametexts[0],DTA_VirtualWidthF,ss2.x,DTA_VirtualHeightF,ss2.y,DTA_KeepRatio,true);
|
||||
double foy = mSmallFont.GetHeight()+(auth?6:8);
|
||||
if ( auth )
|
||||
{
|
||||
double oy = foy*(hs2/hs);
|
||||
Screen.Dim("Black",.8,int((Screen.GetWidth()-dimlen)/2.),int(oy*hs),dimlen,int((smallfont.GetHeight()+2)*hs));
|
||||
Screen.DrawText(smallfont,Font.CR_WHITE,int((ss.x-len[1])/2.),oy,authortexts[0],DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
foy += (smallfont.GetHeight()+2)*(hs/hs2);
|
||||
Screen.Dim("Black",.8,int((Screen.GetWidth()-dimlen)/2.),int(oy*hs),dimlen,int((mSmallFont.GetHeight()+2)*hs));
|
||||
Screen.DrawText(mSmallFont,Font.CR_WHITE,int((ss.x-len[1])/2.),oy,authortexts[0],DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
foy += (mSmallFont.GetHeight()+2)*(hs/hs2);
|
||||
}
|
||||
foy += 4.;
|
||||
String str = StringTable.Localize("$WI_FINISHED");
|
||||
len[0] = smallfont.StringWidth(str);
|
||||
Screen.Dim("Black",.8,int((ss2.x-len[0]-8)/2*hs2),int(foy*hs2),int((len[0]+8)*hs2),int((smallfont.GetHeight()+4)*hs2));
|
||||
Screen.DrawText(smallfont,Font.CR_FIRE,int((ss2.x-len[0])/2.),foy+2,str,DTA_VirtualWidthF,ss2.x,DTA_VirtualHeightF,ss2.y,DTA_KeepRatio,true);
|
||||
len[0] = mSmallFont.StringWidth(str);
|
||||
Screen.Dim("Black",.8,int((ss2.x-len[0]-8)/2*hs2),int(foy*hs2),int((len[0]+8)*hs2),int((mSmallFont.GetHeight()+4)*hs2));
|
||||
Screen.DrawText(mSmallFont,Font.CR_FIRE,int((ss2.x-len[0])/2.),foy+2,str,DTA_VirtualWidthF,ss2.x,DTA_VirtualHeightF,ss2.y,DTA_KeepRatio,true);
|
||||
// return not used
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -196,21 +198,21 @@ Class SWWMStatScreen : StatusScreen abstract
|
|||
// remove trailing colon (usually appearing on Heretic)
|
||||
if ( str.RightIndexOf(":") == (str.length()-1) ) str.Truncate(str.length()-1);
|
||||
int len[2];
|
||||
len[0] = smallfont.StringWidth(str);
|
||||
Screen.Dim("Black",.8,int((ss2.x-len[0]-8)/2*hs2),int(4*hs2),int((len[0]+8)*hs2),int((smallfont.GetHeight()+4)*hs2));
|
||||
Screen.DrawText(smallfont,Font.CR_FIRE,int((ss2.x-len[0])/2.),6,str,DTA_VirtualWidthF,ss2.x,DTA_VirtualHeightF,ss2.y,DTA_KeepRatio,true);
|
||||
double foy = smallfont.GetHeight()+12;
|
||||
len[0] = smallfont.StringWidth(lnametexts[1]);
|
||||
len[1] = smallfont.StringWidth(authortexts[1]);
|
||||
len[0] = mSmallFont.StringWidth(str);
|
||||
Screen.Dim("Black",.8,int((ss2.x-len[0]-8)/2*hs2),int(4*hs2),int((len[0]+8)*hs2),int((mSmallFont.GetHeight()+4)*hs2));
|
||||
Screen.DrawText(mSmallFont,Font.CR_FIRE,int((ss2.x-len[0])/2.),6,str,DTA_VirtualWidthF,ss2.x,DTA_VirtualHeightF,ss2.y,DTA_KeepRatio,true);
|
||||
double foy = mSmallFont.GetHeight()+12;
|
||||
len[0] = mSmallFont.StringWidth(lnametexts[1]);
|
||||
len[1] = mSmallFont.StringWidth(authortexts[1]);
|
||||
int dimlen = max(int((len[0]+8)*hs2),int((len[1]+8)*hs));
|
||||
bool auth = (authortexts[1].Length()>0);
|
||||
Screen.Dim("Black",.8,int((Screen.GetWidth()-dimlen)/2.),int(foy*hs2),dimlen,int((smallfont.GetHeight()+(auth?2:4))*hs2));
|
||||
Screen.DrawText(smallfont,Font.CR_GREEN,int((ss2.x-len[0])/2.),foy+2,lnametexts[1],DTA_VirtualWidthF,ss2.x,DTA_VirtualHeightF,ss2.y,DTA_KeepRatio,true);
|
||||
Screen.Dim("Black",.8,int((Screen.GetWidth()-dimlen)/2.),int(foy*hs2),dimlen,int((mSmallFont.GetHeight()+(auth?2:4))*hs2));
|
||||
Screen.DrawText(mSmallFont,Font.CR_GREEN,int((ss2.x-len[0])/2.),foy+2,lnametexts[1],DTA_VirtualWidthF,ss2.x,DTA_VirtualHeightF,ss2.y,DTA_KeepRatio,true);
|
||||
if ( auth )
|
||||
{
|
||||
double oy = (foy+smallfont.GetHeight()+2)*(hs2/hs);
|
||||
Screen.Dim("Black",.8,int((Screen.GetWidth()-dimlen)/2.),int(oy*hs),dimlen,int((smallfont.GetHeight()+2)*hs));
|
||||
Screen.DrawText(smallfont,Font.CR_WHITE,int((ss.x-len[1])/2.),oy,authortexts[1],DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
double oy = (foy+mSmallFont.GetHeight()+2)*(hs2/hs);
|
||||
Screen.Dim("Black",.8,int((Screen.GetWidth()-dimlen)/2.),int(oy*hs),dimlen,int((mSmallFont.GetHeight()+2)*hs));
|
||||
Screen.DrawText(mSmallFont,Font.CR_WHITE,int((ss.x-len[1])/2.),oy,authortexts[1],DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
}
|
||||
}
|
||||
override void drawShowNextLoc( void )
|
||||
|
|
@ -467,70 +469,70 @@ Class SWWMStatScreen_SP : SWWMStatScreen
|
|||
int maxlen, maxlenl = 0, maxlenr = 0;
|
||||
// left strings
|
||||
String str = StringTable.Localize("$TXT_IMKILLS")..":";
|
||||
int len = smallfont.StringWidth(str);
|
||||
int len = mSmallFont.StringWidth(str);
|
||||
maxlenl = len;
|
||||
str = StringTable.Localize("$TXT_IMITEMS")..":";
|
||||
len = smallfont.StringWidth(str);
|
||||
len = mSmallFont.StringWidth(str);
|
||||
if ( len > maxlenl ) maxlenl = len;
|
||||
str = StringTable.Localize("$TXT_IMSECRETS")..":";
|
||||
len = smallfont.StringWidth(str);
|
||||
len = mSmallFont.StringWidth(str);
|
||||
if ( len > maxlenl ) maxlenl = len;
|
||||
str = StringTable.Localize("$TXT_IMTIME")..":";
|
||||
len = smallfont.StringWidth(str);
|
||||
len = mSmallFont.StringWidth(str);
|
||||
if ( len > maxlenl ) maxlenl = len;
|
||||
if ( wi_showtotaltime )
|
||||
{
|
||||
str = StringTable.Localize("$SCORE_TOTAL")..":"; // hey, as long as it works
|
||||
len = smallfont.StringWidth(str);
|
||||
len = mSmallFont.StringWidth(str);
|
||||
if ( len > maxlenl ) maxlenl = len;
|
||||
}
|
||||
if ( wbs.partime )
|
||||
{
|
||||
str = StringTable.Localize("$TXT_IMPAR")..":";
|
||||
len = smallfont.StringWidth(str);
|
||||
len = mSmallFont.StringWidth(str);
|
||||
if ( len > maxlenl ) maxlenl = len;
|
||||
}
|
||||
// right strings
|
||||
if ( wi_percents )
|
||||
{
|
||||
str = String.Format("%d%%",GetPct(Plrs[me].skills,wbs.maxkills));
|
||||
len = smallfont.StringWidth(str);
|
||||
len = mSmallFont.StringWidth(str);
|
||||
maxlenr = len;
|
||||
str = String.Format("%d%%",GetPct(Plrs[me].sitems,wbs.maxitems));
|
||||
len = smallfont.StringWidth(str);
|
||||
len = mSmallFont.StringWidth(str);
|
||||
if ( len > maxlenr ) maxlenr = len;
|
||||
str = String.Format("%d%%",GetPct(Plrs[me].ssecret,wbs.maxsecret));
|
||||
len = smallfont.StringWidth(str);
|
||||
len = mSmallFont.StringWidth(str);
|
||||
if ( len > maxlenr ) maxlenr = len;
|
||||
}
|
||||
else
|
||||
{
|
||||
str = String.Format("%d / %d",Plrs[me].skills,wbs.maxkills);
|
||||
len = smallfont.StringWidth(str);
|
||||
len = mSmallFont.StringWidth(str);
|
||||
maxlenr = len;
|
||||
str = String.Format("%d / %d",Plrs[me].sitems,wbs.maxitems);
|
||||
len = smallfont.StringWidth(str);
|
||||
len = mSmallFont.StringWidth(str);
|
||||
if ( len > maxlenr ) maxlenr = len;
|
||||
str = String.Format("%d / %d",Plrs[me].ssecret,wbs.maxsecret);
|
||||
len = smallfont.StringWidth(str);
|
||||
len = mSmallFont.StringWidth(str);
|
||||
if ( len > maxlenr ) maxlenr = len;
|
||||
}
|
||||
str = TimeStr(Thinker.Tics2Seconds(Plrs[me].stime));
|
||||
len = smallfont.StringWidth(str);
|
||||
len = mSmallFont.StringWidth(str);
|
||||
if ( len > maxlenr ) maxlenr = len;
|
||||
if ( wi_showtotaltime )
|
||||
{
|
||||
str = TimeStr(Thinker.Tics2Seconds(wbs.totaltime));
|
||||
len = smallfont.StringWidth(str);
|
||||
len = mSmallFont.StringWidth(str);
|
||||
if ( len > maxlenr ) maxlenr = len;
|
||||
}
|
||||
if ( wbs.partime )
|
||||
{
|
||||
str = TimeStr(wbs.partime/GameTicRate);
|
||||
len = smallfont.StringWidth(str);
|
||||
len = mSmallFont.StringWidth(str);
|
||||
if ( len > maxlenr ) maxlenr = len;
|
||||
}
|
||||
int step = smallfont.GetHeight()+1;
|
||||
int step = mSmallFont.GetHeight()+1;
|
||||
int nl = clamp(sp_state/2,0,4);
|
||||
if ( (nl == 4) )
|
||||
{
|
||||
|
|
@ -542,20 +544,20 @@ Class SWWMStatScreen_SP : SWWMStatScreen
|
|||
// draw the whole damn thing
|
||||
if ( sp_state >= 2 ) Screen.Dim("Black",.8,int((ss2.x-maxlen-8)*.5*hs2),int((ss2.y-nl-8)*.5*hs2),int((maxlen+8)*hs2),int((nl+8)*hs2));
|
||||
int xx = int((ss2.x-maxlen)/2), yy = int((ss2.y-nl)/2);
|
||||
if ( sp_state >= 2 ) Screen.DrawText(smallfont,Font.CR_GREEN,xx,yy,StringTable.Localize("$TXT_IMKILLS")..":",DTA_VirtualWidthF,ss2.x,DTA_VirtualHeightF,ss2.y,DTA_KeepRatio,true);
|
||||
if ( sp_state >= 2 ) Screen.DrawText(mSmallFont,Font.CR_GREEN,xx,yy,StringTable.Localize("$TXT_IMKILLS")..":",DTA_VirtualWidthF,ss2.x,DTA_VirtualHeightF,ss2.y,DTA_KeepRatio,true);
|
||||
yy += step;
|
||||
if ( sp_state >= 4 ) Screen.DrawText(smallfont,Font.CR_GREEN,xx,yy,StringTable.Localize("$TXT_IMITEMS")..":",DTA_VirtualWidthF,ss2.x,DTA_VirtualHeightF,ss2.y,DTA_KeepRatio,true);
|
||||
if ( sp_state >= 4 ) Screen.DrawText(mSmallFont,Font.CR_GREEN,xx,yy,StringTable.Localize("$TXT_IMITEMS")..":",DTA_VirtualWidthF,ss2.x,DTA_VirtualHeightF,ss2.y,DTA_KeepRatio,true);
|
||||
yy += step;
|
||||
if ( sp_state >= 6 ) Screen.DrawText(smallfont,Font.CR_GREEN,xx,yy,StringTable.Localize("$TXT_IMSECRETS")..":",DTA_VirtualWidthF,ss2.x,DTA_VirtualHeightF,ss2.y,DTA_KeepRatio,true);
|
||||
if ( sp_state >= 6 ) Screen.DrawText(mSmallFont,Font.CR_GREEN,xx,yy,StringTable.Localize("$TXT_IMSECRETS")..":",DTA_VirtualWidthF,ss2.x,DTA_VirtualHeightF,ss2.y,DTA_KeepRatio,true);
|
||||
yy += step;
|
||||
if ( sp_state >= 8 ) Screen.DrawText(smallfont,Font.CR_GREEN,xx,yy,StringTable.Localize("$TXT_IMTIME")..":",DTA_VirtualWidthF,ss2.x,DTA_VirtualHeightF,ss2.y,DTA_KeepRatio,true);
|
||||
if ( sp_state >= 8 ) Screen.DrawText(mSmallFont,Font.CR_GREEN,xx,yy,StringTable.Localize("$TXT_IMTIME")..":",DTA_VirtualWidthF,ss2.x,DTA_VirtualHeightF,ss2.y,DTA_KeepRatio,true);
|
||||
yy += step;
|
||||
if ( wi_showtotaltime )
|
||||
{
|
||||
if ( sp_state >= 8 ) Screen.DrawText(smallfont,Font.CR_GREEN,xx,yy,StringTable.Localize("$SCORE_TOTAL")..":",DTA_VirtualWidthF,ss2.x,DTA_VirtualHeightF,ss2.y,DTA_KeepRatio,true);
|
||||
if ( sp_state >= 8 ) Screen.DrawText(mSmallFont,Font.CR_GREEN,xx,yy,StringTable.Localize("$SCORE_TOTAL")..":",DTA_VirtualWidthF,ss2.x,DTA_VirtualHeightF,ss2.y,DTA_KeepRatio,true);
|
||||
yy += step;
|
||||
}
|
||||
if ( wbs.partime && (sp_state >= 8) ) Screen.DrawText(smallfont,Font.CR_GREEN,xx,yy,StringTable.Localize("$TXT_IMPAR")..":",DTA_VirtualWidthF,ss2.x,DTA_VirtualHeightF,ss2.y,DTA_KeepRatio,true);
|
||||
if ( wbs.partime && (sp_state >= 8) ) Screen.DrawText(mSmallFont,Font.CR_GREEN,xx,yy,StringTable.Localize("$TXT_IMPAR")..":",DTA_VirtualWidthF,ss2.x,DTA_VirtualHeightF,ss2.y,DTA_KeepRatio,true);
|
||||
xx = int((ss2.x+maxlen)/2);
|
||||
yy = int((ss2.y-nl)/2);
|
||||
if ( wi_percents )
|
||||
|
|
@ -563,22 +565,22 @@ Class SWWMStatScreen_SP : SWWMStatScreen
|
|||
if ( cnt_kills[0] >= 0 )
|
||||
{
|
||||
str = String.Format("%d\cu%%\c-",GetPct(cnt_kills[0],wbs.maxkills));
|
||||
len = smallfont.StringWidth(str);
|
||||
Screen.DrawText(smallfont,(!wbs.maxkills||(cnt_kills[0]>=wbs.maxkills))?Font.CR_GOLD:Font.CR_WHITE,xx-len,yy,str,DTA_VirtualWidthF,ss2.x,DTA_VirtualHeightF,ss2.y,DTA_KeepRatio,true);
|
||||
len = mSmallFont.StringWidth(str);
|
||||
Screen.DrawText(mSmallFont,(!wbs.maxkills||(cnt_kills[0]>=wbs.maxkills))?Font.CR_GOLD:Font.CR_WHITE,xx-len,yy,str,DTA_VirtualWidthF,ss2.x,DTA_VirtualHeightF,ss2.y,DTA_KeepRatio,true);
|
||||
}
|
||||
yy += step;
|
||||
if ( cnt_items[0] >= 0 )
|
||||
{
|
||||
str = String.Format("%d\cu%%\c-",GetPct(cnt_items[0],wbs.maxitems));
|
||||
len = smallfont.StringWidth(str);
|
||||
Screen.DrawText(smallfont,(!wbs.maxitems||(cnt_items[0]>=wbs.maxitems))?Font.CR_GOLD:Font.CR_WHITE,xx-len,yy,str,DTA_VirtualWidthF,ss2.x,DTA_VirtualHeightF,ss2.y,DTA_KeepRatio,true);
|
||||
len = mSmallFont.StringWidth(str);
|
||||
Screen.DrawText(mSmallFont,(!wbs.maxitems||(cnt_items[0]>=wbs.maxitems))?Font.CR_GOLD:Font.CR_WHITE,xx-len,yy,str,DTA_VirtualWidthF,ss2.x,DTA_VirtualHeightF,ss2.y,DTA_KeepRatio,true);
|
||||
}
|
||||
yy += step;
|
||||
if ( cnt_secret[0] >= 0 )
|
||||
{
|
||||
str = String.Format("%d\cu%%\c-",GetPct(cnt_secret[0],wbs.maxsecret));
|
||||
len = smallfont.StringWidth(str);
|
||||
Screen.DrawText(smallfont,(!wbs.maxsecret||(cnt_secret[0]>=wbs.maxsecret))?Font.CR_GOLD:Font.CR_WHITE,xx-len,yy,str,DTA_VirtualWidthF,ss2.x,DTA_VirtualHeightF,ss2.y,DTA_KeepRatio,true);
|
||||
len = mSmallFont.StringWidth(str);
|
||||
Screen.DrawText(mSmallFont,(!wbs.maxsecret||(cnt_secret[0]>=wbs.maxsecret))?Font.CR_GOLD:Font.CR_WHITE,xx-len,yy,str,DTA_VirtualWidthF,ss2.x,DTA_VirtualHeightF,ss2.y,DTA_KeepRatio,true);
|
||||
}
|
||||
yy += step;
|
||||
}
|
||||
|
|
@ -587,30 +589,30 @@ Class SWWMStatScreen_SP : SWWMStatScreen
|
|||
if ( cnt_kills[0] >= 0 )
|
||||
{
|
||||
str = String.Format("%d \cu/\c- \cj%d\c-",max(cnt_kills[0],0),wbs.maxkills);
|
||||
len = smallfont.StringWidth(str);
|
||||
Screen.DrawText(smallfont,(wbs.maxkills&&(cnt_kills[0]>=wbs.maxkills))?Font.CR_GOLD:Font.CR_WHITE,xx-len,yy,str,DTA_VirtualWidthF,ss2.x,DTA_VirtualHeightF,ss2.y,DTA_KeepRatio,true);
|
||||
len = mSmallFont.StringWidth(str);
|
||||
Screen.DrawText(mSmallFont,(wbs.maxkills&&(cnt_kills[0]>=wbs.maxkills))?Font.CR_GOLD:Font.CR_WHITE,xx-len,yy,str,DTA_VirtualWidthF,ss2.x,DTA_VirtualHeightF,ss2.y,DTA_KeepRatio,true);
|
||||
}
|
||||
yy += step;
|
||||
if ( cnt_items[0] >= 0 )
|
||||
{
|
||||
str = String.Format("%d \cu/\c- \cj%d\c-",max(cnt_items[0],0),wbs.maxitems);
|
||||
len = smallfont.StringWidth(str);
|
||||
Screen.DrawText(smallfont,(wbs.maxitems&&(cnt_items[0]>=wbs.maxitems))?Font.CR_GOLD:Font.CR_WHITE,xx-len,yy,str,DTA_VirtualWidthF,ss2.x,DTA_VirtualHeightF,ss2.y,DTA_KeepRatio,true);
|
||||
len = mSmallFont.StringWidth(str);
|
||||
Screen.DrawText(mSmallFont,(wbs.maxitems&&(cnt_items[0]>=wbs.maxitems))?Font.CR_GOLD:Font.CR_WHITE,xx-len,yy,str,DTA_VirtualWidthF,ss2.x,DTA_VirtualHeightF,ss2.y,DTA_KeepRatio,true);
|
||||
}
|
||||
yy += step;
|
||||
if ( cnt_secret[0] >= 0 )
|
||||
{
|
||||
str = String.Format("%d \cu/\c- \cj%d\c-",max(cnt_secret[0],0),wbs.maxsecret);
|
||||
len = smallfont.StringWidth(str);
|
||||
Screen.DrawText(smallfont,(wbs.maxsecret&&(cnt_secret[0]>=wbs.maxsecret))?Font.CR_GOLD:Font.CR_WHITE,xx-len,yy,str,DTA_VirtualWidthF,ss2.x,DTA_VirtualHeightF,ss2.y,DTA_KeepRatio,true);
|
||||
len = mSmallFont.StringWidth(str);
|
||||
Screen.DrawText(mSmallFont,(wbs.maxsecret&&(cnt_secret[0]>=wbs.maxsecret))?Font.CR_GOLD:Font.CR_WHITE,xx-len,yy,str,DTA_VirtualWidthF,ss2.x,DTA_VirtualHeightF,ss2.y,DTA_KeepRatio,true);
|
||||
}
|
||||
yy += step;
|
||||
}
|
||||
if ( cnt_time >= 0 )
|
||||
{
|
||||
str = TimeStr(cnt_time);
|
||||
len = smallfont.StringWidth(str);
|
||||
Screen.DrawText(smallfont,(wbs.partime&&(cnt_time<=(wbs.partime/GameTicRate)))?Font.CR_GOLD:((wbs.sucktime>0)&&(cnt_time>(wbs.sucktime*3600)))?Font.CR_RED:Font.CR_WHITE,xx-len,yy,str,DTA_VirtualWidthF,ss2.x,DTA_VirtualHeightF,ss2.y,DTA_KeepRatio,true);
|
||||
len = mSmallFont.StringWidth(str);
|
||||
Screen.DrawText(mSmallFont,(wbs.partime&&(cnt_time<=(wbs.partime/GameTicRate)))?Font.CR_GOLD:((wbs.sucktime>0)&&(cnt_time>(wbs.sucktime*3600)))?Font.CR_RED:Font.CR_WHITE,xx-len,yy,str,DTA_VirtualWidthF,ss2.x,DTA_VirtualHeightF,ss2.y,DTA_KeepRatio,true);
|
||||
}
|
||||
yy += step;
|
||||
if ( wi_showtotaltime )
|
||||
|
|
@ -618,16 +620,16 @@ Class SWWMStatScreen_SP : SWWMStatScreen
|
|||
if ( cnt_total_time >= 0 )
|
||||
{
|
||||
str = TimeStr(cnt_total_time);
|
||||
len = smallfont.StringWidth(str);
|
||||
Screen.DrawText(smallfont,Font.CR_WHITE,xx-len,yy,str,DTA_VirtualWidthF,ss2.x,DTA_VirtualHeightF,ss2.y,DTA_KeepRatio,true);
|
||||
len = mSmallFont.StringWidth(str);
|
||||
Screen.DrawText(mSmallFont,Font.CR_WHITE,xx-len,yy,str,DTA_VirtualWidthF,ss2.x,DTA_VirtualHeightF,ss2.y,DTA_KeepRatio,true);
|
||||
}
|
||||
yy += step;
|
||||
}
|
||||
if ( wbs.partime && (cnt_par >= 0) )
|
||||
{
|
||||
str = TimeStr(cnt_par);
|
||||
len = smallfont.StringWidth(str);
|
||||
Screen.DrawText(smallfont,Font.CR_WHITE,xx-len,yy,str,DTA_VirtualWidthF,ss2.x,DTA_VirtualHeightF,ss2.y,DTA_KeepRatio,true);
|
||||
len = mSmallFont.StringWidth(str);
|
||||
Screen.DrawText(mSmallFont,Font.CR_WHITE,xx-len,yy,str,DTA_VirtualWidthF,ss2.x,DTA_VirtualHeightF,ss2.y,DTA_KeepRatio,true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -774,12 +776,12 @@ Class SWWMStatScreen_Coop : SWWMStatScreen
|
|||
String killsstr = StringTable.Localize("$SCORE_KILLS");
|
||||
String missedstr = StringTable.Localize("$SCORE_MISSED");
|
||||
String totalstr = StringTable.Localize("$SCORE_TOTAL");
|
||||
int namelen = max(max(smallfont.StringWidth(namestr),smallfont.StringWidth("XXXXXXXXXX")),max(smallfont.StringWidth(missedstr),smallfont.StringWidth(totalstr)));
|
||||
int namelen = max(max(mSmallFont.StringWidth(namestr),mSmallFont.StringWidth("XXXXXXXXXX")),max(mSmallFont.StringWidth(missedstr),mSmallFont.StringWidth(totalstr)));
|
||||
int nplayers = 0;
|
||||
for ( int i=0; i<MAXPLAYERS; i++ )
|
||||
{
|
||||
if ( !playeringame[i] ) continue;
|
||||
namelen = max(namelen,smallfont.StringWidth(players[i].GetUserName()));
|
||||
namelen = max(namelen,mSmallFont.StringWidth(players[i].GetUserName()));
|
||||
nplayers++;
|
||||
}
|
||||
int misseditems = wbs.maxitems;
|
||||
|
|
@ -788,29 +790,29 @@ Class SWWMStatScreen_Coop : SWWMStatScreen
|
|||
String itemstotal = String.Format("%d",misseditems);
|
||||
String secrettotal = String.Format("%d",missedsecret);
|
||||
String killstotal = String.Format("%d",missedkills);
|
||||
int itemslen = max(smallfont.StringWidth("100%"),max(smallfont.StringWidth(itemstotal),smallfont.StringWidth(itemsstr)));
|
||||
int secretlen = max(smallfont.StringWidth("100%"),max(smallfont.StringWidth(secrettotal),smallfont.StringWidth(secretstr)));
|
||||
int killslen = max(smallfont.StringWidth("100%"),max(smallfont.StringWidth(killstotal),smallfont.StringWidth(killsstr)));
|
||||
int itemslen = max(mSmallFont.StringWidth("100%"),max(mSmallFont.StringWidth(itemstotal),mSmallFont.StringWidth(itemsstr)));
|
||||
int secretlen = max(mSmallFont.StringWidth("100%"),max(mSmallFont.StringWidth(secrettotal),mSmallFont.StringWidth(secretstr)));
|
||||
int killslen = max(mSmallFont.StringWidth("100%"),max(mSmallFont.StringWidth(killstotal),mSmallFont.StringWidth(killsstr)));
|
||||
int pad = 2;
|
||||
int spc = 12;
|
||||
int hspc = 6;
|
||||
int lspc = 2;
|
||||
int rwidth = smallfont.GetCharWidth(checkmark)+4;
|
||||
int rwidth = mSmallFont.GetCharWidth(checkmark)+4;
|
||||
int linew = pad+rwidth+namelen+spc+itemslen+spc+secretlen+spc+killslen+pad;
|
||||
int boxwidth = pad+linew+pad;
|
||||
int lineh = smallfont.GetHeight();
|
||||
int lineh = mSmallFont.GetHeight();
|
||||
int boxheight = pad+lineh+hspc+(lineh+lspc)*nplayers+hspc+lineh+lspc+lineh+pad;
|
||||
Screen.Dim("Black",.8,int((ss.x-boxwidth)*hs)/2,int((ss.y-boxheight)*hs)/2,int(boxwidth*hs),int(boxheight*hs));
|
||||
// header
|
||||
int xx = int((ss.x-boxwidth)/2+pad+pad+rwidth);
|
||||
int yy = int((ss.y-boxheight)/2+pad);
|
||||
Screen.DrawText(smallfont,Font.CR_GREEN,xx,yy,namestr,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
Screen.DrawText(mSmallFont,Font.CR_GREEN,xx,yy,namestr,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
xx += namelen+spc;
|
||||
Screen.DrawText(smallfont,Font.CR_GREEN,xx,yy,itemsstr,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
Screen.DrawText(mSmallFont,Font.CR_GREEN,xx,yy,itemsstr,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
xx += itemslen+spc;
|
||||
Screen.DrawText(smallfont,Font.CR_GREEN,xx,yy,secretstr,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
Screen.DrawText(mSmallFont,Font.CR_GREEN,xx,yy,secretstr,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
xx += secretlen+spc;
|
||||
Screen.DrawText(smallfont,Font.CR_GREEN,xx,yy,killsstr,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
Screen.DrawText(mSmallFont,Font.CR_GREEN,xx,yy,killsstr,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
yy += lineh+hspc;
|
||||
String str;
|
||||
for ( int i=0; i<MAXPLAYERS; i++ )
|
||||
|
|
@ -819,65 +821,65 @@ Class SWWMStatScreen_Coop : SWWMStatScreen
|
|||
xx = int((ss.x-boxwidth)/2.+pad);
|
||||
Screen.Dim(players[i].GetDisplayColor(),.4,int(xx*hs),int(yy*hs),int(linew*hs),int(lineh*hs));
|
||||
xx += pad;
|
||||
if ( playerready[i] || players[i].Bot ) Screen.DrawChar(smallfont,Font.CR_GREEN,xx,yy,checkmark,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
if ( playerready[i] || players[i].Bot ) Screen.DrawChar(mSmallFont,Font.CR_GREEN,xx,yy,checkmark,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
xx += rwidth;
|
||||
Screen.DrawText(smallfont,GetRowColor(players[i],i==me),xx,yy,players[i].GetUserName(),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
Screen.DrawText(mSmallFont,GetRowColor(players[i],i==me),xx,yy,players[i].GetUserName(),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
xx += namelen+spc;
|
||||
if ( ng_state >= 4 )
|
||||
{
|
||||
str = String.Format("%3d\cu%%\c-",GetPct(cnt_items[i],wbs.maxitems));
|
||||
Screen.DrawText(smallfont,(!wbs.maxitems||(cnt_items[i]>=wbs.maxitems))?Font.CR_GOLD:Font.CR_WHITE,xx+itemslen-smallfont.StringWidth(str),yy,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
Screen.DrawText(mSmallFont,(!wbs.maxitems||(cnt_items[i]>=wbs.maxitems))?Font.CR_GOLD:Font.CR_WHITE,xx+itemslen-mSmallFont.StringWidth(str),yy,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
misseditems -= cnt_items[i];
|
||||
}
|
||||
xx += itemslen+spc;
|
||||
if ( ng_state >= 6 )
|
||||
{
|
||||
str = String.Format("%3d\cu%%\c-",GetPct(cnt_secret[i],wbs.maxsecret));
|
||||
Screen.DrawText(smallfont,(!wbs.maxsecret||(cnt_secret[i]>=wbs.maxsecret))?Font.CR_GOLD:Font.CR_WHITE,xx+secretlen-smallfont.StringWidth(str),yy,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
Screen.DrawText(mSmallFont,(!wbs.maxsecret||(cnt_secret[i]>=wbs.maxsecret))?Font.CR_GOLD:Font.CR_WHITE,xx+secretlen-mSmallFont.StringWidth(str),yy,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
missedsecret -= cnt_secret[i];
|
||||
}
|
||||
xx += secretlen+spc;
|
||||
str = String.Format("%3d\cu%%\c-",GetPct(cnt_kills[i],wbs.maxkills));
|
||||
Screen.DrawText(smallfont,(!wbs.maxkills||(cnt_kills[i]>=wbs.maxkills))?Font.CR_GOLD:Font.CR_WHITE,xx+killslen-smallfont.StringWidth(str),yy,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
Screen.DrawText(mSmallFont,(!wbs.maxkills||(cnt_kills[i]>=wbs.maxkills))?Font.CR_GOLD:Font.CR_WHITE,xx+killslen-mSmallFont.StringWidth(str),yy,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
missedkills -= cnt_kills[i];
|
||||
yy += lineh+lspc;
|
||||
}
|
||||
xx = int((ss.x-boxwidth)/2+pad+pad+rwidth);
|
||||
yy += hspc;
|
||||
Screen.DrawText(smallfont,Font.CR_GREEN,xx,yy,missedstr,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
Screen.DrawText(mSmallFont,Font.CR_GREEN,xx,yy,missedstr,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
xx += namelen+spc;
|
||||
if ( ng_state >= 4 )
|
||||
{
|
||||
str = String.Format("%3d\cu%%\c-",GetPct(misseditems,wbs.maxitems,true));
|
||||
Screen.DrawText(smallfont,(wbs.maxitems&&(misseditems>0))?Font.CR_WHITE:Font.CR_GOLD,xx+itemslen-smallfont.StringWidth(str),yy,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
Screen.DrawText(mSmallFont,(wbs.maxitems&&(misseditems>0))?Font.CR_WHITE:Font.CR_GOLD,xx+itemslen-mSmallFont.StringWidth(str),yy,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
}
|
||||
xx += itemslen+spc;
|
||||
if ( ng_state >= 6 )
|
||||
{
|
||||
str = String.Format("%3d\cu%%\c-",GetPct(missedsecret,wbs.maxsecret,true));
|
||||
Screen.DrawText(smallfont,(wbs.maxsecret&&(missedsecret>0))?Font.CR_WHITE:Font.CR_GOLD,xx+secretlen-smallfont.StringWidth(str),yy,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
Screen.DrawText(mSmallFont,(wbs.maxsecret&&(missedsecret>0))?Font.CR_WHITE:Font.CR_GOLD,xx+secretlen-mSmallFont.StringWidth(str),yy,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
}
|
||||
xx += secretlen+spc;
|
||||
str = String.Format("%3d\cu%%\c-",GetPct(missedkills,wbs.maxkills,true));
|
||||
Screen.DrawText(smallfont,(wbs.maxkills&&(missedkills>0))?Font.CR_WHITE:Font.CR_GOLD,xx+killslen-smallfont.StringWidth(str),yy,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
Screen.DrawText(mSmallFont,(wbs.maxkills&&(missedkills>0))?Font.CR_WHITE:Font.CR_GOLD,xx+killslen-mSmallFont.StringWidth(str),yy,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
yy += lineh+lspc;
|
||||
xx = int((ss.x-boxwidth)/2+pad+pad+rwidth);
|
||||
Screen.DrawText(smallfont,Font.CR_GREEN,xx,yy,totalstr,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
Screen.DrawText(mSmallFont,Font.CR_GREEN,xx,yy,totalstr,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
xx += namelen+spc;
|
||||
if ( ng_state >= 4 )
|
||||
{
|
||||
str = String.Format("%d",wbs.maxitems);
|
||||
Screen.DrawText(smallfont,Font.CR_WHITE,xx+itemslen-smallfont.StringWidth(str),yy,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
Screen.DrawText(mSmallFont,Font.CR_WHITE,xx+itemslen-mSmallFont.StringWidth(str),yy,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
}
|
||||
xx += itemslen+spc;
|
||||
if ( ng_state >= 6 )
|
||||
{
|
||||
str = String.Format("%d",wbs.maxsecret);
|
||||
Screen.DrawText(smallfont,Font.CR_WHITE,xx+secretlen-smallfont.StringWidth(str),yy,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
Screen.DrawText(mSmallFont,Font.CR_WHITE,xx+secretlen-mSmallFont.StringWidth(str),yy,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
}
|
||||
xx += secretlen+spc;
|
||||
str = String.Format("%d",wbs.maxkills);
|
||||
Screen.DrawText(smallfont,Font.CR_WHITE,xx+killslen-smallfont.StringWidth(str),yy,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
Screen.DrawText(mSmallFont,Font.CR_WHITE,xx+killslen-mSmallFont.StringWidth(str),yy,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -993,36 +995,36 @@ Class SWWMStatScreen_DM : SWWMStatScreen
|
|||
String deathsstr = StringTable.Localize("$SCORE_DEATHS");
|
||||
String fragsstr = StringTable.Localize("$SCORE_FRAGS");
|
||||
String totalstr = StringTable.Localize("$SCORE_TOTAL");
|
||||
int namelen = max(max(smallfont.StringWidth(namestr),smallfont.StringWidth("XXXXXXXXXX")),smallfont.StringWidth(totalstr));
|
||||
int namelen = max(max(mSmallFont.StringWidth(namestr),mSmallFont.StringWidth("XXXXXXXXXX")),mSmallFont.StringWidth(totalstr));
|
||||
int nplayers = 0;
|
||||
for ( int i=0; i<MAXPLAYERS; i++ )
|
||||
{
|
||||
if ( !playeringame[i] ) continue;
|
||||
namelen = max(namelen,smallfont.StringWidth(players[i].GetUserName()));
|
||||
namelen = max(namelen,mSmallFont.StringWidth(players[i].GetUserName()));
|
||||
nplayers++;
|
||||
}
|
||||
String deathstotal = String.Format("%d",total_deaths);
|
||||
String fragstotal = String.Format("%d",total_frags);
|
||||
int deathslen = max(smallfont.StringWidth(deathstotal),smallfont.StringWidth(deathsstr));
|
||||
int fragslen = max(smallfont.StringWidth(fragstotal),smallfont.StringWidth(fragsstr));
|
||||
int deathslen = max(mSmallFont.StringWidth(deathstotal),mSmallFont.StringWidth(deathsstr));
|
||||
int fragslen = max(mSmallFont.StringWidth(fragstotal),mSmallFont.StringWidth(fragsstr));
|
||||
int pad = 2;
|
||||
int spc = 12;
|
||||
int hspc = 6;
|
||||
int lspc = 2;
|
||||
int rwidth = smallfont.GetCharWidth(checkmark)+4;
|
||||
int rwidth = mSmallFont.GetCharWidth(checkmark)+4;
|
||||
int linew = pad+rwidth+namelen+spc+deathslen+spc+fragslen+pad;
|
||||
int boxwidth = pad+linew+pad;
|
||||
int lineh = smallfont.GetHeight();
|
||||
int lineh = mSmallFont.GetHeight();
|
||||
int boxheight = pad+lineh+hspc+(lineh+lspc)*nplayers+hspc+lineh+pad;
|
||||
Screen.Dim("Black",.8,int((ss.x-boxwidth)*hs)/2,int((ss.y-boxheight)*hs)/2,int(boxwidth*hs),int(boxheight*hs));
|
||||
// header
|
||||
int xx = int((ss.x-boxwidth)/2+pad+pad+rwidth);
|
||||
int yy = int((ss.y-boxheight)/2+pad);
|
||||
Screen.DrawText(smallfont,Font.CR_GREEN,xx,yy,namestr,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
Screen.DrawText(mSmallFont,Font.CR_GREEN,xx,yy,namestr,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
xx += namelen+spc;
|
||||
Screen.DrawText(smallfont,Font.CR_GREEN,xx,yy,deathsstr,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
Screen.DrawText(mSmallFont,Font.CR_GREEN,xx,yy,deathsstr,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
xx += deathslen+spc;
|
||||
Screen.DrawText(smallfont,Font.CR_GREEN,xx,yy,fragsstr,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
Screen.DrawText(mSmallFont,Font.CR_GREEN,xx,yy,fragsstr,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
yy += lineh+hspc;
|
||||
String str;
|
||||
Array<Int> sorted;
|
||||
|
|
@ -1034,31 +1036,31 @@ Class SWWMStatScreen_DM : SWWMStatScreen
|
|||
xx = int((ss.x-boxwidth)/2+pad);
|
||||
Screen.Dim(players[i].GetDisplayColor(),.4,int(xx*hs),int(yy*hs),int(linew*hs),int(lineh*hs));
|
||||
xx += pad;
|
||||
if ( playerready[i] || players[i].Bot ) Screen.DrawChar(smallfont,Font.CR_GREEN,xx,yy,checkmark,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
if ( playerready[i] || players[i].Bot ) Screen.DrawChar(mSmallFont,Font.CR_GREEN,xx,yy,checkmark,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
xx += rwidth;
|
||||
Screen.DrawText(smallfont,GetRowColor(players[i],i==me),xx,yy,players[i].GetUserName(),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
Screen.DrawText(mSmallFont,GetRowColor(players[i],i==me),xx,yy,players[i].GetUserName(),DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
xx += namelen+spc;
|
||||
if ( ng_state >= 2 )
|
||||
{
|
||||
str = String.Format("%d",cnt_deaths[i]);
|
||||
Screen.DrawText(smallfont,Font.CR_WHITE,xx+deathslen-smallfont.StringWidth(str),yy,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
Screen.DrawText(mSmallFont,Font.CR_WHITE,xx+deathslen-mSmallFont.StringWidth(str),yy,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
}
|
||||
xx += deathslen+spc;
|
||||
str = String.Format("%d",cnt_frags[i]);
|
||||
Screen.DrawText(smallfont,Font.CR_WHITE,xx+fragslen-smallfont.StringWidth(str),yy,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
Screen.DrawText(mSmallFont,Font.CR_WHITE,xx+fragslen-mSmallFont.StringWidth(str),yy,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
yy += lineh+lspc;
|
||||
}
|
||||
xx = int((ss.x-boxwidth)/2+pad+pad+rwidth);
|
||||
yy += hspc;
|
||||
Screen.DrawText(smallfont,Font.CR_GREEN,xx,yy,totalstr,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
Screen.DrawText(mSmallFont,Font.CR_GREEN,xx,yy,totalstr,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
xx += namelen+spc;
|
||||
if ( ng_state >= 4 )
|
||||
{
|
||||
str = String.Format("%d",total_deaths);
|
||||
Screen.DrawText(smallfont,Font.CR_WHITE,xx+deathslen-smallfont.StringWidth(str),yy,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
Screen.DrawText(mSmallFont,Font.CR_WHITE,xx+deathslen-mSmallFont.StringWidth(str),yy,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
}
|
||||
xx += deathslen+spc;
|
||||
str = String.Format("%d",total_frags);
|
||||
Screen.DrawText(smallfont,Font.CR_WHITE,xx+fragslen-smallfont.StringWidth(str),yy,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
Screen.DrawText(mSmallFont,Font.CR_WHITE,xx+fragslen-mSmallFont.StringWidth(str),yy,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -175,7 +175,15 @@ Class OptionMenuItemSWWMPlayTime : OptionMenuItem
|
|||
// option menu /w tooltips
|
||||
Class SWWMOptionMenu : OptionMenu
|
||||
{
|
||||
private String ttip;
|
||||
private String ttip, olttip;
|
||||
private Font mTipFont;
|
||||
private BrokenLines ttlines;
|
||||
|
||||
override void Init( Menu parent, OptionMenuDescriptor desc )
|
||||
{
|
||||
Super.Init(parent,desc);
|
||||
mTipFont = Font.GetFont('TewiFont');
|
||||
}
|
||||
|
||||
override void Ticker()
|
||||
{
|
||||
|
|
@ -185,13 +193,16 @@ Class SWWMOptionMenu : OptionMenu
|
|||
String mcvar = mDesc.mItems[mDesc.mSelectedItem].GetAction();
|
||||
mcvar.Replace(" ","_"); // need to strip whitespace for command actions
|
||||
String locstr = String.Format("TOOLTIP_%s",mcvar);
|
||||
olttip = ttip;
|
||||
ttip = StringTable.Localize(locstr,false);
|
||||
if ( ttip == locstr ) ttip = "";
|
||||
if ( (ttip != olttip) && ttlines ) ttlines.Destroy();
|
||||
if ( !ttlines ) ttlines = mTipFont.BreakLines(ttip,CleanWidth_1-8);
|
||||
}
|
||||
override void Drawer()
|
||||
{
|
||||
Super.Drawer();
|
||||
if ( ttip == "" ) return;
|
||||
if ( (ttip == "") || !ttlines ) return;
|
||||
// re-evaluate y to check where the cursor is
|
||||
int cy = 0;
|
||||
int y = mDesc.mPosition;
|
||||
|
|
@ -220,22 +231,20 @@ Class SWWMOptionMenu : OptionMenu
|
|||
break;
|
||||
}
|
||||
}
|
||||
let lines = smallfont.BreakLines(ttip,CleanWidth_1-8);
|
||||
int height = (4+smallfont.GetHeight()*lines.Count())*CleanYFac_1;
|
||||
int height = (4+mTipFont.GetHeight()*ttlines.Count())*CleanYFac_1;
|
||||
// draw at the bottom unless the selected option could be covered by the tooltip
|
||||
int ypos = Screen.GetHeight()-height;
|
||||
if ( cy > ypos ) ypos = 0;
|
||||
Screen.Dim("Black",.75,0,ypos,Screen.GetWidth(),height);
|
||||
ypos += 2*CleanYFac_1;
|
||||
for ( int i=0; i<lines.Count(); i++ )
|
||||
for ( int i=0; i<ttlines.Count(); i++ )
|
||||
{
|
||||
Screen.DrawText(smallfont,Font.CR_WHITE,4*CleanXFac_1,ypos,lines.StringAt(i),DTA_CleanNoMove_1,true);
|
||||
ypos += smallfont.GetHeight()*CleanYFac_1;
|
||||
Screen.DrawText(mTipFont,Font.CR_WHITE,4*CleanXFac_1,ypos,ttlines.StringAt(i),DTA_CleanNoMove_1,true);
|
||||
ypos += mTipFont.GetHeight()*CleanYFac_1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// main menu w/ version info
|
||||
Class SWWMCleanMenu : ListMenu
|
||||
{
|
||||
override bool MouseEvent( int type, int x, int y )
|
||||
|
|
@ -268,11 +277,13 @@ Class SWWMCleanMenu : ListMenu
|
|||
}
|
||||
}
|
||||
|
||||
// main menu w/ version info
|
||||
Class SWWMMainMenu : SWWMCleanMenu
|
||||
{
|
||||
TextureID demotex, gradtex;
|
||||
double demopos;
|
||||
transient uint prevms;
|
||||
Font mSmallFont;
|
||||
|
||||
private TextureID GetDemoTex()
|
||||
{
|
||||
|
|
@ -307,6 +318,7 @@ Class SWWMMainMenu : SWWMCleanMenu
|
|||
override void Init( Menu parent, ListMenuDescriptor desc )
|
||||
{
|
||||
Super.Init(parent,desc);
|
||||
mSmallFont = Font.GetFont('TewiFont');
|
||||
demotex = GetDemoTex();
|
||||
demopos = 120;
|
||||
prevms = MSTime();
|
||||
|
|
@ -353,12 +365,12 @@ Class SWWMMainMenu : SWWMCleanMenu
|
|||
mDesc.mItems[i].OffsetPositionY(-GetMenuYOffset());
|
||||
int xx, yy;
|
||||
String str = StringTable.Localize("$SWWM_MODVER");
|
||||
int width = smallfont.StringWidth(str)+8;
|
||||
int height = smallfont.GetHeight()+4;
|
||||
int width = mSmallFont.StringWidth(str)+8;
|
||||
int height = mSmallFont.GetHeight()+4;
|
||||
xx = CleanWidth_1-width;
|
||||
yy = CleanHeight_1-height;
|
||||
Screen.Dim("Black",.75,int(xx*CleanXFac_1),int(yy*CleanYFac_1),int(width*CleanXFac_1),int(height*CleanYFac_1));
|
||||
Screen.DrawText(smallfont,Font.CR_GOLD,(xx+4)*CleanXFac_1,(yy+2)*CleanYFac_1,str,DTA_CleanNoMove_1,true);
|
||||
Screen.DrawText(mSmallFont,Font.CR_GOLD,(xx+4)*CleanXFac_1,(yy+2)*CleanYFac_1,str,DTA_CleanNoMove_1,true);
|
||||
prevms = MSTime();
|
||||
}
|
||||
|
||||
|
|
@ -381,9 +393,12 @@ Class SWWMBigMenuHack : SWWMCleanMenu
|
|||
bool longlist; // more than 10 entries, scrolls
|
||||
int ofs;
|
||||
|
||||
Font mSmallFont;
|
||||
|
||||
override void Init( Menu parent, ListMenuDescriptor desc )
|
||||
{
|
||||
Super.Init(parent,desc);
|
||||
mSmallFont = Font.GetFont('TewiFont');
|
||||
for ( int i=0; i<mDesc.mItems.Size(); i++ )
|
||||
{
|
||||
let itm = mDesc.mItems[i];
|
||||
|
|
@ -473,19 +488,19 @@ Class SWWMBigMenuHack : SWWMCleanMenu
|
|||
isclean = true;
|
||||
}
|
||||
String str = "⌃ ⌃ ⌃";
|
||||
double x = (w-smallfont.StringWidth(str))/2;
|
||||
double x = (w-mSmallFont.StringWidth(str))/2;
|
||||
double y = (h-224)/2;
|
||||
if ( isclean ) SWWMUtility.AdjustClean_1(x,y);
|
||||
if ( ofs > 0 )
|
||||
{
|
||||
if ( isclean ) Screen.DrawText(smallfont,Font.CR_FIRE,x,y+16*CleanYFac_1,str,DTA_CleanNoMove_1,true);
|
||||
else Screen.DrawText(smallfont,Font.CR_FIRE,x,y+16,str,DTA_VirtualWidth,w,DTA_VirtualHeight,h,DTA_FullscreenScale,FSMode_ScaleToFit43);
|
||||
if ( isclean ) Screen.DrawText(mSmallFont,Font.CR_FIRE,x,y+16*CleanYFac_1,str,DTA_CleanNoMove_1,true);
|
||||
else Screen.DrawText(mSmallFont,Font.CR_FIRE,x,y+16,str,DTA_VirtualWidth,w,DTA_VirtualHeight,h,DTA_FullscreenScale,FSMode_ScaleToFit43);
|
||||
}
|
||||
if ( ofs < (mDesc.mItems.Size()-8) )
|
||||
{
|
||||
str = "⌄ ⌄ ⌄";
|
||||
if ( isclean ) Screen.DrawText(smallfont,Font.CR_FIRE,x,y+256*CleanYFac_1,str,DTA_CleanNoMove_1,true);
|
||||
else Screen.DrawText(smallfont,Font.CR_FIRE,x,y+256,str,DTA_VirtualWidth,w,DTA_VirtualHeight,h,DTA_FullscreenScale,FSMode_ScaleToFit43);
|
||||
if ( isclean ) Screen.DrawText(mSmallFont,Font.CR_FIRE,x,y+256*CleanYFac_1,str,DTA_CleanNoMove_1,true);
|
||||
else Screen.DrawText(mSmallFont,Font.CR_FIRE,x,y+256,str,DTA_VirtualWidth,w,DTA_VirtualHeight,h,DTA_FullscreenScale,FSMode_ScaleToFit43);
|
||||
}
|
||||
for ( int i=0; i<mDesc.mItems.Size(); i++ )
|
||||
{
|
||||
|
|
@ -569,17 +584,21 @@ Class ListMenuItemSWWMStaticTextM : ListMenuItem
|
|||
String text = Stringtable.Localize(mText);
|
||||
int w = desc?desc.DisplayWidth():ListMenuDescriptor.CleanScale;
|
||||
int h = desc?desc.DisplayHeight():-1;
|
||||
let font = menuDelegate.PickFont(mFont);
|
||||
int scl;
|
||||
if ( font != NewSmallFont ) scl = 3;
|
||||
else scl = 2;
|
||||
if ( w == ListMenuDescriptor.CleanScale )
|
||||
{
|
||||
double x = int(320-mFont.StringWidth(text)*1.5)/2;
|
||||
double x = (320-mFont.StringWidth(text)*scl)/2;
|
||||
double y = mYpos;
|
||||
SWWMUtility.AdjustClean_1(x,y);
|
||||
Screen.DrawText(mFont,mColor,x,y,text,DTA_ScaleX,CleanXFac_1*1.5,DTA_ScaleY,CleanYFac_1*1.5);
|
||||
Screen.DrawText(mFont,mColor,x,y,text,DTA_ScaleX,CleanXFac_1*scl,DTA_ScaleY,CleanYFac_1*scl);
|
||||
}
|
||||
else
|
||||
{
|
||||
double x = int(w-mFont.StringWidth(text)*1.5)/2;
|
||||
Screen.DrawText(mFont,mColor,x,mYpos,text,DTA_VirtualWidth,w,DTA_VirtualHeight,h,DTA_FullscreenScale,FSMode_ScaleToFit43,DTA_ScaleX,1.5,DTA_ScaleY,1.5);
|
||||
double x = (w-mFont.StringWidth(text)*scl)/2;
|
||||
Screen.DrawText(mFont,mColor,x,mYpos,text,DTA_VirtualWidth,w,DTA_VirtualHeight,h,DTA_FullscreenScale,FSMode_ScaleToFit43,DTA_ScaleX,scl,DTA_ScaleY,scl);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -642,9 +661,9 @@ Class SWWMMessageBox : MessageBoxMenu
|
|||
}
|
||||
else
|
||||
{
|
||||
destWidth = CleanWidth_1*2;
|
||||
destHeight = CleanHeight_1*2;
|
||||
textfont = bigfont;
|
||||
destWidth = CleanWidth_1;
|
||||
destHeight = CleanHeight_1;
|
||||
textfont = Font.GetFont('TewiFontOutline');
|
||||
mMessage = textfont.BreakLines(Stringtable.Localize(message),480);
|
||||
}
|
||||
}
|
||||
|
|
@ -701,8 +720,8 @@ Class SWWMMessageBox : MessageBoxMenu
|
|||
Screen.DrawText(textfont,messageSelection==0?OptionMenuSettings.mFontColorSelection:OptionMenuSettings.mFontColor,(destWidth-2*textfont.StringWidth(stryes))/2,y,stryes, DTA_VirtualWidth,destWidth,DTA_VirtualHeight,destHeight,DTA_KeepRatio,true,DTA_ScaleX,2.,DTA_ScaleY,2.);
|
||||
Screen.DrawText(textfont,messageSelection==1?OptionMenuSettings.mFontColorSelection:OptionMenuSettings.mFontColor,(destWidth-2*textfont.StringWidth(strno))/2,y+fontheight*2,strno,DTA_VirtualWidth,destWidth,DTA_VirtualHeight,destHeight,DTA_KeepRatio,true,DTA_ScaleX,2.,DTA_ScaleY,2.);
|
||||
if ( (messageSelection < 0) || ((MenuTime()%8) >= 4) ) return;
|
||||
Screen.DrawText(textfont,OptionMenuSettings.mFontColorSelection,(destWidth-2*textfont.StringWidth(messageSelection?strno:stryes))/2-46,y+fontheight*2*messageSelection,"►",DTA_VirtualWidth,destWidth,DTA_VirtualHeight,destHeight,DTA_KeepRatio,true,DTA_ScaleX,2.,DTA_ScaleY,2.);
|
||||
Screen.DrawText(textfont,OptionMenuSettings.mFontColorSelection,(destWidth+2*textfont.StringWidth(messageSelection?strno:stryes))/2+16,y+fontheight*2*messageSelection,"◄",DTA_VirtualWidth,destWidth,DTA_VirtualHeight,destHeight,DTA_KeepRatio,true,DTA_ScaleX,2.,DTA_ScaleY,2.);
|
||||
Screen.DrawText(textfont,OptionMenuSettings.mFontColorSelection,(destWidth-2*textfont.StringWidth(messageSelection?strno:stryes))/2-26,y+fontheight*2*messageSelection,"►",DTA_VirtualWidth,destWidth,DTA_VirtualHeight,destHeight,DTA_KeepRatio,true,DTA_ScaleX,2.,DTA_ScaleY,2.);
|
||||
Screen.DrawText(textfont,OptionMenuSettings.mFontColorSelection,(destWidth+2*textfont.StringWidth(messageSelection?strno:stryes))/2+12,y+fontheight*2*messageSelection,"◄",DTA_VirtualWidth,destWidth,DTA_VirtualHeight,destHeight,DTA_KeepRatio,true,DTA_ScaleX,2.,DTA_ScaleY,2.);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -800,7 +819,9 @@ class ListMenuItemSWWMTextItemM : ListMenuItemSelectable
|
|||
override int GetWidth()
|
||||
{
|
||||
let font = menuDelegate.PickFont(mFont);
|
||||
return max(1,font.StringWidth(StringTable.Localize(mText)));
|
||||
int w = font.StringWidth(StringTable.Localize(mText));
|
||||
if ( font != NewSmallFont ) w *= 2;
|
||||
return max(1,w);
|
||||
}
|
||||
|
||||
override void Draw( bool selected, ListMenuDescriptor desc )
|
||||
|
|
@ -809,13 +830,16 @@ class ListMenuItemSWWMTextItemM : ListMenuItemSelectable
|
|||
int h = desc?desc.DisplayHeight():-1;
|
||||
String text = StringTable.Localize(mText);
|
||||
let font = menuDelegate.PickFont(mFont);
|
||||
int scl;
|
||||
if ( font != NewSmallFont ) scl = 2;
|
||||
else scl = 1;
|
||||
double x;
|
||||
// centered
|
||||
if ( w == ListMenuDescriptor.CleanScale ) x = (320-font.StringWidth(text))/2;
|
||||
else x = (w-font.StringWidth(text))/2;
|
||||
if ( w == ListMenuDescriptor.CleanScale ) x = (320-font.StringWidth(text)*scl)/2;
|
||||
else x = (w-font.StringWidth(text)*scl)/2;
|
||||
double y = mYpos;
|
||||
// offset text so it's centered
|
||||
y += (mHeight-font.GetHeight())/2;
|
||||
y += (mHeight-font.GetHeight()*scl)/2;
|
||||
if ( selected )
|
||||
{
|
||||
double xx = x;
|
||||
|
|
@ -830,8 +854,8 @@ class ListMenuItemSWWMTextItemM : ListMenuItemSelectable
|
|||
int ch;
|
||||
[ch, pos] = text.GetNextCodePoint(pos);
|
||||
double yy = y+4*sin(32*i+8*Menu.MenuTime())*CleanYFac_1;
|
||||
Screen.DrawChar(font,mColorSelected,xx,yy,ch,DTA_CleanNoMove_1,true);
|
||||
xx += (font.GetCharWidth(ch)+kern)*CleanXFac_1;
|
||||
Screen.DrawChar(font,mColorSelected,xx,yy,ch,DTA_ScaleX,CleanXFac_1*scl,DTA_ScaleY,CleanYFac_1*scl);
|
||||
xx += (font.GetCharWidth(ch)+kern)*CleanXFac_1*scl;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
@ -841,17 +865,17 @@ class ListMenuItemSWWMTextItemM : ListMenuItemSelectable
|
|||
int ch;
|
||||
[ch, pos] = text.GetNextCodePoint(pos);
|
||||
double yy = y+4*sin(32*i+8*Menu.MenuTime());
|
||||
Screen.DrawChar(mFont,mColorSelected,xx,yy,ch,DTA_VirtualWidth,w,DTA_VirtualHeight,h,DTA_FullscreenScale,FSMode_ScaleToFit43);
|
||||
xx += (font.GetCharWidth(ch)+kern);
|
||||
Screen.DrawChar(mFont,mColorSelected,xx,yy,ch,DTA_VirtualWidth,w,DTA_VirtualHeight,h,DTA_FullscreenScale,FSMode_ScaleToFit43,DTA_ScaleX,scl,DTA_ScaleY,scl);
|
||||
xx += (font.GetCharWidth(ch)+kern)*scl;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ( w == ListMenuDescriptor.CleanScale )
|
||||
{
|
||||
SWWMUtility.AdjustClean_1(x,y);
|
||||
Screen.DrawText(font,mColor,x,y,text,DTA_CleanNoMove_1,true);
|
||||
Screen.DrawText(font,mColor,x,y,text,DTA_ScaleX,CleanXFac_1*scl,DTA_ScaleY,CleanYFac_1*scl);
|
||||
}
|
||||
else Screen.DrawText(font,mColor,x,y,text,DTA_VirtualWidth,w,DTA_VirtualHeight,h,DTA_FullscreenScale,FSMode_ScaleToFit43);
|
||||
else Screen.DrawText(font,mColor,x,y,text,DTA_VirtualWidth,w,DTA_VirtualHeight,h,DTA_FullscreenScale,FSMode_ScaleToFit43,DTA_ScaleX,scl,DTA_ScaleY,scl);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -972,15 +996,16 @@ Class OptionMenuItemScaleSliderFix : OptionMenuItemScaleSlider
|
|||
}
|
||||
}
|
||||
|
||||
// draw captions using our own font
|
||||
Class SWWMMenuDelegate : DoomMenuDelegate
|
||||
{
|
||||
// we've got our own fonts 'round here
|
||||
override Font PickFont( Font fnt )
|
||||
Font mBigFont;
|
||||
|
||||
override int DrawCaption( String title, Font fnt, int y, bool drawit )
|
||||
{
|
||||
if ( generic_ui ) return NewSmallFont;
|
||||
if ( !fnt ) return SmallFont;
|
||||
if ( (fnt == AlternativeBigFont) || (fnt == OriginalBigFont) || (fnt == IntermissionFont) ) return BigFont;
|
||||
if ( (fnt == AlternativeSmallFont) || (fnt == NewSmallFont) ) return SmallFont;
|
||||
return fnt;
|
||||
if ( !mBigFont ) mBigFont = Font.GetFont('TewiFontOutline');
|
||||
fnt = mBigFont;
|
||||
if ( drawit ) Screen.DrawText(fnt,OptionMenuSettings.mTitleColor,(Screen.GetWidth()-fnt.StringWidth(title)*CleanXFac_1*2)/2,8*CleanYFac_1,title,DTA_ScaleX,CleanXFac_1*2,DTA_ScaleY,CleanYFac_1*2);
|
||||
return (y+fnt.GetHeight()*2)*CleanYFac_1;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ Class SWWMTitleStuff : EventHandler
|
|||
ui int rss;
|
||||
ui int stopinit_t;
|
||||
bool bFadeIn;
|
||||
ui Font mSmallFont, mBigFont;
|
||||
|
||||
private ui int GetUIRandom()
|
||||
{
|
||||
|
|
@ -137,6 +138,8 @@ Class SWWMTitleStuff : EventHandler
|
|||
|
||||
override void RenderUnderlay( RenderEvent e )
|
||||
{
|
||||
if ( !mSmallFont ) mSmallFont = Font.GetFont('TewiFont');
|
||||
if ( !mBigFont ) mBigFont = Font.GetFont('TewiFontOutline');
|
||||
if ( !camtex ) camtex = TexMan.CheckForTexture("LOGOFADE",TexMan.Type_Any);
|
||||
Screen.DrawTexture(camtex,false,0,0);
|
||||
if ( !tex[2] ) tex[2] = TexMan.CheckForTexture("graphics/tempbg.png",TexMan.Type_Any);
|
||||
|
|
@ -189,7 +192,7 @@ Class SWWMTitleStuff : EventHandler
|
|||
lastlang = language;
|
||||
lastlogo = swwm_oldlogo;
|
||||
// estimate scroll length
|
||||
double llen = smallfont.StringWidth(scrolls[sline]);
|
||||
double llen = mSmallFont.StringWidth(scrolls[sline]);
|
||||
double soffset = 40*((titletimer+e.FracTic)/GameTicRate-sbase);
|
||||
if ( soffset > llen+ss.x )
|
||||
{
|
||||
|
|
@ -213,15 +216,15 @@ Class SWWMTitleStuff : EventHandler
|
|||
alf = max(0,1.-abs((ss.x/2)-xx)/(ss.x/2))**.5;
|
||||
alf *= .2*trl;
|
||||
double xxofs = 5*sin(15*i+120*(titletimer+e.FracTic)/GameTicRate-90.*(1.-trl))-16*(1.-trl);
|
||||
Screen.DrawChar(smallfont,Font.CR_BLUE,xx-xxofs,yy,ch,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Alpha,alf,DTA_LegacyRenderStyle,STYLE_Add);
|
||||
Screen.DrawChar(mSmallFont,Font.CR_BLUE,xx-xxofs,yy,ch,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Alpha,alf,DTA_LegacyRenderStyle,STYLE_Add);
|
||||
}
|
||||
double yy = (ss.y-35)+10*sin(15*i+160*(titletimer+e.FracTic)/GameTicRate);
|
||||
alf = max(0,1.-abs((ss.x/2)-xx)/(ss.x/2))**.5;
|
||||
double xxofs = 5*sin(15*i+120*(titletimer+e.FracTic)/GameTicRate);
|
||||
Color c = Color(int(127.5+127.5*sin(10*i+80*(titletimer+e.FracTic)/GameTicRate)),0,0);
|
||||
Screen.DrawChar(smallfont,Font.CR_SAPPHIRE,xx-xxofs,yy,ch,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Alpha,alf);
|
||||
Screen.DrawChar(mSmallFont,Font.CR_SAPPHIRE,xx-xxofs,yy,ch,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Alpha,alf);
|
||||
}
|
||||
xx += smallfont.GetCharWidth(ch)+smallfont.GetDefaultKerning();
|
||||
xx += mSmallFont.GetCharWidth(ch)+mSmallFont.GetDefaultKerning();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -242,14 +245,14 @@ Class SWWMTitleStuff : EventHandler
|
|||
String str = StringTable.Localize("$SWWM_TITLEPRESENTS");
|
||||
alf = clamp(((titletimer+e.FracTic)/GameTicRate)-10,0.,1.);
|
||||
alf *= 1.-clamp(((titletimer+e.FracTic)/GameTicRate)-16,0.,1.);
|
||||
Screen.DrawText(smallfont,Font.CR_WHITE,(ss.x-smallfont.StringWidth(str))/2,(ss.y-smallfont.GetHeight())/2,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Alpha,alf);
|
||||
Screen.DrawText(mSmallFont,Font.CR_WHITE,(ss.x-mSmallFont.StringWidth(str))/2,(ss.y-mSmallFont.GetHeight())/2,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Alpha,alf);
|
||||
if ( bFadeIn ) Screen.Dim("Black",1.-clamp(((titletimer+e.FracTic)/GameTicRate)-22,0.,1.),0,0,Screen.GetWidth(),Screen.GetHeight());
|
||||
else
|
||||
{
|
||||
str = StringTable.Localize("$SWWM_TITLEMODBY");
|
||||
alf = clamp(((titletimer+e.FracTic)/GameTicRate)-18,0.,1.);
|
||||
alf *= 1.-clamp(((titletimer+e.FracTic)/GameTicRate)-24,0.,1.);
|
||||
Screen.DrawText(smallfont,Font.CR_WHITE,(ss.x-smallfont.StringWidth(str))/2,(ss.y-smallfont.GetHeight())/2,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Alpha,alf);
|
||||
Screen.DrawText(mSmallFont,Font.CR_WHITE,(ss.x-mSmallFont.StringWidth(str))/2,(ss.y-mSmallFont.GetHeight())/2,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Alpha,alf);
|
||||
}
|
||||
tsize = TexMan.GetScaledSize(tex[1]);
|
||||
sar = tsize.x/tsize.y;
|
||||
|
|
@ -270,23 +273,23 @@ Class SWWMTitleStuff : EventHandler
|
|||
double alf = clamp(((titletimer+e.FracTic)/GameTicRate)-1,0.,1.);
|
||||
alf *= 1.-clamp(((titletimer+e.FracTic)/GameTicRate)-4,0.,1.);
|
||||
String str = StringTable.Localize("$SWWM_TITLEPRESENTSA");
|
||||
Screen.DrawText(smallfont,Font.CR_FIRE,(Screen.GetWidth()-smallfont.StringWidth(str)*CleanXFac)/2,(Screen.GetHeight()/2)-(smallfont.GetHeight()*CleanYFac),str,DTA_CleanNoMove,true,DTA_Alpha,alf);
|
||||
Screen.DrawText(mSmallFont,Font.CR_FIRE,(Screen.GetWidth()-mSmallFont.StringWidth(str)*CleanXFac)/2,(Screen.GetHeight()/2)-(mSmallFont.GetHeight()*CleanYFac),str,DTA_CleanNoMove,true,DTA_Alpha,alf);
|
||||
str = StringTable.Localize("$SWWM_TITLEPRESENTSB");
|
||||
Screen.DrawText(smallfont,Font.CR_WHITE,(Screen.GetWidth()-smallfont.StringWidth(str)*CleanXFac)/2,(Screen.GetHeight()/2),str,DTA_CleanNoMove,true,DTA_Alpha,alf);
|
||||
Screen.DrawText(mSmallFont,Font.CR_WHITE,(Screen.GetWidth()-mSmallFont.StringWidth(str)*CleanXFac)/2,(Screen.GetHeight()/2),str,DTA_CleanNoMove,true,DTA_Alpha,alf);
|
||||
alf = clamp(((titletimer+e.FracTic)/GameTicRate)-5,0.,1.);
|
||||
alf *= 1.-clamp(((titletimer+e.FracTic)/GameTicRate)-8,0.,1.);
|
||||
str = StringTable.Localize("$SWWM_TITLEMODBYA");
|
||||
Screen.DrawText(smallfont,Font.CR_WHITE,(Screen.GetWidth()-smallfont.StringWidth(str)*CleanXFac)/2,(Screen.GetHeight()/2)-(smallfont.GetHeight()*CleanYFac),str,DTA_CleanNoMove,true,DTA_Alpha,alf);
|
||||
Screen.DrawText(mSmallFont,Font.CR_WHITE,(Screen.GetWidth()-mSmallFont.StringWidth(str)*CleanXFac)/2,(Screen.GetHeight()/2)-(mSmallFont.GetHeight()*CleanYFac),str,DTA_CleanNoMove,true,DTA_Alpha,alf);
|
||||
str = StringTable.Localize("$SWWM_TITLEMODBYB");
|
||||
Screen.DrawText(smallfont,Font.CR_FIRE,(Screen.GetWidth()-smallfont.StringWidth(str)*CleanXFac)/2,(Screen.GetHeight()/2),str,DTA_CleanNoMove,true,DTA_Alpha,alf);
|
||||
Screen.DrawText(mSmallFont,Font.CR_FIRE,(Screen.GetWidth()-mSmallFont.StringWidth(str)*CleanXFac)/2,(Screen.GetHeight()/2),str,DTA_CleanNoMove,true,DTA_Alpha,alf);
|
||||
alf = clamp(((titletimer+e.FracTic)/GameTicRate)-10,0.,1.);
|
||||
alf *= 1.-clamp(((titletimer+e.FracTic)/GameTicRate)-21,0.,1.);
|
||||
str = StringTable.Localize("$SWWM_TITLEINTROA");
|
||||
Screen.DrawText(smallfont,Font.CR_WHITE,(Screen.GetWidth()-smallfont.StringWidth(str)*CleanXFac)/2,(Screen.GetHeight()/2)-(smallfont.GetHeight()*CleanYFac*3)/2,str,DTA_CleanNoMove,true,DTA_Alpha,alf);
|
||||
Screen.DrawText(mSmallFont,Font.CR_WHITE,(Screen.GetWidth()-mSmallFont.StringWidth(str)*CleanXFac)/2,(Screen.GetHeight()/2)-(mSmallFont.GetHeight()*CleanYFac*3)/2,str,DTA_CleanNoMove,true,DTA_Alpha,alf);
|
||||
str = StringTable.Localize("$SWWM_TITLEINTROB");
|
||||
Screen.DrawText(smallfont,Font.CR_WHITE,(Screen.GetWidth()-smallfont.StringWidth(str)*CleanXFac)/2,(Screen.GetHeight()/2)-(smallfont.GetHeight()*CleanYFac)/2,str,DTA_CleanNoMove,true,DTA_Alpha,alf);
|
||||
Screen.DrawText(mSmallFont,Font.CR_WHITE,(Screen.GetWidth()-mSmallFont.StringWidth(str)*CleanXFac)/2,(Screen.GetHeight()/2)-(mSmallFont.GetHeight()*CleanYFac)/2,str,DTA_CleanNoMove,true,DTA_Alpha,alf);
|
||||
str = StringTable.Localize("$SWWM_TITLEINTROC");
|
||||
Screen.DrawText(smallfont,Font.CR_WHITE,(Screen.GetWidth()-smallfont.StringWidth(str)*CleanXFac)/2,(Screen.GetHeight()/2)+(smallfont.GetHeight()*CleanYFac)/2,str,DTA_CleanNoMove,true,DTA_Alpha,alf);
|
||||
Screen.DrawText(mSmallFont,Font.CR_WHITE,(Screen.GetWidth()-mSmallFont.StringWidth(str)*CleanXFac)/2,(Screen.GetHeight()/2)+(mSmallFont.GetHeight()*CleanYFac)/2,str,DTA_CleanNoMove,true,DTA_Alpha,alf);
|
||||
double ar = Screen.GetAspectRatio();
|
||||
Vector2 tsize = TexMan.GetScaledSize(tex[4]);
|
||||
double sar = tsize.x/tsize.y;
|
||||
|
|
@ -318,11 +321,11 @@ Class SWWMTitleStuff : EventHandler
|
|||
Screen.DrawTexture(tex[4],false,(vsize.x-tsize.x)/2,(vsize.y-tsize.y)/2,DTA_VirtualWidthF,vsize.x,DTA_VirtualHeightF,vsize.y,DTA_KeepRatio,true,DTA_Alpha,alf);
|
||||
}
|
||||
double scl = Screen.GetHeight()/vsize.y;
|
||||
double tscl1 = max(.5,(floor((Screen.GetHeight()*4.)/vsize.y)+3.)/2.);
|
||||
double tscl1 = max(1.,floor((Screen.GetHeight()*4.)/vsize.y)+3.);
|
||||
str = "CODENAME";
|
||||
alf = clamp(((titletimer+e.FracTic)/GameTicRate)-22,0.,1.);
|
||||
Screen.DrawText(BigFont,Font.CR_SAPPHIRE,int(Screen.GetWidth()-tscl1*BigFont.StringWidth(str))/2,int(Screen.GetHeight()-(scl*400+BigFont.GetHeight()*tscl1))/2,str,DTA_ScaleX,tscl1,DTA_ScaleY,tscl1,DTA_Alpha,alf);
|
||||
double tscl2 = max(.5,floor((Screen.GetHeight()*4.)/vsize.y)/2.);
|
||||
Screen.DrawText(mBigFont,Font.CR_SAPPHIRE,int(Screen.GetWidth()-tscl1*mBigFont.StringWidth(str))/2,int(Screen.GetHeight()-(scl*400+mBigFont.GetHeight()*tscl1))/2,str,DTA_ScaleX,tscl1,DTA_ScaleY,tscl1,DTA_Alpha,alf);
|
||||
double tscl2 = max(1.,floor((Screen.GetHeight()*4.)/vsize.y));
|
||||
if ( !stitle || (lastlang2 != language) )
|
||||
{
|
||||
Array<String> done;
|
||||
|
|
@ -349,7 +352,7 @@ Class SWWMTitleStuff : EventHandler
|
|||
}
|
||||
else c.SetString("1");
|
||||
if ( stitle ) stitle.Destroy();
|
||||
stitle = BigFont.BreakLines(StringTable.Localize("$SWWM_TITLESUB"..which),int.max);
|
||||
stitle = mBigFont.BreakLines(StringTable.Localize("$SWWM_TITLESUB"..which),int.max);
|
||||
}
|
||||
lastlang2 = language;
|
||||
alf = clamp(((titletimer+e.FracTic)/GameTicRate)-27,0.,1.);
|
||||
|
|
@ -357,9 +360,9 @@ Class SWWMTitleStuff : EventHandler
|
|||
double yy = int(Screen.GetHeight()+(scl*360+(1.-alf)*80*tscl2))/2;
|
||||
for ( int i=0; i<stitle.Count(); i++ )
|
||||
{
|
||||
xx = int(Screen.GetWidth()-tscl2*BigFont.StringWidth(stitle.StringAt(i)))/2;
|
||||
Screen.DrawText(BigFont,Font.CR_SAPPHIRE,xx,yy,stitle.StringAt(i),DTA_ScaleX,tscl2,DTA_ScaleY,tscl2,DTA_Alpha,alf);
|
||||
yy += int(tscl2*BigFont.GetHeight());
|
||||
xx = int(Screen.GetWidth()-tscl2*mBigFont.StringWidth(stitle.StringAt(i)))/2;
|
||||
Screen.DrawText(mBigFont,Font.CR_SAPPHIRE,xx,yy,stitle.StringAt(i),DTA_ScaleX,tscl2,DTA_ScaleY,tscl2,DTA_Alpha,alf);
|
||||
yy += int(tscl2*mBigFont.GetHeight());
|
||||
}
|
||||
if ( (((titletimer+e.FracTic)/GameTicRate) >= 23.) && (((titletimer+e.FracTic)/GameTicRate) < 25.6) )
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue