From 04da3fb9c7d2c4b47597f2a921fbff55b770d1e8 Mon Sep 17 00:00:00 2001 From: Jonathan Payne Date: Mon, 25 Aug 2014 21:08:23 -0700 Subject: [PATCH] include IsCourse(), fix StageDisplay for courses! (cherry picked from commit 56003157f77be78bd5ab9e608b1f3836cf288e08) --- Themes/_fallback/Scripts/02 Branches.lua | 4 +--- Themes/_fallback/Scripts/02 Utilities.lua | 5 +++++ .../default/Graphics/ScreenGameplay StageDisplay.lua | 10 ++++++++-- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/Themes/_fallback/Scripts/02 Branches.lua b/Themes/_fallback/Scripts/02 Branches.lua index 1e40714f5c..49e967b52b 100644 --- a/Themes/_fallback/Scripts/02 Branches.lua +++ b/Themes/_fallback/Scripts/02 Branches.lua @@ -121,9 +121,7 @@ Branch = { elseif STATSMAN:GetCurStageStats():AllFailed() then return "ScreenGameOver" elseif GAMESTATE:GetSmallestNumStagesLeftForAnyHumanPlayer() == 0 then - if GAMESTATE:GetPlayMode() ~= "PlayMode_Regular" - and GAMESTATE:GetPlayMode() ~= "PlayMode_Battle" - and GAMESTATE:GetPlayMode() ~= "PlayMode_Rave" then + if IsCourse() then return "ScreenEvaluationSummary" else return "ScreenGameOver" diff --git a/Themes/_fallback/Scripts/02 Utilities.lua b/Themes/_fallback/Scripts/02 Utilities.lua index cb57430538..4750c48b7d 100644 --- a/Themes/_fallback/Scripts/02 Utilities.lua +++ b/Themes/_fallback/Scripts/02 Utilities.lua @@ -210,6 +210,11 @@ function IsFreePlay() return IsArcade() and (GAMESTATE:GetCoinMode() == 'CoinMode_Free') or false end +function IsCourse() + local pm = GAMESTATE:GetPlayMode(); + return pm == "PlayMode_Nonstop" or "PlayMode_Oni" or "PlayMode_Endless" +end + function ArgsIfPlayerJoinedOrNil(arg1,arg2) if arg1==nil then arg1=arg2 elseif arg2==nil then arg2=arg1 end diff --git a/Themes/default/Graphics/ScreenGameplay StageDisplay.lua b/Themes/default/Graphics/ScreenGameplay StageDisplay.lua index 44640d1a0e..7499572f08 100644 --- a/Themes/default/Graphics/ScreenGameplay StageDisplay.lua +++ b/Themes/default/Graphics/ScreenGameplay StageDisplay.lua @@ -26,8 +26,14 @@ local t = Def.ActorFrame { CurrentTraiP1ChangedMessageCommand=cmd(playcommand,"Set"); CurrentTraiP2ChangedMessageCommand=cmd(playcommand,"Set"); SetCommand=function(self) - if playMode ~= 'PlayMode_Regular' and playMode ~= 'PlayMode_Battle' and playMode ~= 'PlayMode_Rave' then - self:settextf("%i / %i", tonumber(curStageIndex) + 1, GAMESTATE:GetCurrentCourse():GetEstimatedNumStages()); + if IsCourse() then + local stats = STATSMAN:GetCurStageStats() + if not stats then + return + end + local mpStats = stats:GetPlayerStageStats( GAMESTATE:GetMasterPlayerNumber() ) + local songsPlayed = mpStats:GetSongsPassed() + 1 + self:settextf("%i / %i", songsPlayed, GAMESTATE:GetCurrentCourse():GetEstimatedNumStages()); else if GAMESTATE:IsEventMode() then self:settextf("Stage %s", curStageIndex+1);