diff --git a/Themes/MouseTest/BGAnimations/ScreenTitleMenu background.lua b/Themes/MouseTest/BGAnimations/ScreenTitleMenu background.lua new file mode 100644 index 0000000000..4b9b2013c3 --- /dev/null +++ b/Themes/MouseTest/BGAnimations/ScreenTitleMenu background.lua @@ -0,0 +1,3 @@ +return Def.Quad{ + InitCommand=cmd(Center;FullScreen;diffuse,HSV(192,1,0.8);diffusebottomedge,HSV(192,0.625,0.25)); +}; \ No newline at end of file diff --git a/Themes/MouseTest/BGAnimations/ScreenTitleMenu overlay.lua b/Themes/MouseTest/BGAnimations/ScreenTitleMenu overlay.lua new file mode 100644 index 0000000000..919f13545d --- /dev/null +++ b/Themes/MouseTest/BGAnimations/ScreenTitleMenu overlay.lua @@ -0,0 +1,51 @@ +local t = Def.ActorFrame{ + LoadActor(THEME:GetPathG("_click","target"))..{ + InitCommand=cmd(diffusealpha,0;Real); + LeftClickMessageCommand=function(self) + MESSAGEMAN:Broadcast("MouseInput", { Input = "Left" }); + end; + RightClickMessageCommand=function(self) + MESSAGEMAN:Broadcast("MouseInput", { Input = "Right" }); + end; + MiddleClickMessageCommand=function(self) + MESSAGEMAN:Broadcast("MouseInput", { Input = "Middle" }); + end; + MouseWheelUpMessageCommand=function(self) + MESSAGEMAN:Broadcast("MouseInput", { Input = "WheelUp" }); + end; + MouseWheelDownMessageCommand=function(self) + MESSAGEMAN:Broadcast("MouseInput", { Input = "WheelDown" }); + end; + MouseInputMessageCommand=function(self,param) + local cX = INPUTFILTER:GetMouseX() + local cY = INPUTFILTER:GetMouseY() + if param.Input == "Left" then + self:stoptweening() + self:x(cX) + self:y(cY) + self:diffusealpha(1) + self:sleep(1) + self:diffusealpha(0) + end + end + }; + LoadFont("common normal")..{ + Name="Coords"; + InitCommand=cmd(shadowlength,1;zoom,0.5;align,0,1); + MouseInputMessageCommand=function(self,param) + local cX = INPUTFILTER:GetMouseX() + local cY = INPUTFILTER:GetMouseY() + if param.Input == "Left" then + self:stoptweening() + self:x(cX + 8) + self:y(cY + 16) + self:settext("(".. string.format("%i",cX) ..",".. string.format("%i",cY) ..")") + self:diffusealpha(1) + self:sleep(1) + self:diffusealpha(0) + end + end + }; +}; + +return t; \ No newline at end of file diff --git a/Themes/MouseTest/BGAnimations/ScreenTitleMenu underlay.lua b/Themes/MouseTest/BGAnimations/ScreenTitleMenu underlay.lua new file mode 100644 index 0000000000..f78dd28efc --- /dev/null +++ b/Themes/MouseTest/BGAnimations/ScreenTitleMenu underlay.lua @@ -0,0 +1,32 @@ +local t = Def.ActorFrame{}; + +local mou = Def.ActorFrame{ + LoadFont("common normal")..{ + Name="Coords"; + InitCommand=cmd(align,0,0;x,SCREEN_LEFT+8;y,SCREEN_BOTTOM-48); + }; +}; +local function UpdateMouse(self) + local coords = self:GetChild("Coords") + local mouseX = INPUTFILTER:GetMouseX() + local mouseY = INPUTFILTER:GetMouseY() + local text = "[Mouse] X: ".. mouseX .." Y: ".. mouseY; + coords:settext(text) +end +mou.InitCommand=cmd(SetUpdateFunction,UpdateMouse); +t[#t+1] = mou; + +t[#t+1] = Def.ActorFrame{ + LoadFont("Common normal")..{ + Name="Title"; + Text=THEME:GetString("MouseTest","Title"); + InitCommand=cmd(CenterX;y,SCREEN_TOP+28;diffuse,color("#333333")); + }; + LoadFont("Common normal")..{ + Name="Instructions"; + Text=THEME:GetString("MouseTest","Instructions"); + InitCommand=cmd(x,SCREEN_LEFT+12;align,0,0;y,SCREEN_TOP+42;diffuse,color("#333333");zoom,16/24;wrapwidthpixels,SCREEN_WIDTH*1.5); + }; +}; + +return t; \ No newline at end of file diff --git a/Themes/MouseTest/Graphics/ScreenTitleMenu scroll.lua b/Themes/MouseTest/Graphics/ScreenTitleMenu scroll.lua new file mode 100644 index 0000000000..36fe28ff45 --- /dev/null +++ b/Themes/MouseTest/Graphics/ScreenTitleMenu scroll.lua @@ -0,0 +1,43 @@ +local gc = Var("GameCommand"); +local index = gc:GetIndex(); +local name = gc:GetName(); +local text = gc:GetText(); + +local itemColors = { + HSV(128, 0.6, 0.85), -- play + HSV(192, 0.6, 0.85), -- options + HSV(160, 0.6, 0.85), -- customization + HSV( 64, 0.6, 0.85), -- edit + HSV( 0, 0.6, 0.85), -- exit +}; + +local t = Def.ActorFrame{ + --[[ + Def.Actor{ + Name="TitleMenuController"; + GainFocusCommand=function(self) + MESSAGEMAN:Broadcast("TitleChange",{NewColor=itemColors[index+1]}); + end; + }; + ]] + LoadFont("Common Normal")..{ + Text=Screen.String(text); + InitCommand=cmd(diffuse,color("1,1,1,1")); + DisabledCommand=cmd(diffuse,color("0.5,0.5,0.5,0.85")); + --GainFocusCommand=cmd(stoptweening;linear,0.25;diffuse,itemColors[index+1]); + GainFocusCommand=cmd(stoptweening;linear,0.25;diffuse,color("1,0.2,0.2,1")); + LoseFocusCommand=cmd(stoptweening;linear,0.25;diffuse,color("1,1,1,1")); + }; + --[[ begin triangle ]] + Def.Quad{ + InitCommand=cmd(x,-SCREEN_WIDTH*0.105;zoomto,8,24;zwrite,true;blend,'BlendMode_NoEffect'); + }; + Def.Quad{ + InitCommand=cmd(x,-SCREEN_WIDTH*0.1;zoomto,12,12;rotationz,45;diffuselowerleft,color("0,0,0,0");ztest,true); + GainFocusCommand=cmd(stoptweening;visible,true); + LoseFocusCommand=cmd(stoptweening;visible,false); + }; + --[[ end triangle ]] +}; + +return t; \ No newline at end of file diff --git a/Themes/MouseTest/Graphics/_click target.png b/Themes/MouseTest/Graphics/_click target.png new file mode 100644 index 0000000000..88fe2211e7 Binary files /dev/null and b/Themes/MouseTest/Graphics/_click target.png differ diff --git a/Themes/MouseTest/Languages/en.ini b/Themes/MouseTest/Languages/en.ini new file mode 100644 index 0000000000..69659b79b7 --- /dev/null +++ b/Themes/MouseTest/Languages/en.ini @@ -0,0 +1,6 @@ +[Common] +WindowTitle=sm-ssc Mouse Test + +[MouseTest] +Title=sm-ssc Mouse Test +Instructions=Move around with the mouse. You'll see some coordinates in the bottom right, and when you click, a target appears. \ No newline at end of file diff --git a/Themes/MouseTest/ThemeInfo.ini b/Themes/MouseTest/ThemeInfo.ini new file mode 100644 index 0000000000..a44e86304e --- /dev/null +++ b/Themes/MouseTest/ThemeInfo.ini @@ -0,0 +1,3 @@ +[ThemeInfo] +DisplayName=sm-ssc Mouse Test +Author=sm-ssc Developers \ No newline at end of file diff --git a/Themes/MouseTest/metrics.ini b/Themes/MouseTest/metrics.ini new file mode 100644 index 0000000000..1a707786b5 --- /dev/null +++ b/Themes/MouseTest/metrics.ini @@ -0,0 +1,15 @@ +# sm-ssc Mouse Test theme +[Common] +InitialScreen="ScreenTitleMenu" + +[ScreenTitleMenu] +IdleTimeoutSeconds=-1 +IdleTimeoutScreen="ScreenTitleMenu" + +ChoiceNames="1,2" +Choice1="screen,ScreenOptionsService;text,Options" +Choice2="screen,ScreenExit;text,Exit" + +[ScreenOptionsService] +PrevScreen="ScreenTitleMenu" +NextScreen="ScreenTitleMenu" \ No newline at end of file