diff --git a/Themes/default/BGAnimations/Screen cancel/default.lua b/Themes/default/BGAnimations/Screen cancel/default.lua index fa945f224e..b9b444db14 100644 --- a/Themes/default/BGAnimations/Screen cancel/default.lua +++ b/Themes/default/BGAnimations/Screen cancel/default.lua @@ -1,9 +1,19 @@ return Def.ActorFrame { Def.Quad { - InitCommand=cmd(Center;zoomto,SCREEN_WIDTH+1,SCREEN_HEIGHT); - OnCommand=cmd(diffuse,color("0,0,0,0.5");sleep,5/60;diffusealpha,1;sleep,5/60); + InitCommand=function(self) + self:Center(); + self:zoomto(SCREEN_WIDTH + 1, SCREEN_HEIGHT); + end; + OnCommand=function(self) + self:diffuse(color("0,0,0,0.5")); + self:sleep(5 / 60); + self:diffusealpha(1); + self:sleep(5 / 60); + end; }; LoadActor(THEME:GetPathS("_Screen","cancel")) .. { - StartTransitioningCommand=cmd(play); + StartTransitioningCommand=function(self) + self:play(); + end; }; }; \ No newline at end of file diff --git a/Themes/default/BGAnimations/Screen in/default.lua b/Themes/default/BGAnimations/Screen in/default.lua index ec91cd3aec..e784205cf8 100644 --- a/Themes/default/BGAnimations/Screen in/default.lua +++ b/Themes/default/BGAnimations/Screen in/default.lua @@ -2,7 +2,15 @@ local fSleepTime = THEME:GetMetric( Var "LoadingScreen","ScreenInDelay"); return Def.ActorFrame { Def.Quad { - InitCommand=cmd(Center;zoomto,SCREEN_WIDTH+1,SCREEN_HEIGHT); - OnCommand=cmd(diffuse,color("0,0,0,1");sleep,fSleepTime;linear,0.01;diffusealpha,0); + InitCommand=function(self) + self:Center(); + self:zoomto(SCREEN_WIDTH + 1, SCREEN_HEIGHT); + end; + OnCommand=function(self) + self:diffuse(color("0,0,0,1")); + self:sleep(fSleepTime); + self:linear(0.01); + self:diffusealpha(0); + end; }; }; \ No newline at end of file diff --git a/Themes/default/BGAnimations/Screen out/default.lua b/Themes/default/BGAnimations/Screen out/default.lua index d62b6e1e06..d04a51bb3e 100644 --- a/Themes/default/BGAnimations/Screen out/default.lua +++ b/Themes/default/BGAnimations/Screen out/default.lua @@ -2,7 +2,15 @@ local fSleepTime = THEME:GetMetric( Var "LoadingScreen","ScreenOutDelay"); return Def.ActorFrame { Def.Quad { - InitCommand=cmd(Center;zoomto,SCREEN_WIDTH+1,SCREEN_HEIGHT); - OnCommand=cmd(diffuse,color("0,0,0,0");sleep,fSleepTime;linear,0.01;diffusealpha,1); + InitCommand=function(self) + self:Center(); + self:zoomto(SCREEN_WIDTH + 1, SCREEN_HEIGHT); + end; + OnCommand=function(self) + self:diffuse(color("0,0,0,0")); + self:sleep(fSleepTime); + self:linear(0.01); + self:diffusealpha(1); + end; }; }; \ No newline at end of file diff --git a/Themes/default/BGAnimations/ScreenCredits background/default.lua b/Themes/default/BGAnimations/ScreenCredits background/default.lua index 8cd4a8ea35..41d49ebc7a 100644 --- a/Themes/default/BGAnimations/ScreenCredits background/default.lua +++ b/Themes/default/BGAnimations/ScreenCredits background/default.lua @@ -1,20 +1,50 @@ -local scrolltime = 95; - -local t = Def.ActorFrame { - InitCommand=cmd(Center); - LoadActor("_space")..{ - InitCommand=cmd(y,-SCREEN_HEIGHT*1.5;fadebottom,0.125;fadetop,0.25); - OnCommand=cmd(linear,scrolltime;addy,SCREEN_HEIGHT*1.5825); - }; - Def.Quad { - InitCommand=cmd(scaletoclipped,SCREEN_WIDTH+1,SCREEN_HEIGHT); - OnCommand=cmd(diffusecolor,color("#FFCB05");diffusebottomedge,color("#F0BA00");diffusealpha,0.45); - }; - LoadActor("_grid")..{ - InitCommand=cmd(customtexturerect,0,0,(SCREEN_WIDTH+1)/4,SCREEN_HEIGHT/4;SetTextureFiltering,true); - OnCommand=cmd(zoomto,SCREEN_WIDTH+1,SCREEN_HEIGHT;diffuse,Color("Black");diffuseshift;effecttiming,(1/8)*4,0,(7/8)*4,0;effectclock,'beatnooffset'; - effectcolor2,Color("Black");effectcolor1,Color.Alpha(Color("Black"),0.45);fadebottom,0.25;fadetop,0.25;croptop,48/480;cropbottom,48/480;diffusealpha,0.345); - }; -}; - +local scrolltime = 95; + +local t = Def.ActorFrame { + InitCommand=function(self) + self:Center(); + end; + LoadActor("_space")..{ + InitCommand=function(self) + self:y(-SCREEN_HEIGHT * 1.5); + self:fadebottom(0.125); + self:fadetop(0.25); + end; + OnCommand=function(self) + self:linear(scrolltime); + self:addy(SCREEN_HEIGHT * 1.5825); + end; + }; + Def.Quad { + InitCommand=function(self) + self:scaletoclipped(SCREEN_WIDTH + 1, SCREEN_HEIGHT); + end; + OnCommand=function(self) + self:diffusecolor(color("#FFCB05")); + self:diffusebottomedge(color("#F0BA00")); + self:diffusealpha(0.45); + end; + }; + LoadActor("_grid")..{ + InitCommand=function(self) + self:customtexturerect(0, 0, (SCREEN_WIDTH + 1) / 4, SCREEN_HEIGHT / 4); + self:SetTextureFiltering(true); + end; + OnCommand=function(self) + self:zoomto(SCREEN_WIDTH + 1, SCREEN_HEIGHT); + self:diffuse(Color("Black")); + self:diffuseshift(); + self:effecttiming((1 / 8) * 4, 0, (7 / 8) * 4, 0); + self:effectclock('beatnooffset'); + self:effectcolor2(Color("Black")); + self:effectcolor1(Color.Alpha(Color("Black"),0.45)); + self:fadebottom(0.25); + self:fadetop(0.25); + self:croptop(48 / 480); + self:cropbottom(48 / 480); + self:diffusealpha(0.345); + end; + }; +}; + return t \ No newline at end of file diff --git a/Themes/default/BGAnimations/ScreenCredits overlay.lua b/Themes/default/BGAnimations/ScreenCredits overlay.lua index 56b525eb64..c2d58e15f5 100644 --- a/Themes/default/BGAnimations/ScreenCredits overlay.lua +++ b/Themes/default/BGAnimations/ScreenCredits overlay.lua @@ -118,8 +118,18 @@ local sections = { -- To add people or sections modify the above. -local lineOn = cmd(zoom,0.875;strokecolor,color("#444444");shadowcolor,color("#444444");shadowlength,3) -local sectionOn = cmd(diffuse,color("#88DDFF");strokecolor,color("#446688");shadowcolor,color("#446688");shadowlength,3) +local lineOn = function(self) + self:zoom(0.875); + self:strokecolor(color("#444444")); + self:shadowcolor(color("#444444")); + self:shadowlength(3); +end; +local sectionOn = function(self) + self:diffuse(color("#88DDFF")); + self:strokecolor(color("#446688")); + self:shadowcolor(color("#446688")); + self:shadowlength(3); +end; local item_padding_start = 4; local creditScroller = Def.ActorScroller { @@ -128,7 +138,9 @@ local creditScroller = Def.ActorScroller { TransformFunction = function( self, offset, itemIndex, numItems) self:y(30*offset) end; - OnCommand = cmd(scrollwithpadding,item_padding_start,15); + OnCommand = function(self) + self:scrollwithpadding(item_padding_start,15); + end; } local function AddLine( text, command ) @@ -157,9 +169,14 @@ end; return Def.ActorFrame{ creditScroller..{ - InitCommand=cmd(CenterX;y,SCREEN_BOTTOM-64), + InitCommand=function(self) + self:CenterX(); + self:y(SCREEN_BOTTOM - 64); + end; }, LoadActor(THEME:GetPathB("ScreenWithMenuElements","background/_bg top"))..{ - InitCommand=cmd(Center), + InitCommand=function(self) + self:Center(); + end; }, }; diff --git a/Themes/default/BGAnimations/ScreenDemonstration out.lua b/Themes/default/BGAnimations/ScreenDemonstration out.lua index 0ddcb832c7..44820ab81d 100644 --- a/Themes/default/BGAnimations/ScreenDemonstration out.lua +++ b/Themes/default/BGAnimations/ScreenDemonstration out.lua @@ -1,6 +1,15 @@ return Def.ActorFrame{ Def.Quad{ - InitCommand=cmd(FullScreen;diffuse,color("0,0,0,1");cropbottom,1;fadebottom,1); - OnCommand=cmd(decelerate,0.5;cropbottom,0;fadebottom,0); + InitCommand=function(self) + self:FullScreen(); + self:diffuse(color("0,0,0,1")); + self:cropbottom(1); + self:fadebottom(1); + end; + OnCommand=function(self) + self:decelerate(0.5); + self:cropbottom(0); + self:fadebottom(0); + end; }; }; \ No newline at end of file diff --git a/Themes/default/BGAnimations/ScreenDemonstration overlay/default.lua b/Themes/default/BGAnimations/ScreenDemonstration overlay/default.lua index e060d59ca9..77addcaaf1 100644 --- a/Themes/default/BGAnimations/ScreenDemonstration overlay/default.lua +++ b/Themes/default/BGAnimations/ScreenDemonstration overlay/default.lua @@ -1,46 +1,83 @@ -local t = Def.ActorFrame{ - Def.Quad{ - Name="TopFrame"; - InitCommand=cmd(CenterX;y,SCREEN_TOP;valign,0;zoomto,SCREEN_WIDTH,SCREEN_HEIGHT*0.15;diffuse,color("0,0,0,1");fadebottom,0.5); - }; - - Def.Quad{ - Name="BotFrame"; - InitCommand=cmd(CenterX;y,SCREEN_BOTTOM;valign,1;zoomto,SCREEN_WIDTH,SCREEN_HEIGHT*0.15;diffuse,color("0,0,0,1");fadetop,0.5); - }; - - Def.ActorFrame{ - Name="MiddleSection"; - InitCommand=cmd(CenterX;y,SCREEN_CENTER_Y*1.35); - Def.Quad{ - Name="Frame"; - InitCommand=cmd(zoomto,SCREEN_WIDTH,0;diffuse,color("0.1,0.1,0.1,0.75");fadebottom,0.25;fadetop,0.25;); - OnCommand=cmd(smooth,0.75;zoomtoheight,64;); - }; - LoadFont("Common normal")..{ - Text=Screen.String("Demonstration"); - InitCommand=cmd(diffusealpha,0;strokecolor,color("0,0,0,0.5")); - OnCommand=cmd(smooth,0.75;diffusealpha,1;diffuseshift;effectcolor1,HSV(38,0.45,0.95)); - }; - }; - - LoadFont("Common normal")..{ - Name="SongTitle"; - InitCommand=cmd(x,SCREEN_CENTER_X;y,SCREEN_TOP+16;zoom,0.5;shadowlength,1;valign,0); - BeginCommand=function(self) - local song = GAMESTATE:GetCurrentSong(); - local text = ""; - if song then - local artist = song:GetDisplayArtist() - local title = song:GetDisplayFullTitle() - local group = song:GetGroupName() - text = string.format(Screen.String("%s - %s [from %s]"),artist,title,group) - end; - self:settext(text); - end; --- OnCommand=cmd(queuecommand,"Scroll"); --- ScrollCommand=cmd(linear,10;x,-SCREEN_WIDTH*2;sleep,1;x,SCREEN_WIDTH*2;queuecommand,"Scroll"); - }; -}; - +local t = Def.ActorFrame{ + Def.Quad{ + Name="TopFrame"; + InitCommand=function(self) + self:CenterX(); + self:y(SCREEN_TOP); + self:valign(0); + self:zoomto(SCREEN_WIDTH, SCREEN_HEIGHT * 0.15); + self:diffuse(color("0,0,0,1")); + self:fadebottom(0.5); + end; + }; + + Def.Quad{ + Name="BotFrame"; + InitCommand=function(self) + self:CenterX(); + self:y(SCREEN_BOTTOM); + self:valign(1); + self:zoomto(SCREEN_WIDTH, SCREEN_HEIGHT * 0.15); + self:diffuse(color("0,0,0,1")); + self:fadetop(0.5); + end; + }; + + Def.ActorFrame{ + Name="MiddleSection"; + InitCommand=function(self) + self:CenterX(); + self:y(SCREEN_CENTER_Y * 1.35); + end; + Def.Quad{ + Name="Frame"; + InitCommand=function(self) + self:zoomto(SCREEN_WIDTH, 0); + self:diffuse(color("0.1,0.1,0.1,0.75")); + self:fadebottom(0.25); + self:fadetop(0.25); + end; + OnCommand=function(self) + self:smooth(0.75); + self:zoomtoheight(64); + end; + }; + LoadFont("Common normal")..{ + Text=Screen.String("Demonstration"); + InitCommand=function(self) + self:diffusealpha(0); + self:strokecolor(color("0,0,0,0.5")); + end; + OnCommand=function(self) + self:smooth(0.75); + self:diffusealpha(1); + self:diffuseshift(); + self:effectcolor1(HSV(38,0.45,0.95)); + end; + }; + }; + + LoadFont("Common normal")..{ + Name="SongTitle"; + InitCommand=function(self) + self:x(SCREEN_CENTER_X); + self:y(SCREEN_TOP+16); + self:zoom(0.5); + self:shadowlength(1); + self:valign(0); + end; + BeginCommand=function(self) + local song = GAMESTATE:GetCurrentSong(); + local text = ""; + if song then + local artist = song:GetDisplayArtist() + local title = song:GetDisplayFullTitle() + local group = song:GetGroupName() + text = string.format(Screen.String("%s - %s [from %s]"),artist,title,group) + end; + self:settext(text); + end; + }; +}; + return t; \ No newline at end of file diff --git a/Themes/default/BGAnimations/ScreenEdit background.lua b/Themes/default/BGAnimations/ScreenEdit background.lua index 150a3537d8..6e147850f7 100644 --- a/Themes/default/BGAnimations/ScreenEdit background.lua +++ b/Themes/default/BGAnimations/ScreenEdit background.lua @@ -1,27 +1,44 @@ -local t = Def.ActorFrame { - InitCommand=cmd(fov,90); -}; -t[#t+1] = Def.ActorFrame { - InitCommand=cmd(Center); - LoadActor( THEME:GetPathB("ScreenWithMenuElements","background/_bg top") ) .. { - InitCommand=cmd(scaletoclipped,SCREEN_WIDTH,SCREEN_HEIGHT); - }; - Def.Quad{ - InitCommand=cmd(scaletoclipped,SCREEN_WIDTH,SCREEN_HEIGHT;diffuse,color("0.2,0.2,0.2,0")); - OnCommand=function(self) - local topScreen = SCREENMAN:GetTopScreen() - if topScreen then - local screenName = topScreen:GetName() - if screenName == "ScreenEdit" or screenName == "ScreenPractice" then - self:diffusealpha(0.95) - else - self:diffusealpha(0.65) - end; - end; - end; - EditorShowMessageCommand=cmd(stoptweening;linear,0.5;diffusealpha,0.95); - EditorHideMessageCommand=cmd(stoptweening;linear,0.5;diffusealpha,0.65); - }; -}; - -return t; +local t = Def.ActorFrame { + InitCommand=function(self) + self:fov(90); + end; +}; +t[#t+1] = Def.ActorFrame { + InitCommand=function(self) + self:Center(); + end; + LoadActor( THEME:GetPathB("ScreenWithMenuElements","background/_bg top") ) .. { + InitCommand=function(self) + self:scaletoclipped(SCREEN_WIDTH, SCREEN_HEIGHT); + end; + }; + Def.Quad{ + InitCommand=function(self) + self:scaletoclipped(SCREEN_WIDTH, SCREEN_HEIGHT); + self:diffuse(color("0.2,0.2,0.2,0")); + end; + OnCommand=function(self) + local topScreen = SCREENMAN:GetTopScreen() + if topScreen then + local screenName = topScreen:GetName() + if screenName == "ScreenEdit" or screenName == "ScreenPractice" then + self:diffusealpha(0.95) + else + self:diffusealpha(0.65) + end; + end; + end; + EditorShowMessageCommand=function(self) + self:stoptweening(); + self:linear(0.5); + self:diffusealpha(0.95); + end; + EditorHideMessageCommand=function(self) + self:stoptweening(); + self:linear(0.5); + self:diffusealpha(0.95); + end; + }; +}; + +return t; diff --git a/Themes/default/BGAnimations/ScreenEvaluation background/default.lua b/Themes/default/BGAnimations/ScreenEvaluation background/default.lua index e3170839cf..f4efc00a0d 100644 --- a/Themes/default/BGAnimations/ScreenEvaluation background/default.lua +++ b/Themes/default/BGAnimations/ScreenEvaluation background/default.lua @@ -1,38 +1,42 @@ -local t = Def.ActorFrame {}; - -t[#t+1] = Def.ActorFrame { - InitCommand=cmd(Center); - Def.Sprite { - OnCommand=function(self) - if GAMESTATE:GetCurrentSong() then - local song = GAMESTATE:GetCurrentSong(); - if song:HasBackground() then - self:LoadBackground(song:GetBackgroundPath()); - end; - self:scale_or_crop_background() - self:fadebottom(0.25) - self:fadetop(0.25) - self:croptop(1/10) - self:cropbottom(1/10) - else - self:visible(false); - end - end; - }; - Def.Quad { - InitCommand=cmd(scaletoclipped,SCREEN_WIDTH+1,SCREEN_HEIGHT); - OnCommand=cmd(diffuse,color("#FFCB05");diffusebottomedge,color("#F0BA00");diffusealpha,0.45); - }; ---[[ - LoadActor(THEME:GetPathB("ScreenWithMenuElements","background/_grid")).. { - InitCommand=cmd(customtexturerect,0,0,(SCREEN_WIDTH+1)/4,SCREEN_HEIGHT/4;SetTextureFiltering,true); - OnCommand=cmd(zoomto,SCREEN_WIDTH+1,SCREEN_HEIGHT;diffuse,Color("Black");diffuseshift;effecttiming,(1/8)*4,0,(7/8)*4,0;effectclock,'beatnooffset'; - effectcolor2,Color("Black");effectcolor1,Colors.Alpha(Color("Black"),0.45);fadebottom,0.25;fadetop,0.25;croptop,48/480;cropbottom,48/480;diffusealpha,0.345); - }; --]] - LoadActor(THEME:GetPathB("ScreenWithMenuElements","background/_bg top")) .. { - InitCommand=cmd(scaletoclipped,SCREEN_WIDTH+1,SCREEN_HEIGHT); - }; - -}; - +local t = Def.ActorFrame {}; + +t[#t+1] = Def.ActorFrame { + InitCommand=function(self) + self:Center(); + end; + Def.Sprite { + OnCommand=function(self) + if GAMESTATE:GetCurrentSong() then + local song = GAMESTATE:GetCurrentSong(); + if song:HasBackground() then + self:LoadBackground(song:GetBackgroundPath()); + end; + self:scale_or_crop_background() + self:fadebottom(0.25) + self:fadetop(0.25) + self:croptop(1/10) + self:cropbottom(1/10) + else + self:visible(false); + end + end; + }; + Def.Quad { + InitCommand=function(self) + self:scaletoclipped(SCREEN_WIDTH + 1, SCREEN_HEIGHT); + end; + OnCommand=function(self) + self:diffuse(color("#FFCB05")); + self:diffusebottomedge(color("#F0BA00")); + self:diffusealpha(0.45); + end; + }; + LoadActor(THEME:GetPathB("ScreenWithMenuElements","background/_bg top")) .. { + InitCommand=function(self) + self:scaletoclipped(SCREEN_WIDTH + 1, SCREEN_HEIGHT); + end; + }; + +}; + return t \ No newline at end of file diff --git a/Themes/default/BGAnimations/ScreenEvaluation decorations/default.lua b/Themes/default/BGAnimations/ScreenEvaluation decorations/default.lua index 8695387dfe..4bbea80b12 100644 --- a/Themes/default/BGAnimations/ScreenEvaluation decorations/default.lua +++ b/Themes/default/BGAnimations/ScreenEvaluation decorations/default.lua @@ -1,256 +1,316 @@ -local function GraphDisplay( pn ) - local t = Def.ActorFrame { - Def.GraphDisplay { - InitCommand=cmd(Load,"GraphDisplay";); - BeginCommand=function(self) - local ss = SCREENMAN:GetTopScreen():GetStageStats(); - self:Set( ss, ss:GetPlayerStageStats(pn) ); - self:player( pn ); - end - }; - }; - return t; -end - -local function ComboGraph( pn ) - local t = Def.ActorFrame { - Def.ComboGraph { - InitCommand=cmd(Load,"ComboGraph";); - BeginCommand=function(self) - local ss = SCREENMAN:GetTopScreen():GetStageStats(); - self:Set( ss, ss:GetPlayerStageStats(pn) ); - self:player( pn ); - end - }; - }; - return t; -end - -local function PercentScore( pn ) - local t = LoadFont("Common normal")..{ - InitCommand=cmd(zoom,0.625;shadowlength,1;player,pn); - BeginCommand=cmd(playcommand,"Set"); - SetCommand=function(self) - -- todo: color by difficulty - local SongOrCourse, StepsOrTrail; - if GAMESTATE:IsCourseMode() then - SongOrCourse = GAMESTATE:GetCurrentCourse() - StepsOrTrail = GAMESTATE:GetCurrentTrail(pn) - else - SongOrCourse = GAMESTATE:GetCurrentSong() - StepsOrTrail = GAMESTATE:GetCurrentSteps(pn) - end; - if SongOrCourse and StepsOrTrail then - local st = StepsOrTrail:GetStepsType(); - local diff = StepsOrTrail:GetDifficulty(); - local courseType = GAMESTATE:IsCourseMode() and SongOrCourse:GetCourseType() or nil; - local cd = GetCustomDifficulty(st, diff, courseType); - self:diffuse(CustomDifficultyToColor(cd)); - self:shadowcolor(CustomDifficultyToDarkColor(cd)); - end - - local pss = STATSMAN:GetPlayedStageStats(1):GetPlayerStageStats(pn); - if pss then - local pct = pss:GetPercentDancePoints(); - if pct == 1 then - self:settext("100%"); - else - self:settext(FormatPercentScore(pct)); - end; - end; - end; - }; - return t; -end - -local t = LoadFallbackB(); - -t[#t+1] = StandardDecorationFromFileOptional("StageDisplay","StageDisplay"); - -if ShowStandardDecoration("GraphDisplay") then - for pn in ivalues(GAMESTATE:GetHumanPlayers()) do - t[#t+1] = StandardDecorationFromTable( "GraphDisplay" .. ToEnumShortString(pn), GraphDisplay(pn) ); - end -end - -if ShowStandardDecoration("ComboGraph") then - for pn in ivalues(GAMESTATE:GetHumanPlayers()) do - t[#t+1] = StandardDecorationFromTable( "ComboGraph" .. ToEnumShortString(pn), ComboGraph(pn) ); - end -end - -if ShowStandardDecoration("StepsDisplay") then - for pn in ivalues(PlayerNumber) do - local t2 = Def.StepsDisplay { - InitCommand=cmd(Load,"StepsDisplayEvaluation",pn;SetFromGameState,pn;); - UpdateNetEvalStatsMessageCommand=function(self,param) - if GAMESTATE:IsPlayerEnabled(pn) then - self:SetFromSteps(param.Steps) - end; - end; - }; - t[#t+1] = StandardDecorationFromTable( "StepsDisplay" .. ToEnumShortString(pn), t2 ); - t[#t+1] = StandardDecorationFromTable( "PercentScore" .. ToEnumShortString(pn), PercentScore(pn) ); - end -end - -for pn in ivalues(PlayerNumber) do - local MetricsName = "MachineRecord" .. PlayerNumberToString(pn); - t[#t+1] = LoadActor( THEME:GetPathG(Var "LoadingScreen", "MachineRecord"), pn ) .. { - InitCommand=function(self) - self:player(pn); - self:name(MetricsName); - ActorUtil.LoadAllCommandsAndSetXY(self,Var "LoadingScreen"); - end; - }; -end - -for pn in ivalues(PlayerNumber) do - local MetricsName = "PersonalRecord" .. PlayerNumberToString(pn); - t[#t+1] = LoadActor( THEME:GetPathG(Var "LoadingScreen", "PersonalRecord"), pn ) .. { - InitCommand=function(self) - self:player(pn); - self:name(MetricsName); - ActorUtil.LoadAllCommandsAndSetXY(self,Var "LoadingScreen"); - end; - }; -end - -for pn in ivalues(PlayerNumber) do - local MetricsName = "StageAward" .. PlayerNumberToString(pn); - t[#t+1] = LoadActor( THEME:GetPathG(Var "LoadingScreen", "StageAward"), pn ) .. { - InitCommand=function(self) - self:player(pn); - self:name(MetricsName); - ActorUtil.LoadAllCommandsAndSetXY(self,Var "LoadingScreen"); - end; - BeginCommand=cmd(playcommand,"Set"); - SetCommand=function(self) - local tStats = THEME:GetMetric(Var "LoadingScreen", "Summary") and STATSMAN:GetAccumPlayedStageStats() or STATSMAN:GetCurStageStats(); - tStats = tStats:GetPlayerStageStats(pn); - if tStats:GetStageAward() and not tStats:GetFailed() then - self:settext( THEME:GetString( "StageAward", ToEnumShortString( tStats:GetStageAward() ) ) ); - else - self:settext( "" ); - end - end; - }; -end - -for pn in ivalues(PlayerNumber) do - local MetricsName = "PeakComboAward" .. PlayerNumberToString(pn); - t[#t+1] = LoadActor( THEME:GetPathG(Var "LoadingScreen", "PeakComboAward"), pn ) .. { - InitCommand=function(self) - self:player(pn); - self:name(MetricsName); - ActorUtil.LoadAllCommandsAndSetXY(self,Var "LoadingScreen"); - end; - BeginCommand=cmd(playcommand,"Set"); - SetCommand=function(self) - local tStats = THEME:GetMetric(Var "LoadingScreen", "Summary") and STATSMAN:GetAccumPlayedStageStats() or STATSMAN:GetCurStageStats(); - tStats = tStats:GetPlayerStageStats(pn); - if tStats:GetPeakComboAward() then - self:settext( THEME:GetString( "PeakComboAward", ToEnumShortString( tStats:GetPeakComboAward() ) ) ); - else - self:settext( "" ); - end - end; - }; -end - -t[#t+1] = StandardDecorationFromFileOptional("SongInformation","SongInformation") .. { - BeginCommand=function(self) - local SongOrCourse; - if GAMESTATE:GetCurrentSong() then - SongOrCourse = GAMESTATE:GetCurrentSong(); - elseif GAMESTATE:GetCurrentCourse() then - SongOrCourse = GAMESTATE:GetCurrentCourse(); - else - return - end - - if SongOrCourse:HasBanner() then - self:visible(false); - else - self:visible(true); - end - end; - SetCommand=function(self) - local c = self:GetChildren(); - local SongOrCourse; - if GAMESTATE:GetCurrentSong() then - SongOrCourse = GAMESTATE:GetCurrentSong(); - - c.TextTitle:settext( SongOrCourse:GetDisplayMainTitle() or nil ); - c.TextSubtitle:settext( SongOrCourse:GetDisplaySubTitle() or nil ); - c.TextArtist:settext( SongOrCourse:GetDisplayArtist() or nil ); - - if SongOrCourse:GetDisplaySubTitle() == "" then - c.TextTitle:visible(true); - c.TextTitle:y(-16.5/2); - c.TextSubtitle:visible(false); - c.TextSubtitle:y(0); - c.TextArtist:visible(true); - c.TextArtist:y(18/2); - else - c.TextTitle:visible(true); - c.TextTitle:y(-16.5); - c.TextSubtitle:visible(true); - c.TextSubtitle:y(0); - c.TextArtist:visible(true); - c.TextArtist:y(18); - end --- self:playcommand("Tick"); - elseif GAMESTATE:GetCurrentCourse() then - SongOrCourse = GAMESTATE:GetCurrentCourse(); - - c.TextTitle:settext( SongOrCourse:GetDisplayMainTitle() or nil ); - c.TextSubtitle:settext( SongOrCourse:GetDisplaySubTitle() or nil ); - c.TextArtist:settext( SongOrCourse:GetDisplayArtist() or nil ); - --- self:playcommand("Tick"); - else - SongOrCourse = nil; - - c.TextTitle:settext(""); - c.TextSubtitle:settext(""); - c.TextArtist:settext(""); - - self:playcommand("Hide") - end - end; --- OnCommand=cmd(playcommand,"Set"); - CurrentSongChangedMessageCommand=cmd(playcommand,"Set"); - CurrentCourseChangedMessageCommand=cmd(playcommand,"Set"); - DisplayLanguageChangedMessageCommand=cmd(playcommand,"Set"); -}; -t[#t+1] = StandardDecorationFromFileOptional("LifeDifficulty","LifeDifficulty"); -t[#t+1] = StandardDecorationFromFileOptional("TimingDifficulty","TimingDifficulty"); -t[#t+1] = StandardDecorationFromFileOptional("GameType","GameType"); -t[#t+1] = Def.ActorFrame { - Condition=GAMESTATE:HasEarnedExtraStage() and GAMESTATE:IsExtraStage() and not GAMESTATE:IsExtraStage2(); - InitCommand=cmd(draworder,105); - LoadActor( THEME:GetPathS("ScreenEvaluation","try Extra1" ) ) .. { - Condition=THEME:GetMetric( Var "LoadingScreen","Summary" ) == false; - OnCommand=cmd(play); - }; - LoadActor( THEME:GetPathG("ScreenStageInformation","Stage extra1" ) ) .. { - Condition=THEME:GetMetric( Var "LoadingScreen","Summary" ) == false; - InitCommand=cmd(Center); - OnCommand=cmd(diffusealpha,0;zoom,0.85;bounceend,1;zoom,1;diffusealpha,1;sleep,0;glow,Color("White");decelerate,1;glow,Color("Invisible");smooth,0.35;zoom,0.25;y,SCREEN_BOTTOM-72); - }; -}; -t[#t+1] = Def.ActorFrame { - Condition=GAMESTATE:HasEarnedExtraStage() and not GAMESTATE:IsExtraStage() and GAMESTATE:IsExtraStage2(); - InitCommand=cmd(draworder,105); - LoadActor( THEME:GetPathS("ScreenEvaluation","try Extra2" ) ) .. { - Condition=THEME:GetMetric( Var "LoadingScreen","Summary" ) == false; - OnCommand=cmd(play); - }; - LoadActor( THEME:GetPathG("ScreenStageInformation","Stage extra2" ) ) .. { - Condition=THEME:GetMetric( Var "LoadingScreen","Summary" ) == false; - InitCommand=cmd(Center); - OnCommand=cmd(diffusealpha,0;zoom,0.85;bounceend,1;zoom,1;diffusealpha,1;sleep,0;glow,Color("White");decelerate,1;glow,Color("Invisible");smooth,0.35;zoom,0.25;y,SCREEN_BOTTOM-72); - }; -}; +local function GraphDisplay( pn ) + local t = Def.ActorFrame { + Def.GraphDisplay { + InitCommand=function(self) + self:Load("GraphDisplay"); + end; + BeginCommand=function(self) + local ss = SCREENMAN:GetTopScreen():GetStageStats(); + self:Set( ss, ss:GetPlayerStageStats(pn) ); + self:player( pn ); + end + }; + }; + return t; +end + +local function ComboGraph( pn ) + local t = Def.ActorFrame { + Def.ComboGraph { + InitCommand=function(self) + self:Load("ComboGraph"); + end; + BeginCommand=function(self) + local ss = SCREENMAN:GetTopScreen():GetStageStats(); + self:Set( ss, ss:GetPlayerStageStats(pn) ); + self:player( pn ); + end + }; + }; + return t; +end + +local function PercentScore( pn ) + local t = LoadFont("Common normal")..{ + InitCommand=function(self) + self:zoom(0.625); + self:shadowlength(1); + self:player(pn); + end; + BeginCommand=function(self) + self:playcommand("Set"); + end; + SetCommand=function(self) + -- todo: color by difficulty + local SongOrCourse, StepsOrTrail; + if GAMESTATE:IsCourseMode() then + SongOrCourse = GAMESTATE:GetCurrentCourse() + StepsOrTrail = GAMESTATE:GetCurrentTrail(pn) + else + SongOrCourse = GAMESTATE:GetCurrentSong() + StepsOrTrail = GAMESTATE:GetCurrentSteps(pn) + end; + if SongOrCourse and StepsOrTrail then + local st = StepsOrTrail:GetStepsType(); + local diff = StepsOrTrail:GetDifficulty(); + local courseType = GAMESTATE:IsCourseMode() and SongOrCourse:GetCourseType() or nil; + local cd = GetCustomDifficulty(st, diff, courseType); + self:diffuse(CustomDifficultyToColor(cd)); + self:shadowcolor(CustomDifficultyToDarkColor(cd)); + end + + local pss = STATSMAN:GetPlayedStageStats(1):GetPlayerStageStats(pn); + if pss then + local pct = pss:GetPercentDancePoints(); + if pct == 1 then + self:settext("100%"); + else + self:settext(FormatPercentScore(pct)); + end; + end; + end; + }; + return t; +end + +local t = LoadFallbackB(); + +t[#t+1] = StandardDecorationFromFileOptional("StageDisplay","StageDisplay"); + +if ShowStandardDecoration("GraphDisplay") then + for pn in ivalues(GAMESTATE:GetHumanPlayers()) do + t[#t+1] = StandardDecorationFromTable( "GraphDisplay" .. ToEnumShortString(pn), GraphDisplay(pn) ); + end +end + +if ShowStandardDecoration("ComboGraph") then + for pn in ivalues(GAMESTATE:GetHumanPlayers()) do + t[#t+1] = StandardDecorationFromTable( "ComboGraph" .. ToEnumShortString(pn), ComboGraph(pn) ); + end +end + +if ShowStandardDecoration("StepsDisplay") then + for pn in ivalues(PlayerNumber) do + local t2 = Def.StepsDisplay { + InitCommand=function(self) + self:Load("StepsDisplayEvaluation",pn); + self:SetFromGameState(pn); + end; + UpdateNetEvalStatsMessageCommand=function(self,param) + if GAMESTATE:IsPlayerEnabled(pn) then + self:SetFromSteps(param.Steps) + end; + end; + }; + t[#t+1] = StandardDecorationFromTable( "StepsDisplay" .. ToEnumShortString(pn), t2 ); + t[#t+1] = StandardDecorationFromTable( "PercentScore" .. ToEnumShortString(pn), PercentScore(pn) ); + end +end + +for pn in ivalues(PlayerNumber) do + local MetricsName = "MachineRecord" .. PlayerNumberToString(pn); + t[#t+1] = LoadActor( THEME:GetPathG(Var "LoadingScreen", "MachineRecord"), pn ) .. { + InitCommand=function(self) + self:player(pn); + self:name(MetricsName); + ActorUtil.LoadAllCommandsAndSetXY(self,Var "LoadingScreen"); + end; + }; +end + +for pn in ivalues(PlayerNumber) do + local MetricsName = "PersonalRecord" .. PlayerNumberToString(pn); + t[#t+1] = LoadActor( THEME:GetPathG(Var "LoadingScreen", "PersonalRecord"), pn ) .. { + InitCommand=function(self) + self:player(pn); + self:name(MetricsName); + ActorUtil.LoadAllCommandsAndSetXY(self,Var "LoadingScreen"); + end; + }; +end + +for pn in ivalues(PlayerNumber) do + local MetricsName = "StageAward" .. PlayerNumberToString(pn); + t[#t+1] = LoadActor( THEME:GetPathG(Var "LoadingScreen", "StageAward"), pn ) .. { + InitCommand=function(self) + self:player(pn); + self:name(MetricsName); + ActorUtil.LoadAllCommandsAndSetXY(self,Var "LoadingScreen"); + end; + BeginCommand=function(self) + self:playcommand("Set"); + end; + SetCommand=function(self) + local tStats = THEME:GetMetric(Var "LoadingScreen", "Summary") and STATSMAN:GetAccumPlayedStageStats() or STATSMAN:GetCurStageStats(); + tStats = tStats:GetPlayerStageStats(pn); + if tStats:GetStageAward() and not tStats:GetFailed() then + self:settext( THEME:GetString( "StageAward", ToEnumShortString( tStats:GetStageAward() ) ) ); + else + self:settext( "" ); + end + end; + }; +end + +for pn in ivalues(PlayerNumber) do + local MetricsName = "PeakComboAward" .. PlayerNumberToString(pn); + t[#t+1] = LoadActor( THEME:GetPathG(Var "LoadingScreen", "PeakComboAward"), pn ) .. { + InitCommand=function(self) + self:player(pn); + self:name(MetricsName); + ActorUtil.LoadAllCommandsAndSetXY(self,Var "LoadingScreen"); + end; + BeginCommand=function(self) + self:playcommand("Set"); + end; + SetCommand=function(self) + local tStats = THEME:GetMetric(Var "LoadingScreen", "Summary") and STATSMAN:GetAccumPlayedStageStats() or STATSMAN:GetCurStageStats(); + tStats = tStats:GetPlayerStageStats(pn); + if tStats:GetPeakComboAward() then + self:settext( THEME:GetString( "PeakComboAward", ToEnumShortString( tStats:GetPeakComboAward() ) ) ); + else + self:settext( "" ); + end + end; + }; +end + +t[#t+1] = StandardDecorationFromFileOptional("SongInformation","SongInformation") .. { + BeginCommand=function(self) + local SongOrCourse; + if GAMESTATE:GetCurrentSong() then + SongOrCourse = GAMESTATE:GetCurrentSong(); + elseif GAMESTATE:GetCurrentCourse() then + SongOrCourse = GAMESTATE:GetCurrentCourse(); + else + return + end + + if SongOrCourse:HasBanner() then + self:visible(false); + else + self:visible(true); + end + end; + SetCommand=function(self) + local c = self:GetChildren(); + local SongOrCourse; + if GAMESTATE:GetCurrentSong() then + SongOrCourse = GAMESTATE:GetCurrentSong(); + + c.TextTitle:settext( SongOrCourse:GetDisplayMainTitle() or nil ); + c.TextSubtitle:settext( SongOrCourse:GetDisplaySubTitle() or nil ); + c.TextArtist:settext( SongOrCourse:GetDisplayArtist() or nil ); + + if SongOrCourse:GetDisplaySubTitle() == "" then + c.TextTitle:visible(true); + c.TextTitle:y(-16.5/2); + c.TextSubtitle:visible(false); + c.TextSubtitle:y(0); + c.TextArtist:visible(true); + c.TextArtist:y(18/2); + else + c.TextTitle:visible(true); + c.TextTitle:y(-16.5); + c.TextSubtitle:visible(true); + c.TextSubtitle:y(0); + c.TextArtist:visible(true); + c.TextArtist:y(18); + end +-- self:playcommand("Tick"); + elseif GAMESTATE:GetCurrentCourse() then + SongOrCourse = GAMESTATE:GetCurrentCourse(); + + c.TextTitle:settext( SongOrCourse:GetDisplayMainTitle() or nil ); + c.TextSubtitle:settext( SongOrCourse:GetDisplaySubTitle() or nil ); + c.TextArtist:settext( SongOrCourse:GetDisplayArtist() or nil ); + +-- self:playcommand("Tick"); + else + SongOrCourse = nil; + + c.TextTitle:settext(""); + c.TextSubtitle:settext(""); + c.TextArtist:settext(""); + + self:playcommand("Hide") + end + end; + CurrentSongChangedMessageCommand=function(self) + self:playcommand("Set"); + end; + CurrentCourseChangedMessageCommand=function(self) + self:playcommand("Set"); + end; + DisplayLanguageChangedMessageCommand=function(self) + self:playcommand("Set"); + end; +}; +t[#t+1] = StandardDecorationFromFileOptional("LifeDifficulty","LifeDifficulty"); +t[#t+1] = StandardDecorationFromFileOptional("TimingDifficulty","TimingDifficulty"); +t[#t+1] = StandardDecorationFromFileOptional("GameType","GameType"); +t[#t+1] = Def.ActorFrame { + Condition=GAMESTATE:HasEarnedExtraStage() and GAMESTATE:IsExtraStage() and not GAMESTATE:IsExtraStage2(); + InitCommand=function(self) + self:draworder(105); + end; + LoadActor( THEME:GetPathS("ScreenEvaluation","try Extra1" ) ) .. { + Condition=THEME:GetMetric( Var "LoadingScreen","Summary" ) == false; + OnCommand=function(self) + self:play(); + end; + }; + LoadActor( THEME:GetPathG("ScreenStageInformation","Stage extra1" ) ) .. { + Condition=THEME:GetMetric( Var "LoadingScreen","Summary" ) == false; + InitCommand=function(self) + self:Center(); + end; + OnCommand=function(self) + self:diffusealpha(0); + self:zoom(0.85); + self:bounceend(1); + self:zoom(1); + self:diffusealpha(1); + self:sleep(0); + self:glow(Color("White")); + self:decelerate(1); + self:glow(Color("Invisible")); + self:smooth(0.35); + self:zoom(0.25); + self:y(SCREEN_BOTTOM-72); + end; + }; +}; +t[#t+1] = Def.ActorFrame { + Condition=GAMESTATE:HasEarnedExtraStage() and not GAMESTATE:IsExtraStage() and GAMESTATE:IsExtraStage2(); + InitCommand=function(self) + self:draworder(105); + end; + LoadActor( THEME:GetPathS("ScreenEvaluation","try Extra2" ) ) .. { + Condition=THEME:GetMetric( Var "LoadingScreen","Summary" ) == false; + OnCommand=function(self) + self:play(); + end; + }; + LoadActor( THEME:GetPathG("ScreenStageInformation","Stage extra2" ) ) .. { + Condition=THEME:GetMetric( Var "LoadingScreen","Summary" ) == false; + InitCommand=function(self) + self:Center(); + end; + OnCommand=function(self) + self:diffusealpha(0); + self:zoom(0.85); + self:bounceend(1); + self:zoom(1); + self:diffusealpha(1); + self:sleep(0); + self:glow(Color("White")); + self:decelerate(1); + self:glow(Color("Invisible")); + self:smooth(0.35); + self:zoom(0.25); + self:y(SCREEN_BOTTOM-72); + end; + }; +}; return t \ No newline at end of file diff --git a/Themes/default/BGAnimations/ScreenEvaluation overlay/default.lua b/Themes/default/BGAnimations/ScreenEvaluation overlay/default.lua index a4a00ca7e6..130bd29bb2 100644 --- a/Themes/default/BGAnimations/ScreenEvaluation overlay/default.lua +++ b/Themes/default/BGAnimations/ScreenEvaluation overlay/default.lua @@ -1,68 +1,158 @@ -local vStats = STATSMAN:GetCurStageStats(); - -local function CreateStats( pnPlayer ) - -- Actor Templates - local aLabel = LoadFont("Common Normal") .. { InitCommand=cmd(zoom,0.5;shadowlength,1;horizalign,left); }; - local aText = LoadFont("Common Normal") .. { InitCommand=cmd(zoom,0.5;shadowlength,1;horizalign,left); }; - -- DA STATS, JIM!! - local pnStageStats = vStats:GetPlayerStageStats( pnPlayer ); - -- Organized Stats. - local tStats = { - W1 = pnStageStats:GetTapNoteScores('TapNoteScore_W1'); - W2 = pnStageStats:GetTapNoteScores('TapNoteScore_W2'); - W3 = pnStageStats:GetTapNoteScores('TapNoteScore_W3'); - W4 = pnStageStats:GetTapNoteScores('TapNoteScore_W4'); - W5 = pnStageStats:GetTapNoteScores('TapNoteScore_W5'); - Miss = pnStageStats:GetTapNoteScores('TapNoteScore_Miss'); - HitMine = pnStageStats:GetTapNoteScores('TapNoteScore_HitMine'); - AvoidMine = pnStageStats:GetTapNoteScores('TapNoteScore_AvoidMine'); - Held = pnStageStats:GetHoldNoteScores('HoldNoteScore_Held'); - LetGo = pnStageStats:GetHoldNoteScores('HoldNoteScore_LetGo'); - }; - -- Organized Equation Values - local tValues = { - -- marvcount*7 + perfcount*6 + greatcount*5 + goodcount*4 + boocount*2 + okcount*7 - ITG = ( tStats["W1"]*7 + tStats["W2"]*6 + tStats["W3"]*5 + tStats["W4"]*4 + tStats["W5"]*2 + tStats["Held"]*7 ), - -- (marvcount + perfcount + greatcount + goodcount + boocount + misscount + okcount + ngcount)*7 - ITG_MAX = ( tStats["W1"] + tStats["W2"] + tStats["W3"] + tStats["W4"] + tStats["W5"] + tStats["Miss"] + tStats["Held"] + tStats["LetGo"] )*7, - -- marvcount*3 + perfcount*2 + greatcount*1 - boocount*4 - misscount*8 + okcount*6 - MIGS = ( tStats["W1"]*3 + tStats["W2"]*2 + tStats["W3"] - tStats["W5"]*4 - tStats["Miss"]*8 + tStats["Held"]*6 ), - -- (marvcount + perfcount + greatcount + goodcount + boocount + misscount)*3 + (okcount + ngcount)*6 - MIGS_MAX = ( (tStats["W1"] + tStats["W2"] + tStats["W3"] + tStats["W4"] + tStats["W5"] + tStats["Miss"])*3 + (tStats["Held"] + tStats["LetGo"])*6 ), - }; - - local t = Def.ActorFrame {}; - t[#t+1] = Def.ActorFrame { - InitCommand=cmd(y,-34); - LoadActor(THEME:GetPathG("ScreenTitleMenu","PreferenceFrame")) .. { - InitCommand=cmd(zoom,0.875;diffuse,PlayerColor( pnPlayer )); - }; - aLabel .. { Text=THEME:GetString("ScreenEvaluation","ITG DP:"); InitCommand=cmd(x,-64) }; - aText .. { Text=string.format("%04i",tValues["ITG"]); InitCommand=cmd(x,-8;y,5;vertalign,bottom;zoom,0.6); }; - aText .. { Text="/"; InitCommand=cmd(x,28;y,5;vertalign,bottom;zoom,0.5;diffusealpha,0.5); }; - aText .. { Text=string.format("%04i",tValues["ITG_MAX"]); InitCommand=cmd(x,32;y,5;vertalign,bottom;zoom,0.5); }; - }; - t[#t+1] = Def.ActorFrame { - InitCommand=cmd(y,-6); - LoadActor(THEME:GetPathG("ScreenTitleMenu","PreferenceFrame")) .. { - InitCommand=cmd(zoom,0.875;diffuse,PlayerColor( pnPlayer )); - }; - aLabel .. { Text=THEME:GetString("ScreenEvaluation","MIGS DP:"); InitCommand=cmd(x,-64) }; - aText .. { Text=string.format("%04i",tValues["MIGS"]); InitCommand=cmd(x,-8;y,5;vertalign,bottom;zoom,0.6); }; - aText .. { Text="/"; InitCommand=cmd(x,28;y,5;vertalign,bottom;zoom,0.5;diffusealpha,0.5); }; - aText .. { Text=string.format("%04i",tValues["MIGS_MAX"]); InitCommand=cmd(x,32;y,5;vertalign,bottom;zoom,0.5); }; - }; - return t -end; - -local t = Def.ActorFrame {}; -GAMESTATE:IsPlayerEnabled(PLAYER_1) -t[#t+1] = Def.ActorFrame { - InitCommand=cmd(hide_if,not GAMESTATE:IsPlayerEnabled(PLAYER_1);x,WideScale(math.floor(SCREEN_CENTER_X*0.3)-8,math.floor(SCREEN_CENTER_X*0.5)-8);y,SCREEN_CENTER_Y-34); - CreateStats( PLAYER_1 ); -}; -t[#t+1] = Def.ActorFrame { - InitCommand=cmd(hide_if,not GAMESTATE:IsPlayerEnabled(PLAYER_2);x,WideScale(math.floor(SCREEN_CENTER_X*1.7)+8,math.floor(SCREEN_CENTER_X*1.5)+8);y,SCREEN_CENTER_Y-34); - CreateStats( PLAYER_2 ); -}; +local vStats = STATSMAN:GetCurStageStats(); + +local function CreateStats( pnPlayer ) + -- Actor Templates + local aLabel = LoadFont("Common Normal") .. { + InitCommand=function(self) + self:zoom(0.5); + self:shadowlength(1); + self:horizalign(left); + end; + }; + local aText = LoadFont("Common Normal") .. { + InitCommand=function(self) + self:zoom(0.5); + self:shadowlength(1); + self:horizalign(left); + end; + }; + -- DA STATS, JIM!! + local pnStageStats = vStats:GetPlayerStageStats( pnPlayer ); + -- Organized Stats. + local tStats = { + W1 = pnStageStats:GetTapNoteScores('TapNoteScore_W1'); + W2 = pnStageStats:GetTapNoteScores('TapNoteScore_W2'); + W3 = pnStageStats:GetTapNoteScores('TapNoteScore_W3'); + W4 = pnStageStats:GetTapNoteScores('TapNoteScore_W4'); + W5 = pnStageStats:GetTapNoteScores('TapNoteScore_W5'); + Miss = pnStageStats:GetTapNoteScores('TapNoteScore_Miss'); + HitMine = pnStageStats:GetTapNoteScores('TapNoteScore_HitMine'); + AvoidMine = pnStageStats:GetTapNoteScores('TapNoteScore_AvoidMine'); + Held = pnStageStats:GetHoldNoteScores('HoldNoteScore_Held'); + LetGo = pnStageStats:GetHoldNoteScores('HoldNoteScore_LetGo'); + }; + -- Organized Equation Values + local tValues = { + -- marvcount*7 + perfcount*6 + greatcount*5 + goodcount*4 + boocount*2 + okcount*7 + ITG = ( tStats["W1"]*7 + tStats["W2"]*6 + tStats["W3"]*5 + tStats["W4"]*4 + tStats["W5"]*2 + tStats["Held"]*7 ), + -- (marvcount + perfcount + greatcount + goodcount + boocount + misscount + okcount + ngcount)*7 + ITG_MAX = ( tStats["W1"] + tStats["W2"] + tStats["W3"] + tStats["W4"] + tStats["W5"] + tStats["Miss"] + tStats["Held"] + tStats["LetGo"] )*7, + -- marvcount*3 + perfcount*2 + greatcount*1 - boocount*4 - misscount*8 + okcount*6 + MIGS = ( tStats["W1"]*3 + tStats["W2"]*2 + tStats["W3"] - tStats["W5"]*4 - tStats["Miss"]*8 + tStats["Held"]*6 ), + -- (marvcount + perfcount + greatcount + goodcount + boocount + misscount)*3 + (okcount + ngcount)*6 + MIGS_MAX = ( (tStats["W1"] + tStats["W2"] + tStats["W3"] + tStats["W4"] + tStats["W5"] + tStats["Miss"])*3 + (tStats["Held"] + tStats["LetGo"])*6 ), + }; + + local t = Def.ActorFrame {}; + t[#t+1] = Def.ActorFrame { + InitCommand=function(self) + self:y(-34); + end; + LoadActor(THEME:GetPathG("ScreenTitleMenu","PreferenceFrame")) .. { + InitCommand=function(self) + self:zoom(0.875); + self:diffuse(PlayerColor( pnPlayer )); + end; + }; + aLabel .. { + Text=THEME:GetString("ScreenEvaluation","ITG DP:"); + InitCommand=function(self) + self:x(-64); + end; + }; + aText .. { + Text=string.format("%04i",tValues["ITG"]); + InitCommand=function(self) + self:x(-8); + self:y(5); + self:vertalign(bottom); + self:zoom(0.6); + end; + }; + aText .. { + Text="/"; + InitCommand=function(self) + self:x(28); + self:y(5); + self:vertalign(bottom); + self:zoom(0.5); + self:diffusealpha(0.5); + end; + }; + aText .. { + Text=string.format("%04i",tValues["ITG_MAX"]); + InitCommand=function(self) + self:x(32); + self:y(5); + self:vertalign(bottom); + self:zoom(0.5); + end; + }; + }; + t[#t+1] = Def.ActorFrame { + InitCommand=function(self) + self:y(-6); + end; + LoadActor(THEME:GetPathG("ScreenTitleMenu","PreferenceFrame")) .. { + InitCommand=function(self) + self:zoom(0.875); + self:diffuse(PlayerColor( pnPlayer )); + end; + }; + aLabel .. { + Text=THEME:GetString("ScreenEvaluation","MIGS DP:"); + InitCommand=function(self) + self:x(-64); + end; + }; + aText .. { + Text=string.format("%04i",tValues["MIGS"]); + InitCommand=function(self) + self:x(-8); + self:y(5); + self:vertalign(bottom); + self:zoom(0.6); + end; + }; + aText .. { + Text="/"; + InitCommand=function(self) + self:x(28); + self:y(5); + self:vertalign(bottom); + self:zoom(0.5); + self:diffusealpha(0.5); + end; + }; + aText .. { + Text=string.format("%04i",tValues["MIGS_MAX"]); + InitCommand=function(self) + self:x(32); + self:y(5); + self:vertalign(bottom); + self:zoom(0.5); + end; + }; + }; + return t +end; + +local t = Def.ActorFrame {}; +GAMESTATE:IsPlayerEnabled(PLAYER_1) +t[#t+1] = Def.ActorFrame { + InitCommand=function(self) + self:hide_if(not GAMESTATE:IsPlayerEnabled(PLAYER_1)); + self:x(WideScale(math.floor(SCREEN_CENTER_X * 0.3) - 8, math.floor(SCREEN_CENTER_X * 0.5) - 8)); + self:y(SCREEN_CENTER_Y-34); + end; + CreateStats( PLAYER_1 ); +}; +t[#t+1] = Def.ActorFrame { + InitCommand=function(self) + self:hide_if(not GAMESTATE:IsPlayerEnabled(PLAYER_2)); + self:x(WideScale(math.floor(SCREEN_CENTER_X * 1.7) + 8, math.floor(SCREEN_CENTER_X * 1.5) + 8)); + self:y(SCREEN_CENTER_Y-34); + end; + CreateStats( PLAYER_2 ); +}; return t \ No newline at end of file diff --git a/Themes/default/BGAnimations/ScreenEvaluation overlay/kyuze.lua b/Themes/default/BGAnimations/ScreenEvaluation overlay/kyuze.lua index 586c793ab2..8b1bef1b14 100644 --- a/Themes/default/BGAnimations/ScreenEvaluation overlay/kyuze.lua +++ b/Themes/default/BGAnimations/ScreenEvaluation overlay/kyuze.lua @@ -2,8 +2,20 @@ local vStats = STATSMAN:GetCurStageStats(); local function CreateStats( pnPlayer ) -- Actor Templates - local aLabel = LoadFont("Common Normal") .. { InitCommand=cmd(zoom,0.5;shadowlength,1;horizalign,left); }; - local aText = LoadFont("Common Normal") .. { InitCommand=cmd(zoom,0.5;shadowlength,1;horizalign,left); }; + local aLabel = LoadFont("Common Normal") .. { + InitCommand=function(self) + self:zoom(0.5); + self:shadowlength(1); + self:horizalign(left); + end; + }; + local aText = LoadFont("Common Normal") .. { + InitCommand=function(self) + self:zoom(0.5); + self:shadowlength(1); + self:horizalign(left); + end; + }; -- DA STATS, JIM!! local pnStageStats = vStats:GetPlayerStageStats( pnPlayer ); -- Organized Stats. @@ -65,24 +77,94 @@ local function CreateStats( pnPlayer ) local t = Def.ActorFrame {}; t[#t+1] = Def.ActorFrame { - InitCommand=cmd(y,-34); + InitCommand=function(self) + self:y(-34); + end; LoadActor(THEME:GetPathG("ScreenTitleMenu","PreferenceFrame")) .. { - InitCommand=cmd(zoom,0.875;diffuse,PlayerColor( pnPlayer )); + InitCommand=function(self) + self:zoom(0.875); + self:diffuse(PlayerColor( pnPlayer )); + end; + }; + aLabel .. { + Text=THEME:GetString("ScreenEvaluation","ITG DP:"); + InitCommand=function(self) + self:x(-64); + end; + }; + aText .. { + Text=string.format("%04i",tValues["ITG"]); + InitCommand=function(self) + self:x(-8); + self:y(5); + self:vertalign(bottom); + self:zoom(0.6); + end; + }; + aText .. { + Text="/"; + InitCommand=function(self) + self:x(28); + self:y(5); + self:vertalign(bottom); + self:zoom(0.5); + self:diffusealpha(0.5); + end; + }; + aText .. { + Text=string.format("%04i",tValues["ITG_MAX"]); + InitCommand=function(self) + self:x(32); + self:y(5); + self:vertalign(bottom); + self:zoom(0.5); + end; }; - aLabel .. { Text=THEME:GetString("ScreenEvaluation","ITG DP:"); InitCommand=cmd(x,-64) }; - aText .. { Text=string.format("%04i",tValues["ITG"]); InitCommand=cmd(x,-8;y,5;vertalign,bottom;zoom,0.6); }; - aText .. { Text="/"; InitCommand=cmd(x,28;y,5;vertalign,bottom;zoom,0.5;diffusealpha,0.5); }; - aText .. { Text=string.format("%04i",tValues["ITG_MAX"]); InitCommand=cmd(x,32;y,5;vertalign,bottom;zoom,0.5); }; }; t[#t+1] = Def.ActorFrame { - InitCommand=cmd(y,-6); + InitCommand=function(self) + self:y(-6); + end; LoadActor(THEME:GetPathG("ScreenTitleMenu","PreferenceFrame")) .. { - InitCommand=cmd(zoom,0.875;diffuse,PlayerColor( pnPlayer )); + InitCommand=function(self) + self:zoom(0.875); + self:diffuse(PlayerColor( pnPlayer )); + end; + }; + aLabel .. { + Text=THEME:GetString("ScreenEvaluation","MIGS DP:"); + InitCommand=function(self) + self:x(-64); + end; + }; + aText .. { + Text=string.format("%04i",tValues["MIGS"]); + InitCommand=function(self) + self:x(-8); + self:y(5); + self:vertalign(bottom); + self:zoom(0.6); + end; + }; + aText .. { + Text="/"; + InitCommand=function(self) + self:x(28); + self:y(5); + self:vertalign(bottom); + self:zoom(0.5); + self:diffusealpha(0.5); + end; + }; + aText .. { + Text=string.format("%04i",tValues["MIGS_MAX"]); + InitCommand=function(self) + self:x(32); + self:y(5); + self:vertalign(bottom); + self:zoom(0.5); + end; }; - aLabel .. { Text=THEME:GetString("ScreenEvaluation","MIGS DP:"); InitCommand=cmd(x,-64) }; - aText .. { Text=string.format("%04i",tValues["MIGS"]); InitCommand=cmd(x,-8;y,5;vertalign,bottom;zoom,0.6); }; - aText .. { Text="/"; InitCommand=cmd(x,28;y,5;vertalign,bottom;zoom,0.5;diffusealpha,0.5); }; - aText .. { Text=string.format("%04i",tValues["MIGS_MAX"]); InitCommand=cmd(x,32;y,5;vertalign,bottom;zoom,0.5); }; }; return t end; @@ -90,11 +172,19 @@ end; local t = Def.ActorFrame {}; GAMESTATE:IsPlayerEnabled(PLAYER_1) t[#t+1] = Def.ActorFrame { - InitCommand=cmd(hide_if,not GAMESTATE:IsPlayerEnabled(PLAYER_1);x,WideScale(math.floor(SCREEN_CENTER_X*0.3)-8,math.floor(SCREEN_CENTER_X*0.5)-8);y,SCREEN_CENTER_Y-34); + InitCommand=function(self) + self:hide_if(not GAMESTATE:IsPlayerEnabled(PLAYER_1)); + self:x(WideScale(math.floor(SCREEN_CENTER_X * 0.3) - 8, math.floor(SCREEN_CENTER_X * 0.5) - 8)); + self:y(SCREEN_CENTER_Y-34); + end; CreateStats( PLAYER_1 ); }; t[#t+1] = Def.ActorFrame { - InitCommand=cmd(hide_if,not GAMESTATE:IsPlayerEnabled(PLAYER_2);x,WideScale(math.floor(SCREEN_CENTER_X*1.7)+8,math.floor(SCREEN_CENTER_X*1.5)+8);y,SCREEN_CENTER_Y-34); + InitCommand=function(self) + self:hide_if(not GAMESTATE:IsPlayerEnabled(PLAYER_2)); + self:x(WideScale(math.floor(SCREEN_CENTER_X * 1.7) + 8, math.floor(SCREEN_CENTER_X * 1.5) + 8)); + self:y(SCREEN_CENTER_Y-34); + end; CreateStats( PLAYER_2 ); }; -return t \ No newline at end of file +return t diff --git a/Themes/default/BGAnimations/ScreenEvaluation overlay/original.lua b/Themes/default/BGAnimations/ScreenEvaluation overlay/original.lua deleted file mode 100644 index 8cde03487b..0000000000 --- a/Themes/default/BGAnimations/ScreenEvaluation overlay/original.lua +++ /dev/null @@ -1,86 +0,0 @@ -local ss = STATSMAN:GetCurStageStats(); -local pss = ss:GetPlayerStageStats('PlayerNumber_P1'); -local misscount = pss:GetTapNoteScores('TapNoteScore_Miss'); -local boocount = pss:GetTapNoteScores('TapNoteScore_W5'); -local goodcount = pss:GetTapNoteScores('TapNoteScore_W4'); -local greatcount = pss:GetTapNoteScores('TapNoteScore_W3'); -local perfcount = pss:GetTapNoteScores('TapNoteScore_W2'); -local marvcount = pss:GetTapNoteScores('TapNoteScore_W1'); -local minehitcount = pss:GetTapNoteScores('TapNoteScore_HitMine'); -local minemisscount = pss:GetTapNoteScores('TapNoteScore_AvoidMine'); -local okcount = pss:GetHoldNoteScores('HoldNoteScore_Held'); -local ngcount = pss:GetHoldNoteScores('HoldNoteScore_LetGo'); -local ITGdp = marvcount*7 + perfcount*6 + greatcount*5 + goodcount*4 + boocount*2 + okcount*7 -local ITGdpmax = (marvcount + perfcount + greatcount + goodcount + boocount + misscount + okcount + ngcount)*7 -local MIGSdp = marvcount*3 + perfcount*2 + greatcount*1 - boocount*4 - misscount*8 + okcount*6 -local MIGSdpmax = (marvcount + perfcount + greatcount + goodcount + boocount + misscount)*3 + (okcount + ngcount)*6 -local histogram = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0} -local total = 0 -local maxValue = 0; -print("John11length: "..#histogram); - -for i=1,#tTotalJudgmentsSigned do - print("John11Timings: "..i.." - "..tTotalJudgmentsSigned[i]) - local index = math.floor((0.18-tTotalJudgmentsSigned[i])*(#histogram/.36)); - print("John11Index: "..i.." - "..index) - if index >= 0 and index <= #histogram - 1 then - histogram[index] = histogram[index] + 1 - total = total + 1 - if histogram[index] > maxValue then - maxValue = histogram[index] - end - end -end - -for i=1,#histogram do - print("John11Judgments: "..i.." - "..histogram[i]) -end - -local t = Def.ActorFrame {} -t[#t+1] = Def.ActorFrame { - InitCommand=cmd(x,SCREEN_CENTER_X/3;y,SCREEN_CENTER_Y); - LoadFont("Common Normal") .. { - Text="MIGS DP: "..tostring(MIGSdp).."/"..tostring(MIGSdpmax).."\nITG DP: "..tostring(ITGdp).."/"..tostring(ITGdpmax).."\nOffset Avg: "..RoundTo(tTimingDifferenceAverage,5).."\nAbs Offset Avg: "..RoundTo(tTimingDifferenceAbsAverage,5).."\nEarly Taps: "..tEarlyHits.."\nLate Taps: "..tLateHits; - InitCommand=cmd(y,-4;shadowlength,1;diffuse,Color("Red");zoom,0.5) - }; -} - -for i=1,#histogram do - local offset = -1 - if i > #histogram/2 then - offset = 1 - end - t[#t+1] = Def.Quad { - InitCommand=cmd(diffuse,Color("Red");zoomtowidth,300/#histogram-1;zoomtoheight,histogram[#histogram-i]/maxValue*150;x,SCREEN_CENTER_X+100+300/#histogram*i+offset;y,SCREEN_CENTER_Y-histogram[#histogram-i]/maxValue*150/2); - } -end - -t[#t+1] = Def.Quad { - InitCommand=cmd(x,SCREEN_CENTER_X+250;y,SCREEN_CENTER_Y+3;zoomtowidth,300;zoomtoheight,5;diffuse,color("#FFFFFF")); -} - -t[#t+1] = Def.Quad { - InitCommand=cmd(x,SCREEN_CENTER_X+252;y,SCREEN_CENTER_Y-75;zoomtowidth,1;zoomtoheight,150;diffuse,color("#000000")); -} - - -t[#t+1] = Def.ActorFrame { - InitCommand=cmd(x,SCREEN_CENTER_X+125;y,SCREEN_CENTER_Y+15); - LoadFont("Common Normal") .. { - Text="Early"; - InitCommand=cmd(shadowlength,1;diffuse,Color("#FF0000");zoom,0.5) - }; -} - -t[#t+1] = Def.ActorFrame { - InitCommand=cmd(x,SCREEN_CENTER_X+375;y,SCREEN_CENTER_Y+15); - LoadFont("Common Normal") .. { - Text="Late"; - InitCommand=cmd(shadowlength,1;diffuse,Color("#FF0000");zoom,0.5) - }; -} - -print("John11Total: "..total) -print("John11MaxValue: "..maxValue) - -return t \ No newline at end of file diff --git a/Themes/default/BGAnimations/ScreenGameOver underlay/default.lua b/Themes/default/BGAnimations/ScreenGameOver underlay/default.lua index 4cfaedad3c..2485959fb5 100644 --- a/Themes/default/BGAnimations/ScreenGameOver underlay/default.lua +++ b/Themes/default/BGAnimations/ScreenGameOver underlay/default.lua @@ -1,11 +1,22 @@ -return Def.ActorFrame { - InitCommand=cmd(x,SCREEN_CENTER_X;y,SCREEN_CENTER_Y); - LoadFont("Common Normal") .. { - Text=ScreenString("GAME OVER"); - InitCommand=cmd(y,-4;shadowlength,1;diffuse,Color("Red")); - }; - LoadFont("Common Normal") .. { - Text=ScreenString("Play again soon!"); - InitCommand=cmd(y,16;shadowlength,1;zoom,0.5;); - }; +return Def.ActorFrame { + InitCommand=function(self) + self:x(SCREEN_CENTER_X); + self:y(SCREEN_CENTER_Y); + end; + LoadFont("Common Normal") .. { + Text=ScreenString("GAME OVER"); + InitCommand=function(self) + self:y(-4); + self:shadowlength(1); + self:diffuse(Color("Red")); + end; + }; + LoadFont("Common Normal") .. { + Text=ScreenString("Play again soon!"); + InitCommand=function(self) + self:y(16); + self:shadowlength(1); + self:zoom(0.5); + end; + }; }; \ No newline at end of file diff --git a/Themes/default/BGAnimations/ScreenGameplay danger all/default.lua b/Themes/default/BGAnimations/ScreenGameplay danger all/default.lua index ca4fb88585..a608bd9470 100644 --- a/Themes/default/BGAnimations/ScreenGameplay danger all/default.lua +++ b/Themes/default/BGAnimations/ScreenGameplay danger all/default.lua @@ -1,6 +1,15 @@ return Def.ActorFrame { Def.Quad{ - InitCommand=cmd(FullScreen;diffuse,color("1,0,0,0");blend,Blend.Multiply); - OnCommand=cmd(smooth,1;diffuse,color("0.75,0,0,0.75");decelerate,2;diffuse,color("0,0,0,1")); + InitCommand=function(self) + self:FullScreen(); + self:diffuse(color("1,0,0,0")); + self:blend(Blend.Multiply); + end; + OnCommand=function(self) + self:smooth(1); + self:diffuse(color("0.75,0,0,0.75")); + self:decelerate(2); + self:diffuse(color("0,0,0,1")); + end; }; }; \ No newline at end of file diff --git a/Themes/default/BGAnimations/ScreenGameplay go/default.lua b/Themes/default/BGAnimations/ScreenGameplay go/default.lua index e9b1a6b5e8..8ac0392da8 100644 --- a/Themes/default/BGAnimations/ScreenGameplay go/default.lua +++ b/Themes/default/BGAnimations/ScreenGameplay go/default.lua @@ -1,9 +1,25 @@ -if IsNetSMOnline() then - -- don't show "Ready" online; it will obscure the immediately-starting steps. - return Def.ActorFrame{} -end - -return LoadActor("go") .. { - InitCommand=cmd(Center;draworder,105); - StartTransitioningCommand=cmd(zoom,1.3;diffusealpha,0;bounceend,0.25;zoom,1;diffusealpha,1;linear,0.15;glow,BoostColor(Color("Blue"),1.75);decelerate,0.3;glow,1,1,1,0;sleep,1-0.45;linear,0.25;diffusealpha,0;); +if IsNetSMOnline() then + -- don't show "Ready" online; it will obscure the immediately-starting steps. + return Def.ActorFrame{} +end + +return LoadActor("go") .. { + InitCommand=function(self) + self:Center(); + self:draworder(105); + end; + StartTransitioningCommand=function(self) + self:zoom(1.3); + self:diffusealpha(0); + self:bounceend(0.25); + self:zoom(1); + self:diffusealpha(1); + self:linear(0.15); + self:glow(BoostColor(Color("Blue"),1.75)); + self:decelerate(0.3); + self:glow(1, 1, 1, 0); + self:sleep(1-0.45); + self:linear(0.25); + self:diffusealpha(0); + end; }; \ No newline at end of file diff --git a/Themes/default/BGAnimations/ScreenGameplay in/default.lua b/Themes/default/BGAnimations/ScreenGameplay in/default.lua index 0a43fa337b..b84d6bf432 100644 --- a/Themes/default/BGAnimations/ScreenGameplay in/default.lua +++ b/Themes/default/BGAnimations/ScreenGameplay in/default.lua @@ -1,15 +1,20 @@ -local t = Def.ActorFrame {}; -t[#t+1] = Def.Sprite { - InitCommand=cmd(Center;diffusealpha,1); - BeginCommand=cmd(LoadFromCurrentSongBackground); - OnCommand=function(self) - if PREFSMAN:GetPreference("StretchBackgrounds") then - self:SetSize(SCREEN_WIDTH,SCREEN_HEIGHT) - else - self:scale_or_crop_background() - end - self:linear(1) - self:diffusealpha(0) - end; -}; +local t = Def.ActorFrame {}; +t[#t+1] = Def.Sprite { + InitCommand=function(self) + self:Center(); + self:diffusealpha(1); + end; + BeginCommand=function(self) + self:LoadFromCurrentSongBackground(); + end; + OnCommand=function(self) + if PREFSMAN:GetPreference("StretchBackgrounds") then + self:SetSize(SCREEN_WIDTH,SCREEN_HEIGHT) + else + self:scale_or_crop_background() + end + self:linear(1) + self:diffusealpha(0) + end; +}; return t; \ No newline at end of file diff --git a/Themes/default/BGAnimations/ScreenGameplay overlay.lua b/Themes/default/BGAnimations/ScreenGameplay overlay.lua index 116f950fab..b5c9893795 100644 --- a/Themes/default/BGAnimations/ScreenGameplay overlay.lua +++ b/Themes/default/BGAnimations/ScreenGameplay overlay.lua @@ -1,40 +1,42 @@ -local t = Def.ActorFrame {}; -local function UpdateTime(self) - local c = self:GetChildren(); - for pn in ivalues(PlayerNumber) do - local vStats = STATSMAN:GetCurStageStats():GetPlayerStageStats( pn ); - local vTime; - local obj = self:GetChild( string.format("RemainingTime" .. PlayerNumberToString(pn) ) ); - if vStats and obj then - vTime = vStats:GetLifeRemainingSeconds() - obj:settext( SecondsToMMSSMsMs( vTime ) ); - end; - end; -end -if GAMESTATE:GetCurrentCourse() then - if GAMESTATE:GetCurrentCourse():GetCourseType() == "CourseType_Survival" then - -- RemainingTime - for pn in ivalues(PlayerNumber) do - local MetricsName = "RemainingTime" .. PlayerNumberToString(pn); - t[#t+1] = LoadActor( THEME:GetPathG( Var "LoadingScreen", "RemainingTime"), pn ) .. { - InitCommand=function(self) - self:player(pn); - self:name(MetricsName); - ActorUtil.LoadAllCommandsAndSetXY(self,Var "LoadingScreen"); - end; - }; - end - for pn in ivalues(PlayerNumber) do - local MetricsName = "DeltaSeconds" .. PlayerNumberToString(pn); - t[#t+1] = LoadActor( THEME:GetPathG( Var "LoadingScreen", "DeltaSeconds"), pn ) .. { - InitCommand=function(self) - self:player(pn); - self:name(MetricsName); - ActorUtil.LoadAllCommandsAndSetXY(self,Var "LoadingScreen"); - end; - }; - end - end; -end; -t.InitCommand=cmd(SetUpdateFunction,UpdateTime); -return t +local t = Def.ActorFrame {}; +local function UpdateTime(self) + local c = self:GetChildren(); + for pn in ivalues(PlayerNumber) do + local vStats = STATSMAN:GetCurStageStats():GetPlayerStageStats( pn ); + local vTime; + local obj = self:GetChild( string.format("RemainingTime" .. PlayerNumberToString(pn) ) ); + if vStats and obj then + vTime = vStats:GetLifeRemainingSeconds() + obj:settext( SecondsToMMSSMsMs( vTime ) ); + end; + end; +end +if GAMESTATE:GetCurrentCourse() then + if GAMESTATE:GetCurrentCourse():GetCourseType() == "CourseType_Survival" then + -- RemainingTime + for pn in ivalues(PlayerNumber) do + local MetricsName = "RemainingTime" .. PlayerNumberToString(pn); + t[#t+1] = LoadActor( THEME:GetPathG( Var "LoadingScreen", "RemainingTime"), pn ) .. { + InitCommand=function(self) + self:player(pn); + self:name(MetricsName); + ActorUtil.LoadAllCommandsAndSetXY(self,Var "LoadingScreen"); + end; + }; + end + for pn in ivalues(PlayerNumber) do + local MetricsName = "DeltaSeconds" .. PlayerNumberToString(pn); + t[#t+1] = LoadActor( THEME:GetPathG( Var "LoadingScreen", "DeltaSeconds"), pn ) .. { + InitCommand=function(self) + self:player(pn); + self:name(MetricsName); + ActorUtil.LoadAllCommandsAndSetXY(self,Var "LoadingScreen"); + end; + }; + end + end; +end; +t.InitCommand=function(self) + self:SetUpdateFunction(UpdateTime); +end; +return t diff --git a/Themes/default/BGAnimations/ScreenGameplay ready/default.lua b/Themes/default/BGAnimations/ScreenGameplay ready/default.lua index 73c513579a..a8a4d9541c 100644 --- a/Themes/default/BGAnimations/ScreenGameplay ready/default.lua +++ b/Themes/default/BGAnimations/ScreenGameplay ready/default.lua @@ -1,9 +1,25 @@ -if IsNetSMOnline() then - -- don't show "Ready" online; it will obscure the immediately-starting steps. - return Def.ActorFrame{} -end - -return LoadActor("ready") .. { - InitCommand=cmd(Center;draworder,105); - StartTransitioningCommand=cmd(zoom,1.3;diffusealpha,0;bounceend,0.25;zoom,1;diffusealpha,1;linear,0.15;glow,BoostColor(Color("Orange"),1.75);decelerate,0.3;glow,1,1,1,0;sleep,1-0.45;linear,0.25;diffusealpha,0;); +if IsNetSMOnline() then + -- don't show "Ready" online; it will obscure the immediately-starting steps. + return Def.ActorFrame{} +end + +return LoadActor("ready") .. { + InitCommand=function(self) + self:Center(); + self:draworder(105); + end; + StartTransitioningCommand=function(self) + self:zoom(1.3); + self:diffusealpha(0); + self:bounceend(0.25); + self:zoom(1); + self:diffusealpha(1); + self:linear(0.15); + self:glow(BoostColor(Color("Orange"),1.75)); + self:decelerate(0.3); + self:glow(1, 1, 1, 0); + self:sleep(1-0.45); + self:linear(0.25); + self:diffusealpha(0); + end; }; \ No newline at end of file diff --git a/Themes/default/BGAnimations/ScreenGameplay toasty/default.lua b/Themes/default/BGAnimations/ScreenGameplay toasty/default.lua index 59e402fabc..266d2d031a 100644 --- a/Themes/default/BGAnimations/ScreenGameplay toasty/default.lua +++ b/Themes/default/BGAnimations/ScreenGameplay toasty/default.lua @@ -1,6 +1,5 @@ -return Def.ActorFrame { --- InitCommand=cmd(x,SCREEN_RIGHT;y,SCREEN_BOTTOM;draworder,101); - StartTransitioningCommand=function(self) - MESSAGEMAN:Broadcast("Toasty",{ Time = math.random(1,3) }); - end +return Def.ActorFrame { + StartTransitioningCommand=function(self) + MESSAGEMAN:Broadcast("Toasty",{ Time = math.random(1,3) }); + end }; \ No newline at end of file diff --git a/Themes/default/BGAnimations/ScreenGameplay underlay/danger.lua b/Themes/default/BGAnimations/ScreenGameplay underlay/danger.lua index df6ab760e1..1ee180cda9 100644 --- a/Themes/default/BGAnimations/ScreenGameplay underlay/danger.lua +++ b/Themes/default/BGAnimations/ScreenGameplay underlay/danger.lua @@ -1,27 +1,29 @@ -local players = GAMESTATE:GetHumanPlayers() - -local t = Def.ActorFrame {}; - -for pn=1,#players do - t[#t+1] = Def.ActorFrame { - InitCommand=function(self) - self:y(SCREEN_CENTER_Y) - self:x( - THEME:GetMetric( - Var "LoadingScreen", - "Player" .. ToEnumShortString(players[pn]) .. ToEnumShortString(GAMESTATE:GetCurrentStyle():GetStyleType()) .. "X" - ) - ) - end, - Def.Quad { - InitCommand=function(self) - (cmd('fadeleft,0.1;faderight,0.1;zoomtoheight,SCREEN_HEIGHT'))(self) - self:zoomtowidth( - Center1Player() and SCREEN_WIDTH-32 or SCREEN_CENTER_X-16 - ) - end - }; - }; -end - +local players = GAMESTATE:GetHumanPlayers() + +local t = Def.ActorFrame {}; + +for pn=1,#players do + t[#t+1] = Def.ActorFrame { + InitCommand=function(self) + self:y(SCREEN_CENTER_Y) + self:x( + THEME:GetMetric( + Var "LoadingScreen", + "Player" .. ToEnumShortString(players[pn]) .. ToEnumShortString(GAMESTATE:GetCurrentStyle():GetStyleType()) .. "X" + ) + ) + end, + Def.Quad { + InitCommand=function(self) + self:fadeleft(0.1); + self:faderight(0.1); + self:zoomtoheight(SCREEN_HEIGHT); + self:zoomtowidth( + Center1Player() and SCREEN_WIDTH-32 or SCREEN_CENTER_X-16 + ) + end + }; + }; +end + return t \ No newline at end of file diff --git a/Themes/default/BGAnimations/ScreenHowToPlay background/default.lua b/Themes/default/BGAnimations/ScreenHowToPlay background/default.lua index 90b31246e0..cd74393d39 100644 --- a/Themes/default/BGAnimations/ScreenHowToPlay background/default.lua +++ b/Themes/default/BGAnimations/ScreenHowToPlay background/default.lua @@ -1,4 +1,13 @@ return LoadActor("bg.png") ..{ - InitCommand=cmd(x,SCREEN_CENTER_X;y,SCREEN_CENTER_Y;zoomtowidth,SCREEN_WIDTH;zoomtoheight,SCREEN_HEIGHT); - OnCommand=cmd(texcoordvelocity,0,-1;customtexturerect,0,0,SCREEN_WIDTH/self:GetWidth(),SCREEN_HEIGHT/self:GetHeight();diffuse,color("0.9,0.9,0.9,1")); + InitCommand=function(self) + self:x(SCREEN_CENTER_X); + self:y(SCREEN_CENTER_Y); + self:zoomtowidth(SCREEN_WIDTH); + self:zoomtoheight(SCREEN_HEIGHT); + end; + OnCommand=function(self) + self:texcoordvelocity(0, -1); + self:customtexturerect(0, 0, SCREEN_WIDTH / self:GetWidth(), SCREEN_HEIGHT / self:GetHeight()); + self:diffuse(color("0.9,0.9,0.9,1")); + end; }; \ No newline at end of file diff --git a/Themes/default/BGAnimations/ScreenHowToPlay overlay/_message jump.lua b/Themes/default/BGAnimations/ScreenHowToPlay overlay/_message jump.lua index ca12423f28..6f08bf8171 100644 --- a/Themes/default/BGAnimations/ScreenHowToPlay overlay/_message jump.lua +++ b/Themes/default/BGAnimations/ScreenHowToPlay overlay/_message jump.lua @@ -1,6 +1,16 @@ -return Def.ActorFrame{ - LoadActor("jumpmessage") .. { - InitCommand=cmd(x,SCREEN_CENTER_X+160;y,SCREEN_CENTER_Y+40;diffusealpha,0;); - ShowCommand=cmd(linear,0;diffusealpha,1;sleep,1.7;linear,0;diffusealpha,0); - }; +return Def.ActorFrame{ + LoadActor("jumpmessage") .. { + InitCommand=function(self) + self:x(SCREEN_CENTER_X + 160); + self:y(SCREEN_CENTER_Y + 40); + self:diffusealpha(0); + end; + ShowCommand=function(self) + self:linear(0); + self:diffusealpha(1); + self:sleep(1.7); + self:linear(0); + self:diffusealpha(0); + end; + }; }; \ No newline at end of file diff --git a/Themes/default/BGAnimations/ScreenHowToPlay overlay/_message miss.lua b/Themes/default/BGAnimations/ScreenHowToPlay overlay/_message miss.lua index b573579a14..dc5098f9e4 100644 --- a/Themes/default/BGAnimations/ScreenHowToPlay overlay/_message miss.lua +++ b/Themes/default/BGAnimations/ScreenHowToPlay overlay/_message miss.lua @@ -1,6 +1,16 @@ -return Def.ActorFrame{ - LoadActor("missmessage") .. { - InitCommand=cmd(x,SCREEN_CENTER_X+160;y,SCREEN_CENTER_Y+40;diffusealpha,0;); - ShowCommand=cmd(linear,0;diffusealpha,1;sleep,22.7;linear,0;diffusealpha,0); - }; +return Def.ActorFrame{ + LoadActor("missmessage") .. { + InitCommand=function(self) + self:x(SCREEN_CENTER_X + 160); + self:y(SCREEN_CENTER_Y + 40); + self:diffusealpha(0); + end; + ShowCommand=function(self) + self:linear(0); + self:diffusealpha(1); + self:sleep(22.7); + self:linear(0); + self:diffusealpha(0); + end; + }; }; \ No newline at end of file diff --git a/Themes/default/BGAnimations/ScreenHowToPlay overlay/_message tap.lua b/Themes/default/BGAnimations/ScreenHowToPlay overlay/_message tap.lua index 1b53a61643..7b3f828975 100644 --- a/Themes/default/BGAnimations/ScreenHowToPlay overlay/_message tap.lua +++ b/Themes/default/BGAnimations/ScreenHowToPlay overlay/_message tap.lua @@ -1,6 +1,16 @@ -return Def.ActorFrame{ - LoadActor("tapmessage") .. { - InitCommand=cmd(x,SCREEN_CENTER_X+160;y,SCREEN_CENTER_Y+40;diffusealpha,0;); - ShowCommand=cmd(linear,0;diffusealpha,1;sleep,2;linear,0;diffusealpha,0); - }; +return Def.ActorFrame{ + LoadActor("tapmessage") .. { + InitCommand=function(self) + self:x(SCREEN_CENTER_X + 160); + self:y(SCREEN_CENTER_Y + 40); + self:diffusealpha(0); + end; + ShowCommand=function(self) + self:linear(0); + self:diffusealpha(1); + self:sleep(2); + self:linear(0); + self:diffusealpha(0); + end; + }; }; \ No newline at end of file diff --git a/Themes/default/BGAnimations/ScreenJukebox in.lua b/Themes/default/BGAnimations/ScreenJukebox in.lua index 933729de3f..00f1674d3d 100644 --- a/Themes/default/BGAnimations/ScreenJukebox in.lua +++ b/Themes/default/BGAnimations/ScreenJukebox in.lua @@ -1,6 +1,12 @@ -return Def.ActorFrame{ - Def.Quad{ - InitCommand=cmd(FullScreen;diffuse,color("0,0,0,1")); - OnCommand=cmd(decelerate,0.5;diffusealpha,0); - }; +return Def.ActorFrame{ + Def.Quad{ + InitCommand=function(self) + self:FullScreen(); + self:diffuse(color("0,0,0,1")); + end; + OnCommand=function(self) + self:decelerate(0.5); + self:diffusealpha(0); + end; + }; }; \ No newline at end of file diff --git a/Themes/default/BGAnimations/ScreenJukebox out.lua b/Themes/default/BGAnimations/ScreenJukebox out.lua index daa7205234..c8d5aef8fa 100644 --- a/Themes/default/BGAnimations/ScreenJukebox out.lua +++ b/Themes/default/BGAnimations/ScreenJukebox out.lua @@ -1,6 +1,12 @@ -return Def.ActorFrame{ - Def.Quad{ - InitCommand=cmd(FullScreen;diffuse,color("0,0,0,0")); - OnCommand=cmd(accelerate,0.5;diffusealpha,1); - }; +return Def.ActorFrame{ + Def.Quad{ + InitCommand=function(self) + self:FullScreen(); + self:diffuse(color("0,0,0,0")); + end; + OnCommand=function(self) + self:accelerate(0.5); + self:diffusealpha(1); + end; + }; }; \ No newline at end of file diff --git a/Themes/default/BGAnimations/ScreenMiniMenu underlay/default.lua b/Themes/default/BGAnimations/ScreenMiniMenu underlay/default.lua index a4f08559c1..6fa325bfd9 100644 --- a/Themes/default/BGAnimations/ScreenMiniMenu underlay/default.lua +++ b/Themes/default/BGAnimations/ScreenMiniMenu underlay/default.lua @@ -1,5 +1,8 @@ return Def.ActorFrame { Def.Quad{ - InitCommand=cmd(scaletocover,-SCREEN_WIDTH*2,SCREEN_TOP,SCREEN_WIDTH*2,SCREEN_BOTTOM;diffuse,color("0,0,0,0.5")); + InitCommand=function(self) + self:scaletocover(-SCREEN_WIDTH * 2, SCREEN_TOP, SCREEN_WIDTH * 2, SCREEN_BOTTOM); + self:diffuse(color("0,0,0,0.5")); + end; }; }; \ No newline at end of file diff --git a/Themes/default/BGAnimations/ScreenTitleJoin overlay.lua b/Themes/default/BGAnimations/ScreenTitleJoin overlay.lua index a170fa5fdb..51c3c74b2e 100644 --- a/Themes/default/BGAnimations/ScreenTitleJoin overlay.lua +++ b/Themes/default/BGAnimations/ScreenTitleJoin overlay.lua @@ -4,7 +4,13 @@ local t = Def.ActorFrame{}; if GAMESTATE:IsEventMode() then t[#t+1] = LoadFont("Common normal")..{ Text=Screen.String("EventMode"); - InitCommand=cmd(CenterX;y,SCREEN_BOTTOM-72;zoom,0.75;diffuse,HSV(56,0.8,1);shadowlength,1); + InitCommand=function(self) + self:CenterX(); + self:y(SCREEN_BOTTOM - 72); + self:zoom(0.75); + self:diffuse(HSV(56,0.8,1)); + self:shadowlength(1); + end; }; end; diff --git a/Themes/default/BGAnimations/ScreenTitleMenu underlay/default.lua b/Themes/default/BGAnimations/ScreenTitleMenu underlay/default.lua index 74fb90bfad..5e9710a2e2 100644 --- a/Themes/default/BGAnimations/ScreenTitleMenu underlay/default.lua +++ b/Themes/default/BGAnimations/ScreenTitleMenu underlay/default.lua @@ -1,10 +1,29 @@ -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); - }; +return Def.ActorFrame { + Def.Quad { + InitCommand=function(self) + self:horizalign(left); + self:vertalign(top); + self:y(SCREEN_TOP + 8); + end; + OnCommand=function(self) + self:diffuse(Color.Black); + self:diffusealpha(0.5); + self:zoomto(256, 84); + self:faderight(1); + end; + }; + Def.Quad { + InitCommand=function(self) + self:horizalign(right); + self:vertalign(top); + self:x(SCREEN_RIGHT); + self:y(SCREEN_TOP+8); + end; + OnCommand=function(self) + self:diffuse(Color.Black); + self:diffusealpha(0.5); + self:zoomto(256, 46); + self:fadeleft(1); + end; + }; }; \ No newline at end of file diff --git a/Themes/default/BGAnimations/_frame 3x1/default.lua b/Themes/default/BGAnimations/_frame 3x1/default.lua index 9673efba02..6df7c6df13 100644 --- a/Themes/default/BGAnimations/_frame 3x1/default.lua +++ b/Themes/default/BGAnimations/_frame 3x1/default.lua @@ -6,7 +6,27 @@ local FullFile = THEME:GetPathB('','_frame files 3x1/'..File ) local Frame = LoadActor( FullFile ) return Def.ActorFrame { - Frame .. { InitCommand=cmd(setstate,0;pause;horizalign,right;x,-Width/2) }; - Frame .. { InitCommand=cmd(setstate,1;pause;zoomtowidth,Width) }; - Frame .. { InitCommand=cmd(setstate,2;pause;horizalign,left;x,Width/2) }; + Frame .. { + InitCommand=function(self) + self:setstate(0); + self:pause(); + self:horizalign(right); + self:x(-Width / 2); + end; + }; + Frame .. { + InitCommand=function(self) + self:setstate(1); + self:pause(); + self:zoomtowidth(Width); + end; + }; + Frame .. { + InitCommand=function(self) + self:setstate(2); + self:pause(); + self:horizalign(left); + self:x(Width / 2); + end; + }; }; diff --git a/Themes/default/BGAnimations/old ScreenWithMenuElements background/default.lua b/Themes/default/BGAnimations/old ScreenWithMenuElements background/default.lua index 7a72bd6e78..0352cbe74f 100644 --- a/Themes/default/BGAnimations/old ScreenWithMenuElements background/default.lua +++ b/Themes/default/BGAnimations/old ScreenWithMenuElements background/default.lua @@ -1,10 +1,17 @@ local t = Def.ActorFrame {}; t[#t+1] = Def.ActorFrame { - InitCommand=cmd(Center); + InitCommand=function(self) + self:Center(); + end; Def.Quad { - InitCommand=cmd(scaletoclipped,SCREEN_WIDTH,SCREEN_HEIGHT); - OnCommand=cmd(diffuse,color("#00bfe8");diffusetopedge,color("#009ad5")); + InitCommand=function(self) + self:scaletoclipped(SCREEN_WIDTH, SCREEN_HEIGHT); + end; + OnCommand=function(self) + self:diffuse(color("#00bfe8")); + self:diffusetopedge(color("#009ad5")); + end; }; }; diff --git a/Themes/default/Graphics/CombinedLifeMeterTug frame.lua b/Themes/default/Graphics/CombinedLifeMeterTug frame.lua index 0d9a822490..8cc7f6ad61 100644 --- a/Themes/default/Graphics/CombinedLifeMeterTug frame.lua +++ b/Themes/default/Graphics/CombinedLifeMeterTug frame.lua @@ -1,3 +1,6 @@ return LoadActor(THEME:GetPathG("_combined","life frame"))..{ - InitCommand=cmd(diffuse,PlayerColor(PLAYER_1);diffuserightedge,PlayerColor(PLAYER_2)); + InitCommand=function(self) + self:diffuse(PlayerColor(PLAYER_1)); + self:diffuserightedge(PlayerColor(PLAYER_2)); + end; }; \ No newline at end of file diff --git a/Themes/default/Graphics/ComboGraph ComboNumber.lua b/Themes/default/Graphics/ComboGraph ComboNumber.lua index 33b3dbeb86..a607ce3e10 100644 --- a/Themes/default/Graphics/ComboGraph ComboNumber.lua +++ b/Themes/default/Graphics/ComboGraph ComboNumber.lua @@ -1,3 +1,9 @@ -return LoadFont("Combo Numbers") .. { - InitCommand=cmd(zoom,12/54;y,-1;shadowlengthx,0;shadowlengthy,1;strokecolor,color("#00000077");); +return LoadFont("Combo Numbers") .. { + InitCommand=function(self) + self:zoom(12/54); + self:y(-1); + self:shadowlengthx(0); + self:shadowlengthy(1); + self:strokecolor(color("#00000077")); + end; }; \ No newline at end of file diff --git a/Themes/default/Graphics/EditMenu Right.lua b/Themes/default/Graphics/EditMenu Right.lua index ed065fd94e..b2b3da3871 100644 --- a/Themes/default/Graphics/EditMenu Right.lua +++ b/Themes/default/Graphics/EditMenu Right.lua @@ -1,6 +1,8 @@ local t = Def.ActorFrame{ LoadActor("EditMenu Left")..{ - BeginCommand=cmd(zoomx,-1); + BeginCommand=function(self) + self:zoomx(-1); + end; }; }; diff --git a/Themes/default/Graphics/MusicWheelItem Roulette NormalPart.lua b/Themes/default/Graphics/MusicWheelItem Roulette NormalPart.lua index f496776126..054d83c41d 100644 --- a/Themes/default/Graphics/MusicWheelItem Roulette NormalPart.lua +++ b/Themes/default/Graphics/MusicWheelItem Roulette NormalPart.lua @@ -1,8 +1,14 @@ -return Def.ActorFrame { - LoadActor(THEME:GetPathG("MusicWheelItem","Course NormalPart")) .. { - InitCommand=cmd(glow,color('1,1,1,0.25')); - }; - LoadActor(THEME:GetPathG("MusicWheelItem","Course NormalPart")) .. { - InitCommand=cmd(blend,Blend.Add;rainbow;diffusealpha,0.325); - }; +return Def.ActorFrame { + LoadActor(THEME:GetPathG("MusicWheelItem","Course NormalPart")) .. { + InitCommand=function(self) + self:glow(color('1,1,1,0.25')); + end; + }; + LoadActor(THEME:GetPathG("MusicWheelItem","Course NormalPart")) .. { + InitCommand=function(self) + self:blend(Blend.Add); + self:rainbow(); + self:diffusealpha(0.325); + end; + }; }; \ No newline at end of file diff --git a/Themes/default/Graphics/ScreenEvaluation MachineRecord.lua b/Themes/default/Graphics/ScreenEvaluation MachineRecord.lua index 59c903f8f3..74d1d1a2cf 100644 --- a/Themes/default/Graphics/ScreenEvaluation MachineRecord.lua +++ b/Themes/default/Graphics/ScreenEvaluation MachineRecord.lua @@ -1,14 +1,21 @@ -local Player = ... -assert(Player,"MachineRecord needs Player") -local stats = STATSMAN:GetCurStageStats():GetPlayerStageStats(Player); -local record = stats:GetMachineHighScoreIndex() -local hasMachineRecord = record ~= -1 - -return LoadFont("Common normal")..{ - InitCommand=cmd(zoom,0.55;shadowlength,1;NoStroke;glowshift;effectcolor1,color("1,1,1,0");effectcolor2,color("1,1,1,0.25")); - BeginCommand=function(self) - self:visible(hasMachineRecord); - local text = string.format(THEME:GetString("ScreenEvaluation", "MachineRecord"), record+1) - self:settext(text); - end; +local Player = ... +assert(Player,"MachineRecord needs Player") +local stats = STATSMAN:GetCurStageStats():GetPlayerStageStats(Player); +local record = stats:GetMachineHighScoreIndex() +local hasMachineRecord = record ~= -1 + +return LoadFont("Common normal")..{ + InitCommand=function(self) + self:zoom(0.55); + self:shadowlength(1); + self:NoStroke(); + self:glowshift(); + self:effectcolor1(color("1,1,1,0")); + self:effectcolor2(color("1,1,1,0.25")); + end; + BeginCommand=function(self) + self:visible(hasMachineRecord); + local text = string.format(THEME:GetString("ScreenEvaluation", "MachineRecord"), record+1) + self:settext(text); + end; }; \ No newline at end of file diff --git a/Themes/default/Graphics/ScreenEvaluation PersonalRecord.lua b/Themes/default/Graphics/ScreenEvaluation PersonalRecord.lua index 3166197762..3ab74a5891 100644 --- a/Themes/default/Graphics/ScreenEvaluation PersonalRecord.lua +++ b/Themes/default/Graphics/ScreenEvaluation PersonalRecord.lua @@ -1,14 +1,21 @@ -local Player = ... -assert(Player,"PersonalRecord needs Player") -local stats = STATSMAN:GetCurStageStats():GetPlayerStageStats(Player); -local record = stats:GetPersonalHighScoreIndex() -local hasPersonalRecord = record ~= -1 - -return LoadFont("Common normal")..{ - InitCommand=cmd(zoom,0.55;shadowlength,1;NoStroke;glowshift;effectcolor1,color("1,1,1,0");effectcolor2,color("1,1,1,0.25")); - BeginCommand=function(self) - self:visible(hasPersonalRecord); - local text = string.format(THEME:GetString("ScreenEvaluation", "PersonalRecord"), record+1) - self:settext(text) - end +local Player = ... +assert(Player,"PersonalRecord needs Player") +local stats = STATSMAN:GetCurStageStats():GetPlayerStageStats(Player); +local record = stats:GetPersonalHighScoreIndex() +local hasPersonalRecord = record ~= -1 + +return LoadFont("Common normal")..{ + InitCommand=function(self) + self:zoom(0.55); + self:shadowlength(1); + self:NoStroke(); + self:glowshift(); + self:effectcolor1(color("1,1,1,0")); + self:effectcolor2(color("1,1,1,0.25")); + end; + BeginCommand=function(self) + self:visible(hasPersonalRecord); + local text = string.format(THEME:GetString("ScreenEvaluation", "PersonalRecord"), record+1) + self:settext(text) + end }; \ No newline at end of file diff --git a/Themes/default/Graphics/ScreenGameplay SongTitle.lua b/Themes/default/Graphics/ScreenGameplay SongTitle.lua index bcba67547d..300b01155d 100644 --- a/Themes/default/Graphics/ScreenGameplay SongTitle.lua +++ b/Themes/default/Graphics/ScreenGameplay SongTitle.lua @@ -1,5 +1,7 @@ return LoadFont("ScreenGameplay","SongTitle") .. { - CurrentSongChangedMessageCommand=cmd(playcommand,"Refresh"); + CurrentSongChangedMessageCommand=function(self) + self:playcommand("Refresh"); + end; RefreshCommand=function(self) local vSong = GAMESTATE:GetCurrentSong(); local vCourse = GAMESTATE:GetCurrentCourse(); diff --git a/Themes/default/Graphics/ScreenGameplay StageDisplay.lua b/Themes/default/Graphics/ScreenGameplay StageDisplay.lua index 6d3fa31919..fef14ae0b3 100644 --- a/Themes/default/Graphics/ScreenGameplay StageDisplay.lua +++ b/Themes/default/Graphics/ScreenGameplay StageDisplay.lua @@ -1,40 +1,44 @@ -local curScreen = Var "LoadingScreen"; -local curStage = GAMESTATE:GetCurrentStage(); -local curStageIndex = GAMESTATE:GetCurrentStageIndex(); -local tRemap = { - Stage_1st = 1, - Stage_2nd = 2, - Stage_3rd = 3, - Stage_4th = 4, - Stage_5th = 5, - Stage_6th = 6, -}; -if tRemap[curStage] == PREFSMAN:GetPreference("SongsPerPlay") then - curStage = "Stage_Final"; -end - -local t = Def.ActorFrame {}; - -t[#t+1] = Def.ActorFrame { - LoadActor(THEME:GetPathB("_frame","3x3"),"rounded black",64,16); - LoadFont("Common Normal") .. { - InitCommand=cmd(y,-1;shadowlength,1;playcommand,"Set"); - SetCommand=function(self) - if GAMESTATE:GetCurrentCourse() then - self:settext( GAMESTATE:GetCurrentStageIndex()+1 .. " / " .. GAMESTATE:GetCurrentCourse():GetEstimatedNumStages() ); - elseif GAMESTATE:IsEventMode() then - self:settextf("Stage %s", curStageIndex+1); - else - if THEME:GetMetric(curScreen,"StageDisplayUseShortString") then - self:settextf("%s", ToEnumShortString(curStage)); - else - self:settextf("%s Stage", ToEnumShortString(curStage)); - end; - end; - self:zoom(0.675); - self:diffuse(StageToColor(curStage)); - self:diffusetopedge(ColorLightTone(StageToColor(curStage))); - end; - }; -}; +local curScreen = Var "LoadingScreen"; +local curStage = GAMESTATE:GetCurrentStage(); +local curStageIndex = GAMESTATE:GetCurrentStageIndex(); +local tRemap = { + Stage_1st = 1, + Stage_2nd = 2, + Stage_3rd = 3, + Stage_4th = 4, + Stage_5th = 5, + Stage_6th = 6, +}; +if tRemap[curStage] == PREFSMAN:GetPreference("SongsPerPlay") then + curStage = "Stage_Final"; +end + +local t = Def.ActorFrame {}; + +t[#t+1] = Def.ActorFrame { + LoadActor(THEME:GetPathB("_frame","3x3"),"rounded black",64,16); + LoadFont("Common Normal") .. { + InitCommand=function(self) + self:y(-1); + self:shadowlength(1); + self:playcommand("Set"); + end; + SetCommand=function(self) + if GAMESTATE:GetCurrentCourse() then + self:settext( GAMESTATE:GetCurrentStageIndex()+1 .. " / " .. GAMESTATE:GetCurrentCourse():GetEstimatedNumStages() ); + elseif GAMESTATE:IsEventMode() then + self:settextf("Stage %s", curStageIndex+1); + else + if THEME:GetMetric(curScreen,"StageDisplayUseShortString") then + self:settextf("%s", ToEnumShortString(curStage)); + else + self:settextf("%s Stage", ToEnumShortString(curStage)); + end; + end; + self:zoom(0.675); + self:diffuse(StageToColor(curStage)); + self:diffusetopedge(ColorLightTone(StageToColor(curStage))); + end; + }; +}; return t \ No newline at end of file diff --git a/Themes/default/Graphics/ScreenNetSelectBase ChatInputBox.lua b/Themes/default/Graphics/ScreenNetSelectBase ChatInputBox.lua index 288b3b06bb..34e554a285 100644 --- a/Themes/default/Graphics/ScreenNetSelectBase ChatInputBox.lua +++ b/Themes/default/Graphics/ScreenNetSelectBase ChatInputBox.lua @@ -1,5 +1,8 @@ return Def.ActorFrame{ Def.Quad{ - InitCommand=cmd(zoomto,THEME:GetMetric(Var "LoadingScreen","ChatInputBoxWidth"),THEME:GetMetric(Var "LoadingScreen","ChatInputBoxHeight");diffuse,color("0,0,0,0.25")); + InitCommand=function(self) + self:zoomto(THEME:GetMetric(Var "LoadingScreen","ChatInputBoxWidth"), THEME:GetMetric(Var "LoadingScreen","ChatInputBoxHeight")); + self:diffuse(color("0,0,0,0.25")); + end; }; }; \ No newline at end of file diff --git a/Themes/default/Graphics/ScreenNetSelectBase ChatOutputBox.lua b/Themes/default/Graphics/ScreenNetSelectBase ChatOutputBox.lua index 31d73053d7..715d24ecde 100644 --- a/Themes/default/Graphics/ScreenNetSelectBase ChatOutputBox.lua +++ b/Themes/default/Graphics/ScreenNetSelectBase ChatOutputBox.lua @@ -1,5 +1,8 @@ return Def.ActorFrame{ Def.Quad{ - InitCommand=cmd(zoomto,THEME:GetMetric(Var "LoadingScreen","ChatOutputBoxWidth"),THEME:GetMetric(Var "LoadingScreen","ChatOutputBoxHeight");diffuse,color("0,0,0,0.25")); + InitCommand=function(self) + self:zoomto(THEME:GetMetric(Var "LoadingScreen","ChatOutputBoxWidth"), THEME:GetMetric(Var "LoadingScreen","ChatOutputBoxHeight")); + self:diffuse(color("0,0,0,0.25")); + end; }; }; \ No newline at end of file diff --git a/Themes/default/Graphics/ScreenSelectMusic BPMDisplay.lua b/Themes/default/Graphics/ScreenSelectMusic BPMDisplay.lua index 097e6e92da..d2634247a1 100644 --- a/Themes/default/Graphics/ScreenSelectMusic BPMDisplay.lua +++ b/Themes/default/Graphics/ScreenSelectMusic BPMDisplay.lua @@ -2,6 +2,10 @@ return Def.BPMDisplay { File=THEME:GetPathF("BPMDisplay", "bpm"); Name="BPMDisplay"; SetCommand=function(self) self:SetFromGameState() end; - CurrentSongChangedMessageCommand=cmd(playcommand,"Set"); - CurrentCourseChangedMessageCommand=cmd(playcommand,"Set"); + CurrentSongChangedMessageCommand=function(self) + self:playcommand("Set"); + end; + CurrentCourseChangedMessageCommand=function(self) + self:playcommand("Set"); + end; }; \ No newline at end of file diff --git a/Themes/default/Graphics/ScreenSelectMusic BPMLabel.lua b/Themes/default/Graphics/ScreenSelectMusic BPMLabel.lua index df55f18245..49746aee03 100644 --- a/Themes/default/Graphics/ScreenSelectMusic BPMLabel.lua +++ b/Themes/default/Graphics/ScreenSelectMusic BPMLabel.lua @@ -1,6 +1,10 @@ -return Def.ActorFrame { - LoadFont("Common Normal") .. { - Text="BPM"; - InitCommand=cmd(horizalign,right;zoom,0.75;strokecolor,Color("Outline")); - }; +return Def.ActorFrame { + LoadFont("Common Normal") .. { + Text="BPM"; + InitCommand=function(self) + self:horizalign(right); + self:zoom(0.75); + self:strokecolor(Color("Outline")); + end; + }; }; \ No newline at end of file diff --git a/Themes/default/Graphics/ScreenSelectMusic SongOptionsFrame.lua b/Themes/default/Graphics/ScreenSelectMusic SongOptionsFrame.lua index 19756a33bf..9051510181 100644 --- a/Themes/default/Graphics/ScreenSelectMusic SongOptionsFrame.lua +++ b/Themes/default/Graphics/ScreenSelectMusic SongOptionsFrame.lua @@ -1,3 +1,5 @@ return Def.Quad { - InitCommand=cmd(zoomto,SCREEN_WIDTH,64); + InitCommand=function(self) + self:zoomto(SCREEN_WIDTH,64); + end; }; \ No newline at end of file diff --git a/Themes/default/Graphics/ScreenSelectMusic SortOrderFrame.lua b/Themes/default/Graphics/ScreenSelectMusic SortOrderFrame.lua index 0abf8c6a8a..e360acd21c 100644 --- a/Themes/default/Graphics/ScreenSelectMusic SortOrderFrame.lua +++ b/Themes/default/Graphics/ScreenSelectMusic SortOrderFrame.lua @@ -1,8 +1,15 @@ return Def.ActorFrame { LoadActor(THEME:GetPathG("OptionRowExit","frame")) .. { - InitCommand=cmd(diffusebottomedge,Color("Orange")); + InitCommand=function(self) + self:diffusebottomedge(Color("Orange")); + end; }; LoadActor(THEME:GetPathG("_icon","Sort")) .. { - InitCommand=cmd(x,-60;shadowlength,1;diffuse,Color("Orange");diffusetopedge,Color("Yellow")); + InitCommand=function(self) + self:x(-60); + self:shadowlength(1); + self:diffuse(Color("Orange")); + self:diffusetopedge(Color("Yellow")); + end; }; }; \ No newline at end of file diff --git a/Themes/default/Graphics/ScreenSelectStyle Icon.lua b/Themes/default/Graphics/ScreenSelectStyle Icon.lua index 2c206d90f3..63fe840f6e 100644 --- a/Themes/default/Graphics/ScreenSelectStyle Icon.lua +++ b/Themes/default/Graphics/ScreenSelectStyle Icon.lua @@ -4,8 +4,12 @@ t[#t+1] = Def.ActorFrame { GainFocusCommand=THEME:GetMetric(Var "LoadingScreen","IconGainFocusCommand"); LoseFocusCommand=THEME:GetMetric(Var "LoadingScreen","IconLoseFocusCommand"); LoadActor(THEME:GetPathG("_SelectIcon",gc:GetName() )) .. { - DisabledCommand=cmd(diffuse,color("0.5,0.5,0.5,1")); - EnabledCommand=cmd(diffuse,color("1,1,1,1")); + DisabledCommand=function(self) + self:diffuse(color("0.5,0.5,0.5,1")); + end; + EnabledCommand=function(self) + self:diffuse(color("1,1,1,1")); + 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 c426ee610c..57843fc916 100644 --- a/Themes/default/Graphics/ScreenTitleMenu LifeDifficulty.lua +++ b/Themes/default/Graphics/ScreenTitleMenu LifeDifficulty.lua @@ -1,17 +1,29 @@ -return Def.ActorFrame { - LoadFont("Common Normal") .. { - Text=GetLifeDifficulty(); - AltText=""; - InitCommand=cmd(horizalign,left;zoom,0.675); - OnCommand=cmd(shadowlength,1); - BeginCommand=function(self) - self:settextf( Screen.String("LifeDifficulty"), "" ); - end - }; - LoadFont("Common Normal") .. { - Text=GetLifeDifficulty(); - AltText=""; - InitCommand=cmd(x,136;zoom,0.675;halign,0); - OnCommand=cmd(shadowlength,1;skewx,-0.125); - }; +return Def.ActorFrame { + LoadFont("Common Normal") .. { + Text=GetLifeDifficulty(); + AltText=""; + InitCommand=function(self) + self:horizalign(left); + self:zoom(0.675); + end; + OnCommand=function(self) + self:shadowlength(1); + end; + BeginCommand=function(self) + self:settextf( Screen.String("LifeDifficulty"), "" ); + end + }; + LoadFont("Common Normal") .. { + Text=GetLifeDifficulty(); + AltText=""; + InitCommand=function(self) + self:x(136); + self:zoom(0.675); + self:halign(0); + end; + OnCommand=function(self) + self:shadowlength(1); + self:skewx(-0.125); + end; + }; }; \ No newline at end of file diff --git a/Themes/default/Graphics/ScreenTitleMenu VersionInfo.lua b/Themes/default/Graphics/ScreenTitleMenu VersionInfo.lua index c566856ea0..2230fd580e 100644 --- a/Themes/default/Graphics/ScreenTitleMenu VersionInfo.lua +++ b/Themes/default/Graphics/ScreenTitleMenu VersionInfo.lua @@ -1,14 +1,25 @@ -return Def.ActorFrame { - LoadFont("Common Normal") .. { - Text=string.format("%s %s", ProductFamily(), ProductVersion()); - AltText="StepMania"; - InitCommand=cmd(zoom,0.675); - OnCommand=cmd(horizalign,right;shadowlength,1); - }; - LoadFont("Common Normal") .. { - Text=string.format("%s", VersionDate()); - AltText="Unknown Version"; - InitCommand=cmd(y,16;zoom,0.5); - OnCommand=cmd(horizalign,right;shadowlength,1); - }; +return Def.ActorFrame { + LoadFont("Common Normal") .. { + Text=string.format("%s %s", ProductFamily(), ProductVersion()); + AltText="StepMania"; + InitCommand=function(self) + self:zoom(0.675); + end; + OnCommand=function(self) + self:horizalign(right); + self:shadowlength(1); + end; + }; + LoadFont("Common Normal") .. { + Text=string.format("%s", VersionDate()); + AltText="Unknown Version"; + InitCommand=function(self) + self:y(16); + self:zoom(0.5); + end; + OnCommand=function(self) + self:horizalign(right); + self:shadowlength(1); + end; + }; }; \ No newline at end of file diff --git a/Themes/default/Graphics/ScreenTitleMenu cursor.lua b/Themes/default/Graphics/ScreenTitleMenu cursor.lua index 9e10a78ff3..d38c5f632b 100644 --- a/Themes/default/Graphics/ScreenTitleMenu cursor.lua +++ b/Themes/default/Graphics/ScreenTitleMenu cursor.lua @@ -1,7 +1,11 @@ local t = Def.ActorFrame { Def.Quad { - InitCommand=cmd(zoomto,32,32); - OnCommand=cmd(spin); + InitCommand=function(self) + self:zoomto(32, 32); + end; + OnCommand=function(self) + self:spin(); + end; }; }; diff --git a/Themes/default/Graphics/ScreenTitleMenu logo/default.lua b/Themes/default/Graphics/ScreenTitleMenu logo/default.lua index 4c80c37b0d..2756a02d08 100644 --- a/Themes/default/Graphics/ScreenTitleMenu logo/default.lua +++ b/Themes/default/Graphics/ScreenTitleMenu logo/default.lua @@ -1,15 +1,31 @@ -local t = Def.ActorFrame{ - InitCommand=cmd(fov,70); - LoadActor("_arrow")..{ - InitCommand=cmd(x,225;); - OnCommand=cmd(wag;effectmagnitude,0,0,16;effectperiod,2.5;); - }; - LoadActor("_text"); - LoadActor("_text")..{ - Name="TextGlow"; - InitCommand=cmd(blend,Blend.Add;diffusealpha,0.05;); - OnCommand=cmd(glowshift;effectperiod,2.5;effectcolor1,color("1,1,1,0.25");effectcolor2,color("1,1,1,1");); - }; -}; - -return t; +local t = Def.ActorFrame{ + InitCommand=function(self) + self:fov(70); + end; + LoadActor("_arrow")..{ + InitCommand=function(self) + self:x(225); + end; + OnCommand=function(self) + self:wag(); + self:effectmagnitude(0, 0, 16); + self:effectperiod(2.5); + end; + }; + LoadActor("_text"); + LoadActor("_text")..{ + Name="TextGlow"; + InitCommand=function(self) + self:blend(Blend.Add); + self:diffusealpha(0.05); + end; + OnCommand=function(self) + self:glowshift(); + self:effectperiod(2.5); + self:effectcolor1(color("1,1,1,0.25")); + self:effectcolor2(color("1,1,1,1")); + end; + }; +}; + +return t; diff --git a/Themes/default/Graphics/ScreenWithMenuElements Footer.lua b/Themes/default/Graphics/ScreenWithMenuElements Footer.lua index d351749af7..48e74fab1c 100644 --- a/Themes/default/Graphics/ScreenWithMenuElements Footer.lua +++ b/Themes/default/Graphics/ScreenWithMenuElements Footer.lua @@ -1,7 +1,11 @@ local t = Def.ActorFrame {}; t[#t+1] = Def.Quad { - InitCommand=cmd(vertalign,bottom;zoomto,SCREEN_WIDTH+1,34;diffuse,Color.Black); + InitCommand=function(self) + self:vertalign(bottom); + self:zoomto(SCREEN_WIDTH + 1, 34); + self:diffuse(Color.Black); + end; }; return t; \ No newline at end of file diff --git a/Themes/default/Graphics/ScreenWithMenuElements StageDisplay.lua b/Themes/default/Graphics/ScreenWithMenuElements StageDisplay.lua index e0baff0761..43451688dc 100644 --- a/Themes/default/Graphics/ScreenWithMenuElements StageDisplay.lua +++ b/Themes/default/Graphics/ScreenWithMenuElements StageDisplay.lua @@ -1,39 +1,42 @@ -local curScreen = Var "LoadingScreen"; -local curStage = GAMESTATE:GetCurrentStage(); -local curStageIndex = GAMESTATE:GetCurrentStageIndex(); -local t = Def.ActorFrame {}; - -t[#t+1] = Def.ActorFrame { - LoadActor(THEME:GetPathB("_frame","3x3"),"rounded black",64,12); - LoadFont("Common Normal") .. { - InitCommand=cmd(y,-1;shadowlength,1;); - BeginCommand=function(self) - local top = SCREENMAN:GetTopScreen() - if top then - if not string.find(top:GetName(),"ScreenEvaluation") then - curStageIndex = curStageIndex + 1 - end - end - self:playcommand("Set") - end; - SetCommand=function(self) - if GAMESTATE:GetCurrentCourse() then - self:settext( curStageIndex+1 .. " / " .. GAMESTATE:GetCurrentCourse():GetEstimatedNumStages() ); - elseif GAMESTATE:IsEventMode() then - self:settextf("Stage %s", curStageIndex); - else - if THEME:GetMetric(curScreen,"StageDisplayUseShortString") then - self:settextf("%s", ToEnumShortString(curStage)); - self:zoom(0.75); - else - self:settextf("%s Stage", ToEnumShortString(curStage)); - self:zoom(1); - end; - end; - -- StepMania is being stupid so we have to do this here; - self:diffuse(StageToColor(curStage)); - self:diffusetopedge(ColorLightTone(StageToColor(curStage))); - end; - }; -}; +local curScreen = Var "LoadingScreen"; +local curStage = GAMESTATE:GetCurrentStage(); +local curStageIndex = GAMESTATE:GetCurrentStageIndex(); +local t = Def.ActorFrame {}; + +t[#t+1] = Def.ActorFrame { + LoadActor(THEME:GetPathB("_frame","3x3"),"rounded black",64,12); + LoadFont("Common Normal") .. { + InitCommand=function(self) + self:y(-1); + self:shadowlength(1); + end; + BeginCommand=function(self) + local top = SCREENMAN:GetTopScreen() + if top then + if not string.find(top:GetName(),"ScreenEvaluation") then + curStageIndex = curStageIndex + 1 + end + end + self:playcommand("Set") + end; + SetCommand=function(self) + if GAMESTATE:GetCurrentCourse() then + self:settext( curStageIndex+1 .. " / " .. GAMESTATE:GetCurrentCourse():GetEstimatedNumStages() ); + elseif GAMESTATE:IsEventMode() then + self:settextf("Stage %s", curStageIndex); + else + if THEME:GetMetric(curScreen,"StageDisplayUseShortString") then + self:settextf("%s", ToEnumShortString(curStage)); + self:zoom(0.75); + else + self:settextf("%s Stage", ToEnumShortString(curStage)); + self:zoom(1); + end; + end; + -- StepMania is being stupid so we have to do this here; + self:diffuse(StageToColor(curStage)); + self:diffusetopedge(ColorLightTone(StageToColor(curStage))); + end; + }; +}; return t \ No newline at end of file diff --git a/Themes/default/Graphics/ScrollBar TickThumb.lua b/Themes/default/Graphics/ScrollBar TickThumb.lua index 0c8ff6249f..9bf0ec97c3 100644 --- a/Themes/default/Graphics/ScrollBar TickThumb.lua +++ b/Themes/default/Graphics/ScrollBar TickThumb.lua @@ -2,7 +2,9 @@ local t = Def.ActorFrame {}; t[#t+1] = Def.ActorFrame { Def.Quad { - InitCommand=cmd(zoomto,32,32); + InitCommand=function(self) + self:zoomto(32,32); + end; }; }; diff --git a/Themes/default/Graphics/StepsDisplay StepsType.lua b/Themes/default/Graphics/StepsDisplay StepsType.lua index 3afec31aee..70021e92a3 100644 --- a/Themes/default/Graphics/StepsDisplay StepsType.lua +++ b/Themes/default/Graphics/StepsDisplay StepsType.lua @@ -2,7 +2,9 @@ local sString; local t = Def.ActorFrame{ LoadFont("Common normal")..{ - InitCommand=cmd(shadowlength,1); + InitCommand=function(self) + self:shadowlength(1); + end; SetMessageCommand=function(self,param) if param.StepsType then sString = THEME:GetString("StepsDisplay StepsType",ToEnumShortString(param.StepsType)); @@ -15,15 +17,6 @@ local t = Def.ActorFrame{ end; end; }; - -- argh this isn't working as nicely as I would've hoped... - --[[ - Def.Sprite{ - SetMessageCommand=function(self,param) - self:Load( THEME:GetPathG("","_StepsType/"..ToEnumShortString(param.StepsType)) ); - self:diffusealpha(0.5); - end; - }; - --]] }; return t; \ No newline at end of file diff --git a/Themes/default/Graphics/StepsDisplay autogen/default.lua b/Themes/default/Graphics/StepsDisplay autogen/default.lua index 59ebf66c45..9b097fed8b 100644 --- a/Themes/default/Graphics/StepsDisplay autogen/default.lua +++ b/Themes/default/Graphics/StepsDisplay autogen/default.lua @@ -1,16 +1,31 @@ local t = Def.ActorFrame{}; t[#t+1] = LoadActor("_badge") .. { - InitCommand=cmd(shadowlength,1;diffuse,Color.Green;pulse;effectmagnitude,0.875,1,1;effecttiming,0,0,1,0 - effectclock,'beatnooffset';effectperiod,2); + InitCommand=function(self) + self:shadowlength(1); + self:diffuse(Color.Green); + self:pulse(); + self:effectmagnitude(0.875, 1, 1); + self:effecttiming(0, 0, 1, 0); + self:effectclock('beatnooffset'); + self:effectperiod(2); + end; }; t[#t+1] = Def.Quad { - InitCommand=cmd(zoomto,40,20;diffuse,Color.Black; - diffusealpha,0.5;fadeleft,0.25;faderight,0.25); + InitCommand=function(self) + self:zoomto(40, 20); + self:diffuse(Color.Black); + self:diffusealpha(0.5); + self:fadeleft(0.25); + self:faderight(0.25); + end; }; t[#t+1] = LoadFont("Common","Normal") .. { Text="AG"; - InitCommand=cmd(shadowlength,1;zoom,0.875); + InitCommand=function(self) + self:shadowlength(1); + self:zoom(0.875); + end; }; return t; \ No newline at end of file diff --git a/Themes/default/Graphics/StepsDisplayListRow StepsType.lua b/Themes/default/Graphics/StepsDisplayListRow StepsType.lua index d79262b22b..38892733b6 100644 --- a/Themes/default/Graphics/StepsDisplayListRow StepsType.lua +++ b/Themes/default/Graphics/StepsDisplayListRow StepsType.lua @@ -1,10 +1,12 @@ local sString; local t = Def.ActorFrame{ ---[[ LoadActor("TestStep") .. { - InitCommand=cmd(zoomto,20,20); - }; --]] LoadFont("Common normal")..{ - InitCommand=cmd(shadowlength,1;horizalign,left;zoom,0.45;skewx,-0.125); + InitCommand=function(self) + self:shadowlength(1); + self:horizalign(left); + self:zoom(0.45); + self:skewx(-0.125); + end; SetMessageCommand=function(self,param) sString = THEME:GetString("StepsListDisplayRow StepsType",ToEnumShortString(param.StepsType)); if param.Steps and param.Steps:IsAutogen() then @@ -15,15 +17,6 @@ local t = Def.ActorFrame{ self:settext( sString ); end; }; - -- argh this isn't working as nicely as I would've hoped... - --[[ - Def.Sprite{ - SetMessageCommand=function(self,param) - self:Load( THEME:GetPathG("","_StepsType/"..ToEnumShortString(param.StepsType)) ); - self:diffusealpha(0.5); - end; - }; - --]] }; return t; \ No newline at end of file diff --git a/Themes/default/Scripts/02 TextBanner.lua b/Themes/default/Scripts/02 TextBanner.lua index 7082e08e73..9625acd9cd 100644 --- a/Themes/default/Scripts/02 TextBanner.lua +++ b/Themes/default/Scripts/02 TextBanner.lua @@ -1,40 +1,36 @@ -local mainMaxWidth = 228; -- zoom w/subtitle is 0.75 (multiply by 1.25) -local subMaxWidth = 420; -- zoom is 0.6 (multiply zoom,1 value by 1.4) -local artistMaxWidth = 300/0.8; - ---[[ --- The old (cmd(blah))(Actor) syntax is hard to read. --- This is longer, but much easier to read. - Colby ---]] -function TextBannerAfterSet(self,param) - local Title = self:GetChild("Title") - local Subtitle = self:GetChild("Subtitle") - local Artist = self:GetChild("Artist") - - if Subtitle:GetText() == "" then - Title:maxwidth(mainMaxWidth) - Title:y(-8) - Title:zoom(1) - - -- hide so that the game skips drawing. - Subtitle:visible(false) - - Artist:zoom(0.66) - Artist:maxwidth(artistMaxWidth) - Artist:y(8) - else - Title:maxwidth(mainMaxWidth*1.25) - Title:y(-11) - Title:zoom(0.75) - - -- subtitle below title - Subtitle:visible(true) - Subtitle:zoom(0.6) - Subtitle:y(0) - Subtitle:maxwidth(subMaxWidth) - - Artist:zoom(0.6) - Artist:maxwidth(artistMaxWidth) - Artist:y(10) - end -end +local mainMaxWidth = 228; -- zoom w/subtitle is 0.75 (multiply by 1.25) +local subMaxWidth = 420; -- zoom is 0.6 (multiply zoom,1 value by 1.4) +local artistMaxWidth = 300/0.8; + +function TextBannerAfterSet(self,param) + local Title = self:GetChild("Title") + local Subtitle = self:GetChild("Subtitle") + local Artist = self:GetChild("Artist") + + if Subtitle:GetText() == "" then + Title:maxwidth(mainMaxWidth) + Title:y(-8) + Title:zoom(1) + + -- hide so that the game skips drawing. + Subtitle:visible(false) + + Artist:zoom(0.66) + Artist:maxwidth(artistMaxWidth) + Artist:y(8) + else + Title:maxwidth(mainMaxWidth*1.25) + Title:y(-11) + Title:zoom(0.75) + + -- subtitle below title + Subtitle:visible(true) + Subtitle:zoom(0.6) + Subtitle:y(0) + Subtitle:maxwidth(subMaxWidth) + + Artist:zoom(0.6) + Artist:maxwidth(artistMaxWidth) + Artist:y(10) + end +end diff --git a/Themes/default/metrics.ini b/Themes/default/metrics.ini index 62604795b4..5457fe08bc 100644 --- a/Themes/default/metrics.ini +++ b/Themes/default/metrics.ini @@ -1197,7 +1197,12 @@ DescriptionSetCommand=%function(self,param) \ self:diffuse(CustomDifficultyToColor(param.CustomDifficulty)); \ self:shadowcolor(CustomDifficultyToDarkColor(param.CustomDifficulty)); \ end; \ - (cmd(finishtweening;diffusealpha,0;addx,-4;smooth,0.125;addx,4;diffusealpha,1))(self); \ + self:finishtweening(); \ + self:diffusealpha(0); \ + self:addx(-4); \ + self:smooth(0.125); \ + self:addx(4); \ + self:diffusealpha(1); \ end; # ShowAutogen=false