diff --git a/Themes/default/BGAnimations/ScreenGameplay decorations/default.lua b/Themes/default/BGAnimations/ScreenGameplay decorations/default.lua index 0fd108f477..a8664db8b2 100644 --- a/Themes/default/BGAnimations/ScreenGameplay decorations/default.lua +++ b/Themes/default/BGAnimations/ScreenGameplay decorations/default.lua @@ -1,271 +1,238 @@ -local maxSegments = 150 - -local function CreateSegments(Player) - local t = Def.ActorFrame { }; - local bars = Def.ActorFrame{ Name="CoverBars" }; - local bpmFrame = Def.ActorFrame{ Name="BPMFrame"; }; - local stopFrame = Def.ActorFrame{ Name="StopFrame"; }; - local delayFrame = Def.ActorFrame{ Name="DelayFrame"; }; - local warpFrame = Def.ActorFrame{ Name="WarpFrame"; }; - local fakeFrame = Def.ActorFrame{ Name="FakeFrame"; }; - local scrollFrame = Def.ActorFrame{ Name="ScrollFrame"; }; - local speedFrame = Def.ActorFrame{ Name="SpeedFrame"; }; - - local fFrameWidth = 380; - local fFrameHeight = 8; - -- XXX: doesn't work in course mode -aj - if not GAMESTATE:IsSideJoined( Player ) then - return t - elseif not GAMESTATE:IsCourseMode() then - -- Straight rip off NCRX - local song = GAMESTATE:GetCurrentSong(); - local steps = GAMESTATE:GetCurrentSteps( Player ); - if steps then - local timingData = steps:GetTimingData(); - -- use the StepsSeconds, which will almost always be more proper - -- than a file with ITG2r21 compatibility. - if song then - local songLen = song:MusicLengthSeconds(); - - local firstBeatSecs = song:GetFirstSecond(); - local lastBeatSecs = song:GetLastSecond(); - - local bpms = timingData:GetBPMsAndTimes(); - local stops = timingData:GetStops(); - local delays = timingData:GetDelays(); - local warps = timingData:GetWarps(); - local fakes = timingData:GetFakes(); - local scrolls = timingData:GetScrolls(); - local speeds = timingData:GetSpeeds(); - - -- we don't want too many segments to be shown. - local sumSegments = #bpms + #stops + #delays + #warps + #fakes + #scrolls + #speeds - if sumSegments > maxSegments then - return Def.ActorFrame{} - end - - local function CreateLine(beat, secs, firstShadow, firstDiffuse, secondShadow, firstEffect, secondEffect) - local beatTime = timingData:GetElapsedTimeFromBeat(beat); - if beatTime < 0 then beatTime = 0; end; - return Def.ActorFrame { - Def.Quad { - InitCommand=function(self) - self:shadowlength(0); - self:shadowcolor(color(firstShadow)); - -- set width - self:zoomto(math.max((secs/songLen)*fFrameWidth, 1), fFrameHeight); - -- find location - self:x((scale(beatTime,firstBeatSecs,lastBeatSecs,-fFrameWidth/2,fFrameWidth/2))); - end; - OnCommand=function(self) - self:diffuse(color(firstDiffuse)); - end; - }; - --[[ there's a cool effect that can't happen because we don't fade out like we did before - Def.Quad { - InitCommand=function(self) - --self:diffuse(HSVA(192,1,0.8,0.8)); - self:shadowlength(0); - self:shadowcolor(color(secondShadow)); - -- set width - self:zoomto(math.max((secs/songLen)*fFrameWidth, 1),fFrameHeight); - -- find location - self:x((scale(beatTime,firstBeatSecs,lastBeatSecs,-fFrameWidth/2,fFrameWidth/2))); - end; - OnCommand=function(self) - self:diffusealpha(1); - self:diffuseshift(); - self:effectcolor1(color(firstEffect)); - self:effectcolor2(color(secondEffect)); - self:effectclock('beat'); - self:effectperiod(1/8); - -- - self:diffusealpha(0); - self:sleep(beatTime+1); - self:diffusealpha(1); - self:linear(4); - self:diffusealpha(0); - end; - };]] - }; - end; - - for i=2,#bpms do - local data = split("=",bpms[i]); - bpmFrame[#bpmFrame+1] = CreateLine(data[1], 0, - "#00808077", "#00808077", "#00808077", "#FF634777", "#FF000077"); - end; - - for i=1,#delays do - local data = split("=",delays[i]); - delayFrame[#delayFrame+1] = CreateLine(data[1], data[2], - "#FFFF0077", "#FFFF0077", "#FFFF0077", "#00FF0077", "#FF000077"); - end; - - for i=1,#stops do - local data = split("=",stops[i]); - stopFrame[#stopFrame+1] = CreateLine(data[1], data[2], - "#FFFFFF77", "#FFFFFF77", "#FFFFFF77", "#FFA50077", "#FF000077"); - end; - - for i=1,#scrolls do - local data = split("=",scrolls[i]); - scrollFrame[#scrollFrame+1] = CreateLine(data[1], 0, - "#4169E177", "#4169E177", "#4169E177", "#0000FF77", "#FF000077"); - end; - - for i=1,#speeds do - local data = split("=",speeds[i]); - -- TODO: Turn beats into seconds for this calculation? - speedFrame[#speedFrame+1] = CreateLine(data[1], 0, - "#ADFF2F77", "#ADFF2F77", "#ADFF2F77", "#7CFC0077", "#FF000077"); - end; - - for i=1,#warps do - local data = split("=",warps[i]); - warpFrame[#warpFrame+1] = CreateLine(data[1], 0, - "#CC00CC77", "#CC00CC77", "#CC00CC77", "#FF33CC77", "#FF000077"); - end; - - for i=1,#fakes do - local data = split("=",fakes[i]); - fakeFrame[#fakeFrame+1] = CreateLine(data[1], 0, - "#BC8F8F77", "#BC8F8F77", "#BC8F8F77", "#F4A46077", "#FF000077"); - end; - end; - bars[#bars+1] = bpmFrame; - bars[#bars+1] = scrollFrame; - bars[#bars+1] = speedFrame; - bars[#bars+1] = stopFrame; - bars[#bars+1] = delayFrame; - bars[#bars+1] = warpFrame; - bars[#bars+1] = fakeFrame; - t[#t+1] = bars; - --addition here: increase performance a ton by only rendering once - t[#t+1] = Def.ActorFrameTexture{Name="Target"} - t[#t+1] = Def.Sprite{Name="Actual"} - local FirstPass=true; - local function Draw(self) - kids=self:GetChildren(); - if FirstPass then - kids.Target:setsize(fFrameWidth,fFrameHeight); - kids.Target:EnableAlphaBuffer(true); - kids.Target:Create(); - - kids.Target:GetTexture():BeginRenderingTo(); - for k,v in pairs(kids) do - if k~="Target" and k~="Actual" then - v:Draw(); - end - end - kids.Target:GetTexture():FinishRenderingTo(); - - kids.Actual:SetTexture(kids.Target:GetTexture()); - FirstPass=false; - end - kids.Actual:Draw(); - end - t.InitCommand=function(self) self:SetDrawFunction(Draw); end - end - end - return t -end -local t = LoadFallbackB() -t[#t+1] = StandardDecorationFromFileOptional("ScoreFrame","ScoreFrame"); - -local function songMeterScale(val) return scale(val,0,1,-380/2,380/2) end - -for pn in ivalues(PlayerNumber) do - local MetricsName = "SongMeterDisplay" .. PlayerNumberToString(pn); - local songMeterDisplay = Def.ActorFrame{ - InitCommand=function(self) - self:player(pn); - self:name(MetricsName); - ActorUtil.LoadAllCommandsAndSetXY(self,Var "LoadingScreen"); - end; - Def.Quad { - InitCommand=function(self) - self:zoomto(420, 20); - end; - OnCommand=function(self) - self:fadeleft(0.35); - self:faderight(0.35); - self:diffuse(Color.Black); - self:diffusealpha(0.5); - end; - }; - LoadActor( THEME:GetPathG( 'SongMeterDisplay', 'frame ' .. PlayerNumberToString(pn) ) ) .. { - InitCommand=function(self) - self:name('Frame'); - ActorUtil.LoadAllCommandsAndSetXY(self,MetricsName); - end; - }; - Def.Quad { - InitCommand=function(self) - self:zoomto(2,8); - end; - OnCommand=function(self) - self:x(songMeterScale(0.25)); - self:diffuse(PlayerColor(pn)); - self:diffusealpha(0.5); - end; - }; - Def.Quad { - InitCommand=function(self) - self:zoomto(2,8); - end; - OnCommand=function(self) - self:x(songMeterScale(0.5)); - self:diffuse(PlayerColor(pn)); - self:diffusealpha(0.5); - end; - }; - Def.Quad { - InitCommand=function(self) - self:zoomto(2,8); - end; - OnCommand=function(self) - self:x(songMeterScale(0.75)); - self:diffuse(PlayerColor(pn)); - self:diffusealpha(0.5); - end; - }; - Def.SongMeterDisplay { - StreamWidth=THEME:GetMetric( MetricsName, 'StreamWidth' ); - Stream=LoadActor( THEME:GetPathG( 'SongMeterDisplay', 'stream ' .. PlayerNumberToString(pn) ) )..{ - InitCommand=function(self) - self:diffuse(PlayerColor(pn)); - self:diffusealpha(0.5); - self:blend(Blend.Add); - end; - }; - Tip=LoadActor( THEME:GetPathG( 'SongMeterDisplay', 'tip ' .. PlayerNumberToString(pn) ) ) .. { - InitCommand=function(self) - self:visible(false); - end; - }; - }; - }; - if ThemePrefs.Get("TimingDisplay") == true then - songMeterDisplay[#songMeterDisplay+1] = CreateSegments(pn); - end - t[#t+1] = songMeterDisplay -end; - -for pn in ivalues(PlayerNumber) do - local MetricsName = "ToastyDisplay" .. PlayerNumberToString(pn); - t[#t+1] = LoadActor( THEME:GetPathG("Player", 'toasty'), pn ) .. { - InitCommand=function(self) - self:player(pn); - self:name(MetricsName); - ActorUtil.LoadAllCommandsAndSetXY(self,Var "LoadingScreen"); - end; - }; -end; - - -t[#t+1] = StandardDecorationFromFileOptional("BPMDisplay","BPMDisplay"); -t[#t+1] = StandardDecorationFromFileOptional("StageDisplay","StageDisplay"); -t[#t+1] = StandardDecorationFromFileOptional("SongTitle","SongTitle"); - -return t +local maxSegments = 150 + +local function CreateSegments(Player) + local t = Def.ActorFrame { }; + local bars = Def.ActorFrame{ Name="CoverBars" }; + local bpmFrame = Def.ActorFrame{ Name="BPMFrame"; }; + local stopFrame = Def.ActorFrame{ Name="StopFrame"; }; + local delayFrame = Def.ActorFrame{ Name="DelayFrame"; }; + local warpFrame = Def.ActorFrame{ Name="WarpFrame"; }; + local fakeFrame = Def.ActorFrame{ Name="FakeFrame"; }; + local scrollFrame = Def.ActorFrame{ Name="ScrollFrame"; }; + local speedFrame = Def.ActorFrame{ Name="SpeedFrame"; }; + + local fFrameWidth = 380; + local fFrameHeight = 8; + -- XXX: doesn't work in course mode -aj + if not GAMESTATE:IsSideJoined( Player ) then + return t + elseif not GAMESTATE:IsCourseMode() then + -- Straight rip off NCRX + local song = GAMESTATE:GetCurrentSong(); + local steps = GAMESTATE:GetCurrentSteps( Player ); + if steps then + local timingData = steps:GetTimingData(); + -- use the StepsSeconds, which will almost always be more proper + -- than a file with ITG2r21 compatibility. + if song then + local songLen = song:MusicLengthSeconds(); + + local firstBeatSecs = song:GetFirstSecond(); + local lastBeatSecs = song:GetLastSecond(); + + local bpms = timingData:GetBPMsAndTimes(); + local stops = timingData:GetStops(); + local delays = timingData:GetDelays(); + local warps = timingData:GetWarps(); + local fakes = timingData:GetFakes(); + local scrolls = timingData:GetScrolls(); + local speeds = timingData:GetSpeeds(); + + -- we don't want too many segments to be shown. + local sumSegments = #bpms + #stops + #delays + #warps + #fakes + #scrolls + #speeds + if sumSegments > maxSegments then + return Def.ActorFrame{} + end + + local function CreateLine(beat, secs, firstShadow, firstDiffuse, secondShadow, firstEffect, secondEffect) + local beatTime = timingData:GetElapsedTimeFromBeat(beat); + if beatTime < 0 then beatTime = 0; end; + return Def.ActorFrame { + Def.Quad { + InitCommand=function(self) + self:shadowlength(0); + self:shadowcolor(color(firstShadow)); + -- set width + self:zoomto(math.max((secs/songLen)*fFrameWidth, 1), fFrameHeight); + -- find location + self:x((scale(beatTime,firstBeatSecs,lastBeatSecs,-fFrameWidth/2,fFrameWidth/2))); + end; + OnCommand=function(self) + self:diffuse(color(firstDiffuse)); + end; + }; + --[[ there's a cool effect that can't happen because we don't fade out like we did before + Def.Quad { + InitCommand=function(self) + --self:diffuse(HSVA(192,1,0.8,0.8)); + self:shadowlength(0); + self:shadowcolor(color(secondShadow)); + -- set width + self:zoomto(math.max((secs/songLen)*fFrameWidth, 1),fFrameHeight); + -- find location + self:x((scale(beatTime,firstBeatSecs,lastBeatSecs,-fFrameWidth/2,fFrameWidth/2))); + end; + OnCommand=function(self) + self:diffusealpha(1); + self:diffuseshift(); + self:effectcolor1(color(firstEffect)); + self:effectcolor2(color(secondEffect)); + self:effectclock('beat'); + self:effectperiod(1/8); + -- + self:diffusealpha(0); + self:sleep(beatTime+1); + self:diffusealpha(1); + self:linear(4); + self:diffusealpha(0); + end; + };]] + }; + end; + + for i=2,#bpms do + local data = split("=",bpms[i]); + bpmFrame[#bpmFrame+1] = CreateLine(data[1], 0, + "#00808077", "#00808077", "#00808077", "#FF634777", "#FF000077"); + end; + + for i=1,#delays do + local data = split("=",delays[i]); + delayFrame[#delayFrame+1] = CreateLine(data[1], data[2], + "#FFFF0077", "#FFFF0077", "#FFFF0077", "#00FF0077", "#FF000077"); + end; + + for i=1,#stops do + local data = split("=",stops[i]); + stopFrame[#stopFrame+1] = CreateLine(data[1], data[2], + "#FFFFFF77", "#FFFFFF77", "#FFFFFF77", "#FFA50077", "#FF000077"); + end; + + for i=1,#scrolls do + local data = split("=",scrolls[i]); + scrollFrame[#scrollFrame+1] = CreateLine(data[1], 0, + "#4169E177", "#4169E177", "#4169E177", "#0000FF77", "#FF000077"); + end; + + for i=1,#speeds do + local data = split("=",speeds[i]); + -- TODO: Turn beats into seconds for this calculation? + speedFrame[#speedFrame+1] = CreateLine(data[1], 0, + "#ADFF2F77", "#ADFF2F77", "#ADFF2F77", "#7CFC0077", "#FF000077"); + end; + + for i=1,#warps do + local data = split("=",warps[i]); + warpFrame[#warpFrame+1] = CreateLine(data[1], 0, + "#CC00CC77", "#CC00CC77", "#CC00CC77", "#FF33CC77", "#FF000077"); + end; + + for i=1,#fakes do + local data = split("=",fakes[i]); + fakeFrame[#fakeFrame+1] = CreateLine(data[1], 0, + "#BC8F8F77", "#BC8F8F77", "#BC8F8F77", "#F4A46077", "#FF000077"); + end; + end; + bars[#bars+1] = bpmFrame; + bars[#bars+1] = scrollFrame; + bars[#bars+1] = speedFrame; + bars[#bars+1] = stopFrame; + bars[#bars+1] = delayFrame; + bars[#bars+1] = warpFrame; + bars[#bars+1] = fakeFrame; + t[#t+1] = bars; + --addition here: increase performance a ton by only rendering once + t[#t+1] = Def.ActorFrameTexture{Name="Target"} + t[#t+1] = Def.Sprite{Name="Actual"} + local FirstPass=true; + local function Draw(self) + kids=self:GetChildren(); + if FirstPass then + kids.Target:setsize(fFrameWidth,fFrameHeight); + kids.Target:EnableAlphaBuffer(true); + kids.Target:Create(); + + kids.Target:GetTexture():BeginRenderingTo(); + for k,v in pairs(kids) do + if k~="Target" and k~="Actual" then + v:Draw(); + end + end + kids.Target:GetTexture():FinishRenderingTo(); + + kids.Actual:SetTexture(kids.Target:GetTexture()); + FirstPass=false; + end + kids.Actual:Draw(); + end + t.InitCommand=function(self) self:SetDrawFunction(Draw); end + end + end + return t +end +local t = LoadFallbackB() +t[#t+1] = StandardDecorationFromFileOptional("ScoreFrame","ScoreFrame"); + +local function songMeterScale(val) return scale(val,0,1,-380/2,380/2) end + +for pn in ivalues(PlayerNumber) do + local MetricsName = "SongMeterDisplay" .. PlayerNumberToString(pn); + local songMeterDisplay = Def.ActorFrame{ + InitCommand=function(self) + self:player(pn); + self:name(MetricsName); + ActorUtil.LoadAllCommandsAndSetXY(self,Var "LoadingScreen"); + end; + Def.Quad { + InitCommand=cmd(zoomto,420,20); + OnCommand=cmd(fadeleft,0.35;faderight,0.35;diffuse,Color.Black;diffusealpha,0.5); + }; + LoadActor( THEME:GetPathG( 'SongMeterDisplay', 'frame ' .. PlayerNumberToString(pn) ) ) .. { + InitCommand=function(self) + self:name('Frame'); + ActorUtil.LoadAllCommandsAndSetXY(self,MetricsName); + end; + }; + Def.Quad { + InitCommand=cmd(zoomto,2,8); + OnCommand=cmd(x,songMeterScale(0.25);diffuse,PlayerColor(pn);diffusealpha,0.5); + }; + Def.Quad { + InitCommand=cmd(zoomto,2,8); + OnCommand=cmd(x,songMeterScale(0.5);diffuse,PlayerColor(pn);diffusealpha,0.5); + }; + Def.Quad { + InitCommand=cmd(zoomto,2,8); + OnCommand=cmd(x,songMeterScale(0.75);diffuse,PlayerColor(pn);diffusealpha,0.5); + }; + Def.SongMeterDisplay { + StreamWidth=THEME:GetMetric( MetricsName, 'StreamWidth' ); + Stream=LoadActor( THEME:GetPathG( 'SongMeterDisplay', 'stream ' .. PlayerNumberToString(pn) ) )..{ + InitCommand=cmd(diffuse,PlayerColor(pn);diffusealpha,0.5;blend,Blend.Add;); + }; + Tip=LoadActor( THEME:GetPathG( 'SongMeterDisplay', 'tip ' .. PlayerNumberToString(pn) ) ) .. { InitCommand=cmd(visible,false); }; + }; + }; + if ThemePrefs.Get("TimingDisplay") == true then + songMeterDisplay[#songMeterDisplay+1] = CreateSegments(pn); + end + t[#t+1] = songMeterDisplay +end; + +for pn in ivalues(PlayerNumber) do + local MetricsName = "ToastyDisplay" .. PlayerNumberToString(pn); + t[#t+1] = LoadActor( THEME:GetPathG("Player", 'toasty'), pn ) .. { + InitCommand=function(self) + self:player(pn); + self:name(MetricsName); + ActorUtil.LoadAllCommandsAndSetXY(self,Var "LoadingScreen"); + end; + }; +end; + + +t[#t+1] = StandardDecorationFromFileOptional("BPMDisplay","BPMDisplay"); +t[#t+1] = StandardDecorationFromFileOptional("StageDisplay","StageDisplay"); +t[#t+1] = StandardDecorationFromFileOptional("SongTitle","SongTitle"); + +return t diff --git a/Themes/default/BGAnimations/ScreenGameplay failed/default.lua b/Themes/default/BGAnimations/ScreenGameplay failed/default.lua index 24c6423ad1..4b99a97346 100644 --- a/Themes/default/BGAnimations/ScreenGameplay failed/default.lua +++ b/Themes/default/BGAnimations/ScreenGameplay failed/default.lua @@ -1,76 +1,31 @@ -local longFail = ThemePrefs.Get("LongFail"); - -local t = Def.ActorFrame{}; - -if longFail then - t[#t+1] = Def.Quad{ - InitCommand=function(self) - self:FullScreen(); - self:diffuse(color("1,0,0,0")); - self:blend(Blend.Multiply); - end; - OnCommand=function(self) - self:decelerate(1.25); - self:diffuse(color("0.75,0,0,0.75")); - self:linear(7); - self:diffuse(color("0,0,0,1")); - self:sleep(1.25); - self:linear(1); - self:diffuse(color("1,0,0,1")); - self:decelerate(2); - self:diffuse(color("0,0,0,1")); - end; - }; - t[#t+1] = Def.Quad{ - InitCommand=function(self) - self:FullScreen(); - self:diffuse(color("1,1,1,1")); - self:diffusealpha(0); - end; - OnCommand=function(self) - self:finishtweening(); - self:diffusealpha(1); - self:decelerate(1.25); - self:diffuse(color("1,0,0,0")); - end; - }; - t[#t+1] = LoadActor(THEME:GetPathS( "ScreenGameplayAlternate", "failed" ) ) .. { - StartTransitioningCommand=function(self) - self:play(); - end; - }; -else - t[#t+1] = Def.Quad{ - 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; - }; - t[#t+1] = Def.Quad{ - InitCommand=function(self) - self:FullScreen(); - self:diffuse(color("1,1,1,1")); - self:diffusealpha(0); - end; - OnCommand=function(self) - self:finishtweening(); - self:diffusealpha(1); - self:decelerate(1.25); - self:diffuse(color("1,0,0,0")); - end; - }; - t[#t+1] = LoadActor(THEME:GetPathS( Var "LoadingScreen", "failed" ) ) .. { - StartTransitioningCommand=function(self) - self:play(); - end; - }; -end; - +local longFail = ThemePrefs.Get("LongFail"); + +local t = Def.ActorFrame{}; + +if longFail then + t[#t+1] = Def.Quad{ + InitCommand=cmd(FullScreen;diffuse,color("1,0,0,0");blend,Blend.Multiply); + OnCommand=cmd(decelerate,1.25;diffuse,color("0.75,0,0,0.75");linear,7;diffuse,color("0,0,0,1");sleep,1.25;linear,1;diffuse,color("1,0,0,1");decelerate,2;diffuse,color("0,0,0,1")); + }; + t[#t+1] = Def.Quad{ + InitCommand=cmd(FullScreen;diffuse,color("1,1,1,1");diffusealpha,0); + OnCommand=cmd(finishtweening;diffusealpha,1;decelerate,1.25;diffuse,color("1,0,0,0")); + }; + t[#t+1] = LoadActor(THEME:GetPathS( "ScreenGameplayAlternate", "failed" ) ) .. { + StartTransitioningCommand=cmd(play); + }; +else + t[#t+1] = 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")); + }; + t[#t+1] = Def.Quad{ + InitCommand=cmd(FullScreen;diffuse,color("1,1,1,1");diffusealpha,0); + OnCommand=cmd(finishtweening;diffusealpha,1;decelerate,1.25;diffuse,color("1,0,0,0")); + }; + t[#t+1] = LoadActor(THEME:GetPathS( Var "LoadingScreen", "failed" ) ) .. { + StartTransitioningCommand=cmd(play); + }; +end; + return t; \ No newline at end of file diff --git a/Themes/default/BGAnimations/ScreenGameplay next course song/default.lua b/Themes/default/BGAnimations/ScreenGameplay next course song/default.lua index 97f4b2b008..6cdb2900c2 100644 --- a/Themes/default/BGAnimations/ScreenGameplay next course song/default.lua +++ b/Themes/default/BGAnimations/ScreenGameplay next course song/default.lua @@ -1,82 +1,39 @@ -local t = Def.ActorFrame{}; - -if not GAMESTATE:IsCourseMode() then return t; end; - -t[#t+1] = Def.Sprite { - InitCommand=function(self) - self:Center(); - end; - BeforeLoadingNextCourseSongMessageCommand=function(self) self:LoadFromSongBackground( SCREENMAN:GetTopScreen():GetNextCourseSong() ) end; - ChangeCourseSongInMessageCommand=function(self) - self:scale_or_crop_background(); - end; - StartCommand=function(self) - self:diffusealpha(0); - self:decelerate(0.5); - self:diffusealpha(1); - end; - FinishCommand=function(self) - self:linear(0.1); - self:glow(Color.Alpha(Color("White"),0.5)); - self:decelerate(0.4); - self:glow(Color("Invisible")); - self:diffusealpha(0); - end; -}; - -t[#t+1] = Def.ActorFrame { - InitCommand=function(self) - self:Center(); - end; - OnCommand=function(self) - self:stoptweening(); - self:addx(30); - self:linear(3); - self:addx(-30); - end; - LoadFont("Common Normal") .. { - InitCommand=function(self) - self:strokecolor(Color("Outline")); - self:y(-10); - end; - BeforeLoadingNextCourseSongMessageCommand=function(self) - local NextSong = SCREENMAN:GetTopScreen():GetNextCourseSong(); - self:settext( NextSong:GetDisplayFullTitle() ); - end; - StartCommand=function(self) - self:faderight(1); - self:diffusealpha(0); - self:linear(0.5); - self:faderight(0); - self:diffusealpha(1); - self:sleep(1.5); - self:linear(0.5); - self:diffusealpha(0); - end; - }; - LoadFont("Common Normal") .. { - InitCommand=function(self) - self:strokecolor(Color("Outline")); - self:diffuse(Color("Orange")); - self:diffusebottomedge(Color("Yellow")); - self:zoom(0.75); - self:y(10); - end; - BeforeLoadingNextCourseSongMessageCommand=function(self) - local NextSong = SCREENMAN:GetTopScreen():GetNextCourseSong(); - self:settext( SecondsToMSSMsMs( NextSong:MusicLengthSeconds() ) ); - end; - StartCommand=function(self) - self:faderight(1); - self:diffusealpha(0); - self:linear(0.5); - self:faderight(0); - self:diffusealpha(1); - self:sleep(1.5); - self:linear(0.5); - self:diffusealpha(0); - end; - }; -}; - +local t = Def.ActorFrame{}; + +if not GAMESTATE:IsCourseMode() then return t; end; + +t[#t+1] = Def.Sprite { + InitCommand=cmd(Center); + BeforeLoadingNextCourseSongMessageCommand=function(self) self:LoadFromSongBackground( SCREENMAN:GetTopScreen():GetNextCourseSong() ) end; + ChangeCourseSongInMessageCommand=cmd(scale_or_crop_background); + StartCommand=cmd(diffusealpha,0;decelerate,0.5;diffusealpha,1;); + FinishCommand=cmd(linear,0.1;glow,Color.Alpha(Color("White"),0.5);decelerate,0.4;glow,Color("Invisible");diffusealpha,0); +}; + +t[#t+1] = Def.ActorFrame { + InitCommand=cmd(Center); + OnCommand=cmd(stoptweening;addx,30;linear,3;addx,-30); + LoadFont("Common Normal") .. { + InitCommand=cmd(strokecolor,Color("Outline");y,-10); + BeforeLoadingNextCourseSongMessageCommand=function(self) + local NextSong = SCREENMAN:GetTopScreen():GetNextCourseSong(); + self:settext( NextSong:GetDisplayFullTitle() ); + end; + StartCommand=cmd(faderight,1;diffusealpha,0;linear,0.5;faderight,0;diffusealpha,1;sleep,1.5;linear,0.5;diffusealpha,0); + }; +--[[ LoadFont("Common Normal") .. { + Text=GAMESTATE:IsCourseMode() and GAMESTATE:GetCurrentCourse():GetCourseType() or GAMESTATE:GetCurrentSong():GetDisplayArtist(); + InitCommand=cmd(strokecolor,Color("Outline");zoom,0.75); + OnCommand=cmd(faderight,1;diffusealpha,0;linear,0.5;faderight,0;diffusealpha,1;sleep,1.5;linear,0.5;diffusealpha,0); + }; --]] + LoadFont("Common Normal") .. { + InitCommand=cmd(strokecolor,Color("Outline");diffuse,Color("Orange");diffusebottomedge,Color("Yellow");zoom,0.75;y,10); + BeforeLoadingNextCourseSongMessageCommand=function(self) + local NextSong = SCREENMAN:GetTopScreen():GetNextCourseSong(); + self:settext( SecondsToMSSMsMs( NextSong:MusicLengthSeconds() ) ); + end; + StartCommand=cmd(faderight,1;diffusealpha,0;linear,0.5;faderight,0;diffusealpha,1;sleep,1.5;linear,0.5;diffusealpha,0); + }; +}; + return t; \ No newline at end of file diff --git a/Themes/default/BGAnimations/ScreenGameplay out.lua b/Themes/default/BGAnimations/ScreenGameplay out.lua index a6463beb2d..5ce91f80e6 100644 --- a/Themes/default/BGAnimations/ScreenGameplay out.lua +++ b/Themes/default/BGAnimations/ScreenGameplay out.lua @@ -3,10 +3,7 @@ local raveChildren local bg = Def.ActorFrame{ Def.Quad{ InitCommand=cmd(FullScreen;diffuse,color("0,0,0,0")); - OnCommand=function(self) - self:linear(5); - self:diffusealpha(1); - end; + OnCommand=cmd(linear,5;diffusealpha,1); }; Def.ActorFrame{ @@ -34,54 +31,18 @@ local bg = Def.ActorFrame{ LoadActor(THEME:GetPathG("_rave result","P1"))..{ Name="P1Win"; - InitCommand=function(self) - self:Center(); - self:cropbottom(1); - self:fadebottom(1); - end; - OnCommand=function(self) - self:sleep(2); - self:linear(0.5); - self:cropbottom(0); - self:fadebottom(0); - self:sleep(1.75); - self:linear(0.25); - self:diffusealpha(0); - end; + InitCommand=cmd(Center;cropbottom,1;fadebottom,1;); + OnCommand=cmd(sleep,2;linear,0.5;cropbottom,0;fadebottom,0;sleep,1.75;linear,0.25;diffusealpha,0); }; LoadActor(THEME:GetPathG("_rave result","P2"))..{ Name="P2Win"; - InitCommand=function(self) - self:Center(); - self:cropbottom(1); - self:fadebottom(1); - end; - OnCommand=function(self) - self:sleep(2); - self:linear(0.5); - self:cropbottom(0); - self:fadebottom(0); - self:sleep(1.75); - self:linear(0.25); - self:diffusealpha(0); - end; + InitCommand=cmd(Center;cropbottom,1;fadebottom,1;); + OnCommand=cmd(sleep,2;linear,0.5;cropbottom,0;fadebottom,0;sleep,1.75;linear,0.25;diffusealpha,0); }; LoadActor(THEME:GetPathG("_rave result","draw"))..{ Name="Draw"; - InitCommand=function(self) - self:Center(); - self:cropbottom(1); - self:fadebottom(1); - end; - OnCommand=function(self) - self:sleep(2); - self:linear(0.5); - self:cropbottom(0); - self:fadebottom(0); - self:sleep(1.75); - self:linear(0.25); - self:diffusealpha(0); - end; + InitCommand=cmd(Center;cropbottom,1;fadebottom,1;); + OnCommand=cmd(sleep,2;linear,0.5;cropbottom,0;fadebottom,0;sleep,1.75;linear,0.25;diffusealpha,0); }; }; }; diff --git a/Themes/default/BGAnimations/ScreenHowToPlay overlay/default.lua b/Themes/default/BGAnimations/ScreenHowToPlay overlay/default.lua index 957f60502f..eecab8257d 100644 --- a/Themes/default/BGAnimations/ScreenHowToPlay overlay/default.lua +++ b/Themes/default/BGAnimations/ScreenHowToPlay overlay/default.lua @@ -1,292 +1,75 @@ -return Def.ActorFrame { - Def.ActorFrame { - OnCommand=function(self) - self:x(SCREEN_CENTER_X-20); - end; - - -- Initial glow around receptors - LoadActor("tapglow") .. { - OnCommand=function(self) - self:x(85); - self:y(95); - self:zoom(0.7); - self:rotationz(90); - self:diffuseshift(); - self:effectcolor1(1, 0.93333, 0.266666, 0.4); - self:effectcolor2(1, 1, 1, 1); - self:effectperiod(0.25); - self:effectmagnitude(0, 1, 0); - self:diffusealpha(0); - self:sleep(6); - self:linear(0); - self:diffusealpha(1); - self:sleep(1.7); - self:linear(0); - self:diffusealpha(0); - end; - }; - LoadActor("tapglow") .. { - OnCommand=function(self) - self:x(275); - self:y(95); - self:zoom(0.7); - self:rotationz(270); - self:diffuseshift(); - self:effectcolor1(1, 0.93333, 0.266666, 0.4); - self:effectcolor2(1, 1, 1, 1); - self:effectperiod(0.25); - self:effectmagnitude(0, 1, 0); - self:diffusealpha(0); - self:sleep(6); - self:linear(0); - self:diffusealpha(1); - self:sleep(1.7); - self:linear(0); - self:diffusealpha(0); - end; - }; - LoadActor("tapglow") .. { - OnCommand=function(self) - self:x(212); - self:y(95); - self:zoom(0.7); - self:rotationz(180); - self:diffuseshift(); - self:effectcolor1(1, 0.93333, 0.266666, 0.4); - self:effectcolor2(1, 1, 1, 1); - self:effectperiod(0.25); - self:effectmagnitude(0, 1, 0); - self:diffusealpha(0); - self:sleep(6); - self:linear(0); - self:diffusealpha(1); - self:sleep(1.7); - self:linear(0); - self:diffusealpha(0); - end; - }; - LoadActor("tapglow") .. { - OnCommand=function(self) - self:x(148); - self:y(95); - self:zoom(0.7); - self:diffuseshift(); - self:effectcolor1(1, 0.93333, 0.266666, 0.4); - self:effectcolor2(1, 1, 1, 1); - self:effectperiod(0.25); - self:effectmagnitude(0, 1, 0); - self:diffusealpha(0); - self:sleep(6); - self:linear(0); - self:diffusealpha(1); - self:sleep(1.7); - self:linear(0); - self:diffusealpha(0); - end; - }; - - LoadActor("tapglow") .. { - OnCommand=function(self) - self:x(148); - self:y(95); - self:zoom(0.7); - self:diffuseshift(); - self:effectcolor1(1, 0.93333, 0.266666, 0.4); - self:effectcolor2(1, 1, 1, 1); - self:effectperiod(0.25); - self:effectmagnitude(0, 1, 0); - self:diffusealpha(0); - self:sleep(9.7); - self:linear(0); - self:diffusealpha(1); - self:sleep(1.7); - self:linear(0); - self:diffusealpha(0); - end; - }; - - -- 2nd step UP - LoadActor("tapglow") .. { - OnCommand=function(self) - self:x(212); - self:y(95); - self:zoom(0.7); - self:rotationz(180); - self:diffuseshift(); - self:effectcolor1(1, 0.93333, 0.266666, 0.4); - self:effectcolor2(1, 1, 1, 1); - self:effectperiod(0.25); - self:effectmagnitude(0, 1, 0); - self:diffusealpha(0); - self:sleep(12.7); - self:linear(0); - self:diffusealpha(1); - self:sleep(1.7); - self:linear(0); - self:diffusealpha(0); - end; - }; - - -- 3rd step UP - LoadActor("tapglow") .. { - OnCommand=function(self) - self:x(84); - self:y(95); - self:zoom(0.7); - self:rotationz(90); - self:diffuseshift(); - self:effectcolor1(1, 0.93333, 0.266666, 0.4); - self:effectcolor2(1, 1, 1, 1); - self:effectperiod(0.25); - self:effectmagnitude(0, 1, 0); - self:diffusealpha(0); - self:sleep(15.7); - self:linear(0); - self:diffusealpha(1); - self:sleep(1.7); - self:linear(0); - self:diffusealpha(0); - end; - }; - - -- 4th step jump - LoadActor("tapglow") .. { - OnCommand=function(self) - self:x(85); - self:y(95); - self:zoom(0.7); - self:rotationz(90); - self:diffuseshift(); - self:effectcolor1(1, 0.93333, 0.266666, 0.4); - self:effectcolor2(1, 1, 1, 1); - self:effectperiod(0.25); - self:effectmagnitude(0, 1, 0); - self:diffusealpha(0); - self:sleep(18.7); - self:linear(0); - self:diffusealpha(1); - self:sleep(1.7); - self:linear(0); - self:diffusealpha(0); - end; - }; - LoadActor("tapglow") .. { - OnCommand=function(self) - self:x(275); - self:y(95); - self:zoom(0.7); - self:rotationz(270); - self:diffuseshift(); - self:effectcolor1(1, 0.93333, 0.266666, 0.4); - self:effectcolor2(1, 1, 1, 1); - self:effectperiod(0.25); - self:effectmagnitude(0, 1, 0); - self:diffusealpha(0); - self:sleep(18.7); - self:linear(0); - self:diffusealpha(1); - self:sleep(1.7); - self:linear(0); - self:diffusealpha(0); - end; - }; - - -- miss step - LoadActor("healthhilight") .. { - OnCommand=function(self) - self:x(180); - self:y(40); - self:zoom(0.7); - self:diffuseshift(); - self:effectcolor1(1, 0.93333, 0.266666, 0.4); - self:effectcolor2(1, 1, 1, 1); - self:effectperiod(0.25); - self:effectmagnitude(0, 1, 0); - self:diffusealpha(0); - self:sleep(22.7); - self:linear(0); - self:diffusealpha(1); - self:sleep(1.7); - self:linear(0); - self:diffusealpha(0); - end; - }; - }; - - -- messages - LoadFont("Common Normal") .. { - Text=ScreenString("How To Play StepMania"), - InitCommand=function(self) - self:zbuffer(1); - self:z(20); - self:x(SCREEN_CENTER_X); - self:y(SCREEN_CENTER_Y); - self:shadowlength(1); - self:strokecolor(Color("Outline")); - end; - OnCommand=function(self) - self:diffusealpha(0); - self:zoom(4); - self:sleep(0.0); - self:linear(0.3); - self:diffusealpha(1); - self:zoom(1); - self:sleep(1.8); - self:linear(0.3); - self:zoom(0.75); - self:x(170); - self:y(60); - end; - }; - LoadActor("feet") .. { - OnCommand=function(self) - self:z(20); - self:x(SCREEN_CENTER_X); - self:y(SCREEN_CENTER_Y); - self:addx(-SCREEN_WIDTH); - self:sleep(2.4); - self:decelerate(0.3); - self:addx(SCREEN_WIDTH); - self:sleep(2); - self:linear(0.3); - self:zoomy(0); - end; - }; - - LoadActor("_message tap")..{ - OnCommand=function(self) - self:sleep(6); - self:queuecommand("Show"); - end; - }; - LoadActor("_message tap")..{ - OnCommand=function(self) - self:sleep(9.7); - self:queuecommand("Show"); - end; - }; - LoadActor("_message tap")..{ - OnCommand=function(self) - self:sleep(12.7); - self:queuecommand("Show"); - end; - }; - LoadActor("_message tap")..{ - OnCommand=function(self) - self:sleep(15.7); - self:queuecommand("Show"); - end; - }; - LoadActor("_message jump")..{ - OnCommand=function(self) - self:sleep(18.7); - self:queuecommand("Show"); - end; - }; - LoadActor("_message miss")..{ - OnCommand=function(self) - self:sleep(22.7); - self:queuecommand("Show"); - end; - }; -}; +return Def.ActorFrame { + Def.ActorFrame { + OnCommand=cmd(x,SCREEN_CENTER_X-20); + + -- Initial glow around receptors + LoadActor("tapglow") .. { + OnCommand=cmd(x,85;y,95;zoom,0.7;rotationz,90;diffuseshift;effectcolor1,1,0.93333,0.266666,0.4;effectcolor2,1,1,1,1;effectperiod,0.25;effectmagnitude,0,1,0;diffusealpha,0;sleep,6;linear,0;diffusealpha,1;sleep,1.7;linear,0;diffusealpha,0); + }; + LoadActor("tapglow") .. { + OnCommand=cmd(x,275;y,95;zoom,0.7;rotationz,270;diffuseshift;effectcolor1,1,0.93333,0.266666,0.4;effectcolor2,1,1,1,1;effectperiod,0.25;effectmagnitude,0,1,0;diffusealpha,0;sleep,6;linear,0;diffusealpha,1;sleep,1.7;linear,0;diffusealpha,0); + }; + LoadActor("tapglow") .. { + OnCommand=cmd(x,212;y,95;zoom,0.7;rotationz,180;diffuseshift;effectcolor1,1,0.93333,0.266666,0.4;effectcolor2,1,1,1,1;effectperiod,0.25;effectmagnitude,0,1,0;diffusealpha,0;sleep,6;linear,0;diffusealpha,1;sleep,1.7;linear,0;diffusealpha,0); + }; + LoadActor("tapglow") .. { + OnCommand=cmd(x,148;y,95;zoom,0.7;diffuseshift;effectcolor1,1,0.93333,0.266666,0.4;effectcolor2,1,1,1,1;effectperiod,0.25;effectmagnitude,0,1,0;diffusealpha,0;sleep,6;linear,0;diffusealpha,1;sleep,1.7;linear,0;diffusealpha,0); + }; + + LoadActor("tapglow") .. { + OnCommand=cmd(x,148;y,95;zoom,0.7;diffuseshift;effectcolor1,1,0.93333,0.266666,0.4;effectcolor2,1,1,1,1;effectperiod,0.25;effectmagnitude,0,1,0;diffusealpha,0;sleep,9.7;linear,0;diffusealpha,1;sleep,1.7;linear,0;diffusealpha,0); + }; + + -- 2nd step UP + LoadActor("tapglow") .. { + OnCommand=cmd(x,212;y,95;zoom,0.7;rotationz,180;diffuseshift;effectcolor1,1,0.93333,0.266666,0.4;effectcolor2,1,1,1,1;effectperiod,0.25;effectmagnitude,0,1,0;diffusealpha,0;sleep,12.7;linear,0;diffusealpha,1;sleep,1.7;linear,0;diffusealpha,0); + }; + + -- 3rd step UP + LoadActor("tapglow") .. { + OnCommand=cmd(x,84;y,95;zoom,0.7;rotationz,90;diffuseshift;effectcolor1,1,0.93333,0.266666,0.4;effectcolor2,1,1,1,1;effectperiod,0.25;effectmagnitude,0,1,0;diffusealpha,0;sleep,15.7;linear,0;diffusealpha,1;sleep,1.7;linear,0;diffusealpha,0); + }; + + -- 4th step jump + LoadActor("tapglow") .. { + OnCommand=cmd(x,85;y,95;zoom,0.7;rotationz,90;diffuseshift;effectcolor1,1,0.93333,0.266666,0.4;effectcolor2,1,1,1,1;effectperiod,0.25;effectmagnitude,0,1,0;diffusealpha,0;sleep,18.7;linear,0;diffusealpha,1;sleep,1.7;linear,0;diffusealpha,0); + }; + LoadActor("tapglow") .. { + OnCommand=cmd(x,275;y,95;zoom,0.7;rotationz,270;diffuseshift;effectcolor1,1,0.93333,0.266666,0.4;effectcolor2,1,1,1,1;effectperiod,0.25;effectmagnitude,0,1,0;diffusealpha,0;sleep,18.7;linear,0;diffusealpha,1;sleep,1.7;linear,0;diffusealpha,0); + }; + + -- miss step + LoadActor("healthhilight") .. { + OnCommand=cmd(x,180;y,40;diffuseshift;effectcolor1,1,0.93333,0.266666,0.4;effectcolor2,1,1,1,1;effectperiod,0.25;effectmagnitude,0,1,0;diffusealpha,0;sleep,22.7;linear,0;diffusealpha,1;sleep,1.7;linear,0;diffusealpha,0); + }; + }; + + -- messages + LoadFont("Common Normal") .. { + Text=ScreenString("How To Play StepMania"), + InitCommand=cmd(zbuffer,1;z,20;x,SCREEN_CENTER_X;y,SCREEN_CENTER_Y;shadowlength,1;strokecolor,Color("Outline")); + OnCommand=cmd(diffusealpha,0;zoom,4;sleep,0.0;linear,0.3;diffusealpha,1;zoom,1;sleep,1.8;linear,0.3;zoom,0.75;x,170;y,60); + }; + LoadActor("feet") .. { + OnCommand=cmd(z,20;x,SCREEN_CENTER_X;y,SCREEN_CENTER_Y;addx,-SCREEN_WIDTH;sleep,2.4;decelerate,0.3;addx,SCREEN_WIDTH;sleep,2;linear,0.3;zoomy,0); + }; + + LoadActor("_message tap")..{ + OnCommand=cmd(sleep,6;queuecommand,"Show"); + }; + LoadActor("_message tap")..{ + OnCommand=cmd(sleep,9.7;queuecommand,"Show"); + }; + LoadActor("_message tap")..{ + OnCommand=cmd(sleep,12.7;queuecommand,"Show"); + }; + LoadActor("_message tap")..{ + OnCommand=cmd(sleep,15.7;queuecommand,"Show"); + }; + LoadActor("_message jump")..{ + OnCommand=cmd(sleep,18.7;queuecommand,"Show"); + }; + LoadActor("_message miss")..{ + OnCommand=cmd(sleep,22.7;queuecommand,"Show"); + }; +}; diff --git a/Themes/default/BGAnimations/ScreenPlayerOptions background.lua b/Themes/default/BGAnimations/ScreenPlayerOptions background.lua index 2691439958..083901796c 100644 --- a/Themes/default/BGAnimations/ScreenPlayerOptions background.lua +++ b/Themes/default/BGAnimations/ScreenPlayerOptions background.lua @@ -1,41 +1,33 @@ -local t = Def.ActorFrame {}; - -t[#t+1] = Def.ActorFrame { - InitCommand=function(self) - self:Center(); -end; - Def.Sprite { - Condition=not GAMESTATE:IsCourseMode(); - 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(48/480); - self:cropbottom(48/480); - 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; - }; -}; +local t = Def.ActorFrame {}; + +t[#t+1] = Def.ActorFrame { + InitCommand=cmd(Center); + Def.Sprite { + Condition=not GAMESTATE:IsCourseMode(); + 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(); + (cmd(fadebottom,0.25;fadetop,0.25;croptop,48/480;cropbottom,48/480))(self); + 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,Color.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); + }; +}; return t \ No newline at end of file diff --git a/Themes/default/BGAnimations/ScreenPlayerOptions out.lua b/Themes/default/BGAnimations/ScreenPlayerOptions out.lua index d294a8ff85..3f9c2a7856 100644 --- a/Themes/default/BGAnimations/ScreenPlayerOptions out.lua +++ b/Themes/default/BGAnimations/ScreenPlayerOptions out.lua @@ -6,47 +6,33 @@ local t = Def.ActorFrame { LoadActor( THEME:GetPathB("Screen", "out") ); LoadFont( "common normal" ) .. { - InitCommand=function(self) - self:settext("Press &START; for more options"); - self:x(SCREEN_CENTER_X); - self:y(SCREEN_CENTER_Y + 100); - self:visible(false); - end; - AskForGoToOptionsCommand=function(self) - self:visible(true); - self:diffusealpha(0); - self:linear(0.15); - self:zoomy(1); - self:diffusealpha(1); - self:sleep(1); - self:linear(0.15); - self:diffusealpha(0); - self:zoomy(0); - end; - GoToOptionsCommand=function(self) - self:visible(false); - end; + InitCommand=cmd(settext,"Press &START; for more options";x,SCREEN_CENTER_X;y,SCREEN_CENTER_Y+100;visible,false); + AskForGoToOptionsCommand=cmd( + visible,true; + diffusealpha,0; + linear,0.15; + zoomy,1; + diffusealpha,1; + sleep,1; + linear,0.15; + diffusealpha,0; + zoomy,0; + ); + GoToOptionsCommand=cmd(visible,false); }; LoadFont( "common normal" ) .. { - InitCommand=function(self) - self:settext("entering options..."); - self:x(SCREEN_CENTER_X); - self:y(SCREEN_CENTER_Y + 100); - self:visible(false); - end; - AskForGoToOptionsCommand=function(self) - self:visible(false); - self:linear(0.15); - self:zoomy(1); - self:diffusealpha(1); - self:sleep(1); - self:linear(0.15); - self:diffusealpha(0); - self:zoomy(0); - end; - GoToOptionsCommand=function(self) - self:visible(true); - end; + InitCommand=cmd(settext,"entering options...";x,SCREEN_CENTER_X;y,SCREEN_CENTER_Y+100;visible,false); + AskForGoToOptionsCommand=cmd( + visible,false; + linear,0.15; + zoomy,1; + diffusealpha,1; + sleep,1; + linear,0.15; + diffusealpha,0; + zoomy,0; + ); + GoToOptionsCommand=cmd(visible,true); }; }; diff --git a/Themes/default/BGAnimations/ScreenSelectMusic decorations/default.lua b/Themes/default/BGAnimations/ScreenSelectMusic decorations/default.lua index 0f3b9a8118..5d724f32b8 100644 --- a/Themes/default/BGAnimations/ScreenSelectMusic decorations/default.lua +++ b/Themes/default/BGAnimations/ScreenSelectMusic decorations/default.lua @@ -7,9 +7,7 @@ local function StepsDisplay(pn) end local t = Def.StepsDisplay { - InitCommand=function(self) - self:Load("StepsDisplay", GAMESTATE:GetPlayerState(pn)); - end; + InitCommand=cmd(Load,"StepsDisplay",GAMESTATE:GetPlayerState(pn);); }; if pn == PLAYER_1 then @@ -26,13 +24,8 @@ t[#t+1] = StandardDecorationFromFileOptional("AlternateHelpDisplay","AlternateHe local function PercentScore(pn) local t = LoadFont("Common normal")..{ - InitCommand=function(self) - self:zoom(0.625); - self:shadowlength(1); - end; - BeginCommand=function(self) - self:playcommand("Set"); - end; + InitCommand=cmd(zoom,0.625;shadowlength,1); + BeginCommand=cmd(playcommand,"Set"); SetCommand=function(self) local SongOrCourse, StepsOrTrail; if GAMESTATE:IsCourseMode() then @@ -79,28 +72,16 @@ local function PercentScore(pn) end; self:settext(text); end; - CurrentSongChangedMessageCommand=function(self) - self:playcommand("Set"); - end; - CurrentCourseChangedMessageCommand=function(self) - self:playcommand("Set"); - end; + CurrentSongChangedMessageCommand=cmd(playcommand,"Set"); + CurrentCourseChangedMessageCommand=cmd(playcommand,"Set"); }; if pn == PLAYER_1 then - t.CurrentStepsP1ChangedMessageCommand=function(self) - self:playcommand("Set"); - end; - t.CurrentTrailP1ChangedMessageCommand=function(self) - self:playcommand("Set"); - end; + t.CurrentStepsP1ChangedMessageCommand=cmd(playcommand,"Set"); + t.CurrentTrailP1ChangedMessageCommand=cmd(playcommand,"Set"); else - t.CurrentStepsP2ChangedMessageCommand=function(self) - self:playcommand("Set"); - end; - t.CurrentTrailP2ChangedMessageCommand=function(self) - self:playcommand("Set"); - end; + t.CurrentStepsP2ChangedMessageCommand=cmd(playcommand,"Set"); + t.CurrentTrailP2ChangedMessageCommand=cmd(playcommand,"Set"); end return t; @@ -114,16 +95,13 @@ for pn in ivalues(PlayerNumber) do PlayerJoinedMessageCommand=function(self, params) if params.Player == pn then self:visible(true); - self:zoom(0); - self:bounceend(0.3); - self:zoom(1); + (cmd(zoom,0;bounceend,0.3;zoom,1))(self); end; end; PlayerUnjoinedMessageCommand=function(self, params) if params.Player == pn then self:visible(true); - self:bouncebegin(0.3); - self:zoom(0); + (cmd(bouncebegin,0.3;zoom,0))(self); end; end; }; @@ -181,18 +159,10 @@ t[#t+1] = StandardDecorationFromFileOptional("SongTime","SongTime") .. { end; self:settext( SecondsToMSS(length) ); end; - CurrentSongChangedMessageCommand=function(self) - self:playcommand("Set"); - end; - CurrentCourseChangedMessageCommand=function(self) - self:playcommand("Set"); - end; - CurrentTrailP1ChangedMessageCommand=function(self) - self:playcommand("Set"); - end; - CurrentTrailP2ChangedMessageCommand=function(self) - self:playcommand("Set"); - end; + CurrentSongChangedMessageCommand=cmd(playcommand,"Set"); + CurrentCourseChangedMessageCommand=cmd(playcommand,"Set"); + CurrentTrailP1ChangedMessageCommand=cmd(playcommand,"Set"); + CurrentTrailP2ChangedMessageCommand=cmd(playcommand,"Set"); } if not GAMESTATE:IsCourseMode() then @@ -228,37 +198,20 @@ if not GAMESTATE:IsCourseMode() then end; end; t[#t+1] = Def.ActorFrame { - OnCommand=function(self) - self:draworder(105); - self:x(SCREEN_CENTER_X-76); - self:y(SCREEN_CENTER_Y-72); - self:zoomy(0); - self:sleep(0.5); - self:decelerate(0.25); - self:zoomy(1); - self:SetUpdateFunction(CDTitleUpdate); - end; - OffCommand=function(self) - self:bouncebegin(0.15); - self:zoomx(0); - end; + OnCommand=cmd(draworder,105;x,SCREEN_CENTER_X-76;y,SCREEN_CENTER_Y-72;zoomy,0;sleep,0.5;decelerate,0.25;zoomy,1;SetUpdateFunction,CDTitleUpdate); + OffCommand=cmd(bouncebegin,0.15;zoomx,0); Def.Sprite { Name="CDTitle"; - InitCommand=function(self) - self:y(19); - end; + InitCommand=cmd(y,19); + --OnCommand=cmd(draworder,106;shadowlength,1;zoom,0.75;diffusealpha,1;zoom,0;bounceend,0.35;zoom,0.75;spin;effectmagnitude,0,180,0); }; }; t[#t+1] = StandardDecorationFromFileOptional("NewSong","NewSong") .. { - InitCommand=function(self) - self:playcommand("Set"); - end; - BeginCommand=function(self) - self:playcommand("Set"); - end; - CurrentSongChangedMessageCommand=function(self) - self:playcommand("Set"); - end; + -- ShowCommand=THEME:GetMetric(Var "LoadingScreen", "NewSongShowCommand" ); + -- HideCommand=THEME:GetMetric(Var "LoadingScreen", "NewSongHideCommand" ); + InitCommand=cmd(playcommand,"Set"); + BeginCommand=cmd(playcommand,"Set"); + CurrentSongChangedMessageCommand=cmd(playcommand,"Set"); SetCommand=function(self) -- local pTargetProfile; local sSong; @@ -279,9 +232,7 @@ end; if GAMESTATE:IsCourseMode() then t[#t+1] = StandardDecorationFromFileOptional("NumCourseSongs","NumCourseSongs")..{ - InitCommand=function(self) - self:horizalign(right); - end; + InitCommand=cmd(horizalign,right); SetCommand=function(self) local curSelection= nil; local sAppend = ""; @@ -298,23 +249,23 @@ if GAMESTATE:IsCourseMode() then self:visible(false); end; end; - CurrentCourseChangedMessageCommand=function(self) - self:playcommand("Set"); - end; + CurrentCourseChangedMessageCommand=cmd(playcommand,"Set"); }; end t[#t+1] = StandardDecorationFromFileOptional("DifficultyDisplay","DifficultyDisplay"); t[#t+1] = StandardDecorationFromFileOptional("SortOrderFrame","SortOrderFrame") .. { - +--[[ BeginCommand=cmd(playcommand,"Set"); + SortOrderChangedMessageCommand=cmd(playcommand,"Set";); + SetCommand=function(self) + local s = SortOrderToLocalizedString( GAMESTATE:GetSortOrder() ); + self:settext( s ); + self:playcommand("Sort"); + end; --]] }; t[#t+1] = StandardDecorationFromFileOptional("SortOrder","SortOrderText") .. { - BeginCommand=function(self) - self:playcommand("Set"); - end; - SortOrderChangedMessageCommand=function(self) - self:playcommand("Set"); - end; + BeginCommand=cmd(playcommand,"Set"); + SortOrderChangedMessageCommand=cmd(playcommand,"Set";); SetCommand=function(self) local s = SortOrderToLocalizedString( GAMESTATE:GetSortOrder() ); self:settext( s ); @@ -334,15 +285,10 @@ t[#t+1] = StandardDecorationFromFileOptional("SongOptions","SongOptionsText") .. -- Sounds t[#t+1] = Def.ActorFrame { LoadActor(THEME:GetPathS("_switch","up")) .. { - SelectMenuOpenedMessageCommand=function(self) - self:playcommand("Set"); - end; + SelectMenuOpenedMessageCommand=cmd(stop;play); }; LoadActor(THEME:GetPathS("_switch","down")) .. { - SelectMenuClosedMessageCommand=function(self) - self:stop(); - self:play(); - end; + SelectMenuClosedMessageCommand=cmd(stop;play); }; }; diff --git a/Themes/default/BGAnimations/ScreenSelectProfile overlay.lua b/Themes/default/BGAnimations/ScreenSelectProfile overlay.lua index 466ae0e109..cfb0b93c71 100644 --- a/Themes/default/BGAnimations/ScreenSelectProfile overlay.lua +++ b/Themes/default/BGAnimations/ScreenSelectProfile overlay.lua @@ -10,21 +10,10 @@ function GetLocalProfiles() }; --]] LoadFont("Common Normal") .. { Text=profile:GetDisplayName(); - InitCommand=function(self) - self:shadowlength(1); - self:y(-10); - self:zoom(1); - self:ztest(true); - end; + InitCommand=cmd(shadowlength,1;y,-10;zoom,1;ztest,true); }; LoadFont("Common Normal") .. { - InitCommand=function(self) - self:shadowlength(1); - self:y(8); - self:zoom(0.5); - self:vertspacing(-8); - self:ztest(true); - end; + InitCommand=cmd(shadowlength,1;y,8;zoom,0.5;vertspacing,-8;ztest,true); BeginCommand=function(self) local numSongsPlayed = profile:GetNumTotalSongsPlayed(); local s = numSongsPlayed == 1 and "Song" or "Songs"; @@ -41,9 +30,7 @@ end; function LoadCard(cColor) local t = Def.ActorFrame { LoadActor( THEME:GetPathG("ScreenSelectProfile","CardBackground") ) .. { - InitCommand=function(self) - self:diffuse(cColor); - end; + InitCommand=cmd(diffuse,cColor); }; LoadActor( THEME:GetPathG("ScreenSelectProfile","CardFrame") ); }; @@ -70,14 +57,8 @@ function LoadPlayerStuff(Player) }; --]] LoadFont("Common Normal") .. { Text=THEME:GetString("ScreenSelectProfile","PressStart"); - InitCommand=function(self) - self:shadowlength(1); - end; - OnCommand=function(self) - self:diffuseshift(); - self:effectcolor1(Color('White')); - self:effectcolor2(color("0.5,0.5,0.5")); - end; + InitCommand=cmd(shadowlength,1); + OnCommand=cmd(diffuseshift;effectcolor1,Color('White');effectcolor2,color("0.5,0.5,0.5")); }; }; table.insert( ret, t ); @@ -96,45 +77,20 @@ function LoadPlayerStuff(Player) InitCommand=cmd(y,-2); Def.Quad { - InitCommand=function(self) - self:zoomto(200-10, 40+2); - end; - OnCommand=function(self) - self:diffuse(Color('Black')); - self:diffusealpha(0.5); - end; + InitCommand=cmd(zoomto,200-10,40+2); + OnCommand=cmd(diffuse,Color('Black');diffusealpha,0.5); }; Def.Quad { - InitCommand=function(self) - self:zoomto(200-10, 40); - end; - OnCommand=function(self) - self:diffuse(PlayerColor(Player)); - self:fadeleft(0.25); - self:faderight(0.25); - self:glow(color("1,1,1,0.25")); - end; + InitCommand=cmd(zoomto,200-10,40); + OnCommand=cmd(diffuse,PlayerColor(Player);fadeleft,0.25;faderight,0.25;glow,color("1,1,1,0.25")); }; Def.Quad { - InitCommand=function(self) - self:zoomto(200-10, 40); - self:y(-40 / 2 + 20); - end; - OnCommand=function(self) - self:diffuse(Color("Black")); - self:fadebottom(1); - self:diffusealpha(0.35); - end; + InitCommand=cmd(zoomto,200-10,40;y,-40/2+20); + OnCommand=cmd(diffuse,Color("Black");fadebottom,1;diffusealpha,0.35); }; Def.Quad { - InitCommand=function(self) - self:zoomto(200 - 10, 1); - self:y(-40 / 2 + 1); - end; - OnCommand=function(self) - self:diffuse(PlayerColor(Player)); - self:glow(color("1,1,1,0.25")); - end; + InitCommand=cmd(zoomto,200-10,1;y,-40/2+1); + OnCommand=cmd(diffuse,PlayerColor(Player);glow,color("1,1,1,0.25")); }; }; table.insert( ret, t ); diff --git a/Themes/default/BGAnimations/ScreenStageInformation underlay/CourseDisplay.lua b/Themes/default/BGAnimations/ScreenStageInformation underlay/CourseDisplay.lua index a0ed509f1d..e6d2d39cee 100644 --- a/Themes/default/BGAnimations/ScreenStageInformation underlay/CourseDisplay.lua +++ b/Themes/default/BGAnimations/ScreenStageInformation underlay/CourseDisplay.lua @@ -1,49 +1,32 @@ -if not GAMESTATE:IsCourseMode() then return Def.ActorFrame{} end; -- short circuit -local course = GAMESTATE:GetCurrentCourse() - -local t = Def.ActorFrame{ - -- background - Def.Sprite{ - InitCommand=function(self) - self:(Center); - end; - BeginCommand=function(self) - if course:GetBackgroundPath() then - self:Load( course:GetBackgroundPath() ) - else - -- default to the BG of the first song in the course - self:LoadFromCurrentSongBackground() - end - end; - OnCommand=function(self) - self:diffusealpha(0); - self:scale_or_crop_background(); - self:sleep(0.5); - self:linear(0.50); - self:diffusealpha(1); - self:sleep(3); - end; - }; - -- alternate background - Def.Sprite{ - InitCommand=function(self) - self:(Center); - end; - BeginCommand=function(self) - self:LoadFromCurrentSongBackground(); - self:scale_or_crop_background(); - self:diffusealpha(0); - OnCommand=function(self) - self:sleep(4); - self:playcommand("Show"); - end; - ShowCommand=function(self) - if course:HasBackground() then - self:accelerate(0.25) - self:diffusealpha(1) - end - end; - }; -}; - +if not GAMESTATE:IsCourseMode() then return Def.ActorFrame{} end; -- short circuit +local course = GAMESTATE:GetCurrentCourse() + +local t = Def.ActorFrame{ + -- background + Def.Sprite{ + InitCommand=cmd(Center); + BeginCommand=function(self) + if course:GetBackgroundPath() then + self:Load( course:GetBackgroundPath() ) + else + -- default to the BG of the first song in the course + self:LoadFromCurrentSongBackground() + end + end; + OnCommand=cmd(diffusealpha,0;scale_or_crop_background;sleep,0.5;linear,0.50;diffusealpha,1;sleep,3); + }; + -- alternate background + Def.Sprite{ + InitCommand=cmd(Center;); + BeginCommand=cmd(LoadFromCurrentSongBackground;scale_or_crop_background;diffusealpha,0); + OnCommand=cmd(sleep,4;playcommand,"Show"); + ShowCommand=function(self) + if course:HasBackground() then + self:accelerate(0.25) + self:diffusealpha(1) + end + end; + }; +}; + return t; \ No newline at end of file diff --git a/Themes/default/BGAnimations/ScreenStageInformation underlay/default.lua b/Themes/default/BGAnimations/ScreenStageInformation underlay/default.lua index 640610829a..cac3d01897 100644 --- a/Themes/default/BGAnimations/ScreenStageInformation underlay/default.lua +++ b/Themes/default/BGAnimations/ScreenStageInformation underlay/default.lua @@ -1,166 +1,99 @@ -local playMode = GAMESTATE:GetPlayMode() - -local sStage = "" -sStage = GAMESTATE:GetCurrentStage() - -if playMode ~= 'PlayMode_Regular' and playMode ~= 'PlayMode_Rave' and playMode ~= 'PlayMode_Battle' then - sStage = playMode; -end; - -if not (GAMESTATE:IsCourseMode() or GAMESTATE:IsExtraStage() or GAMESTATE:IsExtraStage2()) then - local tRemap = { - Stage_Event = 0, - Stage_1st = 1, - Stage_2nd = 2, - Stage_3rd = 3, - Stage_4th = 4, - Stage_5th = 5, - Stage_6th = 6, - }; - - local nSongCount = tRemap[sStage] + (GAMESTATE:GetCurrentSong():GetStageCost()-1); - - if nSongCount >= PREFSMAN:GetPreference("SongsPerPlay") then - sStage = "Stage_Final"; - else - sStage = sStage; - end; -end; - -local t = Def.ActorFrame {}; -t[#t+1] = Def.Quad { - InitCommand=function(self) - self:Center(); - self:zoomto(SCREEN_WIDTH, SCREEN_HEIGHT); - self:diffuse(Color("Black")); - end; -}; -if GAMESTATE:IsCourseMode() then - t[#t+1] = LoadActor("CourseDisplay"); -else - t[#t+1] = Def.Sprite { - InitCommand=function(self) - self:Center(); - self:diffusealpha(0); - 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:sleep(0.5) - self:linear(0.50) - self:diffusealpha(1) - self:sleep(3) - end; - }; -end - -t[#t+1] = Def.ActorFrame { - InitCommand=function(self) - self:x(SCREEN_CENTER_X); - self:y(SCREEN_CENTER_Y); - end; - OnCommand=function(self) - self:stoptweening(); - self:zoom(1.25); - self:decelerate(3); - self:zoom(1); - end; - - LoadActor( THEME:GetPathG("ScreenStageInformation", "Stage " .. ToEnumShortString(sStage) ) ) .. { - OnCommand=function(self) - self:diffusealpha(0); - self:linear(0.25); - self:diffusealpha(1); - self:sleep(1.75); - self:linear(0.5); - self:zoomy(0); - self:zoomx(2); - self:diffusealpha(0); - end; - }; -}; - -t[#t+1] = Def.ActorFrame { - InitCommand=function(self) - self:x(SCREEN_CENTER_X); - self:y(SCREEN_CENTER_Y + 96); - end; - OnCommand=function(self) - self:stoptweening(); - self:addy(-16); - self:decelerate(3); - self:addy(16); - end; - LoadFont("Common Normal") .. { - Text=GAMESTATE:IsCourseMode() and GAMESTATE:GetCurrentCourse():GetDisplayFullTitle() or GAMESTATE:GetCurrentSong():GetDisplayFullTitle(); - InitCommand=function(self) - self:strokecolor(Color("Outline")); - self:y(-20); - end; - OnCommand=function(self) - self:diffusealpha(0); - self:linear(0.5); - self:diffusealpha(1); - self:sleep(1.5); - self:linear(0.5); - self:diffusealpha(0); - end; - }; - LoadFont("Common Normal") .. { - Text=GAMESTATE:IsCourseMode() and ToEnumShortString( GAMESTATE:GetCurrentCourse():GetCourseType() ) or GAMESTATE:GetCurrentSong():GetDisplayArtist(); - InitCommand=function(self) - self:strokecolor(Color("Outline")); - self:zoom(0.75); - end; - OnCommand=function(self) - self:diffusealpha(0); - self:linear(0.5); - self:diffusealpha(1); - self:sleep(1.5); - self:linear(0.5); - self:diffusealpha(0); - end; - }; - LoadFont("Common Normal") .. { - InitCommand=function(self) - self:strokecolor(Color("Outline")); - self:diffuse(Color("Orange")); - self:diffusebottomedge(Color("Yellow")); - self:zoom(0.75); - self:y(20); - end; - BeginCommand=function(self) - local text = ""; - local SongOrCourse; - if GAMESTATE:IsCourseMode() then - local trail = GAMESTATE:GetCurrentTrail(GAMESTATE:GetMasterPlayerNumber()); - SongOrCourse = GAMESTATE:GetCurrentCourse(); - if SongOrCourse:GetEstimatedNumStages() == 1 then - text = SongOrCourse:GetEstimatedNumStages() .." Stage / ".. SecondsToMSSMsMs( TrailUtil.GetTotalSeconds(trail) ); - else - text = SongOrCourse:GetEstimatedNumStages() .." Stages / ".. SecondsToMSSMsMs( TrailUtil.GetTotalSeconds(trail) ); - end - else - SongOrCourse = GAMESTATE:GetCurrentSong(); - text = SecondsToMSSMsMs( SongOrCourse:MusicLengthSeconds() ); - end; - self:settext(text); - end; - OnCommand=function(self) - self:diffusealpha(0); - self:linear(0.5); - self:diffusealpha(1); - self:sleep(1.5); - self:linear(0.5); - self:diffusealpha(0); - end; - }; -}; - -return t +local playMode = GAMESTATE:GetPlayMode() + +local sStage = "" +sStage = GAMESTATE:GetCurrentStage() + +if playMode ~= 'PlayMode_Regular' and playMode ~= 'PlayMode_Rave' and playMode ~= 'PlayMode_Battle' then + sStage = playMode; +end; + +if not (GAMESTATE:IsCourseMode() or GAMESTATE:IsExtraStage() or GAMESTATE:IsExtraStage2()) then + local tRemap = { + Stage_Event = 0, + Stage_1st = 1, + Stage_2nd = 2, + Stage_3rd = 3, + Stage_4th = 4, + Stage_5th = 5, + Stage_6th = 6, + }; + + local nSongCount = tRemap[sStage] + (GAMESTATE:GetCurrentSong():GetStageCost()-1); + + if nSongCount >= PREFSMAN:GetPreference("SongsPerPlay") then + sStage = "Stage_Final"; + else + sStage = sStage; + end; +end; + +local t = Def.ActorFrame {}; +t[#t+1] = Def.Quad { + InitCommand=cmd(Center;zoomto,SCREEN_WIDTH,SCREEN_HEIGHT;diffuse,Color("Black")); +}; +if GAMESTATE:IsCourseMode() then + t[#t+1] = LoadActor("CourseDisplay"); +else + t[#t+1] = Def.Sprite { + InitCommand=cmd(Center;diffusealpha,0); + 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:sleep(0.5) + self:linear(0.50) + self:diffusealpha(1) + self:sleep(3) + end; + }; +end + +t[#t+1] = Def.ActorFrame { + InitCommand=cmd(x,SCREEN_CENTER_X;y,SCREEN_CENTER_Y); + OnCommand=cmd(stoptweening;zoom,1.25;decelerate,3;zoom,1); + + LoadActor( THEME:GetPathG("ScreenStageInformation", "Stage " .. ToEnumShortString(sStage) ) ) .. { + OnCommand=cmd(diffusealpha,0;linear,0.25;diffusealpha,1;sleep,1.75;linear,0.5;zoomy,0;zoomx,2;diffusealpha,0); + }; +}; + +t[#t+1] = Def.ActorFrame { + InitCommand=cmd(x,SCREEN_CENTER_X;y,SCREEN_CENTER_Y+96); + OnCommand=cmd(stoptweening;addy,-16;decelerate,3;addy,16); + LoadFont("Common Normal") .. { + Text=GAMESTATE:IsCourseMode() and GAMESTATE:GetCurrentCourse():GetDisplayFullTitle() or GAMESTATE:GetCurrentSong():GetDisplayFullTitle(); + InitCommand=cmd(strokecolor,Color("Outline");y,-20); + OnCommand=cmd(diffusealpha,0;linear,0.5;diffusealpha,1;sleep,1.5;linear,0.5;diffusealpha,0); + }; + LoadFont("Common Normal") .. { + Text=GAMESTATE:IsCourseMode() and ToEnumShortString( GAMESTATE:GetCurrentCourse():GetCourseType() ) or GAMESTATE:GetCurrentSong():GetDisplayArtist(); + InitCommand=cmd(strokecolor,Color("Outline");zoom,0.75); + OnCommand=cmd(diffusealpha,0;linear,0.5;diffusealpha,1;sleep,1.5;linear,0.5;diffusealpha,0); + }; + LoadFont("Common Normal") .. { + InitCommand=cmd(strokecolor,Color("Outline");diffuse,Color("Orange");diffusebottomedge,Color("Yellow");zoom,0.75;y,20); + BeginCommand=function(self) + local text = ""; + local SongOrCourse; + if GAMESTATE:IsCourseMode() then + local trail = GAMESTATE:GetCurrentTrail(GAMESTATE:GetMasterPlayerNumber()); + SongOrCourse = GAMESTATE:GetCurrentCourse(); + if SongOrCourse:GetEstimatedNumStages() == 1 then + text = SongOrCourse:GetEstimatedNumStages() .." Stage / ".. SecondsToMSSMsMs( TrailUtil.GetTotalSeconds(trail) ); + else + text = SongOrCourse:GetEstimatedNumStages() .." Stages / ".. SecondsToMSSMsMs( TrailUtil.GetTotalSeconds(trail) ); + end + else + SongOrCourse = GAMESTATE:GetCurrentSong(); + text = SecondsToMSSMsMs( SongOrCourse:MusicLengthSeconds() ); + end; + self:settext(text); + end; + OnCommand=cmd(diffusealpha,0;linear,0.5;diffusealpha,1;sleep,1.5;linear,0.5;diffusealpha,0); + }; +}; + +return t diff --git a/Themes/default/BGAnimations/ScreenSystemLayer aux.lua b/Themes/default/BGAnimations/ScreenSystemLayer aux.lua index 4168175b41..a06bbb528a 100644 --- a/Themes/default/BGAnimations/ScreenSystemLayer aux.lua +++ b/Themes/default/BGAnimations/ScreenSystemLayer aux.lua @@ -1,66 +1,48 @@ -local t = Def.ActorFrame {}; -local bOpen = false; -local function GetTime(self) - -- Painfully ugly, sorry. - local c = self:GetChildren(); - local tTime = { Hour = nil, Minute = nil, Second = nil, Append = nil}; - - if Hour() then tTime.Hour = Hour() else tTime.Hour = 0 end; - if Minute() then tTime.Minute = Minute() else tTime.Minute = 0 end; - if Second() then tTime.Second = Second() else tTime.Second = 0 end; - - if( Hour() < 12 ) then - tTime.Append = "AM" - else - tTime.Append = "PM" - end; - - if( Hour() == 0 ) then - tTime.Hour = 12; - end; - - c.Time:settextf("%02i:%02i:%02i %s",tTime.Hour,tTime.Minute,tTime.Second,tTime.Append); -end; - -t[#t+1] = Def.ActorFrame { - Def.ActorFrame { - LoadActor(THEME:GetPathB("","_frame 3x3"),"rounded black",96,12) .. { - Name="Background"; - }; - LoadFont("Common Normal") .. { - Text="Test"; - Name="Time"; - InitCommand=function(self) - self:zoom(0.675); - end; - }; - -- - BeginCommand=function(self) - self:SetUpdateFunction( GetTime ); - self:SetUpdateRate( 1/30 ); - end; - }; - ToggleConsoleDisplayMessageCommand=function(self) - bOpen = not bOpen; - if bOpen then self:playcommand("Show") else self:playcommand("Hide") end - end; - InitCommand=function(self) - self:x(SCREEN_RIGHT-50); - self:y(10); - self:zoomy(0); - end; - ShowCommand=function(self) - self:finishtweening(); - self:zoomx(1); - self:zoomy(0); - self:bounceend(0.125); - self:zoomy(1); - end; - HideCommand=function(self) - self:finishtweening(); - self:zoom(1); - self:bouncebegin(0.125); - self:zoomy(0); - end; -}; +local t = Def.ActorFrame {}; +local bOpen = false; +local function GetTime(self) + -- Painfully ugly, sorry. + local c = self:GetChildren(); + local tTime = { Hour = nil, Minute = nil, Second = nil, Append = nil}; + + if Hour() then tTime.Hour = Hour() else tTime.Hour = 0 end; + if Minute() then tTime.Minute = Minute() else tTime.Minute = 0 end; + if Second() then tTime.Second = Second() else tTime.Second = 0 end; + + if( Hour() < 12 ) then + tTime.Append = "AM" + else + tTime.Append = "PM" + end; + + if( Hour() == 0 ) then + tTime.Hour = 12; + end; + + c.Time:settextf("%02i:%02i:%02i %s",tTime.Hour,tTime.Minute,tTime.Second,tTime.Append); +end; +t[#t+1] = Def.ActorFrame { + Def.ActorFrame { + LoadActor(THEME:GetPathB("","_frame 3x3"),"rounded black",96,12) .. { + Name="Background"; + }; + LoadFont("Common Normal") .. { + Text="Test"; + Name="Time"; + InitCommand=cmd(zoom,0.675); + }; + -- + BeginCommand=function(self) + self:SetUpdateFunction( GetTime ); + self:SetUpdateRate( 1/30 ); + end; + }; + ToggleConsoleDisplayMessageCommand=function(self) + bOpen = not bOpen; + if bOpen then self:playcommand("Show") else self:playcommand("Hide") end + end; + InitCommand=cmd(x,SCREEN_RIGHT-50;y,10;zoomy,0); + ShowCommand=cmd(finishtweening;zoomx,1;zoomy,0;bounceend,0.125;zoomy,1); + HideCommand=cmd(finishtweening;zoom,1;bouncebegin,0.125;zoomy,0); +}; return t; \ No newline at end of file diff --git a/Themes/default/BGAnimations/ScreenTitleMenu background/default.lua b/Themes/default/BGAnimations/ScreenTitleMenu background/default.lua index d46ec88d92..6262bb40af 100644 --- a/Themes/default/BGAnimations/ScreenTitleMenu background/default.lua +++ b/Themes/default/BGAnimations/ScreenTitleMenu background/default.lua @@ -1,60 +1,30 @@ local t = Def.ActorFrame {}; t[#t+1] = Def.ActorFrame { FOV=90; - InitCommand=function(self) - self:Center(); - end; + InitCommand=cmd(Center); Def.Quad { - InitCommand=function(self) - self:scaletoclipped(SCREEN_WIDTH,SCREEN_HEIGHT); - end; - OnCommand=function(self) - self:diffuse(color("#FFCB05")); - self:diffusebottomedge(color("#F0BA00")); - end; + InitCommand=cmd(scaletoclipped,SCREEN_WIDTH,SCREEN_HEIGHT); + OnCommand=cmd(diffuse,color("#FFCB05");diffusebottomedge,color("#F0BA00")); }; Def.ActorFrame { Def.ActorFrame { - InitCommand=function(self) - self:hide_if(hideFancyElements); - end; - OffCommand=function(self) - self:decelerate(0.25); - self:rotationx(-90 / 4 * 3.5); - self:y(SCREEN_CENTER_Y); - end; - ShiftCommand=function(self) - self:smooth(1.25); - self:z(256); - self:sleep(2); - self:smooth(1.25); - self:z(0); - self:sleep(2); - self:queuecommand("Shift"); - end; - FlipCommand=function(self) - self:smooth(0.5); - self:rotationy(180); - self:sleep(2); - self:smooth(0.5); - self:rotationy(360); - self:sleep(1); - self:rotationy(0); - self:sleep(1); - self:queuecommand("Flip"); - end; + InitCommand=cmd(hide_if,hideFancyElements;); + OffCommand=cmd(decelerate,0.25;rotationx,-90/4*3.5;y,SCREEN_CENTER_Y); + ShiftCommand=cmd( + smooth,1.25;z,256; + sleep,2; + smooth,1.25;z,0; + sleep,2;queuecommand,"Shift" + ); + FlipCommand=cmd( + smooth,0.5;rotationy,180; + sleep,2;smooth,0.5;rotationy,360; + sleep,1;rotationy,0;sleep,1; + queuecommand,"Flip" + ); LoadActor(THEME:GetPathB("ScreenWithMenuElements","background/_checkerboard")) .. { - InitCommand=function(self) - self:zoomto(SCREEN_WIDTH * 2, SCREEN_HEIGHT * 2); - self:customtexturerect(0, 0, SCREEN_WIDTH * 4 / 256, SCREEN_HEIGHT * 4 / 256); - end; - OnCommand=function(self) - self:texcoordvelocity(0, 0.5); - self:diffuse(color("#ffd400")); - self:diffusealpha(0.5); - self:fadetop(1); - self:fadebottom(1); - end; + InitCommand=cmd(zoomto,SCREEN_WIDTH*2,SCREEN_HEIGHT*2;customtexturerect,0,0,SCREEN_WIDTH*4/256,SCREEN_HEIGHT*4/256); + OnCommand=cmd(texcoordvelocity,0,0.5;diffuse,color("#ffd400");diffusealpha,0.5;fadetop,1;fadebottom,1); }; }; }; diff --git a/Themes/default/BGAnimations/ScreenWithMenuElements aux.lua b/Themes/default/BGAnimations/ScreenWithMenuElements aux.lua index 2bd30d9721..f808d9d5e4 100644 --- a/Themes/default/BGAnimations/ScreenWithMenuElements aux.lua +++ b/Themes/default/BGAnimations/ScreenWithMenuElements aux.lua @@ -1,111 +1,80 @@ -local function Clock() - function UpdateVisible(self) - local screen = SCREENMAN:GetTopScreen() - local bShow = true - if screen then - local sClass = screen:GetName() - bShow = THEME:GetMetric(sClass, "ShowClock") - end - if bShow then - self:smooth(0.25) - self:y(12) - else - self:smooth(0.25) - self:y(-56) - end - end - -- clock - clock = Def.ActorFrame { - Name="Clock", - InitCommand=function(self) - self:x(50); - self:y(12); - self:playcommand("Update") - end; - ScreenChangedMessageCommand=UpdateVisible, - UpdateCommand=function(self) - self:runcommandsonleaves(function(self) - self:queuecommand("Update"); - end;); - end; - Def.RoundedBox(90,26)..{ - InitCommand=function(self) - self:x(-22); - self:y(-4); - end; - }; - Def.ActorFrame { - Name="ClockText", - InitCommand=function(self) - self:y(-2); - end; - LoadFont("Common", "normal")..{ - Text="00:00:", - InitCommand=function(self) - self:horizalign(right); - self:shadowlength(0); - self:diffusebottomedge(color("0.9,0.9,0.9")); - end; - UpdateCommand=function(self) - local hour, min = Hour(), Minute() - if hour > 12 and GetUserPrefB("Use12HourClock") then - hour = hour - 12 - elseif hour == 0 and GetUserPrefB("Use12HourClock") then - hour = 12 - end - self:settext(string.format('%02i:%02i:', hour, min)) - self:sleep(1) - self:queuecommand("Update") - end - }, - LoadFont("Common", "normal")..{ - Text="00", - InitCommand=function(self) - self:horizalign(left); - self:shadowlength(0); - self:diffusebottomedge(color("0.9,0.9,0.9")); - end; - UpdateCommand=function(self) - local sec = Second() - self:settext(string.format('%02i', sec)) - self:sleep(1) - self:queuecommand("Update") - end, - }, - LoadFont("Common", "normal")..{ - Text="", - InitCommand=function(self) - self:x(28); - self:y(-3); - self:horizalign(left); - self:shadowlength(0); - self:diffusebottomedge(color("0.9,0.9,0.9")); - self:visible(false); - self:zoom(0.75); - end; - UpdateCommand=function(self) - if not GetUserPrefB("Use12HourClock") then - self:visible(false) - return - end - local hour = Hour() - if hour < 12 then - self:settext("AM") - self:diffuse(color("1,0.85,0,1")) - self:diffusebottomedge(color("0.75,0.55,0,1")) - else - self:settext("PM") - self:diffuse(color("0,0.85,1,1")) - self:diffusebottomedge(color("0,0.55,1,1")) - end - self:visible(true) - self:sleep(1) - self:queuecommand("Update") - end - } - } - } - return clock; -end -local t = Def.ActorFrame {}; +local function Clock() + function UpdateVisible(self) + local screen = SCREENMAN:GetTopScreen() + local bShow = true + if screen then + local sClass = screen:GetName() + bShow = THEME:GetMetric(sClass, "ShowClock") + end + if bShow then + self:smooth(0.25) + self:y(12) + else + self:smooth(0.25) + self:y(-56) + end + end + -- clock + clock = Def.ActorFrame { + Name="Clock", + InitCommand=cmd(x,50;y,12;playcommand,"Update"), + ScreenChangedMessageCommand=UpdateVisible, + UpdateCommand=cmd(runcommandsonleaves,cmd(queuecommand,"Update")), + Def.RoundedBox(90,26)..{ InitCommand=cmd(x,-22;y,-4) }, + Def.ActorFrame { + Name="ClockText", + InitCommand=cmd(y,-2), + LoadFont("Common", "normal")..{ + Text="00:00:", + InitCommand=cmd(horizalign,right;shadowlength,0;diffusebottomedge,color("0.9,0.9,0.9")), + UpdateCommand=function(self) + local hour, min = Hour(), Minute() + if hour > 12 and GetUserPrefB("Use12HourClock") then + hour = hour - 12 + elseif hour == 0 and GetUserPrefB("Use12HourClock") then + hour = 12 + end + self:settext(string.format('%02i:%02i:', hour, min)) + self:sleep(1) + self:queuecommand("Update") + end + }, + LoadFont("Common", "normal")..{ + Text="00", + InitCommand=cmd(horizalign,left;shadowlength,0;diffusebottomedge,color("0.9,0.9,0.9")), + UpdateCommand=function(self) + local sec = Second() + self:settext(string.format('%02i', sec)) + self:sleep(1) + self:queuecommand("Update") + end, + }, + LoadFont("Common", "normal")..{ + Text="", + InitCommand=cmd(x,28;y,-3;horizalign,left;shadowlength,0;diffusebottomedge,color("0.9,0.9,0.9");visible,false;zoom,0.75), + UpdateCommand=function(self) + if not GetUserPrefB("Use12HourClock") then + self:visible(false) + return + end + local hour = Hour() + if hour < 12 then + self:settext("AM") + self:diffuse(color("1,0.85,0,1")) + self:diffusebottomedge(color("0.75,0.55,0,1")) + else + self:settext("PM") + self:diffuse(color("0,0.85,1,1")) + self:diffusebottomedge(color("0,0.55,1,1")) + end + self:visible(true) + self:sleep(1) + self:queuecommand("Update") + end + } + } + } + return clock; +end +local t = Def.ActorFrame {}; return t; \ No newline at end of file diff --git a/Themes/default/BGAnimations/ScreenWithMenuElements background/default.lua b/Themes/default/BGAnimations/ScreenWithMenuElements background/default.lua index dee2f5e16f..f1f9335318 100644 --- a/Themes/default/BGAnimations/ScreenWithMenuElements background/default.lua +++ b/Themes/default/BGAnimations/ScreenWithMenuElements background/default.lua @@ -1,46 +1,35 @@ -local t = Def.ActorFrame {}; - -t[#t+1] = Def.ActorFrame { - FOV=90; - InitCommand=function(self) - self:Center(); - end; - Def.Quad { - InitCommand=function(self) - self:scaletoclipped(SCREEN_WIDTH,SCREEN_HEIGHT); - end; - OnCommand=function(self) - self:diffuse(color("#FFCB05")); - self:diffusebottomedge(color("#F0BA00")); - end; - }; - Def.ActorFrame { - InitCommand=function(self) - self:hide_if(hideFancyElements); - end; - LoadActor("_checkerboard") .. { - InitCommand=function(self) - self:rotationy(0); - self:rotationz(0); - self:rotationx(-90 / 4 * 3.5); - self:zoomto(SCREEN_WIDTH * 2, SCREEN_HEIGHT * 2); - self:customtexturerect(0, 0, SCREEN_WIDTH * 4 / 256, SCREEN_HEIGHT * 4 / 256); - end; - OnCommand=function(self) - self:texcoordvelocity(0, 0.5); - self:diffuse(color("#ffd400")); - self:diffusealpha(0.5); - self:fadetop(1); - end; - }; - }; - LoadActor("_particleLoader") .. { - InitCommand=function(self) - self:x(-SCREEN_CENTER_X); - self:y(-SCREEN_CENTER_Y); - self:hide_if(hideFancyElements); - end; - }; -}; - -return t; +local t = Def.ActorFrame {}; + +t[#t+1] = Def.ActorFrame { + FOV=90; + InitCommand=cmd(Center); + Def.Quad { + InitCommand=cmd(scaletoclipped,SCREEN_WIDTH,SCREEN_HEIGHT); + OnCommand=cmd(diffuse,color("#FFCB05");diffusebottomedge,color("#F0BA00")); + }; + Def.ActorFrame { + InitCommand=cmd(hide_if,hideFancyElements;); + LoadActor("_checkerboard") .. { + InitCommand=cmd(rotationy,0;rotationz,0;rotationx,-90/4*3.5;zoomto,SCREEN_WIDTH*2,SCREEN_HEIGHT*2;customtexturerect,0,0,SCREEN_WIDTH*4/256,SCREEN_HEIGHT*4/256); + OnCommand=cmd(texcoordvelocity,0,0.5;diffuse,color("#ffd400");diffusealpha,0.5;fadetop,1); + }; + }; + LoadActor("_particleLoader") .. { + InitCommand=cmd(x,-SCREEN_CENTER_X;y,-SCREEN_CENTER_Y;hide_if,hideFancyElements;); + }; +--[[ LoadActor("_particles") .. { + InitCommand=cmd(x,-SCREEN_CENTER_X;y,-SCREEN_CENTER_Y); + }; --]] +--[[ LoadActor("_pattern") .. { + InitCommand=cmd(z,32;x,4;y,4;;rotationy,-12.25;rotationz,-30;rotationx,-20;zoomto,SCREEN_WIDTH*2,SCREEN_HEIGHT*2;customtexturerect,0,0,SCREEN_WIDTH*4/256,SCREEN_HEIGHT*4/256); + OnCommand=cmd(texcoordvelocity,0.125,0.5;diffuse,Color("Black");diffusealpha,0.5); + }; --]] + --[[ 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)*2,0,(7/8)*2,0;effectclock,'beatnooffset'; + effectcolor2,Color("White");effectcolor1,Color("Black");fadebottom,0.25;fadetop,0.25;croptop,48/480;cropbottom,48/480;blend,Blend.Add; + diffusealpha,0.155); + }; --]] +}; + +return t; diff --git a/Themes/default/BGAnimations/ScreenWithMenuElements in/default.lua b/Themes/default/BGAnimations/ScreenWithMenuElements in/default.lua index a09d6fd01c..b1609a31c6 100644 --- a/Themes/default/BGAnimations/ScreenWithMenuElements in/default.lua +++ b/Themes/default/BGAnimations/ScreenWithMenuElements in/default.lua @@ -2,27 +2,34 @@ local fTileSize = 32; local iTilesX = math.ceil( SCREEN_WIDTH/fTileSize ); local iTilesY = math.ceil( SCREEN_HEIGHT/fTileSize ); local fSleepTime = THEME:GetMetric( Var "LoadingScreen","ScreenInDelay"); - +--[[ local function Actor:PositionTile(self,iX,iY) + self:x( scale(iX,1,iTilesX,-SCREEN_CENTER_X,SCREEN_CENTER_X) ); + self:y( scale(iY,1,iTilesY,-SCREEN_CENTER_Y,SCREEN_CENTER_Y) ); +end --]] local t = Def.ActorFrame { - InitCommand=function(self) - self:x(SCREEN_CENTER_X); - self:y(SCREEN_CENTER_Y); - end; - OnCommand=function(self) - self:sleep(fSleepTime); - end; + InitCommand=cmd(x,SCREEN_CENTER_X;y,SCREEN_CENTER_Y); + OnCommand=cmd(sleep,fSleepTime); }; - +--[[ for indx=1,iTilesX do + for indy=1,iTilesY do + t[#t+1] = Def.Quad { + InitCommand=cmd(zoom,fTileSize-2; + x,math.floor( scale(indx,1,iTilesX,(iTilesX/2)*fTileSize*-1,(iTilesX/2)*fTileSize*1) ); + y,math.floor( scale(indy,1,iTilesY,(iTilesY/2)*fTileSize*-1,(iTilesY/2)*fTileSize*1) ); + ); + OnCommand=cmd(diffuse,Color("Black");diffusealpha,1;zoom,fTileSize-2;sleep,(iTilesX+iTilesY)*(1/60);linear,0.0325 + ( indx / 60 );diffusealpha,0;zoom,fTileSize*1.25); + }; + end +end --]] t[#t+1] = Def.Quad { - InitCommand=function(self) - self:zoomto(SCREEN_WIDTH + 1, SCREEN_HEIGHT); - end; - OnCommand=function(self) - self:diffuse(color("0,0,0,1")); - self:sleep(0.0325 + fSleepTime); - self:linear(0.15); - self:diffusealpha(0); - end; + InitCommand=cmd(zoomto,SCREEN_WIDTH+1,SCREEN_HEIGHT); + OnCommand=cmd(diffuse,color("0,0,0,1");sleep,0.0325 + fSleepTime;linear,0.15;diffusealpha,0); }; +--[[ return Def.ActorFrame { + Def.Quad { + InitCommand=cmd(Center;zoomto,SCREEN_WIDTH+1,SCREEN_HEIGHT); + OnCommand=cmd(diffuse,color("0,0,0,1");linear,0.15;diffusealpha,0); + }; +}; --]] return t \ No newline at end of file diff --git a/Themes/default/BGAnimations/ScreenWithMenuElements out/default.lua b/Themes/default/BGAnimations/ScreenWithMenuElements out/default.lua index 575579ce70..ce931f4004 100644 --- a/Themes/default/BGAnimations/ScreenWithMenuElements out/default.lua +++ b/Themes/default/BGAnimations/ScreenWithMenuElements out/default.lua @@ -2,28 +2,34 @@ local fTileSize = 32; local iTilesX = math.ceil( SCREEN_WIDTH/fTileSize ); local iTilesY = math.ceil( SCREEN_HEIGHT/fTileSize ); local fSleepTime = THEME:GetMetric( Var "LoadingScreen","ScreenOutDelay"); - +--[[ local function Actor:PositionTile(self,iX,iY) + self:x( scale(iX,1,iTilesX,-SCREEN_CENTER_X,SCREEN_CENTER_X) ); + self:y( scale(iY,1,iTilesY,-SCREEN_CENTER_Y,SCREEN_CENTER_Y) ); +end --]] local t = Def.ActorFrame { - InitCommand=function(self) - self:x(SCREEN_CENTER_X); - self:y(SCREEN_CENTER_Y); - end; - OnCommand=function(self) - self:sleep(fSleepTime); - end; + InitCommand=cmd(x,SCREEN_CENTER_X;y,SCREEN_CENTER_Y); + OnCommand=cmd(sleep,fSleepTime); }; - +--[[ for indx=1,iTilesX do + for indy=1,iTilesY do + t[#t+1] = Def.Quad { + InitCommand=cmd(zoom,fTileSize-2; + x,math.floor( scale(indx,1,iTilesX,(iTilesX/2)*fTileSize*-1,(iTilesX/2)*fTileSize*1) ); + y,math.floor( scale(indy,1,iTilesY,(iTilesY/2)*fTileSize*-1,(iTilesY/2)*fTileSize*1) ); + ); + OnCommand=cmd(diffuse,Color("Black");diffusealpha,0;zoom,fTileSize*1.25;linear,0.0325 + ( indx / 60 );diffusealpha,1;zoom,fTileSize-2); + }; + end +end --]] t[#t+1] = Def.Quad { - InitCommand=function(self) - self:zoomto(SCREEN_WIDTH + 1, SCREEN_HEIGHT); - end; - OnCommand=function(self) - self:diffuse(color("0,0,0,0")); - self:sleep(0.0325 + fSleepTime); - self:linear(0.15); - self:diffusealpha(0); - end; + InitCommand=cmd(zoomto,SCREEN_WIDTH+1,SCREEN_HEIGHT); + OnCommand=cmd(diffuse,color("0,0,0,0");sleep,0.0325 + fSleepTime;linear,0.15;diffusealpha,1); }; - +--[[ return Def.ActorFrame { + Def.Quad { + InitCommand=cmd(Center;zoomto,SCREEN_WIDTH+1,SCREEN_HEIGHT); + OnCommand=cmd(diffuse,color("0,0,0,1");linear,0.15;diffusealpha,0); + }; +}; --]] return t \ No newline at end of file diff --git a/Themes/default/BGAnimations/_Arcade decorations/default.lua b/Themes/default/BGAnimations/_Arcade decorations/default.lua index fd460ad2a4..ebefb058ab 100644 --- a/Themes/default/BGAnimations/_Arcade decorations/default.lua +++ b/Themes/default/BGAnimations/_Arcade decorations/default.lua @@ -9,31 +9,14 @@ t[#t+1] = Def.ActorFrame { ActorUtil.LoadAllCommandsAndSetXY(self,Var "LoadingScreen") end; LoadActor(THEME:GetPathG("OptionRowExit","Frame")) .. { - InitCommand=function(self) - self:diffuse(Color("Orange")); - self:diffusealpha(0.35); - end; + InitCommand=cmd(diffuse,Color("Orange");diffusealpha,0.35); }; LoadFont("Common Normal") .. { - InitCommand=function(self) - self:zoom(0.75); - self:shadowlength(1); - self:glowshift(); - self:strokecolor(Color("Outline")); - self:diffuse(Color("Orange")); - self:diffusetopedge(Color("Yellow")); - self:textglowmode('TextGlowMode_Inner'); - end; + InitCommand=cmd(zoom,0.75;shadowlength,1;glowshift;strokecolor,Color("Outline");diffuse,Color("Orange");diffusetopedge,Color("Yellow");textglowmode,'TextGlowMode_Inner'); Text="TESTING"; - OnCommand=function(self) - self:playcommand("Refresh"); - end; - CoinInsertedMessageCommand=function(self) - self:playcommand("Refresh"); - end; - CoinModeChangedMessageCommand=function(self) - self:playcommand("Refresh"); - end; + OnCommand=cmd(playcommand,"Refresh"); + CoinInsertedMessageCommand=cmd(playcommand,"Refresh"); + CoinModeChangedMessageCommand=cmd(playcommand,"Refresh"); RefreshCommand=function(self) local bCanPlay = GAMESTATE:EnoughCreditsToJoin(); local bReady = GAMESTATE:GetNumSidesJoined() > 0; diff --git a/Themes/default/BGAnimations/_ScreenTitleMenu out/default.lua b/Themes/default/BGAnimations/_ScreenTitleMenu out/default.lua index 608bf904df..29ab735b5f 100644 --- a/Themes/default/BGAnimations/_ScreenTitleMenu out/default.lua +++ b/Themes/default/BGAnimations/_ScreenTitleMenu out/default.lua @@ -1,67 +1,23 @@ return Def.ActorFrame { - InitCommand=function(self) - self:Center(); - end; + InitCommand=cmd(Center); Def.Quad { - InitCommand=function(self) - self:zoomto(SCREEN_WIDTH, SCREEN_HEIGHT); - self:visible(false); - end; - StartTransitioningCommand=function(self) - self:visible(true); - self:diffuse(Color("Black")); - self:sleep(3.5); - self:diffusealpha(0); - end; + InitCommand=cmd(zoomto,SCREEN_WIDTH,SCREEN_HEIGHT;visible,false); + StartTransitioningCommand=cmd(visible,true;diffuse,Color("Black");sleep,3.5;diffusealpha,0); }; -- Sublime Def.Quad { - InitCommand=function(self) - self:zoomto(SCREEN_WIDTH, 80); - self:diffuse(Color("Orange")); - self:visible(false); - end; - StartTransitioningCommand=function(self) - self:visible(true); - self:decelerate(2); - self:zoomy(44); - self:decelerate(0.5); - self:diffusealpha(0); - end; + InitCommand=cmd(zoomto,SCREEN_WIDTH,80;diffuse,Color("Orange");visible,false); + StartTransitioningCommand=cmd(visible,true;decelerate,2;zoomy,44;decelerate,0.5;diffusealpha,0); }; LoadFont("Common Normal") .. { Text="This is only the beginning..."; - InitCommand=function(self) - self:visible(false); - self:shadowlength(1); - self:shadowcolor(BoostColor(Color("Orange"),0.5)); - end; - StartTransitioningCommand=function(self) - self:visible(true); - self:zoom(0.75); - self:fadeleft(1); - self:faderight(1); - self:linear(1); - self:faderight(0); - self:fadeleft(0); - self:sleep(1); - self:decelerate(0.5); - self:y(12); - self:diffusealpha(0); - end; + InitCommand=cmd(visible,false;shadowlength,1;shadowcolor,BoostColor(Color("Orange"),0.5)); + StartTransitioningCommand=cmd(visible,true;zoom,0.75;fadeleft,1;faderight,1;linear,1;faderight,0;fadeleft,0;sleep,1;decelerate,0.5;y,12;diffusealpha,0); }; -- End Def.Quad { - InitCommand=function(self) - self:zoomto(SCREEN_WIDTH, SCREEN_HEIGHT); - self:diffuse(Color("White")); - self:visible(false); - end; - StartTransitioningCommand=function(self) - self:visible(true); - self:decelerate(1); - self:diffusealpha(0); - end; + InitCommand=cmd(zoomto,SCREEN_WIDTH,SCREEN_HEIGHT;diffuse,Color("White");visible,false); + StartTransitioningCommand=cmd(visible,true;decelerate,1;diffusealpha,0); }; }; \ No newline at end of file diff --git a/Themes/default/BGAnimations/_frame 3x3/default.lua b/Themes/default/BGAnimations/_frame 3x3/default.lua index 3cc6a5d9f8..be645fc354 100644 --- a/Themes/default/BGAnimations/_frame 3x3/default.lua +++ b/Themes/default/BGAnimations/_frame 3x3/default.lua @@ -6,90 +6,13 @@ assert( Height ); local FullFile = THEME:GetPathB('','_frame files 3x3/'..File ) local Frame = LoadActor( FullFile ) return Def.ActorFrame { - Frame .. { - InitCommand=function(self) - self:setstate(0); - self:pause(); - self:horizalign(right); - self:vertalign(bottom); - self:x(-Width / 2); - self:y(-Height / 2); - end; - }; - Frame .. { - InitCommand=function(self) - self:setstate(1); - self:pause(); - self:zoomtowidth(Width); - self:vertalign(bottom); - self:zoomtowidth(Width); - self:y(-Height / 2); - end; - }; - Frame .. { - InitCommand=function(self) - self:setstate(2); - self:pause(); - self:horizalign(left); - self:vertalign(bottom); - self:x(Width / 2); - self:y(-Height / 2); - end; - }; - Frame .. { - InitCommand=function(self) - self:setstate(3); - self:pause(); - self:horizalign(right); - self:x(-Width / 2); - self:zoomtoheight(Height); - end; - }; - Frame .. { - InitCommand=function(self) - self:setstate(4); - self:pause(); - self:zoomtowidth(Width); - self:zoomtoheight(Height); - end; - }; - Frame .. { - InitCommand=function(self) - self:setstate(5); - self:pause(); - self:horizalign(left); - self:x(Width / 2); - self:zoomtoheight(Height); - end; - }; - Frame .. { - InitCommand=function(self) - self:setstate(6); - self:pause(); - self:horizalign(right); - self:vertalign(top); - self:x(-Width / 2); - self:y(Height / 2); - end; - }; - Frame .. { - InitCommand=function(self) - self:setstate(7); - self:pause(); - self:zoomtowidth(Width); - self:vertalign(top); - self:zoomtowidth(Width); - self:y(Height / 2); - end; - }; - Frame .. { - InitCommand=function(self) - self:setstate(8); - self:pause(); - self:horizalign(left); - self:vertalign(top); - self:x(Width / 2); - self:y(Height / 2); - end; - }; + Frame .. { InitCommand=cmd(setstate,0;pause;horizalign,right;vertalign,bottom;x,-Width/2;y,-Height/2) }; + Frame .. { InitCommand=cmd(setstate,1;pause;zoomtowidth,Width;vertalign,bottom;zoomtowidth,Width;y,-Height/2) }; + Frame .. { InitCommand=cmd(setstate,2;pause;horizalign,left;vertalign,bottom;x,Width/2;y,-Height/2) }; + Frame .. { InitCommand=cmd(setstate,3;pause;horizalign,right;x,-Width/2;zoomtoheight,Height) }; + Frame .. { InitCommand=cmd(setstate,4;pause;zoomtowidth,Width;zoomtoheight,Height) }; + Frame .. { InitCommand=cmd(setstate,5;pause;horizalign,left;x,Width/2;zoomtoheight,Height) }; + Frame .. { InitCommand=cmd(setstate,6;pause;horizalign,right;vertalign,top;x,-Width/2;y,Height/2) }; + Frame .. { InitCommand=cmd(setstate,7;pause;zoomtowidth,Width;vertalign,top;zoomtowidth,Width;y,Height/2) }; + Frame .. { InitCommand=cmd(setstate,8;pause;horizalign,left;vertalign,top;x,Width/2;y,Height/2) }; }; diff --git a/Themes/default/Graphics/Combo 1000milestone/default.lua b/Themes/default/Graphics/Combo 1000milestone/default.lua index 41e112a5de..80789ecc72 100644 --- a/Themes/default/Graphics/Combo 1000milestone/default.lua +++ b/Themes/default/Graphics/Combo 1000milestone/default.lua @@ -1,4 +1,12 @@ return Def.ActorFrame { FOV=90; +--[[ LoadActor("shot") .. { + InitCommand=cmd(diffusealpha,0;zoom,2;blend,'BlendMode_Add'); + MilestoneCommand=cmd(diffusealpha,0.75;rotationz,0;accelerate,2.5;diffusealpha,0;rotationz,360;zoom,2.5); + }; --]] +--[[ LoadActor("shot") .. { + InitCommand=cmd(diffusealpha,0;zoom,2;zoomx,-2;blend,'BlendMode_Add'); + MilestoneCommand=cmd(diffusealpha,0.75;rotationz,-360;x,0;linear,2.5;diffusealpha,0;rotationz,0;zoom,2.5); + }; --]] LoadActor(THEME:GetPathG("Combo","100Milestone")); }; diff --git a/Themes/default/Graphics/Combo 100milestone/default.lua b/Themes/default/Graphics/Combo 100milestone/default.lua index 2193429596..2e72062aca 100644 --- a/Themes/default/Graphics/Combo 100milestone/default.lua +++ b/Themes/default/Graphics/Combo 100milestone/default.lua @@ -1,35 +1,11 @@ -local ShowFlashyCombo = ThemePrefs.Get("FlashyCombo") -return Def.ActorFrame { - LoadActor("explosion") .. { - InitCommand=function(self) - self:diffusealpha(0); - self:blend('BlendMode_Add'); - self:hide_if(not ShowFlashyCombo); - end; - MilestoneCommand=function(self) - self:rotationz(0); - self:zoom(2); - self:diffusealpha(0.5); - self:linear(0.5); - self:rotationz(90); - self:zoom(1.75); - self:diffusealpha(0); - end; - }; - LoadActor("explosion") .. { - InitCommand=function(self) - self:diffusealpha(0); - self:blend('BlendMode_Add'); - self:hide_if(not ShowFlashyCombo); - end; - MilestoneCommand=function(self) - self:rotationz(0); - self:zoom(2); - self:diffusealpha(0.5); - self:linear(0.5); - self:rotationz(-90); - self:zoom(1.75); - self:diffusealpha(0); - end; - }; +local ShowFlashyCombo = ThemePrefs.Get("FlashyCombo") +return Def.ActorFrame { + LoadActor("explosion") .. { + InitCommand=cmd(diffusealpha,0;blend,'BlendMode_Add';hide_if,not ShowFlashyCombo); + MilestoneCommand=cmd(rotationz,0;zoom,2;diffusealpha,0.5;linear,0.5;rotationz,90;zoom,1.75;diffusealpha,0); + }; + LoadActor("explosion") .. { + InitCommand=cmd(diffusealpha,0;blend,'BlendMode_Add';hide_if,not ShowFlashyCombo); + MilestoneCommand=cmd(rotationz,0;zoom,2;diffusealpha,0.5;linear,0.5;rotationz,-90;zoom,2.5;diffusealpha,0); + }; }; \ No newline at end of file diff --git a/Themes/default/Graphics/MusicWheelItem grades/default.lua b/Themes/default/Graphics/MusicWheelItem grades/default.lua index 79356ffced..dbbca63f71 100644 --- a/Themes/default/Graphics/MusicWheelItem grades/default.lua +++ b/Themes/default/Graphics/MusicWheelItem grades/default.lua @@ -12,22 +12,23 @@ local grades = { Grade_None = 8; }; +--[[ local t = LoadActor( "grades" ) .. { + InitCommand=cmd(pause); + SetGradeCommand=function(self, params) + local state = grades[params.Grade] or grades.Grade_None; + state = state*2; + + if params.PlayerNumber == PLAYER_2 then + state = state+1; + end + + self:setstate(state); + end; +}; --]] local t = LoadFont("Common Normal") .. { - InitCommand=function(self) - self:zoom(0.75); - self:shadowlength(1); - self:strokecolor(Color("Black")); - end; - ShowCommand=function(self) - self:stoptweening(); - self:bounceend(0.15); - self:zoomy(0.75); - end; - HideCommand=function(self) - self:stoptweening(); - self:bouncebegin(0.15); - self:zoomy(0); - end; + InitCommand=cmd(zoom,0.75;shadowlength,1;strokecolor,Color("Black")); + ShowCommand=cmd(stoptweening;bounceend,0.15;zoomy,0.75); + HideCommand=cmd(stoptweening;bouncebegin,0.15;zoomy,0); SetGradeCommand=function(self,params) local pnPlayer = params.PlayerNumber; local sGrade = params.Grade or 'Grade_None'; @@ -37,6 +38,12 @@ local t = LoadFont("Common Normal") .. { self:diffuse(PlayerColor(pnPlayer)); self:diffusetopedge(BoostColor(PlayerColor(pnPlayer),1.5)); self:strokecolor(BoostColor(PlayerColor(pnPlayer),0.25)); + +--[[ if sGrade == "Grade_NoTier" then + self:playcommand("Hide"); + else + self:playcommand("Show"); + end; --]] end; }; diff --git a/Themes/default/Graphics/PaneDisplay text.lua b/Themes/default/Graphics/PaneDisplay text.lua index 1c07882473..d928285b84 100644 --- a/Themes/default/Graphics/PaneDisplay text.lua +++ b/Themes/default/Graphics/PaneDisplay text.lua @@ -22,27 +22,31 @@ local function CreatePaneDisplayItem( _pnPlayer, _sLabel, _rcRadarCategory ) return Def.ActorFrame { LoadFont("Common SemiBold") .. { Text=string.upper( THEME:GetString("PaneDisplay",_sLabel) ); - InitCommand=function(self) - self:horizalign(left); - end; - OnCommand=function(self) - self:zoom(0.5875); - self:diffuse(color("0.9,0.9,0.9")); - self:shadowlength(1); - end; + InitCommand=cmd(horizalign,left); + OnCommand=cmd(zoom,0.5875;diffuse,color("0.9,0.9,0.9");shadowlength,1); }; LoadFont("Common Normal") .. { Text=string.format("%04i", 0); - InitCommand=function(self) - self:x(96); InitCommand=cmd(x,96;horizalign,right); OnCommand=cmd(zoom,0.5875;shadowlength,1); - CurrentSongChangedMessageCommand=cmd(playcommand,"Set"); - CurrentStepsP1ChangedMessageCommand=cmd(playcommand,"Set"); - CurrentStepsP2ChangedMessageCommand=cmd(playcommand,"Set"); - CurrentTrailP1ChangedMessageCommand=cmd(playcommand,"Set"); - CurrentTrailP2ChangedMessageCommand=cmd(playcommand,"Set"); - CurrentCourseChangedMessageCommand=cmd(playcommand,"Set"); + CurrentSongChangedMessageCommand=function(self) + self:playcommand("Set"); + end; + CurrentStepsP1ChangedMessageCommand=function(self) + self:playcommand("Set"); + end; + CurrentStepsP2ChangedMessageCommand=function(self) + self:playcommand("Set"); + end; + CurrentTrailP1ChangedMessageCommand=function(self) + self:playcommand("Set"); + end; + CurrentTrailP2ChangedMessageCommand=function(self) + self:playcommand("Set"); + end; + CurrentCourseChangedMessageCommand=function(self) + self:playcommand("Set"); + end; SetCommand=function(self) local song = GAMESTATE:GetCurrentSong() local course = GAMESTATE:GetCurrentCourse() @@ -60,37 +64,34 @@ local function CreatePaneDisplayGraph( _pnPlayer, _sLabel, _rcRadarCategory ) return Def.ActorFrame { LoadFont("Common Normal") .. { Text=_sLabel; - InitCommand=function(self) - self:horizalign(left); - end; - OnCommand=function(self) - self:zoom(0.5); - self:shadowlength(1); - end; + InitCommand=cmd(horizalign,left); + OnCommand=cmd(zoom,0.5;shadowlength,1); }; Def.Quad { - InitCommand=function(self) - self:x(12); - self:zoomto(50, 10); - self:horizalign(left); - end; - OnCommand=function(self) - self:diffuse(Color("Black")); - self:shadowlength(1); - self:diffusealpha(0.5); - end; + InitCommand=cmd(x,12;zoomto,50,10;horizalign,left); + OnCommand=cmd(diffuse,Color("Black");shadowlength,1;diffusealpha,0.5); }; Def.Quad { - InitCommand=function(self) - self:x(12); InitCommand=cmd(x,12;zoomto,50,10;horizalign,left); OnCommand=cmd(shadowlength,0;diffuse,Color("Green");diffusebottomedge,ColorLightTone(Color("Green"))); - CurrentSongChangedMessageCommand=cmd(playcommand,"Set"); - CurrentStepsP1ChangedMessageCommand=cmd(playcommand,"Set"); - CurrentStepsP2ChangedMessageCommand=cmd(playcommand,"Set"); - CurrentTrailP1ChangedMessageCommand=cmd(playcommand,"Set"); - CurrentTrailP2ChangedMessageCommand=cmd(playcommand,"Set"); - CurrentCourseChangedMessageCommand=cmd(playcommand,"Set"); + CurrentSongChangedMessageCommand=function(self) + self:playcommand("Set"); + end; + CurrentStepsP1ChangedMessageCommand=function(self) + self:playcommand("Set"); + end; + CurrentStepsP2ChangedMessageCommand=function(self) + self:playcommand("Set"); + end; + CurrentTrailP1ChangedMessageCommand=function(self) + self:playcommand("Set"); + end; + CurrentTrailP2ChangedMessageCommand=function(self) + self:playcommand("Set"); + end; + CurrentCourseChangedMessageCommand=function(self) + self:playcommand("Set"); + end; SetCommand=function(self) local song = GAMESTATE:GetCurrentSong() local course = GAMESTATE:GetCurrentCourse() @@ -106,16 +107,26 @@ local function CreatePaneDisplayGraph( _pnPlayer, _sLabel, _rcRadarCategory ) end; }; LoadFont("Common Normal") .. { - InitCommand=function(self) - self:x(14); InitCommand=cmd(x,14;zoom,0.5;halign,0;); OnCommand=cmd(shadowlength,1;strokecolor,color("0.15,0.15,0.15,0.625")); - CurrentSongChangedMessageCommand=cmd(playcommand,"Set"); - CurrentStepsP1ChangedMessageCommand=cmd(playcommand,"Set"); - CurrentStepsP2ChangedMessageCommand=cmd(playcommand,"Set"); - CurrentTrailP1ChangedMessageCommand=cmd(playcommand,"Set"); - CurrentTrailP2ChangedMessageCommand=cmd(playcommand,"Set"); - CurrentCourseChangedMessageCommand=cmd(playcommand,"Set"); + CurrentSongChangedMessageCommand=function(self) + self:playcommand("Set"); + end; + CurrentStepsP1ChangedMessageCommand=function(self) + self:playcommand("Set"); + end; + CurrentStepsP2ChangedMessageCommand=function(self) + self:playcommand("Set"); + end; + CurrentTrailP1ChangedMessageCommand=function(self) + self:playcommand("Set"); + end; + CurrentTrailP2ChangedMessageCommand=function(self) + self:playcommand("Set"); + end; + CurrentCourseChangedMessageCommand=function(self) + self:playcommand("Set"); + end; SetCommand=function(self) local song = GAMESTATE:GetCurrentSong() local course = GAMESTATE:GetCurrentCourse() diff --git a/Themes/default/Graphics/Player combo/default.lua b/Themes/default/Graphics/Player combo/default.lua index 31a531b379..88fca73c52 100644 --- a/Themes/default/Graphics/Player combo/default.lua +++ b/Themes/default/Graphics/Player combo/default.lua @@ -1,144 +1,158 @@ -local c; -local cf; -local canAnimate = false; -local player = Var "Player"; -local ShowComboAt = THEME:GetMetric("Combo", "ShowComboAt"); -local Pulse = THEME:GetMetric("Combo", "PulseCommand"); -local PulseLabel = THEME:GetMetric("Combo", "PulseLabelCommand"); - -local NumberMinZoom = THEME:GetMetric("Combo", "NumberMinZoom"); -local NumberMaxZoom = THEME:GetMetric("Combo", "NumberMaxZoom"); -local NumberMaxZoomAt = THEME:GetMetric("Combo", "NumberMaxZoomAt"); - -local LabelMinZoom = THEME:GetMetric("Combo", "LabelMinZoom"); -local LabelMaxZoom = THEME:GetMetric("Combo", "LabelMaxZoom"); - -local ShowFlashyCombo = ThemePrefs.Get("FlashyCombo") - -local t = Def.ActorFrame { - InitCommand=function(self) - self:vertalign(bottom); - end; - -- flashy combo elements: - LoadActor(THEME:GetPathG("Combo","100Milestone")) .. { - Name="OneHundredMilestone"; - InitCommand=function(self) - self:visible(ShowFlashyCombo); - end; - FiftyMilestoneCommand=function(self) - self:playcommand("Milestone"); - end; - }; - LoadActor(THEME:GetPathG("Combo","1000Milestone")) .. { - Name="OneThousandMilestone"; - InitCommand=function(self) - self:visible(ShowFlashyCombo); - end; - ToastyAchievedMessageCommand=function(self) - self:playcommand("Milestone"); - end; - }; - -- normal combo elements: - Def.ActorFrame { - Name="ComboFrame"; - LoadFont( "Combo", "numbers" ) .. { - Name="Number"; - OnCommand = THEME:GetMetric("Combo", "NumberOnCommand"); - }; - LoadActor("_combo")..{ - Name="ComboLabel"; - OnCommand = THEME:GetMetric("Combo", "ComboLabelOnCommand"); - }; - LoadActor("_misses")..{ - Name="MissLabel"; - OnCommand = THEME:GetMetric("Combo", "MissLabelOnCommand"); - }; - }; - InitCommand = function(self) - c = self:GetChildren(); - cf = c.ComboFrame:GetChildren(); - cf.Number:visible(false); - cf.ComboLabel:visible(false) - cf.MissLabel:visible(false) - end; - -- Milestones: - -- 25,50,100,250,600 Multiples; - - TwentyFiveMilestoneCommand=function(self,parent) - if ShowFlashyCombo then - self:finishtweening(); - self:addy(-4); - self:bounceend(0.125); - self:addy(4); - end; - end; - - ComboCommand=function(self, param) - local iCombo = param.Misses or param.Combo; - if not iCombo or iCombo < ShowComboAt then - cf.Number:visible(false); - cf.ComboLabel:visible(false) - cf.MissLabel:visible(false) - return; - end - - cf.ComboLabel:visible(false) - cf.MissLabel:visible(false) - - param.Zoom = scale( iCombo, 0, NumberMaxZoomAt, NumberMinZoom, NumberMaxZoom ); - param.Zoom = clamp( param.Zoom, NumberMinZoom, NumberMaxZoom ); - - param.LabelZoom = scale( iCombo, 0, NumberMaxZoomAt, LabelMinZoom, LabelMaxZoom ); - param.LabelZoom = clamp( param.LabelZoom, LabelMinZoom, LabelMaxZoom ); - - if param.Combo then - cf.ComboLabel:visible(true) - cf.MissLabel:visible(false) - else - cf.ComboLabel:visible(false) - cf.MissLabel:visible(true) - end - - cf.Number:visible(true); - cf.Number:settext( string.format("%i", iCombo) ); - cf.Number:textglowmode("TextGlowMode_Stroke"); - -- FullCombo Rewards - if param.FullComboW1 then - cf.Number:diffuse( GameColor.Judgment["JudgmentLine_W1"] ); - cf.Number:strokecolor( GameColor.Judgment["JudgmentLine_W1"] ); - cf.Number:textglowmode("TextGlowMode_Stroke"); - cf.Number:glowshift(); - elseif param.FullComboW2 then - cf.Number:diffuse( GameColor.Judgment["JudgmentLine_W2"] ); - cf.Number:strokecolor( GameColor.Judgment["JudgmentLine_W2"] ); - cf.Number:textglowmode("TextGlowMode_Stroke"); - cf.Number:glowshift(); - elseif param.FullComboW3 then - cf.Number:diffuse( GameColor.Judgment["JudgmentLine_W3"] ); - cf.Number:strokecolor( GameColor.Judgment["JudgmentLine_W3"] ); - cf.Number:textglowmode("TextGlowMode_Stroke"); - cf.Number:glowshift(); - elseif param.Combo then - -- Player 1's color is Red, which conflicts with the miss combo. - -- instead, just diffuse to white for now. -aj - --c.Number:diffuse(PlayerColor(player)); - cf.Number:diffuse(Color("White")); - cf.Number:strokecolor(Color("Stealth")); - cf.Number:stopeffect(); - else - cf.Number:diffuse(color("#ff0000")); - cf.Number:stopeffect(); - end - -- Pulse - Pulse( cf.Number, param ); - if param.Combo then - PulseLabel( cf.ComboLabel, param ); - else - PulseLabel( cf.MissLabel, param ); - end - -- Milestone Logic - end; - -}; - -return t; +local c; +local cf; +local canAnimate = false; +local player = Var "Player"; +local ShowComboAt = THEME:GetMetric("Combo", "ShowComboAt"); +local Pulse = THEME:GetMetric("Combo", "PulseCommand"); +local PulseLabel = THEME:GetMetric("Combo", "PulseLabelCommand"); + +local NumberMinZoom = THEME:GetMetric("Combo", "NumberMinZoom"); +local NumberMaxZoom = THEME:GetMetric("Combo", "NumberMaxZoom"); +local NumberMaxZoomAt = THEME:GetMetric("Combo", "NumberMaxZoomAt"); + +local LabelMinZoom = THEME:GetMetric("Combo", "LabelMinZoom"); +local LabelMaxZoom = THEME:GetMetric("Combo", "LabelMaxZoom"); + +local ShowFlashyCombo = ThemePrefs.Get("FlashyCombo") + +local t = Def.ActorFrame { + InitCommand=cmd(vertalign,bottom); + -- flashy combo elements: + LoadActor(THEME:GetPathG("Combo","100Milestone")) .. { + Name="OneHundredMilestone"; + InitCommand=cmd(visible,ShowFlashyCombo); + FiftyMilestoneCommand=cmd(playcommand,"Milestone"); + }; + LoadActor(THEME:GetPathG("Combo","1000Milestone")) .. { + Name="OneThousandMilestone"; + InitCommand=cmd(visible,ShowFlashyCombo); + ToastyAchievedMessageCommand=cmd(playcommand,"Milestone"); + }; + -- normal combo elements: + Def.ActorFrame { + Name="ComboFrame"; + LoadFont( "Combo", "numbers" ) .. { + Name="Number"; + OnCommand = THEME:GetMetric("Combo", "NumberOnCommand"); + }; + LoadActor("_combo")..{ + Name="ComboLabel"; + OnCommand = THEME:GetMetric("Combo", "ComboLabelOnCommand"); + }; + LoadActor("_misses")..{ + Name="MissLabel"; + OnCommand = THEME:GetMetric("Combo", "MissLabelOnCommand"); + }; + }; + InitCommand = function(self) + c = self:GetChildren(); + cf = c.ComboFrame:GetChildren(); + cf.Number:visible(false); + cf.ComboLabel:visible(false) + cf.MissLabel:visible(false) + end; + -- Milestones: + -- 25,50,100,250,600 Multiples; +--[[ if (iCombo % 100) == 0 then + c.OneHundredMilestone:playcommand("Milestone"); + elseif (iCombo % 250) == 0 then + -- It should really be 1000 but thats slightly unattainable, since + -- combo doesnt save over now. + c.OneThousandMilestone:playcommand("Milestone"); + else + return + end; --]] + TwentyFiveMilestoneCommand=function(self,parent) + if ShowFlashyCombo then + (cmd(finishtweening;addy,-4;bounceend,0.125;addy,4))(self); + end; + end; + --]] + --[[ + ToastyAchievedMessageCommand=function(self,params) + if params.PlayerNumber == player then + (cmd(thump,2;effectclock,'beat'))(c.ComboFrame); + end; + end; + ToastyDroppedMessageCommand=function(self,params) + if params.PlayerNumber == player then + (cmd(stopeffect))(c.ComboFrame); + end; + end; --]] + ComboCommand=function(self, param) + local iCombo = param.Misses or param.Combo; + if not iCombo or iCombo < ShowComboAt then + cf.Number:visible(false); + cf.ComboLabel:visible(false) + cf.MissLabel:visible(false) + return; + end + + cf.ComboLabel:visible(false) + cf.MissLabel:visible(false) + + param.Zoom = scale( iCombo, 0, NumberMaxZoomAt, NumberMinZoom, NumberMaxZoom ); + param.Zoom = clamp( param.Zoom, NumberMinZoom, NumberMaxZoom ); + + param.LabelZoom = scale( iCombo, 0, NumberMaxZoomAt, LabelMinZoom, LabelMaxZoom ); + param.LabelZoom = clamp( param.LabelZoom, LabelMinZoom, LabelMaxZoom ); + + if param.Combo then + cf.ComboLabel:visible(true) + cf.MissLabel:visible(false) + else + cf.ComboLabel:visible(false) + cf.MissLabel:visible(true) + end + + cf.Number:visible(true); + cf.Number:settext( string.format("%i", iCombo) ); + cf.Number:textglowmode("TextGlowMode_Stroke"); + -- FullCombo Rewards + if param.FullComboW1 then + cf.Number:diffuse( GameColor.Judgment["JudgmentLine_W1"] ); + cf.Number:strokecolor( GameColor.Judgment["JudgmentLine_W1"] ); + cf.Number:textglowmode("TextGlowMode_Stroke"); + cf.Number:glowshift(); + elseif param.FullComboW2 then + cf.Number:diffuse( GameColor.Judgment["JudgmentLine_W2"] ); + cf.Number:strokecolor( GameColor.Judgment["JudgmentLine_W2"] ); + cf.Number:textglowmode("TextGlowMode_Stroke"); + cf.Number:glowshift(); + elseif param.FullComboW3 then + cf.Number:diffuse( GameColor.Judgment["JudgmentLine_W3"] ); + cf.Number:strokecolor( GameColor.Judgment["JudgmentLine_W3"] ); + cf.Number:textglowmode("TextGlowMode_Stroke"); + cf.Number:glowshift(); + elseif param.Combo then + -- Player 1's color is Red, which conflicts with the miss combo. + -- instead, just diffuse to white for now. -aj + --c.Number:diffuse(PlayerColor(player)); + cf.Number:diffuse(Color("White")); + cf.Number:strokecolor(Color("Stealth")); + cf.Number:stopeffect(); + else + cf.Number:diffuse(color("#ff0000")); + cf.Number:stopeffect(); + end + -- Pulse + Pulse( cf.Number, param ); + if param.Combo then + PulseLabel( cf.ComboLabel, param ); + else + PulseLabel( cf.MissLabel, param ); + end + -- Milestone Logic + end; +--[[ ScoreChangedMessageCommand=function(self,param) + local iToastyCombo = param.ToastyCombo; + if iToastyCombo and (iToastyCombo > 0) then +-- (cmd(thump;effectmagnitude,1,1.2,1;effectclock,'beat'))(c.Number) +-- (cmd(thump;effectmagnitude,1,1.2,1;effectclock,'beat'))(c.Number) + else +-- c.Number:stopeffect(); + end; + end; --]] +}; + +return t; diff --git a/Themes/default/Graphics/Player judgment/default.lua b/Themes/default/Graphics/Player judgment/default.lua index 4cb0edcb90..75ab3e75ab 100644 --- a/Themes/default/Graphics/Player judgment/default.lua +++ b/Themes/default/Graphics/Player judgment/default.lua @@ -56,99 +56,100 @@ local t = Def.ActorFrame {}; t[#t+1] = Def.ActorFrame { LoadActor(THEME:GetPathG("Judgment","Normal")) .. { Name="Judgment"; - InitCommand=function(self) - self:pause(); - self:visible(false); - end; + InitCommand=cmd(pause;visible,false); OnCommand=THEME:GetMetric("Judgment","JudgmentOnCommand"); ResetCommand=cmd(finishtweening;stopeffect;visible,false); }; LoadFont("Combo Numbers") .. { Name="ProtimingDisplay"; Text=""; - InitCommand=function(self) - self:visible(false); - end; + InitCommand=cmd(visible,false); OnCommand=THEME:GetMetric("Protiming","ProtimingOnCommand"); ResetCommand=cmd(finishtweening;stopeffect;visible,false); }; LoadFont("Common Normal") .. { Name="ProtimingAverage"; Text=""; - InitCommand=function(self) - self:visible(false); - end; + InitCommand=cmd(visible,false); OnCommand=THEME:GetMetric("Protiming","AverageOnCommand"); ResetCommand=cmd(finishtweening;stopeffect;visible,false); }; LoadFont("Common Normal") .. { Name="TextDisplay"; Text=THEME:GetString("Protiming","MS"); - InitCommand=function(self) - self:visible(false); - end; + InitCommand=cmd(visible,false); OnCommand=THEME:GetMetric("Protiming","TextOnCommand"); ResetCommand=cmd(finishtweening;stopeffect;visible,false); }; Def.Quad { Name="ProtimingGraphBG"; - InitCommand=function(self) - self:visible(false); - self:y(32); - self:zoomto(ProtimingWidth, 16); - end; - ResetCommand=function(self) - self:finishtweening(); - self:diffusealpha(0.8); - self:visible(false); - end; - OnCommand=function(self) - self:diffuse(Color("Black")); - self:diffusetopedge(color("0.1,0.1,0.1,1")); - self:diffusealpha(0.8); - self:shadowlength(2); - end; + InitCommand=cmd(visible,false;y,32;zoomto,ProtimingWidth,16); + ResetCommand=cmd(finishtweening;diffusealpha,0.8;visible,false); + OnCommand=cmd(diffuse,Color("Black");diffusetopedge,color("0.1,0.1,0.1,1");diffusealpha,0.8;shadowlength,2;); }; Def.Quad { Name="ProtimingGraphWindowW3"; InitCommand=cmd(visible,false;y,32;zoomto,ProtimingWidth-4,16-4); - ResetCommand=cmd(finishtweening;diffusealpha,1;visible,false); + ResetCommand=function(self) + self:finishtweening(); + self:diffusealpha(1); + self:visible(false); + end; OnCommand=cmd(diffuse,GameColor.Judgment["JudgmentLine_W3"];); }; Def.Quad { Name="ProtimingGraphWindowW2"; InitCommand=cmd(visible,false;y,32;zoomto,scale(PREFSMAN:GetPreference("TimingWindowSecondsW2"),0,PREFSMAN:GetPreference("TimingWindowSecondsW3"),0,ProtimingWidth-4),16-4); - ResetCommand=cmd(finishtweening;diffusealpha,1;visible,false); + ResetCommand=function(self) + self:finishtweening(); + self:diffusealpha(1); + self:visible(false); + end; OnCommand=cmd(diffuse,GameColor.Judgment["JudgmentLine_W2"];); }; Def.Quad { Name="ProtimingGraphWindowW1"; InitCommand=cmd(visible,false;y,32;zoomto,scale(PREFSMAN:GetPreference("TimingWindowSecondsW1"),0,PREFSMAN:GetPreference("TimingWindowSecondsW3"),0,ProtimingWidth-4),16-4); - ResetCommand=cmd(finishtweening;diffusealpha,1;visible,false); + ResetCommand=function(self) + self:finishtweening(); + self:diffusealpha(1); + self:visible(false); + end; OnCommand=cmd(diffuse,GameColor.Judgment["JudgmentLine_W1"];); }; Def.Quad { Name="ProtimingGraphUnderlay"; InitCommand=cmd(visible,false;y,32;zoomto,ProtimingWidth-4,16-4); - ResetCommand=cmd(finishtweening;diffusealpha,0.25;visible,false); + ResetCommand=function(self) + self:finishtweening(); + self:diffusealpha(0.25); + self:visible(false); + end; OnCommand=cmd(diffuse,Color("Black");diffusealpha,0.25); }; Def.Quad { Name="ProtimingGraphFill"; InitCommand=cmd(visible,false;y,32;zoomto,0,16-4;horizalign,left;); - ResetCommand=cmd(finishtweening;diffusealpha,1;visible,false); + ResetCommand=function(self) + self:finishtweening(); + self:diffusealpha(1); + self:visible(false); + end; OnCommand=cmd(diffuse,Color("Red");); }; Def.Quad { Name="ProtimingGraphAverage"; InitCommand=cmd(visible,false;y,32;zoomto,2,7;); - ResetCommand=cmd(finishtweening;diffusealpha,0.85;visible,false); + ResetCommand=function(self) + self:finishtweening(); + self:diffusealpha(0.85); + self:visible(false); + end; OnCommand=cmd(diffuse,Color("Orange");diffusealpha,0.85); }; Def.Quad { Name="ProtimingGraphCenter"; InitCommand=cmd(visible,false;y,32;zoomto,2,16-4;); - ResetCommand=cmd(finishtweening;diffusealpha,1;visible,false); OnCommand=cmd(diffuse,Color("White");diffusealpha,1); }; InitCommand = function(self) @@ -221,7 +222,6 @@ t[#t+1] = Def.ActorFrame { c.ProtimingGraphFill:visible( bShowProtiming ); c.ProtimingGraphFill:finishtweening(); c.ProtimingGraphFill:decelerate(1/60); --- c.ProtimingGraphFill:zoomtowidth( clamp(fTapNoteOffset * 188,-188/2,188/2) ); c.ProtimingGraphFill:zoomtowidth( clamp( scale( fTapNoteOffset, diff --git a/Themes/default/Graphics/Player toasty/default.lua b/Themes/default/Graphics/Player toasty/default.lua index a838a03759..206e223510 100644 --- a/Themes/default/Graphics/Player toasty/default.lua +++ b/Themes/default/Graphics/Player toasty/default.lua @@ -1,57 +1,34 @@ -local Player = ... -assert(Player); -local HasToasty = false; -local fWidth = ( GAMESTATE:GetCurrentStyle():GetStyleType() == 'StyleType_OnePlayerTwoSides' ) and 600 or 256+16; -return Def.ActorFrame { - ToastyAchievedMessageCommand=function(self,params) - if params.PlayerNumber == Player then - self:thump(1); - self:effectclock('beat'); - self:effectmagnitude(1, 1, 1); - self:effectcolor1(color("1,1.125,1,1")); - self:effectcolor2(color("1,1,1,1")); - end - end; - Def.Quad { - InitCommand=function(self) - self:zoomto(fWidth, SCREEN_HEIGHT); - self:diffuse(PlayerColor(Player)); - self:diffusealpha(0); - self:fadeleft(32 / (256 + 16)); - self:faderight(32 / (256 + 16)); - end; - ToastyAchievedMessageCommand=function(self,params) - if params.PlayerNumber == Player then - self:stoptweening(); - self:linear(2.125); - self:diffuse(Color.Alpha( PlayerColor(Player), 0.345 )); - self:glow(color("1,1,1,0.5")); - self:decelerate(3); - self:glow(Color.Alpha( ColorDarkTone( PlayerColor(Player) ), 0 )); - self:diffuseramp(); - self:effectcolor1(ColorLightTone( PlayerColor(Player) )); - self:effectcolor2(PlayerColor(Player)); - self:effectclock('beat'); - self:effectperiod(2); - HasToasty = true; - end - end; - ToastyDroppedMessageCommand=function(self,params) - if params.PlayerNumber == Player then - if HasToasty then - self:finishtweening(); - self:stopeffect(); - self:glow(color("1,1,1,0.5")); - self:decelerate(0.35); - self:diffuse(Color.Alpha( Color("Black"), 0.25 )); - self:glow(color("1,1,1,0")); - self:linear(0.35 * 0.25); - self:diffusealpha(0); - HasToasty = false; - else - return - end - end - end; - }; +local Player = ... +assert(Player); +local HasToasty = false; +local fWidth = ( GAMESTATE:GetCurrentStyle():GetStyleType() == 'StyleType_OnePlayerTwoSides' ) and 600 or 256+16; +return Def.ActorFrame { + ToastyAchievedMessageCommand=function(self,params) + if params.PlayerNumber == Player then + (cmd(thump,1;effectclock,'beat';effectmagnitude,1,1,1; + effectcolor1,color("1,1.125,1,1");effectcolor2,color("1,1,1,1")))(self); + end + end; + Def.Quad { + InitCommand=cmd(zoomto,fWidth,SCREEN_HEIGHT;diffuse,PlayerColor(Player);diffusealpha,0;fadeleft,32/(256+16);faderight,32/(256+16)); + ToastyAchievedMessageCommand=function(self,params) + if params.PlayerNumber == Player then + (cmd(stoptweening;linear,2.125;diffuse,Color.Alpha( PlayerColor(Player), 0.345 );glow,color("1,1,1,0.5");decelerate,3;glow,Color.Alpha( ColorDarkTone( PlayerColor(Player) ), 0 );diffuseramp; + effectcolor1,ColorLightTone( PlayerColor(Player) );effectcolor2,PlayerColor(Player); + effectclock,'beat';effectperiod,2; + ))(self); + HasToasty = true; + end + end; + ToastyDroppedMessageCommand=function(self,params) + if params.PlayerNumber == Player then + if HasToasty then + (cmd(finishtweening;stopeffect;glow,color("1,1,1,0.5");decelerate,0.35;diffuse,Color.Alpha( Color("Black"), 0.25 );glow,color("1,1,1,0");linear,0.35*0.25;diffusealpha,0))(self); + HasToasty = false; + else + return + end + end + end; + }; }; \ No newline at end of file diff --git a/Themes/default/Graphics/ScreenEvaluation SongInformation.lua b/Themes/default/Graphics/ScreenEvaluation SongInformation.lua index 7a9eaae30c..38ca441389 100644 --- a/Themes/default/Graphics/ScreenEvaluation SongInformation.lua +++ b/Themes/default/Graphics/ScreenEvaluation SongInformation.lua @@ -1,35 +1,20 @@ return Def.ActorFrame { LoadFont("Common Normal") .. { Name="TextTitle"; - InitCommand=function(self) - self:y(-16.5); - self:zoom(0.875); - self:maxwidth(256/0.875); - end; - OnCommand=function(self) - self:shadowlength(1); - end; + InitCommand=cmd(y,-16.5;zoom,0.875;maxwidth,256/0.875;); + OnCommand=cmd(shadowlength,1); +-- TickCommand=cmd(finishtweening;diffusealpha,0;addx,-10;zoomx,1.25;zoomy,0;decelerate,0.25;diffusealpha,1;addx,10;zoom,1;sleep,0;glow,Color("White");decelerate,0.275;glow,Color("Invisible")); }; LoadFont("Common Normal") .. { Name="TextSubtitle"; - InitCommand=function(self) - self:zoom(0.5); - self:maxwidth(256/0.5); - end; - OnCommand=function(self) - self:shadowlength(1); - end; + InitCommand=cmd(zoom,0.5;maxwidth,256/0.5); + OnCommand=cmd(shadowlength,1); +-- TickCommand=cmd(finishtweening;diffusealpha,0;addy,-10;addx,10;decelerate,0.25;diffusealpha,1;addy,10;addx,-10); }; LoadFont("Common Normal") .. { Name="TextArtist"; - InitCommand=function(self) - self:y(18); - self:zoom(0.75); - self:maxwidth(256/0.75); - end; - OnCommand=function(self) - self:shadowlength(1); - self:skewx(-0.2); - end; + InitCommand=cmd(y,18;zoom,0.75;maxwidth,256/0.75); + OnCommand=cmd(shadowlength,1;skewx,-0.2); +-- TickCommand=cmd(finishtweening;diffusealpha,0;addy,10;addx,10;decelerate,0.25;diffusealpha,1;addy,-10;addx,-10); }; }; \ No newline at end of file diff --git a/Themes/default/Graphics/ScreenGameplay BPMDisplay.lua b/Themes/default/Graphics/ScreenGameplay BPMDisplay.lua index 22e701211d..f0fbe7818e 100644 --- a/Themes/default/Graphics/ScreenGameplay BPMDisplay.lua +++ b/Themes/default/Graphics/ScreenGameplay BPMDisplay.lua @@ -1,100 +1,96 @@ --- check if players are playing steps with different timingdata. -local numPlayers = GAMESTATE:GetNumPlayersEnabled() - -local function UpdateSingleBPM(self) - local bpmDisplay = self:GetChild("BPMDisplay") - local pn = GAMESTATE:GetMasterPlayerNumber() - local pState = GAMESTATE:GetPlayerState(pn); - local songPosition = pState:GetSongPosition() - local bpm = songPosition:GetCurBPS() * 60 - bpmDisplay:settext( string.format("%03.2f",bpm) ) -end - -local displaySingle = Def.ActorFrame{ - -- manual bpm display - LoadFont("BPMDisplay", "bpm")..{ - Name="BPMDisplay"; - InitCommand=function(self) - self:zoom(0.675); - self:shadowlength(1); - end; - }; -}; - -displaySingle.InitCommand=function(self) - self:SetUpdateFunction(UpdateSingleBPM); -end; - -if numPlayers == 1 then - return displaySingle -else - -- check if both players are playing the same steps - local stepsP1 = GAMESTATE:GetCurrentSteps(PLAYER_1) - local stepsP2 = GAMESTATE:GetCurrentSteps(PLAYER_2) - - if not stepsP1 or not stepsP2 then - return displaySingle - end - - local stP1 = stepsP1:GetStepsType() - local stP2 = stepsP2:GetStepsType() - - local diffP1 = stepsP1:GetDifficulty() - local diffP2 = stepsP2:GetDifficulty() - - -- get timing data... - local timingP1 = stepsP1:GetTimingData() - local timingP2 = stepsP2:GetTimingData() - - --if stP1 == stP2 and diffP1 == diffP2 then - if timingP1 == timingP2 then - -- both players are steps with the same TimingData; only need one. - return displaySingle - end - - -- otherwise, we have some more work to do. - - local function Update2PBPM(self) - local dispP1 = self:GetChild("DisplayP1") - local dispP2 = self:GetChild("DisplayP2") - - -- needs current bpm for p1 and p2 - for pn in ivalues(PlayerNumber) do - local bpmDisplay = (pn == PLAYER_1) and dispP1 or dispP2 - local pState = GAMESTATE:GetPlayerState(pn); - local songPosition = pState:GetSongPosition() - local bpm = songPosition:GetCurBPS() * 60 - bpmDisplay:settext( string.format("%03.2f",bpm) ) - end - end - - local playerOffset = 36 -- was 28 - local displayTwoPlayers = Def.ActorFrame{ - -- manual bpm displays - LoadFont("BPMDisplay", "bpm")..{ - Name="DisplayP1"; - InitCommand=function(self) - self:x(-playerOffset); - self:zoom(0.6); - self:shadowlength(1); - end; - }; - LoadFont("BPMDisplay", "bpm")..{ - Name="DisplayP2"; - InitCommand=function(self) - self:x(playerOffset); - self:zoom(0.6); - self:shadowlength(1); - end; - }; - }; - - displayTwoPlayers.InitCommand=function(self) - self:SetUpdateFunction(Update2PBPM); - end; - - return displayTwoPlayers -end - --- should not get here +-- check if players are playing steps with different timingdata. +local numPlayers = GAMESTATE:GetNumPlayersEnabled() + +local function UpdateSingleBPM(self) + local bpmDisplay = self:GetChild("BPMDisplay") + local pn = GAMESTATE:GetMasterPlayerNumber() + local pState = GAMESTATE:GetPlayerState(pn); + local songPosition = pState:GetSongPosition() + local bpm = songPosition:GetCurBPS() * 60 + bpmDisplay:settext( string.format("%03.2f",bpm) ) +end + +local displaySingle = Def.ActorFrame{ + -- manual bpm display + LoadFont("BPMDisplay", "bpm")..{ + Name="BPMDisplay"; + InitCommand=cmd(zoom,0.675;shadowlength,1); + }; + + --[[ + Def.SongBPMDisplay { + File=THEME:GetPathF("BPMDisplay", "bpm"); + Name="BPMDisplay"; + InitCommand=cmd(zoom,0.675;shadowlength,1); + SetCommand=function(self) self:SetFromGameState() end; + CurrentSongChangedMessageCommand=cmd(playcommand,"Set"); + CurrentCourseChangedMessageCommand=cmd(playcommand,"Set"); + }; + --]] +}; + +displaySingle.InitCommand=cmd(SetUpdateFunction,UpdateSingleBPM); + +if numPlayers == 1 then + return displaySingle +else + -- check if both players are playing the same steps + local stepsP1 = GAMESTATE:GetCurrentSteps(PLAYER_1) + local stepsP2 = GAMESTATE:GetCurrentSteps(PLAYER_2) + + if not stepsP1 or not stepsP2 then + return displaySingle + end + + local stP1 = stepsP1:GetStepsType() + local stP2 = stepsP2:GetStepsType() + + local diffP1 = stepsP1:GetDifficulty() + local diffP2 = stepsP2:GetDifficulty() + + -- get timing data... + local timingP1 = stepsP1:GetTimingData() + local timingP2 = stepsP2:GetTimingData() + + --if stP1 == stP2 and diffP1 == diffP2 then + if timingP1 == timingP2 then + -- both players are steps with the same TimingData; only need one. + return displaySingle + end + + -- otherwise, we have some more work to do. + + local function Update2PBPM(self) + local dispP1 = self:GetChild("DisplayP1") + local dispP2 = self:GetChild("DisplayP2") + + -- needs current bpm for p1 and p2 + for pn in ivalues(PlayerNumber) do + local bpmDisplay = (pn == PLAYER_1) and dispP1 or dispP2 + local pState = GAMESTATE:GetPlayerState(pn); + local songPosition = pState:GetSongPosition() + local bpm = songPosition:GetCurBPS() * 60 + bpmDisplay:settext( string.format("%03.2f",bpm) ) + end + end + + local playerOffset = 36 -- was 28 + local displayTwoPlayers = Def.ActorFrame{ + -- manual bpm displays + LoadFont("BPMDisplay", "bpm")..{ + Name="DisplayP1"; + InitCommand=cmd(x,-playerOffset;zoom,0.6;shadowlength,1); + }; + LoadFont("BPMDisplay", "bpm")..{ + Name="DisplayP2"; + InitCommand=cmd(x,playerOffset;zoom,0.6;shadowlength,1); + }; + }; + + displayTwoPlayers.InitCommand=cmd(SetUpdateFunction,Update2PBPM); + + return displayTwoPlayers +end + +-- should not get here -- return Def.ActorFrame{} \ No newline at end of file diff --git a/Themes/default/Graphics/ScreenHowToInstallSongs scroll.lua b/Themes/default/Graphics/ScreenHowToInstallSongs scroll.lua index 09856c33db..41b7963298 100644 --- a/Themes/default/Graphics/ScreenHowToInstallSongs scroll.lua +++ b/Themes/default/Graphics/ScreenHowToInstallSongs scroll.lua @@ -3,40 +3,14 @@ local squareSize = 8; -- was 18 return Def.ActorFrame { Def.Quad{ - InitCommand=function(self) - self:x(-12); - self:zoom(squareSize); - self:rotationz(45); - self:diffuse(color("#222222")); - end; - GainFocusCommand=function(self) - self:stoptweening(); - self:accelerate(0.25); - self:zoom(squareSize); - self:rotationz(45); - end; - LoseFocusCommand=function(self) - self:stoptweening(); - self:decelerate(0.25); - self:zoom(0); - self:rotationz(360+45); - end; + InitCommand=cmd(x,-12;zoom,squareSize;rotationz,45;diffuse,color("#222222")); + GainFocusCommand=cmd(stoptweening;accelerate,0.25;zoom,squareSize;rotationz,45;); + LoseFocusCommand=cmd(stoptweening;decelerate,0.25;zoom,0;rotationz,360+45); }; LoadFont("Common Normal") .. { Text=gc:GetText(); - InitCommand=function(self) - self:halign(0); - self:zoom(0.625); - end; - GainFocusCommand=function(self) - self:stoptweening(); - self:decelerate(0.25); - self:diffuse(color("1,1,1,1")); - end; - LoseFocusCommand=function(self) - self:stoptweening(); - self:accelerate(0.25); - self:diffuse(color("0.5,0.5,0.5,1")); - end; + InitCommand=cmd(halign,0;zoom,0.625); + GainFocusCommand=cmd(stoptweening;decelerate,0.25;diffuse,color("1,1,1,1")); + LoseFocusCommand=cmd(stoptweening;accelerate,0.25;diffuse,color("0.5,0.5,0.5,1")); }; }; \ No newline at end of file diff --git a/Themes/default/Graphics/ScreenMapControllers exit.lua b/Themes/default/Graphics/ScreenMapControllers exit.lua index c0ac840536..276f1bd9f2 100644 --- a/Themes/default/Graphics/ScreenMapControllers exit.lua +++ b/Themes/default/Graphics/ScreenMapControllers exit.lua @@ -1,33 +1,10 @@ -return LoadFont("Common Normal") .. { - Text=ScreenString("Exit"); - InitCommand=function(self) - self:x(SCREEN_CENTER_X); - self:zoom(0.75); - self:shadowlength(0); - self:diffuse(color("#880000")); - self:NoStroke(); - end; - OnCommand=function(self) - self:diffusealpha(0); - self:decelerate(0.5); - self:diffusealpha(1); - end; - OffCommand=function(self) - self:stoptweening(); - self:accelerate(0.3); - self:diffusealpha(0); - self:queuecommand("Hide"); - end; - HideCommand=function(self) - self:visible(false); - end; - - GainFocusCommand=function(self) - self:diffuseshift(); - self:effectcolor1(color("#FF2222")); - self:effectcolor2(color("#880000")); - end; - LoseFocusCommand=function(self) - self:stopeffect(); - end; -}; +return LoadFont("Common Normal") .. { + Text=ScreenString("Exit"); + InitCommand=cmd(x,SCREEN_CENTER_X;zoom,0.75;shadowlength,0;diffuse,color("#880000");NoStroke); + OnCommand=cmd(diffusealpha,0;decelerate,0.5;diffusealpha,1); + OffCommand=cmd(stoptweening;accelerate,0.3;diffusealpha,0;queuecommand,"Hide"); + HideCommand=cmd(visible,false); + + GainFocusCommand=cmd(diffuseshift;effectcolor1,color("#FF2222");effectcolor2,color("#880000");); + LoseFocusCommand=cmd(stopeffect); +}; diff --git a/Themes/default/Graphics/ScreenQuickSetupOverview icon/default.lua b/Themes/default/Graphics/ScreenQuickSetupOverview icon/default.lua index 41b2e8d258..737cc41cc2 100644 --- a/Themes/default/Graphics/ScreenQuickSetupOverview icon/default.lua +++ b/Themes/default/Graphics/ScreenQuickSetupOverview icon/default.lua @@ -5,80 +5,32 @@ local c = {}; local t = Def.ActorFrame {}; t[#t+1] = Def.ActorFrame { Condition=( gc:GetName() ~= "Back" ); - InitCommand=function(self) - self:x(c.X); - self:y(c.Y); - end; - GainFocusCommand=function(self) - self:finishtweening(); - self:zoom(1.125); - self:bounceend(0.125); - self:zoom(1); - end; - LoseFocusCommand=function(self) - self:stoptweening(); - self:linear(0.125); - self:zoom(0.875); + InitCommand=cmd(x,c.X;y,c.Y); + GainFocusCommand=cmd(finishtweening;zoom,1.125;bounceend,0.125;zoom,1); + LoseFocusCommand=cmd(stoptweening;linear,0.125;zoom,0.875); LoadActor("_base") .. { - GainFocusCommand=function(self) - self:stoptweening(); - self:linear(0.125); - self:diffuse(Color("Orange")); - self:diffusetopedge(Color("Yellow")); - end; - LoseFocusCommand=function(self) - self:stoptweening(); - self:linear(0.125); - self:diffuse(Color("White")); - end; + GainFocusCommand=cmd(stoptweening;linear,0.125;diffuse,Color("Orange");diffusetopedge,Color("Yellow")); + LoseFocusCommand=cmd(stoptweening;linear,0.125;diffuse,Color("White")); }; LoadFont("Common Normal") .. { Text=gc:GetName(); - InitCommand=function(self) - self:strokecolor(Color("White")); - end; - OnCommand=function(self) - self:diffuse(Color("Black")); - end; + InitCommand=cmd(strokecolor,Color("White")); + OnCommand=cmd(diffuse,Color("Black")); }; }; t[#t+1] = Def.ActorFrame { Condition=( gc:GetName() == "Back" ); - InitCommand=function(self) - self:x(c.X); - self:y(c.Y); - end; - GainFocusCommand=function(self) - self:finishtweening(); - self:zoom(1.125); - self:bounceend(0.125); - self:zoom(1); - end; - LoseFocusCommand=function(self) - self:stoptweening(); - self:linear(0.125); - self:zoom(0.875); - end; + InitCommand=cmd(x,c.X;y,c.Y); + GainFocusCommand=cmd(finishtweening;zoom,1.125;bounceend,0.125;zoom,1); + LoseFocusCommand=cmd(stoptweening;linear,0.125;zoom,0.875); LoadActor("_base") .. { - GainFocusCommand=function(self) - self:stoptweening(); - self:linear(0.125); - self:diffuse(Color("Red")); - end; - LoseFocusCommand=function(self) - self:stoptweening(); - self:linear(0.125); - self:diffuse(Color("White")); - end; + GainFocusCommand=cmd(stoptweening;linear,0.125;diffuse,Color("Red")); + LoseFocusCommand=cmd(stoptweening;linear,0.125;diffuse,Color("White")); }; LoadFont("Common Normal") .. { Text=gc:GetName(); - InitCommand=function(self) - self:strokecolor(Color("White")); - end; - OnCommand=function(self) - self:diffuse(Color("Black")); - end; + InitCommand=cmd(strokecolor,Color("White")); + OnCommand=cmd(diffuse,Color("Black")); }; }; diff --git a/Themes/default/Graphics/ScreenSelectMusic CourseContentsList.lua b/Themes/default/Graphics/ScreenSelectMusic CourseContentsList.lua index 9a7eedf701..1df9511108 100644 --- a/Themes/default/Graphics/ScreenSelectMusic CourseContentsList.lua +++ b/Themes/default/Graphics/ScreenSelectMusic CourseContentsList.lua @@ -1,61 +1,43 @@ return Def.CourseContentsList { MaxSongs = 4; NumItemsToDraw = 8; -- xxx: Doesn't scroll anymore. - ShowCommand=function(self) - self:bouncebegin(0.3); - self:zoomy(1); - end; - HideCommand=function(self) - self:linear(0.3); - self:zoomy(0); - end; +--[[ InitCommand=cmd(x,SCREEN_CENTER_X+160;y,SCREEN_CENTER_Y+91); + OnCommand=cmd(zoomy,0;bounceend,0.3;zoom,1); + OffCommand=cmd(zoomy,1;bouncebegin,0.3;zoomy,0); --]] + ShowCommand=cmd(bouncebegin,0.3;zoomy,1); + HideCommand=cmd(linear,0.3;zoomy,0); SetCommand=function(self) self:SetFromGameState(); self:PositionItems(); self:SetTransformFromHeight(44); self:SetCurrentAndDestinationItem(0); +-- self:SetDestinationItem( self:GetNumItems()-2 ); self:SetLoop(false); self:SetMask(270,0); end; - CurrentTrailP1ChangedMessageCommand=function(self) - self:playcommand("Set"); - end; - CurrentTrailP2ChangedMessageCommand=function(self) - self:playcommand("Set"); - end; + CurrentTrailP1ChangedMessageCommand=cmd(playcommand,"Set"); + CurrentTrailP2ChangedMessageCommand=cmd(playcommand,"Set"); Display = Def.ActorFrame { - InitCommand=function(self) - self:setsize(270,44); - end; + InitCommand=cmd(setsize,270,44); LoadActor(THEME:GetPathG("CourseEntryDisplay","bar")) .. { +-- InitCommand=cmd(diffusetopedge,Color("Invisible")); SetSongCommand=function(self, params) if params.Difficulty then +-- self:diffuse( SONGMAN:GetSongColor(params.Song) ); self:diffuse( CustomDifficultyToColor(params.Difficulty) ); else self:diffuse( color("#FFFFFF") ); +-- self:diffuse( CustomDifficultyToColor(params.Difficulty) ); end - self:finishtweening(); - self:diffusealpha(0); - self:sleep(0.125 * params.Number); - self:linear(0.125); - self:diffusealpha(1); - self:linear(0.05); - self:glow(color("1,1,1,0.5")); - self:decelerate(0.1); - self:glow(color("1,1,1,0")); + (cmd(finishtweening;diffusealpha,0;sleep,0.125*params.Number;linear,0.125;diffusealpha,1;linear,0.05;glow,color("1,1,1,0.5");decelerate,0.1;glow,color("1,1,1,0")))(self); end; }; Def.TextBanner { - InitCommand=function(self) - self:x(-128); - self:y(1); - self:Load("TextBanner"); - self:SetFromString("", "", "", "", "", ""); - end; + InitCommand=cmd(x,-128;y,1;Load,"TextBanner";SetFromString,"", "", "", "", "", ""); SetSongCommand=function(self, params) if params.Song then if GAMESTATE:GetCurrentCourse():GetDisplayFullTitle() == "Abomination" then @@ -75,45 +57,48 @@ return Def.CourseContentsList { self:SetFromSong( params.Song ); end; self:diffuse( CustomDifficultyToColor(params.Difficulty) ); +-- self:glow("1,1,1,0.5"); else self:SetFromString( "??????????", "??????????", "", "", "", "" ); self:diffuse( color("#FFFFFF") ); +-- self:glow("1,1,1,0"); end - self:finishtweening(); - self:zoomy(0); - self:sleep(0.125 * params.Number); - self:linear(0.125); - self:zoomy(1.1); - self:linear(0.05); - self:zoomx(1.1); - self:decelerate(0.1); - self:zoom(1); + (cmd(finishtweening;zoomy,0;sleep,0.125*params.Number;linear,0.125;zoomy,1.1;linear,0.05;zoomx,1.1;decelerate,0.1;zoom,1))(self); end; }; +--[[ LoadFont("CourseEntryDisplay","number") .. { + InitCommand=cmd(x,114+8;y,-12;shadowlength,1); + SetSongCommand=function(self, params) + self:settext(string.format("#%i", params.Number)); + + (cmd(finishtweening;zoom,0.5;zoomy,0.5*1.5;diffusealpha,0;sleep,0.125*params.Number;linear,0.125;diffusealpha,1;linear,0.05;zoomy,0.5*1;zoomx,0.5*1.1;glow,color("1,1,1,0.5");decelerate,0.1;zoom,0.5;glow,color("1,1,1,0")))(self); + end; + }; --]] LoadFont("CourseEntryDisplay","difficulty") .. { Text="0"; - InitCommand=function(self) - self:x(114); - self:y(0); - self:zoom(0.75); - self:shadowlength(1); - end; + InitCommand=cmd(x,114;y,0;zoom,0.75;shadowlength,1); SetSongCommand=function(self, params) if params.PlayerNumber ~= GAMESTATE:GetMasterPlayerNumber() then return end self:settext( params.Meter ); self:diffuse( CustomDifficultyToColor(params.Difficulty) ); - self:finishtweening(); - self:zoomy(0); - self:sleep(0.125 * params.Number); - self:linear(0.125); - self:zoomy(1.1); - self:linear(0.05); - self:zoomx(1.1); - self:decelerate(0.1); - self:zoom(1); + (cmd(finishtweening;zoomy,0;sleep,0.125*params.Number;linear,0.125;zoomy,1.1;linear,0.05;zoomx,1.1;decelerate,0.1;zoom,1))(self); end; }; +--[[ LoadFont("Common","normal") .. { + OnCommand=cmd(x,0;y,-8;zoom,0.7;shadowlength,0); + DifficultyChangedCommand=function(self, params) + if params.PlayerNumber ~= GAMESTATE:GetMasterPlayerNumber() then return end + self:settext( params.Meter ); + self:diffuse( CourseDifficultyColors[params.Difficulty] ); + end; + }; --]] + +--[[ LoadFont("Common","normal") .. { + OnCommand=cmd(x,SCREEN_CENTER_X-192;y,SCREEN_CENTER_Y-230;horizalign,right;shadowlength,0); + SetSongCommand=function(self, params) self:settext(params.Modifiers); end; + }; --]] + }; }; \ No newline at end of file diff --git a/Themes/default/Graphics/ScreenSelectMusic DifficultyDisplay/default.lua b/Themes/default/Graphics/ScreenSelectMusic DifficultyDisplay/default.lua index ce7c3e9bc5..c5cea3d73f 100644 --- a/Themes/default/Graphics/ScreenSelectMusic DifficultyDisplay/default.lua +++ b/Themes/default/Graphics/ScreenSelectMusic DifficultyDisplay/default.lua @@ -60,45 +60,20 @@ for idx,diff in pairs(Difficulty) do c.Meter:settext( meter ); self:playcommand( bHasStepsTypeAndDifficulty and "Show" or "Hide" ); end; - CurrentSongChangedMessageCommand=function(self) - self:playcommand("Set"); - end; + CurrentSongChangedMessageCommand=cmd(playcommand,"Set"); -- LoadActor("_barpeice " .. sDifficulty ) .. { Name="BarPeice"; - ShowCommand=function(self) - self:stoptweening(); - self:linear(0.1); - self:diffuse(CustomDifficultyToColor( sDifficulty )); - end; - HideCommand=function(self) - self:stoptweening(); - self:decelerate(0.05); - self:diffuse(CustomDifficultyToDarkColor( sDifficulty )); - end; - InitCommand=function(self) - self:diffuse(CustomDifficultyToColor( sDifficulty )); - end; + ShowCommand=cmd(stoptweening;linear,0.1;diffuse,CustomDifficultyToColor( sDifficulty )); + HideCommand=cmd(stoptweening;decelerate,0.05;diffuse,CustomDifficultyToDarkColor( sDifficulty )); + InitCommand=cmd(diffuse,CustomDifficultyToColor( sDifficulty )); }; LoadFont("StepsDisplay","Meter") .. { Name="Meter"; Text=(sDifficulty == "Edit") and "0 Edits" or "0"; - ShowCommand=function(self) - self:stoptweening(); - self:linear(0.1); - self:diffuse(CustomDifficultyToColor( sDifficulty )); - end; - HideCommand=function(self) - self:stoptweening(); - self:decelerate(0.05); - self:diffuse(CustomDifficultyToDarkColor( sDifficulty )); - end; - InitCommand=function(self) - self:x(-64 - 8 + tLocation[sDifficulty]); - self:shadowlength(1); - self:zoom(0.75); - self:diffuse(CustomDifficultyToColor( sDifficulty )); - end; + ShowCommand=cmd(stoptweening;linear,0.1;diffuse,CustomDifficultyToColor( sDifficulty )); + HideCommand=cmd(stoptweening;decelerate,0.05;diffuse,CustomDifficultyToDarkColor( sDifficulty )); + InitCommand=cmd(x,-64-8+tLocation[sDifficulty];shadowlength,1;zoom,0.75;diffuse,CustomDifficultyToColor( sDifficulty )); }; }; end diff --git a/Themes/default/Graphics/ScreenSelectMusic DifficultyList.lua b/Themes/default/Graphics/ScreenSelectMusic DifficultyList.lua index 096266a81d..3c8c90295a 100644 --- a/Themes/default/Graphics/ScreenSelectMusic DifficultyList.lua +++ b/Themes/default/Graphics/ScreenSelectMusic DifficultyList.lua @@ -2,157 +2,85 @@ return Def.ActorFrame { CurrentSongChangedMessageCommand=function(self) local song = GAMESTATE:GetCurrentSong(); if song then +-- self:setaux(0); self:finishtweening(); self:playcommand("TweenOn"); elseif not song and self:GetZoomX() == 1 then +-- self:setaux(1); self:finishtweening(); self:playcommand("TweenOff"); end; end; Def.Quad { - InitCommand=function(self) - self:y(-14); - self:zoomto(164, 2); - self:fadeleft(8 / 164); - self:faderight(8 / 164); - end; - OnCommand=function(self) - self:diffuse(Color("Black")); - self:diffusealpha(0); - self:linear(0.35); - self:diffusealpha(0.5); - end; + InitCommand=cmd(y,-14;zoomto,164,2;fadeleft,8/164;faderight,8/164); + OnCommand=cmd(diffuse,Color("Black");diffusealpha,0;linear,0.35;diffusealpha,0.5); }; Def.Quad { - InitCommand=function(self) - self:y(24 * 5 - 10); - self:zoomto(164, 2); - self:fadeleft(8 / 164); - self:faderight(8 / 164); - end; - OnCommand=function(self) - self:diffuse(Color("Black")); - self:diffusealpha(0); - self:linear(0.35); - self:diffusealpha(0.5); - end; + InitCommand=cmd(y,24*(5)-10;zoomto,164,2;fadeleft,8/164;faderight,8/164); + OnCommand=cmd(diffuse,Color("Black");diffusealpha,0;linear,0.35;diffusealpha,0.5); }; Def.StepsDisplayList { Name="StepsDisplayListRow"; CursorP1 = Def.ActorFrame { - InitCommand=function(self) - self:x(-128 + 16); - self:player(PLAYER_1); - end; + InitCommand=cmd(x,-128+16;player,PLAYER_1); PlayerJoinedMessageCommand=function(self, params) if params.Player == PLAYER_1 then self:visible(true); - self:zoom(0); - self:bounceend(1); - self:zoom(1); + (cmd(zoom,0;bounceend,1;zoom,1))(self); end; end; PlayerUnjoinedMessageCommand=function(self, params) if params.Player == PLAYER_1 then self:visible(true); - self:bouncebegin(1); - self:zoom(0); + (cmd(bouncebegin,1;zoom,0))(self); end; end; LoadActor(THEME:GetPathG("_StepsDisplayListRow","Cursor")) .. { - InitCommand=function(self) - self:diffuse(PlayerColor(PLAYER_1)); - self:x(8); - self:zoom(0.75); - end; + InitCommand=cmd(diffuse,PlayerColor(PLAYER_1);x,8;zoom,0.75); }; LoadActor(THEME:GetPathG("_StepsDisplayListRow","arrow")) .. { - InitCommand=function(self) - self:x(20); - self:diffuse(PlayerColor(PLAYER_1)); - end; - OnCommand=function(self) - self:thump(1); - self:effectmagnitude(1, 1.25, 1); - self:effectclock('beat'); - end; + InitCommand=cmd(x,20;diffuse,PlayerColor(PLAYER_1)); + OnCommand=cmd(thump,1;effectmagnitude,1,1.25,1;effectclock,'beat';); }; LoadFont("Common Normal") .. { Text="P1"; - InitCommand=function(self) - self:x(2); - self:diffuse(PlayerColor(PLAYER_1)); - self:shadowlength(1); - end; - OnCommand=function(self) - self:zoom(0.75); - end; + InitCommand=cmd(x,2;diffuse,PlayerColor(PLAYER_1);shadowlength,1); + OnCommand=cmd(zoom,0.75); }; }; CursorP2 = Def.ActorFrame { - InitCommand=function(self) - self:x(128 - 16); - self:player(PLAYER_2); - end; + InitCommand=cmd(x,128-16;player,PLAYER_2); PlayerJoinedMessageCommand=function(self, params) if params.Player == PLAYER_2 then self:visible(true); - self:zoom(0); - self:bounceend(1); - self:zoom(1); + (cmd(zoom,0;bounceend,1;zoom,1))(self); end; end; PlayerUnjoinedMessageCommand=function(self, params) if params.Player == PLAYER_2 then self:visible(true); - self:bouncebegin(1); - self:zoom(0); + (cmd(bouncebegin,1;zoom,0))(self); end; end; LoadActor(THEME:GetPathG("_StepsDisplayListRow","Cursor")) .. { - InitCommand=function(self) - self:diffuse(PlayerColor(PLAYER_2)); - self:x(-8); - self:zoom(0.75); - self:zoomx(-0.75); - end; + InitCommand=cmd(diffuse,PlayerColor(PLAYER_2);x,-8;zoom,0.75;zoomx,-0.75;); }; LoadActor(THEME:GetPathG("_StepsDisplayListRow","arrow")) .. { - InitCommand=function(self) - self:x(-20); - self:diffuse(PlayerColor(PLAYER_2)); - self:zoomx(-1); - end; - OnCommand=function(self) - self:thump(1); - self:effectmagnitude(1, 1.25, 1); - self:effectclock('beat'); - end; + InitCommand=cmd(x,-20;diffuse,PlayerColor(PLAYER_2);zoomx,-1); + OnCommand=cmd(thump,1;effectmagnitude,1,1.25,1;effectclock,'beat';); }; LoadFont("Common Normal") .. { Text="P2"; - InitCommand=function(self) - self:x(-2); - self:diffuse(PlayerColor(PLAYER_2)); - self:shadowlength(1); - end; - OnCommand=function(self) - self:zoom(0.75); - end; + InitCommand=cmd(x,-2;diffuse,PlayerColor(PLAYER_2);shadowlength,1); + OnCommand=cmd(zoom,0.75); }; }; CursorP1Frame = Def.Actor{ - ChangeCommand=function(self) - self:stoptweening(); - self:decelerate(0.05); - end; + ChangeCommand=cmd(stoptweening;decelerate,0.05); }; CursorP2Frame = Def.Actor{ - ChangeCommand=function(self) - self:stoptweening(); - self:decelerate(0.05); - end; + ChangeCommand=cmd(stoptweening;decelerate,0.05); }; }; }; \ No newline at end of file diff --git a/Themes/default/Graphics/ScreenSelectMusic SegmentDisplay/default.lua b/Themes/default/Graphics/ScreenSelectMusic SegmentDisplay/default.lua index 878f5ba42b..bd3b8b90ee 100644 --- a/Themes/default/Graphics/ScreenSelectMusic SegmentDisplay/default.lua +++ b/Themes/default/Graphics/ScreenSelectMusic SegmentDisplay/default.lua @@ -3,16 +3,8 @@ local iconPath = "_timingicons" local leftColX = -144 local rightColX = -leftColX -local showCmd = function(self) - self:stoptweening(); - self:accelerate(0.1); - self:diffusealpha(1); -end; -local hideCmd = function(self) - self:stoptweening(); - self:accelerate(0.1); - self:diffusealpha(0); -end; +local showCmd = cmd(stoptweening;accelerate,0.1;diffusealpha,1) +local hideCmd = cmd(stoptweening;accelerate,0.1;diffusealpha,0) local SegmentTypes = { Stops = { Frame = 0, xPos = leftColX, yPos = 0 }, @@ -25,10 +17,8 @@ local SegmentTypes = { }; local t = Def.ActorFrame{ - BeginCommand=function(self) - self:playcommand("SetIcons"); - self:playcommand("SetAttacksIconMessage"); - end; + BeginCommand=cmd(playcommand,"SetIcons";playcommand,"SetAttacksIconMessage"); + --OffCommand=cmd( RunCommandsOnChildren,cmd(playcommand,"Hide") ); SetIconsCommand=function(self) local stops = self:GetChild("StopsIcon") @@ -95,91 +85,47 @@ local t = Def.ActorFrame{ LoadActor(iconPath)..{ Name="WarpsIcon"; - InitCommand=function(self) - self:animate(false); - self:x(SegmentTypes.Warps.xPos); - self:y(SegmentTypes.Warps.yPos); - self:setstate(SegmentTypes.Warps.Frame); - self:diffusealpha(0); - end; + InitCommand=cmd(animate,false;x,SegmentTypes.Warps.xPos;y,SegmentTypes.Warps.yPos;setstate,SegmentTypes.Warps.Frame;diffusealpha,0); ShowCommand=showCmd; HideCommand=hideCmd; }; LoadActor(iconPath)..{ Name="StopsIcon"; - InitCommand=function(self) - self:animate(false); - self:x(SegmentTypes.Stops.xPos); - self:y(SegmentTypes.Stops.yPos); - self:setstate(SegmentTypes.Stops.Frame); - self:diffusealpha(0); - end; + InitCommand=cmd(animate,false;x,SegmentTypes.Stops.xPos;y,SegmentTypes.Stops.yPos;setstate,SegmentTypes.Stops.Frame;diffusealpha,0); ShowCommand=showCmd; HideCommand=hideCmd; }; LoadActor(iconPath)..{ Name="DelaysIcon"; - InitCommand=function(self) - self:animate(false); - self:x(SegmentTypes.Delays.xPos); - self:y(SegmentTypes.Delays.yPos); - self:setstate(SegmentTypes.Delays.Frame); - self:diffusealpha(0); - end; + InitCommand=cmd(animate,false;x,SegmentTypes.Delays.xPos;y,SegmentTypes.Delays.yPos;setstate,SegmentTypes.Delays.Frame;diffusealpha,0); ShowCommand=showCmd; HideCommand=hideCmd; }; LoadActor(iconPath)..{ Name="AttacksIcon"; - InitCommand=function(self) - self:animate(false); - self:x(SegmentTypes.Attacks.xPos); - self:y(SegmentTypes.Attacks.yPos); - self:setstate(SegmentTypes.Attacks.Frame); - self:diffusealpha(0); - end; + InitCommand=cmd(animate,false;x,SegmentTypes.Attacks.xPos;y,SegmentTypes.Attacks.yPos;setstate,SegmentTypes.Attacks.Frame;diffusealpha,0); ShowCommand=showCmd; HideCommand=hideCmd; }; LoadActor(iconPath)..{ Name="ScrollsIcon"; - InitCommand=function(self) - self:animate(false); - self:x(SegmentTypes.Scrolls.xPos); - self:y(SegmentTypes.Scrolls.yPos); - self:setstate(SegmentTypes.Scrolls.Frame); - self:diffusealpha(0); - end; + InitCommand=cmd(animate,false;x,SegmentTypes.Scrolls.xPos;y,SegmentTypes.Scrolls.yPos;setstate,SegmentTypes.Scrolls.Frame;diffusealpha,0); ShowCommand=showCmd; HideCommand=hideCmd; }; LoadActor(iconPath)..{ Name="SpeedsIcon"; - InitCommand=function(self) - self:animate(false); - self:x(SegmentTypes.Speeds.xPos); - self:y(SegmentTypes.Speeds.yPos); - self:setstate(SegmentTypes.Speeds.Frame); - self:diffusealpha(0); - end; + InitCommand=cmd(animate,false;x,SegmentTypes.Speeds.xPos;y,SegmentTypes.Speeds.yPos;setstate,SegmentTypes.Speeds.Frame;diffusealpha,0); ShowCommand=showCmd; HideCommand=hideCmd; }; LoadActor(iconPath)..{ Name="FakesIcon"; - function(self) - self:animate(false); - self:x(SegmentTypes.Fakes.xPos); - self:y(SegmentTypes.Fakes.yPos); - self:setstate(SegmentTypes.Fales.Frame); - self:diffusealpha(0); - end; + InitCommand=cmd(animate,false;x,SegmentTypes.Fakes.xPos;y,SegmentTypes.Fakes.yPos;setstate,SegmentTypes.Fakes.Frame;diffusealpha,0); ShowCommand=showCmd; HideCommand=hideCmd; }; - CurrentSongChangedMessageCommand=function(self) - self:playcommand("SetIcons"); - end; + CurrentSongChangedMessageCommand=cmd(playcommand,"SetIcons";); CurrentStepsP1ChangedMessageCommand=function(self) MESSAGEMAN:Broadcast("SetAttacksIcon",{Player = PLAYER_1}) end; CurrentStepsP2ChangedMessageCommand=function(self) MESSAGEMAN:Broadcast("SetAttacksIcon",{Player = PLAYER_2}) end; }; diff --git a/Themes/default/Graphics/ScreenSelectPlayMode Icon/default.lua b/Themes/default/Graphics/ScreenSelectPlayMode Icon/default.lua index 99aa306a74..dfd7a92e6c 100644 --- a/Themes/default/Graphics/ScreenSelectPlayMode Icon/default.lua +++ b/Themes/default/Graphics/ScreenSelectPlayMode Icon/default.lua @@ -1,24 +1,11 @@ local gc = Var("GameCommand"); local t = Def.ActorFrame {}; t[#t+1] = Def.ActorFrame { - GainFocusCommand=function(self) - self:stoptweening(); - self:bob(); -- the heck is this? - self:effectmagnitude(0, 6, 0); - self:decelerate(0.05); - self:zoom(1); - end; - LoseFocusCommand=function(self) - self:stoptweening(); - self:stopeffect(); - self:decelerate(0.1); - self:zoom(0.6); - end; + GainFocusCommand=cmd(stoptweening;bob;effectmagnitude,0,6,0;decelerate,0.05;zoom,1); + LoseFocusCommand=cmd(stoptweening;stopeffect;decelerate,0.1;zoom,0.6); LoadActor("_background base")..{ - InitCommand=function(self) - self:diffuse(ModeIconColors[gc:GetName()]); - end; + InitCommand=cmd(diffuse,ModeIconColors[gc:GetName()]); }; LoadActor("_background effect"); LoadActor("_gloss"); @@ -27,46 +14,24 @@ t[#t+1] = Def.ActorFrame { -- todo: generate a better font for these. LoadFont("_helveticaneuelt std extblk cn 42px")..{ - InitCommand=function(self) - self:y(-12); - self:zoom(1.1); - self:diffuse(color("#000000")); - self:uppercase(true); - self:settext(gc:GetText()); - end; - GainFocusCommand=function(self) - self:diffuse(Color.Black); - self:stopeffect(); - end; - LoseFocusCommand=function(self) - self:diffuse(Color.Black); - self:stopeffect(); - end; + InitCommand=cmd(y,-12;zoom,1.1;diffuse,color("#000000");uppercase,true;settext,gc:GetText();); + GainFocusCommand=cmd(diffuse,Color.Black;stopeffect); + LoseFocusCommand=cmd(diffuse,Color.Black;stopeffect); }; LoadFont("_helveticaneuelt std extblk cn 42px")..{ - InitCommand=function(self) - self:y(27.5); - self:zoom(0.45); - self:maxwidth(320 * 1.6); - self:uppercase(true); - self:settext(THEME:GetString(Var "LoadingScreen", gc:GetName().."Explanation")); - end; - GainFocusCommand=function(self) - self:diffuse(Color.White); - self:stopeffect(); - end; - LoseFocusCommand=function(self) - self:diffuse(Color.White); - self:stopeffect(); - end; + InitCommand=cmd(y,27.5;zoom,0.45;maxwidth,320*1.6;uppercase,true;settext,THEME:GetString(Var "LoadingScreen", gc:GetName().."Explanation")); + GainFocusCommand=cmd(diffuse,Color.White;stopeffect); + LoseFocusCommand=cmd(diffuse,Color.White;stopeffect); }; LoadActor("_background base") .. { - DisabledCommand=function(self) - self:diffuse(color("0,0,0,0.5")); - end; - EnabledCommand=function(self) - self:diffuse(color("1,1,1,0")); - end; + DisabledCommand=cmd(diffuse,color("0,0,0,0.5")); + EnabledCommand=cmd(diffuse,color("1,1,1,0")); }; + --[[ + 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")); + }; + --]] }; return t \ No newline at end of file diff --git a/Themes/default/Graphics/ScreenSelectPlayMode scroller/default.lua b/Themes/default/Graphics/ScreenSelectPlayMode scroller/default.lua index e387139cd9..16cbba83d7 100644 --- a/Themes/default/Graphics/ScreenSelectPlayMode scroller/default.lua +++ b/Themes/default/Graphics/ScreenSelectPlayMode scroller/default.lua @@ -14,213 +14,57 @@ t[#t+1] = Def.ActorFrame { -- GainFocusCommand=cmd(visible,true); -- LoseFocusCommand=cmd(visible,false); LoadActor(THEME:GetPathG("ScreenSelectPlayMode","BackgroundFrame")) .. { - InitCommand=function(self) - self:diffuse(Color("Black")); - self:diffusealpha(0.7); - end; - GainFocusCommand=function(self) - self:visible(true); - end; - LoseFocusCommand=function(self) - self:visible(false); - end; + InitCommand=cmd(diffuse,Color("Black");diffusealpha,0.7); + GainFocusCommand=cmd(visible,true); + LoseFocusCommand=cmd(visible,false); }; LoadActor("_HighlightFrame") .. { - InitCommand=function(self) - self:diffuse(ModeIconColors[gc:GetName()]); - self:diffusealpha(0); - end; - GainFocusCommand=function(self) - self:finishtweening(); - self:diffusealpha(1); - self:glow(Color.Alpha(Color.White,1)); - self:linear(0.1); - self:glow(Color.Invisible); - end; - LoseFocusCommand=function(self) - self:finishtweening(); - self:diffusealpha(0); - self:glow(Color.Invisible); - end; - OffFocusedCommand=function(self) - self:finishtweening(); - self:glow(Color("White")); - self:decelerate(1); - self:glow(Color("Invisible")); - end; + InitCommand=cmd(diffuse,ModeIconColors[gc:GetName()];diffusealpha,0); + GainFocusCommand=cmd(finishtweening;diffusealpha,1;glow,Color.Alpha(Color.White,1);linear,0.1;glow,Color.Invisible); + LoseFocusCommand=cmd(finishtweening;diffusealpha,0;glow,Color.Invisible); + OffFocusedCommand=cmd(finishtweening;glow,Color("White");decelerate,1;glow,Color("Invisible")); }; }; -- Emblem Frame t[#t+1] = Def.ActorFrame { FOV=90; - InitCommand=function(self) - self:x(-192); - self:zoom(0.9); - end; + InitCommand=cmd(x,-192;zoom,0.9); -- Main Shadow LoadActor( gc:GetName() ) .. { - InitCommand=function(self) - self:x(2); - self:y(2); - self:diffuse(Color("Black")); - self:diffusealpha(0); - self:zoom(0.75); - end; - GainFocusCommand=function(self) - self:stoptweening(); - self:stopeffect(); - self:smooth(0.1); - self:diffusealpha(0); - self:zoom(1); - self:decelerate(0.05); - self:diffusealpha(0.5); - self:pulse(); - self:effecttiming(0.75, 0.125, 0.125, 0.75); - self:effectmagnitude(0.95, 1, 1); - end; - LoseFocusCommand=function(self) - self:stoptweening(); - self:stopeffect(); - self:smooth(0.2); - self:diffusealpha(0); - self:zoom(0.75); - end; - OffFocusedCommand=function(self) - self:finishtweening(); - self:stopeffect(); - self:glow(ModeIconColors[gc:GetName()]); - self:decelerate(0.5); - self:rotationy(360); - end; + InitCommand=cmd(x,2;y,2;diffuse,Color("Black");diffusealpha,0;zoom,0.75); + GainFocusCommand=cmd(stoptweening;stopeffect;smooth,0.1;diffusealpha,0;zoom,1;decelerate,0.05;diffusealpha,0.5;pulse;effecttiming,0.75,0.125,0.125,0.75;effectmagnitude,0.95,1,1;); + LoseFocusCommand=cmd(stoptweening;stopeffect;smooth,0.2;diffusealpha,0;zoom,0.75;); + OffFocusedCommand=cmd(finishtweening;stopeffect;glow,ModeIconColors[gc:GetName()];decelerate,0.5;rotationy,360;); }; -- Main Emblem LoadActor( gc:GetName() ) .. { - InitCommand=function(self) - self:diffusealpha(0); - self:zoom(0.75); - end; - GainFocusCommand=function(self) - self:stoptweening(); - self:stopeffect(); - self:smooth(0.1); - self:diffusealpha(1); - self:zoom(1); - self:glow(Color("White")); - self:decelerate(0.05); - self:glow(Color("Invisible")); - self:pulse(); - self:effecttiming(0.75, 0.125, 0.125, 0.75); - self:effectmagnitude(0.95, 1, 1); - end; - LoseFocusCommand=function(self) - self:stoptweening(); - self:stopeffect(); - self:smooth(0.2); - self:diffusealpha(0); - self:zoom(0.75); - self:glow(Color("Invisible")); - end; - OffFocusedCommand=function(self) - self:finishtweening(); - self:stopeffect(); - self:glow(ModeIconColors[gc:GetName()]); - self:decelerate(0.5); - self:rotationy(360); - self:glow(Color("Invisible")); - end; + InitCommand=cmd(diffusealpha,0;zoom,0.75); + GainFocusCommand=cmd(stoptweening;stopeffect;smooth,0.1;diffusealpha,1;zoom,1;glow,Color("White");decelerate,0.05;glow,Color("Invisible");pulse;effecttiming,0.75,0.125,0.125,0.75;effectmagnitude,0.95,1,1;); + LoseFocusCommand=cmd(stoptweening;stopeffect;smooth,0.2;diffusealpha,0;zoom,0.75;glow,Color("Invisible")); + OffFocusedCommand=cmd(finishtweening;stopeffect;glow,ModeIconColors[gc:GetName()];decelerate,0.5;rotationy,360;glow,Color("Invisible")); }; }; -- Text Frame t[#t+1] = Def.ActorFrame { - InitCommand=function(self) - self:x(-192/2); - self:y(-10); - end; + InitCommand=cmd(x,-192/2;y,-10); Def.Quad { - InitCommand=function(self) - self:horizalign(left); - self:y(20); - self:zoomto(320, 2); - self:diffuse(ModeIconColors[gc:GetName()]); - self:diffusealpha(0); - self:fadeleft(0.35); - self:faderight(0.35); - end; - GainFocusCommand=function(self) - self:stoptweening(); - self:linear(0.1); - self:diffusealpha(1); - end; - LoseFocusCommand=function(self) - self:stoptweening(); - self:linear(0.1); - self:diffusealpha(0); - end; + InitCommand=cmd(horizalign,left;y,20;zoomto,320,2;diffuse,ModeIconColors[gc:GetName()];diffusealpha,0;fadeleft,0.35;faderight,0.35); + GainFocusCommand=cmd(stoptweening;linear,0.1;diffusealpha,1); + LoseFocusCommand=cmd(stoptweening;linear,0.1;diffusealpha,0); }; LoadFont("_helveticaneuelt std extblk cn 42px") .. { Text=gc:GetText(); - InitCommand=function(self) - self:horizalign(left); - self:diffuse(ModeIconColors[gc:GetName()]); - self:shadowcolor(ColorDarkTone(ModeIconColors[gc:GetName()])); - self:shadowlength(2); - self:diffusealpha(0); - self:skewx(-0.125); - end; - GainFocusCommand=function(self) - self:stoptweening(); - self:x(-32); - self:decelerate(0.1); - self:diffusealpha(1); - self:x(0); - end; - LoseFocusCommand=function(self) - self:stoptweening(); - self:x(0); - self:accelerate(0.1); - self:diffusealpha(0); - self:x(32); - self:diffusealpha(0); - end; + InitCommand=cmd(horizalign,left;diffuse,ModeIconColors[gc:GetName()];shadowcolor,ColorDarkTone(ModeIconColors[gc:GetName()]);shadowlength,2;diffusealpha,0;skewx,-0.125); + GainFocusCommand=cmd(stoptweening;x,-32;decelerate,0.1;diffusealpha,1;x,0); + LoseFocusCommand=cmd(stoptweening;x,0;accelerate,0.1;diffusealpha,0;x,32;diffusealpha,0); }; LoadFont("_helveticaneuelt std extblk cn 42px") .. { Text=THEME:GetString(Var "LoadingScreen", gc:GetName() .. "Explanation"); - InitCommand=function(self) - self:horizalign(right); - self:x(320); - self:y(30); - self:shadowlength(1); - self:diffusealpha(0); - self:skewx(-0.125); - self:zoom(0.5); - end; - GainFocusCommand=function(self) - self:stoptweening(); - self:x(320+32); - self:decelerate(0.1); - self:diffusealpha(1); - self:x(320); - end; - LoseFocusCommand=function(self) - self:stoptweening(); - self:x(320); - self:accelerate(0.1); - self:diffusealpha(0); - self:x(320-32); - self:diffusealpha(0); - end; + InitCommand=cmd(horizalign,right;x,320;y,30;shadowlength,1;diffusealpha,0;skewx,-0.125;zoom,0.5); + GainFocusCommand=cmd(stoptweening;x,320+32;decelerate,0.1;diffusealpha,1;x,320); + LoseFocusCommand=cmd(stoptweening;x,320;accelerate,0.1;diffusealpha,0;x,320-32;diffusealpha,0); }; }; -t.GainFocusCommand=function(self) - self:finishtweening(); - self:visible(true); - self:zoom(1.1); - self:decelerate(0.25); - self:zoom(1); -end; -t.LoseFocusCommand=function(self) - self:finishtweening(); - self:visible(false); - self:zoom(1); -end; +t.GainFocusCommand=cmd(finishtweening;visible,true;zoom,1.1;decelerate,0.25;zoom,1); +t.LoseFocusCommand=cmd(finishtweening;visible,false;zoom,1); return t \ No newline at end of file diff --git a/Themes/default/Graphics/ScreenTitleMenu NetworkStatus.lua b/Themes/default/Graphics/ScreenTitleMenu NetworkStatus.lua index beaff263f0..0f1ef18fe9 100644 --- a/Themes/default/Graphics/ScreenTitleMenu NetworkStatus.lua +++ b/Themes/default/Graphics/ScreenTitleMenu NetworkStatus.lua @@ -1,61 +1,41 @@ -local netConnected = IsNetConnected(); -local loggedOnSMO = IsNetSMOnline(); - -local t = Def.ActorFrame{ - Def.Quad { - InitCommand=function(self) - self:y(-12); - self:x(160); - self:zoomto(320 + 32, 38); - self:vertalign(top); - self:diffuse(Color.Black); - self:diffusealpha(0.5); - end; - OnCommand=function(self) - self:faderight(0.45); - end; - BeginCommand=function(self) - if netConnected then - self:zoomtoheight( 38 ); - else - self:zoomtoheight( 24 ); - end - end; - }; - LoadFont("Common Normal") .. { - InitCommand=function(self) - self:uppercase(true); - self:zoom(0.75); - self:shadowlength(1); - self:horizalign(left); - end; - BeginCommand=function(self) - -- check network status - if netConnected then - self:diffuse( color("0.95,0.975,1,1") ); - self:diffusebottomedge( color("0.72,0.89,1,1") ); - self:settext( Screen.String("Network OK") ); - else - self:diffuse( color("1,1,1,1") ); - self:settext( Screen.String("Offline") ); - end; - end; - }; -}; - -if netConnected then - t[#t+1] = LoadFont("Common Normal") .. { - InitCommand=function(self) - self:y(16); - self:horizalign(left); - self:zoom(0.5875); - self:shadowlength(1); - self:diffuse(color("0.72,0.89,1,1")); - end; - BeginCommand=function(self) - self:settext( string.format(Screen.String("Connected to %s"), GetServerName()) ); - end; - }; -end; - +local netConnected = IsNetConnected(); +local loggedOnSMO = IsNetSMOnline(); + +local t = Def.ActorFrame{ + Def.Quad { + InitCommand=cmd(y,-12;x,160;zoomto,320+32,38;vertalign,top;diffuse,Color.Black;diffusealpha,0.5); + OnCommand=cmd(faderight,0.45); + BeginCommand=function(self) + if netConnected then + self:zoomtoheight( 38 ); + else + self:zoomtoheight( 24 ); + end + end; + }; + LoadFont("Common Normal") .. { + InitCommand=cmd(uppercase,true;zoom,0.75;shadowlength,1;horizalign,left); + BeginCommand=function(self) + -- check network status + if netConnected then + self:diffuse( color("0.95,0.975,1,1") ); + self:diffusebottomedge( color("0.72,0.89,1,1") ); + self:settext( Screen.String("Network OK") ); + else + self:diffuse( color("1,1,1,1") ); + self:settext( Screen.String("Offline") ); + end; + end; + }; +}; + +if netConnected then + t[#t+1] = LoadFont("Common Normal") .. { + InitCommand=cmd(y,16;horizalign,left;zoom,0.5875;shadowlength,1;diffuse,color("0.72,0.89,1,1")); + BeginCommand=function(self) + self:settext( string.format(Screen.String("Connected to %s"), GetServerName()) ); + end; + }; +end; + return t; \ No newline at end of file diff --git a/Themes/default/Graphics/ScreenTitleMenu SystemDirection/default.lua b/Themes/default/Graphics/ScreenTitleMenu SystemDirection/default.lua index 1984fd0044..c9a5c0fc98 100644 --- a/Themes/default/Graphics/ScreenTitleMenu SystemDirection/default.lua +++ b/Themes/default/Graphics/ScreenTitleMenu SystemDirection/default.lua @@ -8,24 +8,12 @@ local fSpacingX = 72; local function MakeDisplayBar( fZoomX, fZoomY ) return Def.ActorFrame { Def.Quad { - InitCommand=function(self) - self:vertalign(bottom); - self:y(1); - self:zoomto(fZoomX+2,fZoomY+2); - end; - OnCommand=function(self) - self:diffuse(Color("Black")); - end; + InitCommand=cmd(vertalign,bottom;y,1;zoomto,fZoomX+2,fZoomY+2); + OnCommand=cmd(diffuse,Color("Black")); }; Def.Quad { - InitCommand=function(self) - self:vertalign(bottom); - self:zoomto(fZoomX,fZoomY); - end; - OnCommand=function(self) - self:diffuse(Color("Orange")); - self:diffusetopedge(Color("Yellow")); - end; + InitCommand=cmd(vertalign,bottom;zoomto,fZoomX,fZoomY); + OnCommand=cmd(diffuse,Color("Orange");diffusetopedge,Color("Yellow")); }; }; end @@ -34,19 +22,13 @@ local function MakeIcon( sTarget ) LoadActor(THEME:GetPathG("MenuTimer","Frame")); LoadFont("Common Normal") .. { Text=sTarget[2]; - InitCommand=function(self) - self:y(24+2); - self:zoom(0.5); - self:shadowlength(1); - end; + InitCommand=cmd(y,24+2;zoom,0.5;shadowlength,1); }; -- LoadFont("Common Normal") .. { Text="0"; - OnCommand=function(self) - self:settext(( PREFSMAN:GetPreference("EventMode") ) - and "∞" or PREFSMAN:GetPreference("SongsPerPlay")); - end; + OnCommand=cmd(settext, + ( PREFSMAN:GetPreference("EventMode") ) and "∞" or PREFSMAN:GetPreference("SongsPerPlay") ); Condition=sTarget[1] == "EventMode"; }; diff --git a/Themes/default/Graphics/ScreenTitleMenu TimingDifficulty.lua b/Themes/default/Graphics/ScreenTitleMenu TimingDifficulty.lua index 5bf5b8006d..c419c97a14 100644 --- a/Themes/default/Graphics/ScreenTitleMenu TimingDifficulty.lua +++ b/Themes/default/Graphics/ScreenTitleMenu TimingDifficulty.lua @@ -2,13 +2,8 @@ return Def.ActorFrame { LoadFont("Common Normal") .. { Text=GetTimingDifficulty(); AltText=""; - InitCommand=function(self) - self:horizalign(left); - self:zoom(0.675); - end; - OnCommand=function(self) - self:shadowlength(1); - end; + InitCommand=cmd(horizalign,left;zoom,0.675); + OnCommand=cmd(shadowlength,1); BeginCommand=function(self) self:settextf( Screen.String("TimingDifficulty"), "" ); end @@ -16,18 +11,12 @@ return Def.ActorFrame { LoadFont("Common Normal") .. { Text=GetTimingDifficulty(); AltText=""; - InitCommand=function(self) - self:x(136); - self:zoom(0.675); - self:halign(0); - end; + InitCommand=cmd(x,136;zoom,0.675;halign,0); OnCommand=function(self) - self:shadowlength(1); - self:skewx(-0.125); + (cmd(shadowlength,1;skewx,-0.125))(self); if GetTimingDifficulty() == 9 then self:settext("Justice"); - self:zoom(0.5); - self:diffuse(ColorLightTone( Color("Orange")) ); + (cmd(zoom,0.5;diffuse,ColorLightTone( Color("Orange")) ))(self); else self:settext( GetTimingDifficulty() ); end diff --git a/Themes/default/Graphics/ScreenTitleMenu scroll.lua b/Themes/default/Graphics/ScreenTitleMenu scroll.lua index be0178b54a..481db13bb6 100644 --- a/Themes/default/Graphics/ScreenTitleMenu scroll.lua +++ b/Themes/default/Graphics/ScreenTitleMenu scroll.lua @@ -2,45 +2,15 @@ local gc = Var("GameCommand"); return Def.ActorFrame { Def.Quad{ - InitCommand=function(self) - self:zoomto(256, 26); - self:fadeleft(0.45); - self:faderight(0.45); - end; - OnCommand=function(self) - self:diffuseshift(); - self:effectcolor1(color("0,0,0,0.5")); - self:effectcolor2(color("0,0,0,0.5")); - end; - GainFocusCommand=function(self) - self:stoptweening(); - self:decelerate(0.1); - self:zoomto(256,26); - self:diffusealpha(1); - end; - LoseFocusCommand=function(self) - self:stoptweening(); - self:accelerate(0.1); - self:zoomto(SCREEN_WIDTH,0); - self:diffusealpha(0); - end; + InitCommand=cmd(zoomto,256,26;fadeleft,0.45;faderight,0.45); + OnCommand=cmd(diffuseshift;effectcolor1,color("0,0,0,0.5");effectcolor2,color("0,0,0,0.5")); + GainFocusCommand=cmd(stoptweening;decelerate,0.1;zoomto,256,26;diffusealpha,1); + LoseFocusCommand=cmd(stoptweening;accelerate,0.1;zoomto,SCREEN_WIDTH,0;diffusealpha,0); }; LoadFont("Common Normal") .. { Text=THEME:GetString("ScreenTitleMenu",gc:GetText()); - OnCommand=function(self) - self:shadowlength(1); - end; - GainFocusCommand=function(self) - self:stoptweening(); - self:linear(0.1); - self:zoom(1); - self:diffuse(color("1,1,1,1")); - end; - LoseFocusCommand=function(self) - self:stoptweening(); - self:linear(0.1); - self:zoom(0.75); - self:diffuse(color("0.5,0.5,0.5,1")); - end; + OnCommand=cmd(shadowlength,1); + GainFocusCommand=cmd(stoptweening;linear,0.1;zoom,1;diffuse,color("1,1,1,1")); + LoseFocusCommand=cmd(stoptweening;linear,0.1;zoom,0.75;diffuse,color("0.5,0.5,0.5,1")); }; }; \ No newline at end of file diff --git a/Themes/default/Graphics/ScreenWithMenuElements header/default.lua b/Themes/default/Graphics/ScreenWithMenuElements header/default.lua index 669c3fa890..637c818c4c 100644 --- a/Themes/default/Graphics/ScreenWithMenuElements header/default.lua +++ b/Themes/default/Graphics/ScreenWithMenuElements header/default.lua @@ -1,28 +1,20 @@ local t = Def.ActorFrame {}; t[#t+1] = Def.Quad { - InitCommand=function(self) - self:vertalign(top); - self:zoomto(SCREEN_WIDTH+1,50); - self:diffuse(Color.Black); - end; + InitCommand=cmd(vertalign,top;zoomto,SCREEN_WIDTH+1,50;diffuse,Color.Black); } - +--[[ t[#t+1] = LoadActor("Header") .. { + InitCommand=cmd(vertalign,top;zoomtowidth,SCREEN_WIDTH+1;diffuse,color("#ffd400")); +}; ]] +--[[ t[#t+1] = LoadActor("_texture stripe") .. { + InitCommand=cmd(vertalign,top;zoomto,SCREEN_WIDTH+64,44;customtexturerect,0,0,SCREEN_WIDTH+64/8,44/32); + OnCommand=cmd(fadebottom,0.8;texcoordvelocity,1,0;skewx,-0.0025;diffuse,Color("Black");diffusealpha,0.235); +}; --]] t[#t+1] = LoadFont("Common Bold") .. { Name="HeaderText"; Text=Screen.String("HeaderText"); - InitCommand=function(self) - self:x(-SCREEN_CENTER_X+24); - self:y(24); - self:zoom(1); - self:horizalign(left); - self:shadowlength(0); - self:maxwidth(200); - end; - OnCommand=function(self) - self:strokecolor(Color.Invisible); - self:diffusebottomedge(color("0.75,0.75,0.75")); - end; + InitCommand=cmd(x,-SCREEN_CENTER_X+24;y,24;zoom,1;horizalign,left;shadowlength,0;maxwidth,200); + OnCommand=cmd(strokecolor,Color.Invisible;diffusebottomedge,color("0.75,0.75,0.75")); UpdateScreenHeaderMessageCommand=function(self,param) self:settext(param.Header); end; diff --git a/Themes/default/Graphics/_JudgmentLineLabel/default.lua b/Themes/default/Graphics/_JudgmentLineLabel/default.lua index 2648bcd62f..a9024043b8 100644 --- a/Themes/default/Graphics/_JudgmentLineLabel/default.lua +++ b/Themes/default/Graphics/_JudgmentLineLabel/default.lua @@ -1,39 +1,19 @@ -local jl = Var "JudgmentLine"; - -return Def.ActorFrame { - Def.Quad { - InitCommand=function(self) - self:horizalign(right); - self:zoomto(256,18); - end; - OnCommand=function(self) - self:diffuse(Color("Black")); - self:fadeleft(1); - end; - }; - Def.Quad { - InitCommand=function(self) - self:horizalign(left); - self:zoomto(256,18); - end; - OnCommand=function(self) - self:diffuse(Color("Black")); - self:faderight(1); - end; - }; - - LoadActor("_frame") .. { - InitCommand=function(self) - self:diffuse(JudgmentLineToColor(jl)); - end; - }; - LoadFont("Common Normal") .. { - InitCommand=function(self) - self:zoom(0.675); - self:settext(string.upper(JudgmentLineToLocalizedString(jl))); - self:diffuse(JudgmentLineToColor(jl)); - self:shadowlength(1); - self:maxwidth(180); - end; - }; +local jl = Var "JudgmentLine"; + +return Def.ActorFrame { + Def.Quad { + InitCommand=cmd(horizalign,right;zoomto,256,18); + OnCommand=cmd(diffuse,Color("Black");fadeleft,1); + }; + Def.Quad { + InitCommand=cmd(horizalign,left;zoomto,256,18); + OnCommand=cmd(diffuse,Color("Black");faderight,1); + }; + + LoadActor("_frame") .. { + InitCommand=cmd(diffuse,JudgmentLineToColor(jl)); + }; + LoadFont("Common Normal") .. { + InitCommand=cmd(zoom,0.675;settext,string.upper(JudgmentLineToLocalizedString(jl));diffuse,JudgmentLineToColor(jl);shadowlength,1;maxwidth,180); + }; }; \ No newline at end of file