Some small cleanup.

This commit is contained in:
Mari the Deer 2022-01-13 15:40:17 +01:00
commit 8783aad55f
3 changed files with 35 additions and 53 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 683 B

After

Width:  |  Height:  |  Size: 703 B

Before After
Before After

View file

@ -1,3 +1,3 @@
[default]
SWWM_MODVER="\chSWWM \czGZ\c- \cw1.2pre r107 \cu(Thu 13 Jan 00:27:14 CET 2022)\c-";
SWWM_SHORTVER="\cw1.2pre r107 \cu(2022-01-13 00:27:14)\c-";
SWWM_MODVER="\chSWWM \czGZ\c- \cw1.2pre r108 \cu(Thu 13 Jan 15:40:17 CET 2022)\c-";
SWWM_SHORTVER="\cw1.2pre r108 \cu(2022-01-13 15:40:17)\c-";

View file

@ -749,9 +749,40 @@ Class SWWMMessageBox : MessageBoxMenu
}
}
Mixin Class SWWMSelector
{
override void DrawSelector( double xofs, double yofs, TextureID tex, ListMenuDescriptor desc )
{
if ( tex.isNull() ) return;
int w = desc?desc.DisplayWidth():ListMenuDescriptor.CleanScale;
int h = desc?desc.DisplayHeight():-1;
double y = mYpos+mHeight/2;
if ( w == ListMenuDescriptor.CleanScale )
{
xofs *= CleanXFac_1;
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()));
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()));
}
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()));
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()));
}
}
}
// main menu item with wiggly text when selected and Demo face selectors on both sides
class ListMenuItemSWWMTextItemM : ListMenuItemSelectable
{
Mixin SWWMSelector;
String mText;
Font mFont;
int mColor;
@ -834,36 +865,13 @@ class ListMenuItemSWWMTextItemM : ListMenuItemSelectable
else Screen.DrawText(font,mColor,x,y,text,DTA_VirtualWidth,w,DTA_VirtualHeight,h,DTA_FullscreenScale,FSMode_ScaleToFit43);
}
override void DrawSelector( double xofs, double yofs, TextureID tex, ListMenuDescriptor desc )
{
if ( tex.isNull() ) return;
int w = desc?desc.DisplayWidth():ListMenuDescriptor.CleanScale;
int h = desc?desc.DisplayHeight():-1;
double y = mYpos+mHeight/2;
if ( w == ListMenuDescriptor.CleanScale )
{
xofs *= CleanXFac_1;
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_CenterOffset,true,DTA_Rotate,15.*sin(8*Menu.MenuTime()));
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_CenterOffset,true,DTA_Rotate,-15.*sin(8*Menu.MenuTime()));
}
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_CenterOffset,true,DTA_Rotate,15.*sin(8*Menu.MenuTime()));
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_CenterOffset,true,DTA_Rotate,-15.*sin(8*Menu.MenuTime()));
}
}
}
// for compat with non-text episodes (no longer used?)
Class ListMenuItemSWWMPatchItemM : ListMenuItemSelectable
{
Mixin SWWMSelector;
TextureID mTexture;
void Init( ListMenuDescriptor desc, TextureID patch, String hotkey, Name child, int param = 0 )
@ -901,32 +909,6 @@ Class ListMenuItemSWWMPatchItemM : ListMenuItemSelectable
screen.DrawTexture(mTexture,true,x,mYpos,DTA_VirtualWidth,w,DTA_VirtualHeight,h,DTA_FullscreenScale,FSMode_ScaleToFit43);
}
}
override void DrawSelector( double xofs, double yofs, TextureID tex, ListMenuDescriptor desc )
{
if ( tex.isNull() ) return;
int w = desc?desc.DisplayWidth():ListMenuDescriptor.CleanScale;
int h = desc?desc.DisplayHeight():-1;
double y = mYpos+mHeight/2;
if ( w == ListMenuDescriptor.CleanScale )
{
xofs *= CleanXFac_1;
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_CenterOffset,true,DTA_Rotate,15.*sin(8*Menu.MenuTime()));
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_CenterOffset,true,DTA_Rotate,-15.*sin(8*Menu.MenuTime()));
}
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_CenterOffset,true,DTA_Rotate,15.*sin(8*Menu.MenuTime()));
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_CenterOffset,true,DTA_Rotate,-15.*sin(8*Menu.MenuTime()));
}
}
}
Class OptionMenuItemTrapOption : OptionMenuItem