From d915050656060bea31886cea5fd660a985ab393e Mon Sep 17 00:00:00 2001 From: Jonathan Payne Date: Sat, 5 Jan 2013 23:21:32 -0800 Subject: [PATCH] TitleScreen tweaks. --- .../ScreenTitleMenu background/default.lua | 36 ++++++++++++++-- ...ay.lua => ScreenTitleMenu decorations.lua} | 1 + .../_bg.png | Bin .../ScreenTitleMenu underlay/default.lua | 10 +++++ .../ScreenTitleMenu CurrentGametype.lua | 11 ++--- .../ScreenTitleMenu LifeDifficulty.lua | 19 +-------- .../ScreenTitleMenu NetworkStatus.lua | 17 ++++++-- .../ScreenTitleMenu TimingDifficulty.lua | 21 +-------- .../Graphics/ScreenTitleMenu VersionInfo.lua | 17 +++----- .../Graphics/ScreenTitleMenu scroll.lua | 28 +++--------- Themes/default/metrics.ini | 40 +++++++++--------- 11 files changed, 97 insertions(+), 103 deletions(-) rename Themes/default/BGAnimations/{ScreenTitleMenu underlay.lua => ScreenTitleMenu decorations.lua} (96%) rename Themes/default/BGAnimations/{ScreenTitleMenu background => ScreenTitleMenu underlay}/_bg.png (100%) create mode 100644 Themes/default/BGAnimations/ScreenTitleMenu underlay/default.lua diff --git a/Themes/default/BGAnimations/ScreenTitleMenu background/default.lua b/Themes/default/BGAnimations/ScreenTitleMenu background/default.lua index e0cae44c76..12057b869a 100644 --- a/Themes/default/BGAnimations/ScreenTitleMenu background/default.lua +++ b/Themes/default/BGAnimations/ScreenTitleMenu background/default.lua @@ -1,3 +1,33 @@ -return LoadActor("_bg") .. { - InitCommand=cmd(Center;zoomto,SCREEN_WIDTH+256,SCREEN_HEIGHT); -}; \ No newline at end of file +local t = Def.ActorFrame {}; +t[#t+1] = Def.ActorFrame { + FOV=90; + InitCommand=cmd(Center); + Def.Quad { + InitCommand=cmd(scaletoclipped,SCREEN_WIDTH,SCREEN_HEIGHT); + OnCommand=cmd(diffuse,color("#FFCB05");diffusebottomedge,color("#F0BA00")); + }; + Def.ActorFrame { + OnCommand=cmd(spin;effectmagnitude,0,0,10); + Def.ActorFrame { + InitCommand=cmd(rotationx,30;hide_if,hideFancyElements;); + OnCommand=cmd(sleep,2;queuecommand,"Shift"); + ShiftCommand=cmd( + smooth,1.25;z,256; + sleep,2; + smooth,1.25;z,0; + sleep,2;queuecommand,"Shift" + ); + FlipCommand=cmd( + smooth,0.5;rotationy,180; + sleep,2;smooth,0.5;rotationy,360; + sleep,1;rotationy,0;sleep,1; + queuecommand,"Flip" + ); + LoadActor(THEME:GetPathB("ScreenWithMenuElements","background/_checkerboard")) .. { + InitCommand=cmd(zoomto,SCREEN_WIDTH*2,SCREEN_HEIGHT*2;customtexturerect,0,0,SCREEN_WIDTH*4/256,SCREEN_HEIGHT*4/256); + OnCommand=cmd(texcoordvelocity,0,0.5;diffuse,color("#ffd400");diffusealpha,0.5;fadetop,1;fadebottom,1); + }; + }; + }; +}; +return t; \ No newline at end of file diff --git a/Themes/default/BGAnimations/ScreenTitleMenu underlay.lua b/Themes/default/BGAnimations/ScreenTitleMenu decorations.lua similarity index 96% rename from Themes/default/BGAnimations/ScreenTitleMenu underlay.lua rename to Themes/default/BGAnimations/ScreenTitleMenu decorations.lua index 7f58a28fa3..af734922ce 100644 --- a/Themes/default/BGAnimations/ScreenTitleMenu underlay.lua +++ b/Themes/default/BGAnimations/ScreenTitleMenu decorations.lua @@ -11,6 +11,7 @@ local t = Def.ActorFrame { end; }; +t[#t+1] = StandardDecorationFromFileOptional("Footer","Footer"); t[#t+1] = StandardDecorationFromFileOptional("Logo","Logo"); t[#t+1] = StandardDecorationFromFileOptional("VersionInfo","VersionInfo"); t[#t+1] = StandardDecorationFromFileOptional("CurrentGametype","CurrentGametype"); diff --git a/Themes/default/BGAnimations/ScreenTitleMenu background/_bg.png b/Themes/default/BGAnimations/ScreenTitleMenu underlay/_bg.png similarity index 100% rename from Themes/default/BGAnimations/ScreenTitleMenu background/_bg.png rename to Themes/default/BGAnimations/ScreenTitleMenu underlay/_bg.png diff --git a/Themes/default/BGAnimations/ScreenTitleMenu underlay/default.lua b/Themes/default/BGAnimations/ScreenTitleMenu underlay/default.lua new file mode 100644 index 0000000000..74fb90bfad --- /dev/null +++ b/Themes/default/BGAnimations/ScreenTitleMenu underlay/default.lua @@ -0,0 +1,10 @@ +return Def.ActorFrame { + Def.Quad { + InitCommand=cmd(horizalign,left;vertalign,top;y,SCREEN_TOP+8); + OnCommand=cmd(diffuse,Color.Black;diffusealpha,0.5;zoomto,256,84;faderight,1); + }; + Def.Quad { + InitCommand=cmd(horizalign,right;vertalign,top;x,SCREEN_RIGHT;y,SCREEN_TOP+8); + OnCommand=cmd(diffuse,Color.Black;diffusealpha,0.5;zoomto,256,46;fadeleft,1); + }; +}; \ No newline at end of file diff --git a/Themes/default/Graphics/ScreenTitleMenu CurrentGametype.lua b/Themes/default/Graphics/ScreenTitleMenu CurrentGametype.lua index 575c84d4bd..66d7596359 100644 --- a/Themes/default/Graphics/ScreenTitleMenu CurrentGametype.lua +++ b/Themes/default/Graphics/ScreenTitleMenu CurrentGametype.lua @@ -1,11 +1,8 @@ local curGameName = GAMESTATE:GetCurrentGame():GetName(); -local t = Def.ActorFrame{ - LoadFont("Common Normal") .. { - InitCommand=cmd(horizalign,left;zoom,0.5;); - BeginCommand=function(self) - self:settextf( Screen.String("CurrentGametype"), curGameName ); - end; - }; +local t = LoadFont("Common Normal") .. { + BeginCommand=function(self) + self:settextf( Screen.String("CurrentGametype"), curGameName ); + end; }; return t; \ No newline at end of file diff --git a/Themes/default/Graphics/ScreenTitleMenu LifeDifficulty.lua b/Themes/default/Graphics/ScreenTitleMenu LifeDifficulty.lua index 16d5ce2c28..c426ee610c 100644 --- a/Themes/default/Graphics/ScreenTitleMenu LifeDifficulty.lua +++ b/Themes/default/Graphics/ScreenTitleMenu LifeDifficulty.lua @@ -1,23 +1,8 @@ return Def.ActorFrame { ---[[ LoadActor(THEME:GetPathG("ScreenTitleMenu","PreferenceFrame")) .. { - OnCommand=function(self) - if GetLifeDifficulty() < 3 then - (cmd(diffuseshift;effectcolor1,Color("Blue");effectcolor2,ColorDarkTone(Color("Blue"));effectperiod,1.25))(self); - elseif GetLifeDifficulty() > 3 then - (cmd(diffuseshift;effectcolor1,Color("Red");effectcolor2,ColorDarkTone(Color("Red"));effectperiod,1.25))(self); - else - (cmd(diffuse,Color("Orange");diffusetopedge,Color("Yellow")))(self); - end; - end; - }; --]] --- LoadActor(THEME:GetPathG("OptionRowExit","frame")); - LoadActor(THEME:GetPathG("_icon","Health")) .. { - InitCommand=cmd(x,-60;shadowlength,1); - }; LoadFont("Common Normal") .. { Text=GetLifeDifficulty(); AltText=""; - InitCommand=cmd(x,-72+28;horizalign,left;zoom,0.5); + InitCommand=cmd(horizalign,left;zoom,0.675); OnCommand=cmd(shadowlength,1); BeginCommand=function(self) self:settextf( Screen.String("LifeDifficulty"), "" ); @@ -26,7 +11,7 @@ return Def.ActorFrame { LoadFont("Common Normal") .. { Text=GetLifeDifficulty(); AltText=""; - InitCommand=cmd(x,68*0.75+8;zoom,0.875;halign,0); + InitCommand=cmd(x,136;zoom,0.675;halign,0); OnCommand=cmd(shadowlength,1;skewx,-0.125); }; }; \ No newline at end of file diff --git a/Themes/default/Graphics/ScreenTitleMenu NetworkStatus.lua b/Themes/default/Graphics/ScreenTitleMenu NetworkStatus.lua index 4fcd297528..0f1ef18fe9 100644 --- a/Themes/default/Graphics/ScreenTitleMenu NetworkStatus.lua +++ b/Themes/default/Graphics/ScreenTitleMenu NetworkStatus.lua @@ -2,8 +2,19 @@ local netConnected = IsNetConnected(); local loggedOnSMO = IsNetSMOnline(); local t = Def.ActorFrame{ + Def.Quad { + InitCommand=cmd(y,-12;x,160;zoomto,320+32,38;vertalign,top;diffuse,Color.Black;diffusealpha,0.5); + OnCommand=cmd(faderight,0.45); + BeginCommand=function(self) + if netConnected then + self:zoomtoheight( 38 ); + else + self:zoomtoheight( 24 ); + end + end; + }; LoadFont("Common Normal") .. { - InitCommand=cmd(uppercase,true;zoom,0.75;horizalign,left); + InitCommand=cmd(uppercase,true;zoom,0.75;shadowlength,1;horizalign,left); BeginCommand=function(self) -- check network status if netConnected then @@ -11,7 +22,7 @@ local t = Def.ActorFrame{ self:diffusebottomedge( color("0.72,0.89,1,1") ); self:settext( Screen.String("Network OK") ); else - self:diffuse( color("0.75,0.75,0.75,1") ); + self:diffuse( color("1,1,1,1") ); self:settext( Screen.String("Offline") ); end; end; @@ -20,7 +31,7 @@ local t = Def.ActorFrame{ if netConnected then t[#t+1] = LoadFont("Common Normal") .. { - InitCommand=cmd(y,14;horizalign,left;zoom,0.5;diffuse,color("0.72,0.89,1,1")); + InitCommand=cmd(y,16;horizalign,left;zoom,0.5875;shadowlength,1;diffuse,color("0.72,0.89,1,1")); BeginCommand=function(self) self:settext( string.format(Screen.String("Connected to %s"), GetServerName()) ); end; diff --git a/Themes/default/Graphics/ScreenTitleMenu TimingDifficulty.lua b/Themes/default/Graphics/ScreenTitleMenu TimingDifficulty.lua index d5ab94fe65..c419c97a14 100644 --- a/Themes/default/Graphics/ScreenTitleMenu TimingDifficulty.lua +++ b/Themes/default/Graphics/ScreenTitleMenu TimingDifficulty.lua @@ -1,25 +1,8 @@ return Def.ActorFrame { ---[[ LoadActor(THEME:GetPathG("ScreenTitleMenu","PreferenceFrame")) .. { - OnCommand=function(self) - if GetTimingDifficulty() == 7 then - (cmd(glowshift;diffuse,Color("Yellow");diffuserightedge,Color("Red");effectcolor1,Color.Alpha( Color("Red"), 0.5 );effectcolor2,Color("Invisible");effectperiod,1.25/2))(self); - elseif GetTimingDifficulty() < 4 then - (cmd(diffuseshift;effectcolor1,Color("Blue");effectcolor2,ColorDarkTone(Color("Blue"));effectperiod,1.25))(self); - elseif GetTimingDifficulty() > 4 and GetTimingDifficulty < 6 then - (cmd(diffuseshift;effectcolor1,Color("Red");effectcolor2,ColorDarkTone(Color("Red"));effectperiod,1.25))(self); - else - (cmd(diffuse,Color("Orange");diffusetopedge,Color("Yellow")))(self); - end; - end; - }; --]] --- LoadActor(THEME:GetPathG("OptionRowExit","frame")); - LoadActor(THEME:GetPathG("_icon","Timing")) .. { - InitCommand=cmd(x,-60;shadowlength,1); - }; LoadFont("Common Normal") .. { Text=GetTimingDifficulty(); AltText=""; - InitCommand=cmd(x,-72+28;horizalign,left;zoom,0.5); + InitCommand=cmd(horizalign,left;zoom,0.675); OnCommand=cmd(shadowlength,1); BeginCommand=function(self) self:settextf( Screen.String("TimingDifficulty"), "" ); @@ -28,7 +11,7 @@ return Def.ActorFrame { LoadFont("Common Normal") .. { Text=GetTimingDifficulty(); AltText=""; - InitCommand=cmd(x,68*0.75+8;zoom,0.875;halign,0); + InitCommand=cmd(x,136;zoom,0.675;halign,0); OnCommand=function(self) (cmd(shadowlength,1;skewx,-0.125))(self); if GetTimingDifficulty() == 9 then diff --git a/Themes/default/Graphics/ScreenTitleMenu VersionInfo.lua b/Themes/default/Graphics/ScreenTitleMenu VersionInfo.lua index 78b764c37d..c566856ea0 100644 --- a/Themes/default/Graphics/ScreenTitleMenu VersionInfo.lua +++ b/Themes/default/Graphics/ScreenTitleMenu VersionInfo.lua @@ -1,17 +1,14 @@ return Def.ActorFrame { - LoadActor(THEME:GetPathG("ScreenTitleMenu","PreferenceFrame")) .. { - OnCommand=cmd(diffuse,color("#f7941d");diffusetopedge,color("#fff200");diffusealpha,0.25); - }; LoadFont("Common Normal") .. { - Text=ProductFamily(); + Text=string.format("%s %s", ProductFamily(), ProductVersion()); AltText="StepMania"; - InitCommand=cmd(y,-5;zoom,0.6); - OnCommand=cmd(shadowlength,1); + InitCommand=cmd(zoom,0.675); + OnCommand=cmd(horizalign,right;shadowlength,1); }; LoadFont("Common Normal") .. { - Text=ProductVersion() .. " (".. VersionDate() ..")"; - AltText=""; - InitCommand=cmd(y,8;zoom,0.45); - OnCommand=cmd(shadowlength,1;skewx,-0.125); + Text=string.format("%s", VersionDate()); + AltText="Unknown Version"; + InitCommand=cmd(y,16;zoom,0.5); + OnCommand=cmd(horizalign,right;shadowlength,1); }; }; \ No newline at end of file diff --git a/Themes/default/Graphics/ScreenTitleMenu scroll.lua b/Themes/default/Graphics/ScreenTitleMenu scroll.lua index d9245caac5..12b22aa41a 100644 --- a/Themes/default/Graphics/ScreenTitleMenu scroll.lua +++ b/Themes/default/Graphics/ScreenTitleMenu scroll.lua @@ -2,33 +2,15 @@ local gc = Var("GameCommand"); return Def.ActorFrame { Def.Quad{ - InitCommand=cmd(zoomto,192,26;diffuse,HSVA(192,0.8,1,0.45);blend,Blend.Add;fadeleft,0.5;faderight,0.35;skewx,-0.1); - OnCommand=cmd(glowshift;effectcolor1,color("1,1,1,0");effectcolor2,color("1,1,1,0.125");); - --[[ - GainFocusCommand=cmd(stoptweening;croptop,0;cropbottom,1;linear,0.05;cropbottom,0;); - LoseFocusCommand=cmd(stoptweening;croptop,0;linear,0.05;croptop,1;); - --]] - GainFocusCommand=cmd(stoptweening;cropright,0;cropleft,1;linear,0.05;cropleft,0;); - LoseFocusCommand=cmd(stoptweening;cropright,0;linear,0.05;cropright,1;); + InitCommand=cmd(zoomto,256,26;fadeleft,0.45;faderight,0.45); + OnCommand=cmd(diffuseshift;effectcolor1,color("0,0,0,0.5");effectcolor2,color("0,0,0,0.5")); + GainFocusCommand=cmd(stoptweening;decelerate,0.125;zoomto,256,26;diffusealpha,1); + LoseFocusCommand=cmd(stoptweening;accelerate,0.125;zoomto,SCREEN_WIDTH,0;diffusealpha,0); }; LoadFont("Common Normal") .. { Text=THEME:GetString("ScreenTitleMenu",gc:GetText()); ---[[ EnabledCommand=function(self) - if string.find( THEME:GetMetric( Var "LoadingScreen", "DisabledChoices") , gc:GetText() ) ~= nil then - self:diffuse(Color("Red")); - end - end; --]] - OnCommand=cmd(strokecolor,Color("Outline")); + OnCommand=cmd(shadowlength,1); GainFocusCommand=cmd(stoptweening;linear,0.125;zoom,1;diffuse,color("1,1,1,1")); ---[[ GainFocusCommand=function(self) - if string.find( tostring( THEME:GetMetric( Var "LoadingScreen", "DisabledChoices") ) , gc:GetText() ) ~= nil then - self:zoom(1); - self:diffuse(Color("Red")); - else - self:zoom(1); - self:diffuse(Color("White")); - end - end; --]] LoseFocusCommand=cmd(stoptweening;linear,0.125;zoom,0.75;diffuse,color("0.5,0.5,0.5,1")); }; }; \ No newline at end of file diff --git a/Themes/default/metrics.ini b/Themes/default/metrics.ini index 41aa5e7941..431171a52e 100644 --- a/Themes/default/metrics.ini +++ b/Themes/default/metrics.ini @@ -632,7 +632,7 @@ PersistScreens="ScreenInit,ScreenTitleJoin,ScreenTitleMenu" [ScreenTitleMenu] ShowHeader=false -ShowFooter=false +ShowFooter=true # WrapScroller=false ScrollerTransform=function(self,offset,itemIndex,numItems) self:y((28)*(itemIndex-(numItems-1)/2)); end; @@ -648,31 +648,30 @@ LogoY=SCREEN_CENTER_Y-68 LogoOnCommand= LogoOffCommand= # -ShowCurrentGametype=true -CurrentGametypeX=SCREEN_WIDTH*0.01 -CurrentGametypeY=SCREEN_HEIGHT*0.1575 -CurrentGametypeOnCommand=vertalign,bottom; -CurrentGametypeOffCommand=linear,0.5;cropleft,1 -# -ShowNumSongs=true -NumSongsX=SCREEN_WIDTH*0.99 -NumSongsY=SCREEN_HEIGHT*0.1575+5 -NumSongsOnCommand=vertalign,bottom;horizalign,right;zoom,0.5;playcommand,"Set" -NumSongsOffCommand= -# -# ShowTimingDifficulty=true -TimingDifficultyX=SCREEN_LEFT+84 +TimingDifficultyX=SCREEN_LEFT+16 TimingDifficultyY=SCREEN_TOP+22 TimingDifficultyOnCommand= TimingDifficultyOffCommand= # ShowLifeDifficulty=true -LifeDifficultyX=SCREEN_LEFT+84 -LifeDifficultyY=SCREEN_TOP+48 +LifeDifficultyX=SCREEN_LEFT+16 +LifeDifficultyY=SCREEN_TOP+44 LifeDifficultyOnCommand= LifeDifficultyOffCommand= # +ShowNumSongs=true +NumSongsX=SCREEN_LEFT+16 +NumSongsY=SCREEN_TOP+68 +NumSongsOnCommand=vertalign,bottom;horizalign,left;zoom,0.5;shadowlength,1;playcommand,"Set" +NumSongsOffCommand= +ShowCurrentGametype=true +# +CurrentGametypeX=SCREEN_LEFT+16 +CurrentGametypeY=SCREEN_TOP+84 +CurrentGametypeOnCommand=vertalign,bottom;horizalign,left;zoom,0.5;shadowlength,1 +CurrentGametypeOffCommand=linear,0.5;cropleft,1 +# ShowSystemDirection=false SystemDirectionX=SCREEN_LEFT+40 SystemDirectionY=SCREEN_TOP+24 @@ -680,18 +679,17 @@ SystemDirectionOnCommand= SystemDirectionOffCommand= # ShowVersionInfo=true -VersionInfoX=SCREEN_RIGHT-90 -VersionInfoY=SCREEN_BOTTOM-64 +VersionInfoX=SCREEN_RIGHT-16 +VersionInfoY=SCREEN_TOP+24 VersionInfoOnCommand= VersionInfoOffCommand= # ShowNetworkStatus=true NetworkStatusX=SCREEN_LEFT+12 -NetworkStatusY=SCREEN_HEIGHT*0.85 +NetworkStatusY=SCREEN_BOTTOM-64 NetworkStatusOnCommand=halign,0; NetworkStatusOffCommand=linear,0.5;cropright,1 # -HelpY=SCREEN_BOTTOM-24 # ChoiceNames="GameStart,Options,Edit,Jukebox,Exit" DefaultChoice="GameStart"