Interpolation for all menus (choppy in 4.8.0 due to a bug).
This commit is contained in:
parent
648c3e1077
commit
df84963b44
20 changed files with 81 additions and 64 deletions
|
|
@ -1,3 +1,3 @@
|
|||
[default]
|
||||
SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r137 \cu(Thu 23 Jun 23:11:10 CEST 2022)\c-";
|
||||
SWWM_SHORTVER="\cw1.3pre r137 \cu(2022-06-23 23:11:10)\c-";
|
||||
SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r138 \cu(Thu 23 Jun 23:11:34 CEST 2022)\c-";
|
||||
SWWM_SHORTVER="\cw1.3pre r138 \cu(2022-06-23 23:11:34)\c-";
|
||||
|
|
|
|||
|
|
@ -221,7 +221,7 @@ Class MadcatGame ui
|
|||
|
||||
// draw on the virtual screen
|
||||
// coordinates are absolute
|
||||
virtual void Draw( Vector2 screen_pos, double screen_zoom )
|
||||
virtual void Draw( Vector2 screen_pos, double screen_zoom, double fractic )
|
||||
{
|
||||
// only bootup is handled here
|
||||
if ( global_state != CAT_BOOT ) return;
|
||||
|
|
|
|||
|
|
@ -149,6 +149,7 @@ Class DemolitionistMenu : GenericMenu
|
|||
override void Init( Menu parent )
|
||||
{
|
||||
Super.Init(parent);
|
||||
Animated = true;
|
||||
// can't open this menu outside of the game or if dead
|
||||
// also can't if you're not the Demolitionist
|
||||
if ( (gamestate != GS_LEVEL) || (players[consoleplayer].Health <= 0) || !(players[consoleplayer].mo is 'Demolitionist') )
|
||||
|
|
@ -176,7 +177,7 @@ Class DemolitionistMenu : GenericMenu
|
|||
mkey[0] = Bindings.NameKeys(ikey[0],0);
|
||||
mkey[1] = Bindings.NameKeys(ikey[1],0);
|
||||
tmsg = StringTable.Localize("$SWWM_MAINCONTROLS");
|
||||
tmsgtic = gametic+50;
|
||||
tmsgtic = MenuTime()+50;
|
||||
lasttuid = Random[TUID]();
|
||||
hnd = SWWMHandler(EventHandler.Find("SWWMHandler"));
|
||||
shnd = SWWMStaticHandler(StaticEventHandler.Find("SWWMStaticHandler"));
|
||||
|
|
@ -549,7 +550,7 @@ Class DemolitionistMenu : GenericMenu
|
|||
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;
|
||||
if ( MenuTime() < tmsgtic ) str = tmsg;
|
||||
else str = clockstr;
|
||||
xx = 4;
|
||||
Screen.DrawText(mSmallFont,Font.CR_WHITE,origin.x+xx,origin.y+yy,str,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
|
||||
|
|
@ -559,6 +560,6 @@ Class DemolitionistMenu : GenericMenu
|
|||
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();
|
||||
tabs[curtab].Drawer(System.GetTimeFrac());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -206,7 +206,7 @@ extend Class DemolitionistMenu
|
|||
else
|
||||
{
|
||||
tmsg = StringTable.Localize("$SWWM_INVFAIL");
|
||||
tmsgtic = gametic+70;
|
||||
tmsgtic = MenuTime()+70;
|
||||
MenuSound("menu/noinvuse");
|
||||
}
|
||||
}
|
||||
|
|
@ -216,7 +216,7 @@ extend Class DemolitionistMenu
|
|||
if ( !hnd.checklist[j].result )
|
||||
{
|
||||
tmsg = StringTable.Localize("$SWWM_INVNDROP");
|
||||
tmsgtic = gametic+70;
|
||||
tmsgtic = MenuTime()+70;
|
||||
MenuSound("menu/noinvuse");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ Class DemolitionistMenuTab ui abstract
|
|||
}
|
||||
|
||||
// called every frame while selected
|
||||
virtual void Drawer()
|
||||
virtual void Drawer( double fractic )
|
||||
{
|
||||
// placeholder (so don't call super)
|
||||
String str = StringTable.Localize("$SWWM_COMINGSOON");
|
||||
|
|
|
|||
|
|
@ -93,10 +93,11 @@ Class DemolitionistMenuTextBox ui
|
|||
if ( abs(smofs-ofs) < (1./master.hs) ) smofs = ofs;
|
||||
}
|
||||
|
||||
void Drawer( bool dark = false )
|
||||
void Drawer( double fractic, bool dark = false )
|
||||
{
|
||||
double ssmofs = smofs*(1.-fractic)+((smofs*.6)+(ofs*.4))*fractic;
|
||||
double xx = x+6;
|
||||
double yy = 17-smofs;
|
||||
double yy = 17-ssmofs;
|
||||
Screen.SetClipRect(int((master.origin.x+xx)*master.hs),int((master.origin.y+17)*master.hs),int(w*master.hs),int((master.ws.y-34)*master.hs));
|
||||
// draw image if defined and visible
|
||||
if ( img.IsValid() )
|
||||
|
|
@ -118,7 +119,7 @@ Class DemolitionistMenuTextBox ui
|
|||
xx = x+(w-8);
|
||||
master.DrawVSeparator(xx,14,master.ws.y-28);
|
||||
xx += 2;
|
||||
yy = floor(smofs*((master.ws.y-39)/maxofs))+14;
|
||||
yy = floor(ssmofs*((master.ws.y-39)/maxofs))+14;
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -146,7 +146,7 @@ Class DemolitionistChatTab : DemolitionistMenuTab
|
|||
break;
|
||||
}
|
||||
}
|
||||
override void Drawer()
|
||||
override void Drawer( double fractic )
|
||||
{
|
||||
if ( !hist || (msglist.items.Size() <= 0) )
|
||||
{
|
||||
|
|
@ -156,16 +156,17 @@ Class DemolitionistChatTab : DemolitionistMenuTab
|
|||
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 ssmofs = smofs*(1.-fractic)+((smofs*.6)+(ofs*.4))*fractic;
|
||||
double xx = 3;
|
||||
double yy = 23;
|
||||
Screen.SetClipRect(int((master.origin.x+3)*master.hs),int((master.origin.y+23)*master.hs),int((master.ws.x-12)*master.hs),int((master.ws.y-46)*master.hs));
|
||||
msglist.Drawer((xx,yy-smofs));
|
||||
msglist.Drawer((xx,yy-ssmofs));
|
||||
Screen.ClearClipRect();
|
||||
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;
|
||||
yy = floor(ssmofs*((master.ws.y-39)/maxofs))+14;
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ Class DemolitionistGameTab : DemolitionistMenuTab
|
|||
EventHandler.SendNetworkEvent("swwmgamelore",consoleplayer);
|
||||
// notify
|
||||
master.tmsg = StringTable.Localize("$SWWM_NEWLORE");
|
||||
master.tmsgtic = gametic+70;
|
||||
master.tmsgtic = Menu.MenuTime()+70;
|
||||
}
|
||||
}
|
||||
override void OnDeselect()
|
||||
|
|
@ -120,7 +120,7 @@ Class DemolitionistGameTab : DemolitionistMenuTab
|
|||
if ( game ) game.Tick();
|
||||
}
|
||||
|
||||
override void Drawer()
|
||||
override void Drawer( double fractic )
|
||||
{
|
||||
if ( game )
|
||||
{ // calculate res to fit
|
||||
|
|
@ -138,7 +138,7 @@ Class DemolitionistGameTab : DemolitionistMenuTab
|
|||
Screen.Dim("Black",1.,int((master.origin.x+xx-4)*master.hs),int((master.origin.y+yy-4)*master.hs),int((res.x+8)*master.hs),int((res.y+8)*master.hs));
|
||||
master.DrawFrame(xx-4,yy-4,res.x+8,res.y+8);
|
||||
Screen.SetClipRect(int((master.origin.x+xx)*master.hs),int((master.origin.y+yy)*master.hs),int(res.x*master.hs),int(res.y*master.hs));
|
||||
game.Draw((master.origin.x+xx,master.origin.y+yy)*master.hs,scl);
|
||||
game.Draw((master.origin.x+xx,master.origin.y+yy)*master.hs,scl,fractic);
|
||||
Screen.ClearClipRect();
|
||||
}
|
||||
else
|
||||
|
|
@ -160,8 +160,8 @@ Class DemolitionistGameTab : DemolitionistMenuTab
|
|||
Screen.DrawText(master.mSmallFont,(i==sel)?Font.CR_WHITE:Font.CR_DARKGRAY,master.origin.x+xx,master.origin.y+yy,str,DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true);
|
||||
if ( i == sel )
|
||||
{
|
||||
Screen.DrawChar(master.mSmallFont,Font.CR_GREEN,master.origin.x+xx-12,master.origin.y+yy,((gametic&8)>=4)?0x2727:0x2726,DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true);
|
||||
Screen.DrawChar(master.mSmallFont,Font.CR_GREEN,master.origin.x+xx+w+6,master.origin.y+yy,((gametic&8)>=4)?0x2727:0x2726,DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true);
|
||||
Screen.DrawChar(master.mSmallFont,Font.CR_GREEN,master.origin.x+xx-12,master.origin.y+yy,((Menu.MenuTime()&8)>=4)?0x2727:0x2726,DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true);
|
||||
Screen.DrawChar(master.mSmallFont,Font.CR_GREEN,master.origin.x+xx+w+6,master.origin.y+yy,((Menu.MenuTime()&8)>=4)?0x2727:0x2726,DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true);
|
||||
}
|
||||
yy += 14;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -76,8 +76,8 @@ Class DemolitionistHelpTab : DemolitionistMenuTab
|
|||
{
|
||||
mtext.Ticker();
|
||||
}
|
||||
override void Drawer()
|
||||
override void Drawer( double fractic )
|
||||
{
|
||||
mtext.Drawer();
|
||||
mtext.Drawer(fractic);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -449,7 +449,7 @@ Class DemolitionistInventoryTab : DemolitionistMenuTab
|
|||
}
|
||||
}
|
||||
|
||||
override void Drawer()
|
||||
override void Drawer( double fractic )
|
||||
{
|
||||
if ( !invlist || (invlist.items.Size() <= 0) )
|
||||
{
|
||||
|
|
@ -459,16 +459,17 @@ Class DemolitionistInventoryTab : DemolitionistMenuTab
|
|||
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 ssmofs = smofs*(1.-fractic)+((smofs*.6)+(ofs*.4))*fractic;
|
||||
double xx = 9;
|
||||
double yy = 23;
|
||||
Screen.SetClipRect(int((master.origin.x+9)*master.hs),int((master.origin.y+23)*master.hs),int((master.ws.x-18)*master.hs),int((master.ws.y-46)*master.hs));
|
||||
invlist.Drawer((xx-smofs,yy));
|
||||
invlist.Drawer((xx-ssmofs,yy));
|
||||
Screen.ClearClipRect();
|
||||
if ( maxofs <= 0 ) return;
|
||||
yy = master.ws.y-21;
|
||||
master.DrawHSeparator(0,yy,master.ws.x);
|
||||
yy -= 4;
|
||||
xx = floor(smofs*((master.ws.x-10)/maxofs))+2;
|
||||
xx = floor(ssmofs*((master.ws.x-10)/maxofs))+2;
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -292,7 +292,7 @@ Class DemolitionistKeychainTab : DemolitionistMenuTab
|
|||
}
|
||||
}
|
||||
|
||||
override void Drawer()
|
||||
override void Drawer( double fractic )
|
||||
{
|
||||
if ( !invlist || (invlist.items.Size() <= 0) )
|
||||
{
|
||||
|
|
@ -302,16 +302,17 @@ Class DemolitionistKeychainTab : DemolitionistMenuTab
|
|||
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 ssmofs = smofs*(1.-fractic)+((smofs*.6)+(ofs*.4))*fractic;
|
||||
double xx = 9;
|
||||
double yy = 23;
|
||||
Screen.SetClipRect(int((master.origin.x+9)*master.hs),int((master.origin.y+23)*master.hs),int((master.ws.x-18)*master.hs),int((master.ws.y-46)*master.hs));
|
||||
invlist.Drawer((xx-smofs,yy));
|
||||
invlist.Drawer((xx-ssmofs,yy));
|
||||
Screen.ClearClipRect();
|
||||
if ( maxofs <= 0 ) return;
|
||||
yy = master.ws.y-21;
|
||||
master.DrawHSeparator(0,yy,master.ws.x);
|
||||
yy -= 4;
|
||||
xx = floor(smofs*((master.ws.x-10)/maxofs))+2;
|
||||
xx = floor(ssmofs*((master.ws.x-10)/maxofs))+2;
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -127,7 +127,7 @@ Class DemolitionistLibraryTab : DemolitionistMenuTab
|
|||
loresz = lore.ent.Size();
|
||||
// append the notification for new lore
|
||||
master.tmsg = StringTable.Localize("$SWWM_NEWLORE");
|
||||
master.tmsgtic = gametic+70;
|
||||
master.tmsgtic = Menu.MenuTime()+70;
|
||||
if ( ((lwidth != olwidth) || (maxofs[section] != olmaxofs)) && clore && ltext )
|
||||
ltext.Reinit(StringTable.Localize(clore.text),lwidth+((maxofs[section]>0)?8:0));
|
||||
}
|
||||
|
|
@ -352,7 +352,7 @@ Class DemolitionistLibraryTab : DemolitionistMenuTab
|
|||
break;
|
||||
}
|
||||
}
|
||||
override void Drawer()
|
||||
override void Drawer( double fractic )
|
||||
{
|
||||
double xx = 0;
|
||||
double yy = 15;
|
||||
|
|
@ -398,18 +398,19 @@ Class DemolitionistLibraryTab : DemolitionistMenuTab
|
|||
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;
|
||||
double ssmofs = smofs[section]*(1.-fractic)+((smofs[section]*.6)+(ofs[section]*.4))*fractic;
|
||||
Screen.SetClipRect(int((master.origin.x+3)*master.hs),int((master.origin.y+32)*master.hs),int((lwidth-6)*master.hs),int((master.ws.y-50)*master.hs));
|
||||
lists[section].Drawer((xx,yy-smofs[section]));
|
||||
lists[section].Drawer((xx,yy-ssmofs));
|
||||
Screen.ClearClipRect();
|
||||
if ( maxofs[section] > 0 )
|
||||
{
|
||||
xx = lwidth;
|
||||
master.DrawVSeparator(xx+8,14,master.ws.y-28);
|
||||
xx += 2;
|
||||
yy = floor(smofs[section]*((master.ws.y-39)/maxofs[section]))+14;
|
||||
yy = floor(ssmofs*((master.ws.y-39)/maxofs[section]))+14;
|
||||
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();
|
||||
if ( clore && ltext ) ltext.Drawer(fractic);
|
||||
else
|
||||
{
|
||||
str = StringTable.Localize("$SWWM_LOREUNSEL");
|
||||
|
|
|
|||
|
|
@ -263,7 +263,7 @@ Class DemolitionistMissionTab : DemolitionistMenuTab
|
|||
if ( newent )
|
||||
{
|
||||
master.tmsg = StringTable.Localize("$SWWM_NEWMISSION");
|
||||
master.tmsgtic = gametic+70;
|
||||
master.tmsgtic = Menu.MenuTime()+70;
|
||||
}
|
||||
}
|
||||
// just tick the current textbox
|
||||
|
|
@ -271,9 +271,9 @@ Class DemolitionistMissionTab : DemolitionistMenuTab
|
|||
mtext[sel].Ticker();
|
||||
}
|
||||
|
||||
override void Drawer()
|
||||
override void Drawer( double fractic )
|
||||
{
|
||||
if ( mtext.Size() > 0 ) mtext[sel].Drawer(!!sel);
|
||||
if ( mtext.Size() > 0 ) mtext[sel].Drawer(fractic,!!sel);
|
||||
else
|
||||
{
|
||||
String str = StringTable.Localize("$SWWM_MISSION_NONE");
|
||||
|
|
|
|||
|
|
@ -120,12 +120,13 @@ Class DemolitionistSecretTab : DemolitionistMenuTab
|
|||
if ( abs(smofs-ofs) < (1./master.hs) ) smofs = ofs;
|
||||
}
|
||||
|
||||
override void Drawer()
|
||||
override void Drawer( double fractic )
|
||||
{
|
||||
double ssmofs = smofs*(1.-fractic)+((smofs*.6)+(ofs*.4))*fractic;
|
||||
double xx = 20;
|
||||
double yy;
|
||||
if ( maxofs <= 0 ) yy = master.ws.y/2-160;
|
||||
else yy = 20-smofs;
|
||||
else yy = 20-ssmofs;
|
||||
Screen.SetClipRect(int((master.origin.x+20)*master.hs),int((master.origin.y+20)*master.hs),int((master.ws.x-40)*master.hs),int((master.ws.y-40)*master.hs));
|
||||
Screen.DrawTexture(img,false,master.origin.x+xx,master.origin.y+yy,DTA_VirtualWidthF,master.ss.x,DTA_VirtualHeightF,master.ss.y,DTA_KeepRatio,true);
|
||||
int mxlen = 0;
|
||||
|
|
@ -143,7 +144,7 @@ Class DemolitionistSecretTab : DemolitionistMenuTab
|
|||
xx = master.ws.x-8;
|
||||
master.DrawVSeparator(xx,14,master.ws.y-28);
|
||||
xx += 2;
|
||||
yy = floor(smofs*((master.ws.y-39)/maxofs))+14;
|
||||
yy = floor(ssmofs*((master.ws.y-39)/maxofs))+14;
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -534,7 +534,7 @@ Class DemolitionistStatsTab : DemolitionistMenuTab
|
|||
break;
|
||||
}
|
||||
}
|
||||
override void Drawer()
|
||||
override void Drawer( double fractic )
|
||||
{
|
||||
if ( !stats ) return;
|
||||
double xx = 9;
|
||||
|
|
@ -553,20 +553,21 @@ Class DemolitionistStatsTab : DemolitionistMenuTab
|
|||
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 ssmofs = smofs[section]*(1.-fractic)+((smofs[section]*.6)+(ofs[section]*.4))*fractic;
|
||||
if ( section == 3 )
|
||||
{
|
||||
// achievement drawer has different margins
|
||||
xx = lwidth+12;
|
||||
yy = 26;
|
||||
Screen.SetClipRect(int((master.origin.x+lwidth+12)*master.hs),int((master.origin.y+26)*master.hs),int((master.ws.x-(lwidth+24))*master.hs),int((master.ws.y-52)*master.hs));
|
||||
lists[section].Drawer((xx,yy-smofs[section]));
|
||||
lists[section].Drawer((xx,yy-ssmofs));
|
||||
}
|
||||
else
|
||||
{
|
||||
xx = lwidth+9;
|
||||
yy = 23;
|
||||
Screen.SetClipRect(int((master.origin.x+lwidth+9)*master.hs),int((master.origin.y+23)*master.hs),int((master.ws.x-(lwidth+18))*master.hs),int((master.ws.y-46)*master.hs));
|
||||
lists[section].Drawer((xx,yy-smofs[section]));
|
||||
lists[section].Drawer((xx,yy-ssmofs));
|
||||
}
|
||||
Screen.ClearClipRect();
|
||||
if ( maxofs[section] > 0 )
|
||||
|
|
@ -574,7 +575,7 @@ Class DemolitionistStatsTab : DemolitionistMenuTab
|
|||
xx = master.ws.x-8;
|
||||
master.DrawVSeparator(xx,14,master.ws.y-28);
|
||||
xx += 2;
|
||||
yy = floor(smofs[section]*((master.ws.y-39)/maxofs[section]))+14;
|
||||
yy = floor(ssmofs*((master.ws.y-39)/maxofs[section]))+14;
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
|
@ -750,13 +751,13 @@ Class DemolitionistMenuAchievementItem : DemolitionistMenuListItem
|
|||
oldstr = str;
|
||||
}
|
||||
str = StringTable.Localize("$SWWM_ACHIEVEMENT_"..a.basename.."_TAG");
|
||||
if ( !completed && !hasprogress && ShouldObscure ) SWWMUtility.ObscureText(str,(gametic/3)+ypos*2+1);
|
||||
if ( !completed && !hasprogress && ShouldObscure ) SWWMUtility.ObscureText(str,(Menu.MenuTime()/3)+ypos*2+1);
|
||||
int oy = (32-(14+(9*l.Count())))/2;
|
||||
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);
|
||||
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);
|
||||
if ( !completed && !hasprogress && ShouldObscure ) SWWMUtility.ObscureText(str,(Menu.MenuTime()/3)+ypos*2+2+i);
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -378,7 +378,7 @@ Class DemolitionistStoreTab : DemolitionistMenuTab
|
|||
}
|
||||
}
|
||||
|
||||
override void Drawer()
|
||||
override void Drawer( double fractic )
|
||||
{
|
||||
if ( !invlist[bSell] || (invlist[bSell].items.Size() <= 0) )
|
||||
{
|
||||
|
|
@ -391,13 +391,14 @@ Class DemolitionistStoreTab : DemolitionistMenuTab
|
|||
double xx = 9;
|
||||
double yy = 23;
|
||||
Screen.SetClipRect(int((master.origin.x+9)*master.hs),int((master.origin.y+23)*master.hs),int((master.ws.x-18)*master.hs),int((master.ws.y-46)*master.hs));
|
||||
invlist[bSell].Drawer((xx-smofs,yy));
|
||||
double ssmofs = smofs*(1.-fractic)+((smofs*.6)+(ofs*.4))*fractic;
|
||||
invlist[bSell].Drawer((xx-ssmofs,yy));
|
||||
Screen.ClearClipRect();
|
||||
if ( maxofs <= 0 ) return;
|
||||
yy = master.ws.y-21;
|
||||
master.DrawHSeparator(0,yy,master.ws.x);
|
||||
yy -= 4;
|
||||
xx = floor(smofs*((master.ws.x-10)/maxofs))+2;
|
||||
xx = floor(ssmofs*((master.ws.x-10)/maxofs))+2;
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
|
@ -594,7 +595,7 @@ Class DemolitionistMenuStoreItem : DemolitionistMenuListItem
|
|||
{
|
||||
master.MenuSound("menu/noinvuse");
|
||||
master.tmsg = StringTable.Localize("$SWWM_STOREMUNS");
|
||||
master.tmsgtic = gametic+70;
|
||||
master.tmsgtic = Menu.MenuTime()+70;
|
||||
return;
|
||||
}
|
||||
let cur = players[consoleplayer].mo.FindInventory(inv);
|
||||
|
|
@ -613,7 +614,7 @@ Class DemolitionistMenuStoreItem : DemolitionistMenuListItem
|
|||
{
|
||||
master.MenuSound("menu/noinvuse");
|
||||
master.tmsg = StringTable.Localize("$SWWM_STOREFULL");
|
||||
master.tmsgtic = gametic+70;
|
||||
master.tmsgtic = Menu.MenuTime()+70;
|
||||
return;
|
||||
}
|
||||
EventHandler.SendNetworkEvent(String.Format("swwmstoregive.%s",inv.GetClassName()),consoleplayer,price,amt);
|
||||
|
|
|
|||
|
|
@ -76,14 +76,14 @@ Class SWWMAchievementMenu : GenericMenu
|
|||
bool completed = !!a.state;
|
||||
bool hasprogress = (a.maxval && a.val);
|
||||
String str = StringTable.Localize("$SWWM_ACHIEVEMENT_"..a.basename.."_TAG");
|
||||
if ( !completed && !hasprogress && ShouldObscure ) SWWMUtility.ObscureText(str,gametic/3);
|
||||
if ( !completed && !hasprogress && ShouldObscure ) SWWMUtility.ObscureText(str,MenuTime()/3);
|
||||
int xx = (Screen.GetWidth()-newsmallfont.StringWidth(str)*CleanXFac_1)/2;
|
||||
int yy = y;
|
||||
if ( !a.maxval || (ShouldObscure && !hasprogress) ) yy += ((newsmallfont.GetHeight()+2)*CleanYFac_1)/2;
|
||||
Screen.DrawText(newsmallfont,completed?Font.CR_GREEN:Font.CR_DARKGRAY,xx,yy,str,DTA_CleanNoMove_1,true);
|
||||
yy += (newsmallfont.GetHeight()+2)*CleanYFac_1;
|
||||
str = a.hasformat?String.Format(StringTable.Localize("$SWWM_ACHIEVEMENT_"..a.basename.."_TXT"),a.maxval):StringTable.Localize("$SWWM_ACHIEVEMENT_"..a.basename.."_TXT");
|
||||
if ( !completed && !hasprogress && ShouldObscure ) SWWMUtility.ObscureText(str,(gametic/3)+1);
|
||||
if ( !completed && !hasprogress && ShouldObscure ) SWWMUtility.ObscureText(str,(MenuTime()/3)+1);
|
||||
xx = (Screen.GetWidth()-newsmallfont.StringWidth(str)*CleanXFac_1)/2;
|
||||
Screen.DrawText(newsmallfont,completed?Font.CR_WHITE:Font.CR_BLACK,xx,yy,str,DTA_CleanNoMove_1,true);
|
||||
if ( a.maxval && (!ShouldObscure || hasprogress) )
|
||||
|
|
|
|||
|
|
@ -129,6 +129,7 @@ Class SWWMCreditsMenu : GenericMenu
|
|||
override void Init( Menu parent )
|
||||
{
|
||||
Super.Init(parent);
|
||||
Animated = true;
|
||||
mSmallFont = Font.GetFont('TewiFont');
|
||||
mBigFont = Font.GetFont('TewiFontOutline');
|
||||
bgtex = TexMan.CheckForTexture("graphics/tempbg.png",TexMan.Type_Any);
|
||||
|
|
@ -299,7 +300,7 @@ Class SWWMCreditsMenu : GenericMenu
|
|||
Super.Drawer();
|
||||
UpdateSize();
|
||||
// logo
|
||||
double yy = spos;
|
||||
double yy = spos-((speed*System.GetTimeFrac())/GameTicRate);
|
||||
double xx = ss.x/2.;
|
||||
yy += DrawLogo(xx,yy);
|
||||
// developer
|
||||
|
|
|
|||
|
|
@ -28,9 +28,10 @@ Class SWWMHelpMenu : GenericMenu
|
|||
override void Init( Menu parent )
|
||||
{
|
||||
Super.Init(parent);
|
||||
Animated = true;
|
||||
curpage = 0;
|
||||
prevpage = -1;
|
||||
fadetic = gametic;
|
||||
fadetic = MenuTime();
|
||||
pagedir = 0;
|
||||
bgtex = TexMan.CheckForTexture("graphics/tempbg.png",TexMan.Type_Any);
|
||||
mSmallFont = Font.GetFont('TewiFont');
|
||||
|
|
@ -80,7 +81,7 @@ Class SWWMHelpMenu : GenericMenu
|
|||
|
||||
override bool MenuEvent( int mkey, bool fromcontroller )
|
||||
{
|
||||
double alph = clamp((gametic-fadetic)*(5./GameTicRate),0.,1.);
|
||||
double alph = clamp((MenuTime()-fadetic)*(5./GameTicRate),0.,1.);
|
||||
switch ( mkey )
|
||||
{
|
||||
case MKEY_Enter:
|
||||
|
|
@ -93,7 +94,7 @@ Class SWWMHelpMenu : GenericMenu
|
|||
prevpage = curpage;
|
||||
curpage++;
|
||||
pagedir = 1;
|
||||
fadetic = gametic;
|
||||
fadetic = MenuTime();
|
||||
}
|
||||
return true;
|
||||
break;
|
||||
|
|
@ -107,7 +108,7 @@ Class SWWMHelpMenu : GenericMenu
|
|||
prevpage = curpage;
|
||||
curpage--;
|
||||
pagedir = -1;
|
||||
fadetic = gametic;
|
||||
fadetic = MenuTime();
|
||||
}
|
||||
return true;
|
||||
break;
|
||||
|
|
@ -198,7 +199,7 @@ Class SWWMHelpMenu : GenericMenu
|
|||
Screen.DrawTexture(bgtex,false,(vsize.x-tsize.x)/2,(vsize.y-tsize.y)/2,DTA_VirtualWidthF,vsize.x,DTA_VirtualHeightF,vsize.y,DTA_KeepRatio,true,DTA_ColorOverlay,Color(192,0,0,0),DTA_Alpha,.8);
|
||||
}
|
||||
else Screen.Dim("Black",.8,0,0,Screen.GetWidth(),Screen.GetHeight());
|
||||
double alph = clamp((gametic-fadetic)*(5./GameTicRate),0.,1.);
|
||||
double alph = clamp(((MenuTime()+System.GetTimeFrac())-fadetic)*(5./GameTicRate),0.,1.);
|
||||
if ( (prevpage == -1) || (alph >= 1.) ) DrawPage(curpage);
|
||||
else
|
||||
{
|
||||
|
|
|
|||
|
|
@ -247,6 +247,12 @@ Class SWWMOptionMenu : OptionMenu
|
|||
|
||||
Class SWWMCleanMenu : ListMenu
|
||||
{
|
||||
override void Init( Menu parent, ListMenuDescriptor desc )
|
||||
{
|
||||
Super.Init(parent,desc);
|
||||
Animated = true;
|
||||
}
|
||||
|
||||
override bool MouseEvent( int type, int x, int y )
|
||||
{
|
||||
if ( mDesc.DisplayWidth() != ListMenuDescriptor.CleanScale )
|
||||
|
|
@ -771,17 +777,17 @@ Mixin Class SWWMSelector
|
|||
yofs *= CleanYFac_1;
|
||||
double x = (320-GetWidth())/2;
|
||||
SWWMUtility.AdjustClean_1(x,y);
|
||||
Screen.DrawTexture(tex,true,x+xofs,y+yofs,DTA_ScaleX,CleanXFac_1/4.,DTA_ScaleY,CleanYFac_1/4.,DTA_Rotate,15.*sin(8*Menu.MenuTime()));
|
||||
Screen.DrawTexture(tex,true,x+xofs,y+yofs,DTA_ScaleX,CleanXFac_1/4.,DTA_ScaleY,CleanYFac_1/4.,DTA_Rotate,15.*sin(8*(Menu.MenuTime()+System.GetTimeFrac())));
|
||||
x = (320+GetWidth())/2;
|
||||
SWWMUtility.AdjustClean_1x(x);
|
||||
Screen.DrawTexture(tex,true,x-xofs,y+yofs,DTA_ScaleX,CleanXFac_1/4.,DTA_ScaleY,CleanYFac_1/4.,DTA_Rotate,-15.*sin(8*Menu.MenuTime()));
|
||||
Screen.DrawTexture(tex,true,x-xofs,y+yofs,DTA_ScaleX,CleanXFac_1/4.,DTA_ScaleY,CleanYFac_1/4.,DTA_Rotate,-15.*sin(8*(Menu.MenuTime()+System.GetTimeFrac())));
|
||||
}
|
||||
else
|
||||
{
|
||||
double x = (w-GetWidth())/2;
|
||||
Screen.DrawTexture(tex,true,x+xofs,y+yofs,DTA_ScaleX,.25,DTA_ScaleY,.25,DTA_VirtualWidth,w,DTA_VirtualHeight,h,DTA_FullscreenScale,FSMode_ScaleToFit43,DTA_Rotate,15.*sin(8*Menu.MenuTime()));
|
||||
Screen.DrawTexture(tex,true,x+xofs,y+yofs,DTA_ScaleX,.25,DTA_ScaleY,.25,DTA_VirtualWidth,w,DTA_VirtualHeight,h,DTA_FullscreenScale,FSMode_ScaleToFit43,DTA_Rotate,15.*sin(8*(Menu.MenuTime()+System.GetTimeFrac())));
|
||||
x = (w+GetWidth())/2;
|
||||
Screen.DrawTexture(tex,true,x-xofs,y+yofs,DTA_ScaleX,.25,DTA_ScaleY,.25,DTA_VirtualWidth,w,DTA_VirtualHeight,h,DTA_FullscreenScale,FSMode_ScaleToFit43,DTA_Rotate,-15.*sin(8*Menu.MenuTime()));
|
||||
Screen.DrawTexture(tex,true,x-xofs,y+yofs,DTA_ScaleX,.25,DTA_ScaleY,.25,DTA_VirtualWidth,w,DTA_VirtualHeight,h,DTA_FullscreenScale,FSMode_ScaleToFit43,DTA_Rotate,-15.*sin(8*(Menu.MenuTime()+System.GetTimeFrac())));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -869,7 +875,7 @@ Class ListMenuItemSWWMTextItemM : ListMenuItemSelectable
|
|||
{
|
||||
int ch;
|
||||
[ch, pos] = text.GetNextCodePoint(pos);
|
||||
double yy = y+4*sin(32*i+8*Menu.MenuTime())*CleanYFac_1;
|
||||
double yy = y+4*sin(32*i+8*(Menu.MenuTime()+System.GetTimeFrac()))*CleanYFac_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;
|
||||
}
|
||||
|
|
@ -880,7 +886,7 @@ Class ListMenuItemSWWMTextItemM : ListMenuItemSelectable
|
|||
{
|
||||
int ch;
|
||||
[ch, pos] = text.GetNextCodePoint(pos);
|
||||
double yy = y+4*sin(32*i+8*Menu.MenuTime());
|
||||
double yy = y+4*sin(32*i+8*(Menu.MenuTime()+System.GetTimeFrac()));
|
||||
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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue