Some tweaks.

This commit is contained in:
Mari the Deer 2021-05-17 21:20:08 +02:00
commit 2acbf97531
6 changed files with 24 additions and 13 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 102 B

After

Width:  |  Height:  |  Size: 108 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 33 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 173 KiB

After

Width:  |  Height:  |  Size: 172 KiB

Before After
Before After

View file

@ -1,3 +1,3 @@
[default] [default]
SWWM_MODVER="\chSWWM \czGZ\c- \cw0.9.11b-pre r492 \cu(Mon 17 May 18:53:37 CEST 2021)\c-"; SWWM_MODVER="\chSWWM \czGZ\c- \cw0.9.11b-pre r493 \cu(Mon 17 May 21:20:08 CEST 2021)\c-";
SWWM_SHORTVER="\cw0.9.11b-pre r492 \cu(2021-05-17 18:53:37)\c-"; SWWM_SHORTVER="\cw0.9.11b-pre r493 \cu(2021-05-17 21:20:08)\c-";

View file

@ -262,7 +262,7 @@ ListMenu "MainMenu"
Font "TewiShadedOutline", "White", "Sapphire" Font "TewiShadedOutline", "White", "Sapphire"
Selector "graphics/DemoIcon.png", -24, 0 Selector "graphics/DemoIcon.png", -24, 0
LineSpacing 36 LineSpacing 36
SWWMLogo "graphics/M_SWWM.png" SWWMLogo
Position 0, 56 Position 0, 56
SWWMTextItemM "$MNU_NEWGAME", "n", "PlayerclassMenu" SWWMTextItemM "$MNU_NEWGAME", "n", "PlayerclassMenu"
SWWMTextItemM "$MNU_OPTIONS", "o", "OptionsMenu" SWWMTextItemM "$MNU_OPTIONS", "o", "OptionsMenu"
@ -277,7 +277,7 @@ ListMenu "MainMenuTextOnly"
Font "TewiShadedOutline", "White", "Sapphire" Font "TewiShadedOutline", "White", "Sapphire"
Selector "graphics/DemoIcon.png", -24, 0 Selector "graphics/DemoIcon.png", -24, 0
LineSpacing 36 LineSpacing 36
SWWMLogo "graphics/M_SWWM.png" SWWMLogo
Position 0, 56 Position 0, 56
SWWMTextItemM "$MNU_NEWGAME", "n", "PlayerclassMenu" SWWMTextItemM "$MNU_NEWGAME", "n", "PlayerclassMenu"
SWWMTextItemM "$MNU_OPTIONS", "o", "OptionsMenu" SWWMTextItemM "$MNU_OPTIONS", "o", "OptionsMenu"

View file

@ -294,14 +294,23 @@ Class SWWMMainMenu : SWWMCleanMenu
double demopos; double demopos;
transient uint prevms; transient uint prevms;
override void Init( Menu parent, ListMenuDescriptor desc )
{
Super.Init(parent,desc);
demotex = TexMan.CheckForTexture("graphics/M_DEMOLITIONIST.png",TexMan.Type_Any);
demopos = 120;
prevms = MSTime();
}
override void OnReturn()
{
demopos = 120;
prevms = MSTime();
}
override void Drawer() override void Drawer()
{ {
double frametime = (MSTime()-prevms)/1000.; double frametime = (MSTime()-prevms)/1000.;
if ( !demotex )
{
demotex = TexMan.CheckForTexture("graphics/M_DEMOLITIONIST.png",TexMan.Type_Any);
demopos = 120;
}
double theta = clamp(2.*frametime,0.,1.); // naive, but whatever double theta = clamp(2.*frametime,0.,1.); // naive, but whatever
if ( prevms ) demopos = demopos*(1.-theta)-40*theta; if ( prevms ) demopos = demopos*(1.-theta)-40*theta;
double alph = clamp(1.-(demopos/100),0.,1.); double alph = clamp(1.-(demopos/100),0.,1.);
@ -539,10 +548,10 @@ class ListMenuItemSWWMLogo : ListMenuItem
{ {
TextureID mTexture; TextureID mTexture;
void Init( ListMenuDescriptor desc, TextureID patch ) void Init( ListMenuDescriptor desc )
{ {
Super.Init(desc.mXpos,desc.mYpos); Super.Init(desc.mXpos,desc.mYpos);
mTexture = patch; mTexture = TexMan.CheckForTexture("graphics/M_SWWM.png",TexMan.Type_Any);
} }
override void Draw( bool selected, ListMenuDescriptor desc ) override void Draw( bool selected, ListMenuDescriptor desc )
@ -552,6 +561,8 @@ class ListMenuItemSWWMLogo : ListMenuItem
int w = desc?desc.DisplayWidth():ListMenuDescriptor.CleanScale; int w = desc?desc.DisplayWidth():ListMenuDescriptor.CleanScale;
int h = desc?desc.DisplayHeight():-1; int h = desc?desc.DisplayHeight():-1;
Vector2 vs = TexMan.GetScaledSize(mTexture); Vector2 vs = TexMan.GetScaledSize(mTexture);
double scl = 256./vs.x;
vs *= scl;
double x; double x;
if ( w == ListMenuDescriptor.CleanScale ) if ( w == ListMenuDescriptor.CleanScale )
{ {
@ -559,12 +570,12 @@ class ListMenuItemSWWMLogo : ListMenuItem
x = (x-160)*CleanXFac_1+(Screen.GetWidth()*.5); x = (x-160)*CleanXFac_1+(Screen.GetWidth()*.5);
double y = -48; double y = -48;
y = (y-100)*CleanYFac_1+(Screen.GetHeight()*.5); y = (y-100)*CleanYFac_1+(Screen.GetHeight()*.5);
Screen.DrawTexture(mTexture,false,x,y,DTA_CleanNoMove_1,true); Screen.DrawTexture(mTexture,false,x,y,DTA_ScaleX,CleanXFac_1*scl,DTA_ScaleY,CleanYFac_1*scl);
} }
else else
{ {
x = (w-vs.x)/2; x = (w-vs.x)/2;
Screen.DrawTexture(mTexture,false,x,-48,DTA_VirtualWidth,w,DTA_VirtualHeight,h,DTA_FullscreenScale,FSMode_ScaleToFit43); Screen.DrawTexture(mTexture,false,x,-48,DTA_VirtualWidth,w,DTA_VirtualHeight,h,DTA_FullscreenScale,FSMode_ScaleToFit43,DTA_ScaleX,scl,DTA_ScaleY,scl);
} }
} }
} }