diff --git a/graphics/DemoIcon.png b/graphics/DemoIcon.png index e04035f95..569e6a148 100644 Binary files a/graphics/DemoIcon.png and b/graphics/DemoIcon.png differ diff --git a/language.version b/language.version index 136b3008c..c90478aec 100644 --- a/language.version +++ b/language.version @@ -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-"; diff --git a/zscript/menu/swwm_menus.zsc b/zscript/menu/swwm_menus.zsc index 49ba9f0e7..4e1e39004 100644 --- a/zscript/menu/swwm_menus.zsc +++ b/zscript/menu/swwm_menus.zsc @@ -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