From 91581bb5f7e60d168b07bb9718c3fe1cc2856583 Mon Sep 17 00:00:00 2001 From: Jonathan Payne Date: Mon, 25 Aug 2014 20:40:03 -0700 Subject: [PATCH] Fix eval summary, summary branches + Fixed ScreenGameplay StepsDisplay errors + Fixed ScreenSelectCourse CourseContentsList masks + Fixed ScreenEvaluationSummary banners -- introduced a scroller. + Fixed showing ScreenEvaluationSummary showing after a course (cherry picked from commit 04f7373238410c481cb79c6441fb27c55c69a447) --- Themes/_fallback/Scripts/02 Branches.lua | 8 ++- Themes/_fallback/Scripts/02 ThemePrefs.lua | 3 +- .../ScreenEvaluation background/default.lua | 12 +--- .../ScreenEvaluationSummary background.lua | 3 + .../default.lua | 5 ++ .../ScreenSelectMusic decorations/default.lua | 21 ++++++- .../LifeMeterBattery lives/default.lua | 6 +- .../ScreenEvaluationSummary BannerList.lua | 58 +++++++++++++++++++ .../Graphics/ScreenGameplay StageDisplay.lua | 24 ++++---- .../ScreenSelectMusic CourseContentsList.lua | 16 ++--- Themes/default/Scripts/02 ThemePrefs.lua | 7 --- Themes/default/metrics.ini | 17 ++++-- 12 files changed, 133 insertions(+), 47 deletions(-) create mode 100644 Themes/default/BGAnimations/ScreenEvaluationSummary background.lua create mode 100644 Themes/default/BGAnimations/ScreenEvaluationSummary decorations/default.lua create mode 100644 Themes/default/Graphics/ScreenEvaluationSummary BannerList.lua diff --git a/Themes/_fallback/Scripts/02 Branches.lua b/Themes/_fallback/Scripts/02 Branches.lua index 12004f068c..1e40714f5c 100644 --- a/Themes/_fallback/Scripts/02 Branches.lua +++ b/Themes/_fallback/Scripts/02 Branches.lua @@ -121,7 +121,13 @@ Branch = { elseif STATSMAN:GetCurStageStats():AllFailed() then return "ScreenGameOver" elseif GAMESTATE:GetSmallestNumStagesLeftForAnyHumanPlayer() == 0 then - return "ScreenEvaluationSummary" + if GAMESTATE:GetPlayMode() ~= "PlayMode_Regular" + and GAMESTATE:GetPlayMode() ~= "PlayMode_Battle" + and GAMESTATE:GetPlayMode() ~= "PlayMode_Rave" then + return "ScreenEvaluationSummary" + else + return "ScreenGameOver" + end else return SelectMusicOrCourse() end diff --git a/Themes/_fallback/Scripts/02 ThemePrefs.lua b/Themes/_fallback/Scripts/02 ThemePrefs.lua index a7fa98bb0f..47c58c393e 100644 --- a/Themes/_fallback/Scripts/02 ThemePrefs.lua +++ b/Themes/_fallback/Scripts/02 ThemePrefs.lua @@ -92,6 +92,7 @@ ThemePrefs = -- create the section if it doesn't exist local section = GetThemeName() + Trace( ("ThemePrefs.Init: Theme name is \"%s\""):format(section) ) PrefsTable[section] = PrefsTable[section] and PrefsTable[section] or { } --Trace( "Using section " .. section ) @@ -104,7 +105,7 @@ ThemePrefs = end end - --PrintTable( PrefsTable[section] ) + PrintTable( PrefsTable[section] ) end, Load = function() diff --git a/Themes/default/BGAnimations/ScreenEvaluation background/default.lua b/Themes/default/BGAnimations/ScreenEvaluation background/default.lua index 6500b0096b..f5b2b5e195 100644 --- a/Themes/default/BGAnimations/ScreenEvaluation background/default.lua +++ b/Themes/default/BGAnimations/ScreenEvaluation background/default.lua @@ -18,20 +18,10 @@ t[#t+1] = Def.ActorFrame { end end; }; - Def.Quad { + Def.Quad { InitCommand=cmd(Center;scaletoclipped,SCREEN_WIDTH+1,SCREEN_HEIGHT); OnCommand=cmd(diffuse,color("#FFCB05");diffusebottomedge,color("#F0BA00");diffusealpha,0.45); }; ---[[ - LoadActor(THEME:GetPathB("ScreenWithMenuElements","background/_grid")).. { - InitCommand=cmd(customtexturerect,0,0,(SCREEN_WIDTH+1)/4,SCREEN_HEIGHT/4;SetTextureFiltering,true); - OnCommand=cmd(zoomto,SCREEN_WIDTH+1,SCREEN_HEIGHT;diffuse,Color("Black");diffuseshift;effecttiming,(1/8)*4,0,(7/8)*4,0;effectclock,'beatnooffset'; - effectcolor2,Color("Black");effectcolor1,Colors.Alpha(Color("Black"),0.45);fadebottom,0.25;fadetop,0.25;croptop,48/480;cropbottom,48/480;diffusealpha,0.345); - }; --]] - LoadActor(THEME:GetPathB("ScreenWithMenuElements","background/_bg top")) .. { - InitCommand=cmd(Center;scaletoclipped,SCREEN_WIDTH+1,SCREEN_HEIGHT); - }; - }; return t \ No newline at end of file diff --git a/Themes/default/BGAnimations/ScreenEvaluationSummary background.lua b/Themes/default/BGAnimations/ScreenEvaluationSummary background.lua new file mode 100644 index 0000000000..d2dc23567b --- /dev/null +++ b/Themes/default/BGAnimations/ScreenEvaluationSummary background.lua @@ -0,0 +1,3 @@ +local t = LoadActor(THEME:GetPathB("ScreenWithMenuElements","background")); + +return t; \ No newline at end of file diff --git a/Themes/default/BGAnimations/ScreenEvaluationSummary decorations/default.lua b/Themes/default/BGAnimations/ScreenEvaluationSummary decorations/default.lua new file mode 100644 index 0000000000..4f1334dad6 --- /dev/null +++ b/Themes/default/BGAnimations/ScreenEvaluationSummary decorations/default.lua @@ -0,0 +1,5 @@ +local t = LoadFallbackB(); + +t[#t+1] = StandardDecorationFromFileOptional("BannerList","BannerList"); + +return t; \ No newline at end of file diff --git a/Themes/default/BGAnimations/ScreenSelectMusic decorations/default.lua b/Themes/default/BGAnimations/ScreenSelectMusic decorations/default.lua index 5d724f32b8..c53fa9e85f 100644 --- a/Themes/default/BGAnimations/ScreenSelectMusic decorations/default.lua +++ b/Themes/default/BGAnimations/ScreenSelectMusic decorations/default.lua @@ -116,7 +116,7 @@ t[#t+1] = StandardDecorationFromFileOptional("PaneDisplayFrameP2","PaneDisplayFr t[#t+1] = StandardDecorationFromFileOptional("PaneDisplayTextP1","PaneDisplayTextP1"); t[#t+1] = StandardDecorationFromFileOptional("PaneDisplayTextP2","PaneDisplayTextP2"); t[#t+1] = StandardDecorationFromFileOptional("DifficultyList","DifficultyList"); -t[#t+1] = StandardDecorationFromFileOptional("CourseContentsList","CourseContentsList"); + t[#t+1] = StandardDecorationFromFileOptional("BPMDisplay","BPMDisplay"); t[#t+1] = StandardDecorationFromFileOptional("BPMLabel","BPMLabel"); t[#t+1] = StandardDecorationFromFileOptional("SegmentDisplay","SegmentDisplay"); @@ -231,6 +231,25 @@ if not GAMESTATE:IsCourseMode() then end; if GAMESTATE:IsCourseMode() then + t[#t+1] = Def.ActorFrame { + Def.Quad { + InitCommand=cmd( + x,THEME:GetMetric(Var "LoadingScreen","CourseContentsListX"); + y,THEME:GetMetric(Var "LoadingScreen","CourseContentsListY") - 118; + zoomto,256+32,192; + ); + OnCommand=cmd(diffuse,Color.Green;MaskSource); + }; + Def.Quad { + InitCommand=cmd( + x,THEME:GetMetric(Var "LoadingScreen","CourseContentsListX"); + y,THEME:GetMetric(Var "LoadingScreen","CourseContentsListY") + 186; + zoomto,256+32,64; + ); + OnCommand=cmd(diffuse,Color.Blue;MaskSource); + }; + }; + t[#t+1] = StandardDecorationFromFileOptional("CourseContentsList","CourseContentsList"); t[#t+1] = StandardDecorationFromFileOptional("NumCourseSongs","NumCourseSongs")..{ InitCommand=cmd(horizalign,right); SetCommand=function(self) diff --git a/Themes/default/Graphics/LifeMeterBattery lives/default.lua b/Themes/default/Graphics/LifeMeterBattery lives/default.lua index 8fd1c40f0e..b5306472f2 100755 --- a/Themes/default/Graphics/LifeMeterBattery lives/default.lua +++ b/Themes/default/Graphics/LifeMeterBattery lives/default.lua @@ -12,7 +12,7 @@ local t = Def.ActorFrame { BeginCommand=function(self,param) local screen = SCREENMAN:GetTopScreen(); local glifemeter = screen:GetLifeMeter(player); - self:setstate(glifemeter:GetTotalLives()-1); + self:setstate(clamp(glifemeter:GetTotalLives()-1,0,9)); if glifemeter:GetTotalLives() <= 4 then self:zoomx(barWidth/(4*64)); @@ -26,14 +26,14 @@ local t = Def.ActorFrame { if param.LivesLeft == 0 then self:visible(false) else - self:setstate( math.max(param.LivesLeft-1,0) ) + self:setstate( clamp(param.LivesLeft-1,0,9) ) self:visible(true) end end end; StartCommand=function(self,param) if param.Player == player then - self:setstate( math.max(param.LivesLeft-1,0) ); + self:setstate( clamp(param.LivesLeft-1,0,9) ); end end; FinishCommand=cmd(playcommand,"Start"); diff --git a/Themes/default/Graphics/ScreenEvaluationSummary BannerList.lua b/Themes/default/Graphics/ScreenEvaluationSummary BannerList.lua new file mode 100644 index 0000000000..42feb28aee --- /dev/null +++ b/Themes/default/Graphics/ScreenEvaluationSummary BannerList.lua @@ -0,0 +1,58 @@ +local function GetList() + local l = {}; + for i=1,7 do + local stats; + stats = STATSMAN:GetPlayedStageStats(i); + + if not stats then + MESSAGEMAN:Broadcast("SystemMessage",{ Message="List break (" .. i .. ")" }); + break + end + + l[#l+1] = stats; + end + MESSAGEMAN:Broadcast("SystemMessage",{ Message=tostring(#l) }); + return l +end + +local statList = GetList(); + +local as = Def.ActorScroller { + SecondsPerItem = 1; + NumItemsToDraw = 10; + TransformFunction = function( self, offset, itemIndex, numItems) + self:diffusealpha(1-offset); + end; + OnCommand=function(self) + self:SetLoop(true); + self:SetSecondsPauseBetweenItems(2); + self:ScrollThroughAllItems(); + end; +} + +for i=1,#statList do + local j = #statList - (i-1); + as[#as+1] = Def.ActorFrame { + Def.Sprite { + InitCommand=cmd(scaletoclipped,256,80); + BeginCommand=function(self) + local path = statList[j]:GetPlayedSongs()[1]:GetBannerPath() or THEME:GetPathG("Common","fallback banner"); + self:LoadBanner(path); + end; + }; + Def.Quad { + InitCommand=cmd(x,128;y,40;horizalign,right;vertalign,bottom); + OnCommand=cmd(zoomto,80,18;diffuse,Color.Black;diffusealpha,0.5;fadeleft,0.5); + }; + LoadFont("Common Normal") .. { + Text=StageToLocalizedString( statList[j]:GetStage() ); + InitCommand=cmd(x,128-4;y,40-4;horizalign,right;vertalign,bottom); + OnCommand=cmd(diffuse,StageToColor(statList[j]:GetStage());zoom,0.675;shadowlength,1); + }; + }; +end + +return Def.ActorFrame { + as; + LoadActor(THEME:GetPathG("ScreenSelectMusic","BannerFrame")); +}; diff --git a/Themes/default/Graphics/ScreenGameplay StageDisplay.lua b/Themes/default/Graphics/ScreenGameplay StageDisplay.lua index 01c11f9fab..44640d1a0e 100644 --- a/Themes/default/Graphics/ScreenGameplay StageDisplay.lua +++ b/Themes/default/Graphics/ScreenGameplay StageDisplay.lua @@ -1,6 +1,8 @@ local curScreen = Var "LoadingScreen"; local curStage = GAMESTATE:GetCurrentStage(); local curStageIndex = GAMESTATE:GetCurrentStageIndex(); +local playMode = GAMESTATE:GetPlayMode(); + local tRemap = { Stage_1st = 1, Stage_2nd = 2, @@ -13,9 +15,7 @@ if tRemap[curStage] == PREFSMAN:GetPreference("SongsPerPlay") then curStage = "Stage_Final"; end -local t = Def.ActorFrame {}; - -t[#t+1] = Def.ActorFrame { +local t = Def.ActorFrame { LoadActor(THEME:GetPathB("_frame","3x3"),"rounded black",64,16); LoadFont("Common Normal") .. { InitCommand=cmd(y,-1;shadowlength,1;playcommand,"Set"); @@ -26,16 +26,18 @@ t[#t+1] = Def.ActorFrame { CurrentTraiP1ChangedMessageCommand=cmd(playcommand,"Set"); CurrentTraiP2ChangedMessageCommand=cmd(playcommand,"Set"); SetCommand=function(self) - if GAMESTATE:IsEventMode() then - self:settextf("Stage %s", curStageIndex+1); - elseif GAMESTATE:GetPlayMode() == 'PlayMode_Endless' or 'PlayMode_Oni' or 'Nonstop' then - self:settextf("%i / %i", curStageIndex , GAMESTATE:GetCurrentCourse():GetEstimatedNumStages()); + if playMode ~= 'PlayMode_Regular' and playMode ~= 'PlayMode_Battle' and playMode ~= 'PlayMode_Rave' then + self:settextf("%i / %i", tonumber(curStageIndex) + 1, GAMESTATE:GetCurrentCourse():GetEstimatedNumStages()); else - if THEME:GetMetric(curScreen,"StageDisplayUseShortString") then - self:settextf("%s", ToEnumShortString(curStage)); + if GAMESTATE:IsEventMode() then + self:settextf("Stage %s", curStageIndex+1); else - self:settextf("%s Stage", ToEnumShortString(curStage)); - end; + if THEME:GetMetric(curScreen,"StageDisplayUseShortString") then + self:settextf("%s", ToEnumShortString(curStage)); + else + self:settextf("%s Stage", ToEnumShortString(curStage)); + end + end end; self:zoom(0.675); self:diffuse(StageToColor(curStage)); diff --git a/Themes/default/Graphics/ScreenSelectMusic CourseContentsList.lua b/Themes/default/Graphics/ScreenSelectMusic CourseContentsList.lua index 978a89ca2a..f645433b5c 100644 --- a/Themes/default/Graphics/ScreenSelectMusic CourseContentsList.lua +++ b/Themes/default/Graphics/ScreenSelectMusic CourseContentsList.lua @@ -1,19 +1,21 @@ +local transform = function(self,offsetFromCenter,itemIndex,numitems) + self:y( offsetFromCenter * 44 ); +end return Def.CourseContentsList { - MaxSongs = 4; + MaxSongs = 10; NumItemsToDraw = 8; 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:SetPauseCountdownSeconds(1); + self:SetSecondsPauseBetweenItems( 0.25 ); + self:SetTransformFromFunction(transform); -- - MESSAGEMAN:Broadcast("SystemMessage",{ Text ="Test" }); - -- - self:SetDestinationItem(4); + self:SetDestinationItem( math.max(0,self:GetNumItems() - 4) ); self:SetLoop(false); - self:SetMask(270,44*4); + self:SetMask(0,0); end; CurrentTrailP1ChangedMessageCommand=cmd(playcommand,"Set"); CurrentTrailP2ChangedMessageCommand=cmd(playcommand,"Set"); diff --git a/Themes/default/Scripts/02 ThemePrefs.lua b/Themes/default/Scripts/02 ThemePrefs.lua index 9153351a8e..c95d3fd7d5 100644 --- a/Themes/default/Scripts/02 ThemePrefs.lua +++ b/Themes/default/Scripts/02 ThemePrefs.lua @@ -78,13 +78,6 @@ local Prefs = Choices = { OptionNameString('Off'), OptionNameString('On') }, Values = { false, true } }, - - --[[ - ProtimingP1, - ProtimingP2, - - UserPrefScoringMode = 'DDR Extreme' - --]] } ThemePrefs.InitAll(Prefs) diff --git a/Themes/default/metrics.ini b/Themes/default/metrics.ini index 8d2576e212..62394df646 100644 --- a/Themes/default/metrics.ini +++ b/Themes/default/metrics.ini @@ -1972,24 +1972,30 @@ Summary=true # ShowStageDisplay=false # +ShowBannerList=true +BannerListX=SCREEN_CENTER_X +BannerListY=SCREEN_TOP+96 +BannerListOnCommmand= +BannerListOffCommand= +# SmallBanner1X=SCREEN_CENTER_X-72 SmallBanner1Y=SCREEN_TOP+100-24 -SmallBanner1OnCommand=zoom,0.5 +SmallBanner1OnCommand=visible,false SmallBanner1OffCommand= SmallBanner2X=SCREEN_CENTER_X-48 SmallBanner2Y=SCREEN_TOP+100-16 -SmallBanner2OnCommand=zoom,0.5 +SmallBanner2OnCommand=visible,false SmallBanner2OffCommand= SmallBanner3X=SCREEN_CENTER_X-24 SmallBanner3Y=SCREEN_TOP+100-8 -SmallBanner3OnCommand=zoom,0.5 +SmallBanner3OnCommand=visible,false SmallBanner3OffCommand= SmallBanner4X=SCREEN_CENTER_X+24 SmallBanner4Y=SCREEN_TOP+100+8 -SmallBanner4OnCommand=zoom,0.5 +SmallBanner4OnCommand=visible,false SmallBanner4OffCommand= SmallBanner5X=SCREEN_CENTER_X+48 @@ -1999,7 +2005,7 @@ SmallBanner5OfCommand= SmallBanner6X=SCREEN_CENTER_X+72 SmallBanner6Y=SCREEN_TOP+100+24 -SmallBanner6OnCommand=zoom,0.5 +SmallBanner6OnCommand=visible,false SmallBanner6OffCommand= [ScreenNameEntry] @@ -2009,6 +2015,7 @@ SmallBanner6OffCommand= [ScreenProfileSaveSummary] [ScreenGameOver] +TimerOnCommand=visible,false [ScreenPrompt]