From 7f2fb952cae3339aff81eeb46e7a2a325bd540a4 Mon Sep 17 00:00:00 2001 From: Jason Felds Date: Thu, 18 Jul 2013 17:41:35 -0400 Subject: [PATCH] Revert "MouseTest theme covered." This reverts commit ca1b8cb942080b9053f11c8d39ff633ff522dbb3. --- .../ScreenTitleMenu background.lua | 7 +-- .../BGAnimations/ScreenTitleMenu overlay.lua | 11 +--- .../BGAnimations/ScreenTitleMenu underlay.lua | 26 ++------- .../Graphics/ScreenTitleMenu scroll.lua | 54 ++++++------------- 4 files changed, 24 insertions(+), 74 deletions(-) diff --git a/Themes/MouseTest/BGAnimations/ScreenTitleMenu background.lua b/Themes/MouseTest/BGAnimations/ScreenTitleMenu background.lua index df4bd562cd..0b3a21e72a 100644 --- a/Themes/MouseTest/BGAnimations/ScreenTitleMenu background.lua +++ b/Themes/MouseTest/BGAnimations/ScreenTitleMenu background.lua @@ -1,8 +1,3 @@ return Def.Quad{ - InitCommand=function(self) - self:Center(); - self:FullScreen(); - self:diffuse(HSV(192,1,0.8)); - self:diffusebottomedge(HSV(192,0.625,0.25)); - end; + 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 index 90765ee07c..dedd03adcb 100644 --- a/Themes/MouseTest/BGAnimations/ScreenTitleMenu overlay.lua +++ b/Themes/MouseTest/BGAnimations/ScreenTitleMenu overlay.lua @@ -1,9 +1,6 @@ local t = Def.ActorFrame{ LoadActor(THEME:GetPathG("_click","target"))..{ - InitCommand=function(self) - self:diffusealpha(0); - self:Real(); - end; + InitCommand=cmd(diffusealpha,0;Real); LeftClickMessageCommand=function(self) MESSAGEMAN:Broadcast("MouseInput", { Input = "Left" }); end; @@ -34,11 +31,7 @@ local t = Def.ActorFrame{ }; LoadFont("common normal")..{ Name="Coords"; - InitCommand=function(self) - self:shadowlength(1); - self:zoom(0.5); - self:align(0, 1); - end; + InitCommand=cmd(shadowlength,1;zoom,0.5;align,0,1); MouseInputMessageCommand=function(self,param) local cX = INPUTFILTER:GetMouseX() local cY = INPUTFILTER:GetMouseY() diff --git a/Themes/MouseTest/BGAnimations/ScreenTitleMenu underlay.lua b/Themes/MouseTest/BGAnimations/ScreenTitleMenu underlay.lua index 1f62a9b065..d11b41a28f 100644 --- a/Themes/MouseTest/BGAnimations/ScreenTitleMenu underlay.lua +++ b/Themes/MouseTest/BGAnimations/ScreenTitleMenu underlay.lua @@ -3,11 +3,7 @@ local t = Def.ActorFrame{}; local mou = Def.ActorFrame{ LoadFont("common normal")..{ Name="Coords"; - InitCommand=function(self) - self:align(0, 0); - self:x(SCREEN_LEFT + 8); - self:y(SCREEN_BOTTOM - 48); - end; + InitCommand=cmd(align,0,0;x,SCREEN_LEFT+8;y,SCREEN_BOTTOM-48); }; }; local function UpdateMouse(self) @@ -17,33 +13,19 @@ local function UpdateMouse(self) local text = "[Mouse] X: ".. mouseX .." Y: ".. mouseY; coords:settext(text) end -mou.InitCommand=function(self) - self:SetUpdateFunction(); - UpdateMouse(); -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=function(self) - self:CenterX(); - self:y(SCREEN_TOP + 28); - self:diffuse(color("#333333")); - end; + InitCommand=cmd(CenterX;y,SCREEN_TOP+28;diffuse,color("#333333")); }; LoadFont("Common normal")..{ Name="Instructions"; Text=THEME:GetString("MouseTest","Instructions"); - InitCommand=function(self) - self:x(SCREEN_LEFT + 12); - self:align(0, 0); - self:y(SCREEN_TOP + 42); - self:diffuse(color("#333333")); - self:zoom(2 / 3); - self:wrapwidthpixels(SCREEN_WIDTH * 1.5); - end; + InitCommand=cmd(x,SCREEN_LEFT+12;align,0,0;y,SCREEN_TOP+42;diffuse,color("#333333");zoom,16/24;wrapwidthpixels,SCREEN_WIDTH*1.5); }; }; diff --git a/Themes/MouseTest/Graphics/ScreenTitleMenu scroll.lua b/Themes/MouseTest/Graphics/ScreenTitleMenu scroll.lua index d989aec3e5..d11925aa82 100644 --- a/Themes/MouseTest/Graphics/ScreenTitleMenu scroll.lua +++ b/Themes/MouseTest/Graphics/ScreenTitleMenu scroll.lua @@ -12,50 +12,30 @@ local itemColors = { }; 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=function(self) - self:diffuse(color("1,1,1,1")); - end; - DisabledCommand=function(self) - self:diffuse(color("0.5,0.5,0.5,0.85")); - end; - GainFocusCommand=function(self) - self:stoptweening(); - self:linear(0.25); - self:diffuse(color("1,0.2,0.2,1")); - end; - LoseFocusCommand=function(self) - self:stoptweening(); - self:linear(0.25); - self:diffuse(color("1,1,1,1")); - end; + 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=function(self) - self:x(-SCREEN_WIDTH * 0.105); - self:zoomto(8, 24); - self:zwrite(true); - self:blend('BlendMode_NoEffect'); - end; + InitCommand=cmd(x,-SCREEN_WIDTH*0.105;zoomto,8,24;zwrite,true;blend,'BlendMode_NoEffect'); }; Def.Quad{ - InitCommand=function(self) - self:x(-SCREEN_WIDTH * 0.1); - self:zoomto(12, 12); - self:rotationz(45); - self:diffuselowerleft(color("0,0,0,0")); - self:ztest(true); - end; - GainFocusCommand=function(self) - self:stoptweening(); - self:visible(true); - end; - LoseFocusCommand=function(self) - self:stoptweening(); - self:visible(false); - end; + 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 ]] };