diff --git a/Themes/Til Death/BGAnimations/ScreenEvaluation decorations/default.lua b/Themes/Til Death/BGAnimations/ScreenEvaluation decorations/default.lua index dd80212435..0e783e1715 100644 --- a/Themes/Til Death/BGAnimations/ScreenEvaluation decorations/default.lua +++ b/Themes/Til Death/BGAnimations/ScreenEvaluation decorations/default.lua @@ -536,12 +536,8 @@ end if GAMESTATE:IsPlayerEnabled(PLAYER_1) then t[#t + 1] = scoreBoard(PLAYER_1, 0) - if ShowStandardDecoration("GraphDisplay") then - t[#t + 1] = StandardDecorationFromTable("GraphDisplay" .. ToEnumShortString(PLAYER_1), GraphDisplay(PLAYER_1)) - end - if ShowStandardDecoration("ComboGraph") then - t[#t + 1] = StandardDecorationFromTable("ComboGraph" .. ToEnumShortString(PLAYER_1), ComboGraph(PLAYER_1)) - end + t[#t + 1] = StandardDecorationFromTable("GraphDisplay" .. ToEnumShortString(PLAYER_1), GraphDisplay(PLAYER_1)) + t[#t + 1] = StandardDecorationFromTable("ComboGraph" .. ToEnumShortString(PLAYER_1), ComboGraph(PLAYER_1)) end t[#t + 1] = LoadActor("../offsetplot") diff --git a/Themes/Til Death/BGAnimations/ScreenEvaluation underlay.lua b/Themes/Til Death/BGAnimations/ScreenEvaluation underlay.lua index 775b34a449..0a3811d567 100644 --- a/Themes/Til Death/BGAnimations/ScreenEvaluation underlay.lua +++ b/Themes/Til Death/BGAnimations/ScreenEvaluation underlay.lua @@ -4,13 +4,35 @@ local t = Def.ActorFrame {} if enabled then t[#t + 1] = - LoadSongBackground() .. - { - BeginCommand = function(self) - self:scaletocover(0, 0, SCREEN_WIDTH, SCREEN_BOTTOM) - self:diffusealpha(brightness) + Def.Sprite { + OnCommand = function(self) + if GAMESTATE:GetCurrentSong() and GAMESTATE:GetCurrentSong():GetBackgroundPath() then + self:finishtweening() + self:visible(true) + self:LoadBackground(GAMESTATE:GetCurrentSong():GetBackgroundPath()) + self:scaletocover(0, 0, SCREEN_WIDTH, SCREEN_BOTTOM) + self:sleep(0.5) + self:decelerate(2) + self:diffusealpha(brightness) + else + self:visible(false) + end end } end +t[#t + 1] = + Def.Sprite { + Name = "Banner", + OnCommand = function(self) + self:x(SCREEN_CENTER_X):y(38):valign(0) + self:scaletoclipped(capWideScale(get43size(336), 336), capWideScale(get43size(105), 105)) + local bnpath = GAMESTATE:GetCurrentSong():GetBannerPath() + if not bnpath then + bnpath = THEME:GetPathG("Common", "fallback banner") + end + self:LoadBackground(bnpath) + end +} + return t diff --git a/Themes/Til Death/BGAnimations/ScreenNetEvaluation decorations.lua b/Themes/Til Death/BGAnimations/ScreenNetEvaluation decorations.lua index 026e1230f9..57a2f7dce3 100644 --- a/Themes/Til Death/BGAnimations/ScreenNetEvaluation decorations.lua +++ b/Themes/Til Death/BGAnimations/ScreenNetEvaluation decorations.lua @@ -553,12 +553,8 @@ end if GAMESTATE:IsPlayerEnabled(PLAYER_1) then t[#t + 1] = scoreBoard(PLAYER_1, 0) - if ShowStandardDecoration("GraphDisplay") then - t[#t + 1] = StandardDecorationFromTable("GraphDisplay" .. ToEnumShortString(PLAYER_1), GraphDisplay(PLAYER_1)) - end - if ShowStandardDecoration("ComboGraph") then - t[#t + 1] = StandardDecorationFromTable("ComboGraph" .. ToEnumShortString(PLAYER_1), ComboGraph(PLAYER_1)) - end + t[#t + 1] = StandardDecorationFromTable("GraphDisplay" .. ToEnumShortString(PLAYER_1), GraphDisplay(PLAYER_1)) + t[#t + 1] = StandardDecorationFromTable("ComboGraph" .. ToEnumShortString(PLAYER_1), ComboGraph(PLAYER_1)) end t[#t + 1] = LoadActor("offsetplot") diff --git a/Themes/_fallback/metrics.ini b/Themes/_fallback/metrics.ini index 5ae8f90e28..454aeab8fb 100644 --- a/Themes/_fallback/metrics.ini +++ b/Themes/_fallback/metrics.ini @@ -3258,112 +3258,9 @@ Fallback="ScreenWithMenuElements" NextScreen=Branch.AfterEvaluation() PrevScreen=Branch.AfterEvaluation() TimerSeconds=20 -LightsMode="LightsMode_MenuStartOnly" -# -Summary=false -CheckpointsWithJudgments=EvalUsesCheckpointsWithJudgments() -# -PlayerOptionsSeparator="," -PlayerOptionsHideFailType=false -MaxComboNumDigits=4 -# -ShowBannerArea=true -RollingNumbersClass="RollingNumbersJudgment" -RollingNumbersMaxComboClass="RollingNumbersMaxCombo" -# -ShowSharedJudgmentLineLabels=false -ShowJudgmentLineW1=false -ShowJudgmentLineW2=false -ShowJudgmentLineW3=false -ShowJudgmentLineW4=false -ShowJudgmentLineW5=false -ShowJudgmentLineHeld=false -ShowJudgmentLineMiss=false -ShowJudgmentLineMaxCombo=false -ShowPeakComboAward=false -ShowTimingDifficulty=false -ShowStageDisplay=false -ShowStageFrame=false -ShowGraphDisplay=false -ShowComboGraph=false -ShowStepsDisplay=false -ShowGradeArea=false -ShowPointsArea=false -ShowDetailArea=false -ShowBonusArea=false -ShowSurvivedArea=false -ShowWinArea=false -ShowScoreArea=false -ShowTimeArea=false -ShowItsARecord=false -ShowStageAward=false -# FailedSoundTime=0 PassedSoundTime=0 CheerDelaySeconds=2.5 -# -BannerWidth=256 -BannerHeight=80 -# -LargeBannerX= -LargeBannerY= -LargeBannerOnCommand=visible,false -LargeBannerOffCommand= -LargeBannerFrameX= -LargeBannerFrameY= -LargeBannerFrameOnCommand=visible,false -LargeBannerFrameOffCommand= -# -PlayerOptionsP1X= -PlayerOptionsP1Y= -PlayerOptionsP1OnCommand=visible,false -PlayerOptionsP1OffCommand= -PlayerOptionsP2X= -PlayerOptionsP2Y= -PlayerOptionsP2OnCommand=visible,false -PlayerOptionsP2OffCommand= -# -SongOptionsX= -SongOptionsY= -SongOptionsOnCommand=visible,false -SongOptionsOffCommand= -# -DisqualifiedP1X= -DisqualifiedP1Y= -DisqualifiedP1OnCommand=visible,false -DisqualifiedP1OffCommand= -DisqualifiedP2X= -DisqualifiedP2Y= -DisqualifiedP2OnCommand=visible,false -DisqualifiedP2OffCommand= -# -SmallBanner1X=SCREEN_CENTER_X -SmallBanner1Y=SCREEN_TOP-128 -SmallBanner1OnCommand=visible,false -SmallBanner1OffCommand= -SmallBanner2X=SCREEN_CENTER_X -SmallBanner2Y=SCREEN_TOP-128 -SmallBanner2OnCommand=visible,false -SmallBanner2OffCommand= -SmallBanner3X=SCREEN_CENTER_X -SmallBanner3Y=SCREEN_TOP-128 -SmallBanner3OnCommand=visible,false -SmallBanner3OffCommand= -SmallBanner4X=SCREEN_CENTER_X -SmallBanner4Y=SCREEN_TOP-128 -SmallBanner4OnCommand=visible,false -SmallBanner4OffCommand= -SmallBanner5X=SCREEN_CENTER_X -SmallBanner5Y=SCREEN_TOP-128 -SmallBanner5OnCommand=visible,false -SmallBanner5OffCommand= -SmallBanner6X=SCREEN_CENTER_X -SmallBanner6Y=SCREEN_TOP-128 -SmallBanner6OnCommand=visible,false -SmallBanner6OffCommand= -# -DetailLineFormat="%3d/%3d" -# [ScreenEvaluationNormal] Fallback="ScreenEvaluation" @@ -3371,11 +3268,6 @@ Fallback="ScreenEvaluation" NextScreen=Branch.AfterEvaluation() PrevScreen=Branch.AfterEvaluation() -[ScreenEvaluationSummary] -Fallback="ScreenEvaluation" -NextScreen=Branch.AfterSummary() -Summary=true - [ScreenNetProfileSave] Class="ScreenProfileSave" Fallback="ScreenProfileSave" @@ -3980,6 +3872,11 @@ ModIconMetricsGroup="ModIconSelectMusic" [GraphDisplay] BodyWidth=140 BodyHeight=38 + +[ComboGraph] +BodyWidth=140 +BodyHeight=11 + # Arcade ################################# [ScreenLogo] Fallback="ScreenAttract" diff --git a/src/ScreenEvaluation.cpp b/src/ScreenEvaluation.cpp index c10ca7977f..3e480acada 100644 --- a/src/ScreenEvaluation.cpp +++ b/src/ScreenEvaluation.cpp @@ -28,46 +28,9 @@ #include "ThemeManager.h" #include "GamePreferences.h" -// metrics that are common to all ScreenEvaluation classes -#define BANNER_WIDTH THEME->GetMetricF(m_sName, "BannerWidth") -#define BANNER_HEIGHT THEME->GetMetricF(m_sName, "BannerHeight") -static const char* JudgmentLineNames[] = { "W1", "W2", "W3", "W4", - "W5", "Miss", "Held", "MaxCombo" }; -XToString(JudgmentLine); -LuaXType(JudgmentLine); -XToLocalizedString(JudgmentLine); -LuaFunction(JudgmentLineToLocalizedString, - JudgmentLineToLocalizedString(Enum::Check(L, 1))); - -static const char* DetailLineNames[NUM_DetailLine] = { - "NumSteps", "Jumps", "Holds", "Mines", "Hands", "Rolls", "Lifts", "Fakes" -}; -XToString(DetailLine); -#define DETAILLINE_FORMAT THEME->GetMetric(m_sName, "DetailLineFormat") - #define CHEER_DELAY_SECONDS THEME->GetMetricF(m_sName, "CheerDelaySeconds") #define BAR_ACTUAL_MAX_COMMAND THEME->GetMetricA(m_sName, "BarActualMaxCommand") -// metrics that are specific to classes derived from ScreenEvaluation -#define SHOW_BANNER_AREA THEME->GetMetricB(m_sName,"ShowBannerArea") -#define SHOW_POINTS_AREA THEME->GetMetricB(m_sName,"ShowPointsArea") -#define SHOW_BONUS_AREA THEME->GetMetricB(m_sName,"ShowBonusArea") -#define SHOW_SURVIVED_AREA THEME->GetMetricB(m_sName,"ShowSurvivedArea") -#define SHOW_WIN_AREA THEME->GetMetricB(m_sName,"ShowWinArea") -#define SHOW_SHARED_JUDGMENT_LINE_LABELS THEME->GetMetricB(m_sName,"ShowSharedJudgmentLineLabels") -#define SHOW_JUDGMENT_LINE( l ) THEME->GetMetricB(m_sName,"ShowJudgmentLine"+JudgmentLineToString(l)) - -#define SHOW_DETAIL_AREA THEME->GetMetricB(m_sName, "ShowDetailArea") -#define SHOW_SCORE_AREA THEME->GetMetricB(m_sName, "ShowScoreArea") -#define SHOW_TIME_AREA THEME->GetMetricB(m_sName, "ShowTimeArea") -#define SHOW_RECORDS_AREA THEME->GetMetricB(m_sName, "ShowRecordsArea") -#define PLAYER_OPTIONS_HIDE_FAIL_TYPE \ - THEME->GetMetricB(m_sName, "PlayerOptionsHideFailType") -#define PLAYER_OPTIONS_SEPARATOR \ - THEME->GetMetric(m_sName, "PlayerOptionsSeparator") -#define CHECKPOINTS_WITH_JUDGMENTS \ - THEME->GetMetricB(m_sName, "CheckpointsWithJudgments") - static ThemeMetric g_MinScoreToMaintainCombo( "Gameplay", "MinScoreToMaintainCombo"); @@ -227,18 +190,13 @@ ScreenEvaluation::Init() ZERO(m_bSavedScreenshot); - // Figure out which statistics and songs we're going to display - SUMMARY.Load(m_sName, "Summary"); - if (SUMMARY && GamePreferences::m_AutoPlay != PC_REPLAY) { - STATSMAN->GetFinalEvalStageStats(m_FinalEvalStageStats); - m_pStageStats = &m_FinalEvalStageStats; - } + // update persistent statistics - if (SUMMARY && GamePreferences::m_AutoPlay == PC_REPLAY) { + if (GamePreferences::m_AutoPlay == PC_REPLAY) { m_pStageStats->m_player[PLAYER_1].m_HighScore.SetRadarValues( m_pStageStats->m_player[PLAYER_1].m_radarActual); - } else if (SUMMARY && GamePreferences::m_AutoPlay != PC_REPLAY) { + } else if (GamePreferences::m_AutoPlay != PC_REPLAY) { m_pStageStats->FinalizeScores(true); } @@ -253,402 +211,6 @@ ScreenEvaluation::Init() // load sounds m_soundStart.Load(THEME->GetPathS(m_sName, "start")); - // init banner area - if (SHOW_BANNER_AREA) { - if (SUMMARY) { - for (size_t i = 0; i < m_pStageStats->m_vpPlayedSongs.size() && - i < MAX_SONGS_TO_SHOW; - i++) { - Song* pSong = m_pStageStats->m_vpPlayedSongs[i]; - - m_SmallBanner[i].LoadFromSong(pSong); - m_SmallBanner[i].ScaleToClipped(BANNER_WIDTH, BANNER_HEIGHT); - m_SmallBanner[i].SetName(ssprintf("SmallBanner%zu", i + 1)); - ActorUtil::LoadAllCommands(m_SmallBanner[i], m_sName); - SET_XY(m_SmallBanner[i]); - this->AddChild(&m_SmallBanner[i]); - - m_sprSmallBannerFrame[i].Load( - THEME->GetPathG(m_sName, "BannerFrame")); - m_sprSmallBannerFrame[i]->SetName( - ssprintf("SmallBanner%zu", i + 1)); - ActorUtil::LoadAllCommands(*m_sprSmallBannerFrame[i], m_sName); - SET_XY(m_sprSmallBannerFrame[i]); - this->AddChild(m_sprSmallBannerFrame[i]); - } - } else { - m_LargeBanner.LoadFromSong(GAMESTATE->m_pCurSong); - m_LargeBanner.ScaleToClipped(BANNER_WIDTH, BANNER_HEIGHT); - m_LargeBanner.SetName("LargeBanner"); - ActorUtil::LoadAllCommands(m_LargeBanner, m_sName); - SET_XY(m_LargeBanner); - this->AddChild(&m_LargeBanner); - - m_sprLargeBannerFrame.Load(THEME->GetPathG(m_sName, "BannerFrame")); - m_sprLargeBannerFrame->SetName("LargeBannerFrame"); - ActorUtil::LoadAllCommands(*m_sprLargeBannerFrame, m_sName); - SET_XY(m_sprLargeBannerFrame); - this->AddChild(m_sprLargeBannerFrame); - } - } - - { - if (!SUMMARY) { - FOREACH_EnabledPlayer(p) - { - m_textPlayerOptions[p].LoadFromFont( - THEME->GetPathF(m_sName, "PlayerOptions")); - m_textPlayerOptions[p].SetName( - ssprintf("PlayerOptionsP%d", p + 1)); - ActorUtil::LoadAllCommands(m_textPlayerOptions[p], m_sName); - SET_XY(m_textPlayerOptions[p]); - vector v; - PlayerOptions po = - GAMESTATE->m_pPlayerState[p]->m_PlayerOptions.GetPreferred(); - if (PLAYER_OPTIONS_HIDE_FAIL_TYPE) - po.m_FailType = - static_cast(0); // blank out the fail type so - // that it won't show in the - // mods list - po.GetLocalizedMods(v); - RString sPO = join(PLAYER_OPTIONS_SEPARATOR, v); - m_textPlayerOptions[p].SetText(sPO); - this->AddChild(&m_textPlayerOptions[p]); - } - - { - m_textSongOptions.LoadFromFont( - THEME->GetPathF(m_sName, "SongOptions")); - m_textSongOptions.SetName("SongOptions"); - ActorUtil::LoadAllCommands(m_textSongOptions, m_sName); - SET_XY(m_textSongOptions); - m_textSongOptions.SetText( - GAMESTATE->m_SongOptions.GetStage().GetLocalizedString()); - this->AddChild(&m_textSongOptions); - } - } - - auto p = PLAYER_1; - { - m_sprDisqualified[p].Load(THEME->GetPathG(m_sName, "Disqualified")); - m_sprDisqualified[p]->SetName(ssprintf("DisqualifiedP%d", p + 1)); - LOAD_ALL_COMMANDS_AND_SET_XY(m_sprDisqualified[p]); - m_sprDisqualified[p]->SetVisible( - m_pStageStats->m_player[p].m_bDisqualified); - this->AddChild(m_sprDisqualified[p]); - } - } - - // init points area - if (SHOW_POINTS_AREA) { - FOREACH_EnabledPlayer(p) - { - m_sprPercentFrame[p].Load( - THEME->GetPathG(m_sName, ssprintf("PercentFrame p%d", p + 1))); - m_sprPercentFrame[p]->SetName(ssprintf("PercentFrameP%d", p + 1)); - ActorUtil::LoadAllCommands(*m_sprPercentFrame[p], m_sName); - SET_XY(m_sprPercentFrame[p]); - this->AddChild(m_sprPercentFrame[p]); - - /* Use "ScreenEvaluation Percent" in the [metrics], but position and - * tween it with "PercentP1X", etc. */ - m_Percent[p].SetName(ssprintf("PercentP%d", p + 1)); - m_Percent[p].Load(GAMESTATE->m_pPlayerState[p], - &m_pStageStats->m_player[p], - "ScreenEvaluation Percent", - true); - ActorUtil::LoadAllCommands(m_Percent[p], m_sName); - SET_XY(m_Percent[p]); - this->AddChild(&m_Percent[p]); - } - } - - // init bonus area - if (SHOW_BONUS_AREA) { - // In course mode, we need to make sure the bar doesn't overflow. -aj - float fDivider = 1.0f; - - FOREACH_EnabledPlayer(p) - { - m_sprBonusFrame[p].Load( - THEME->GetPathG(m_sName, ssprintf("BonusFrame p%d", p + 1))); - m_sprBonusFrame[p]->SetName(ssprintf("BonusFrameP%d", p + 1)); - ActorUtil::LoadAllCommands(*m_sprBonusFrame[p], m_sName); - SET_XY(m_sprBonusFrame[p]); - this->AddChild(m_sprBonusFrame[p]); - - // todo: convert this to use category names instead of numbers? -aj - for (int r = 0; r < NUM_SHOWN_RADAR_CATEGORIES; r++) // foreach line - { - float possible = static_cast( - m_pStageStats->m_player[p].m_radarPossible[r]); - float actual = static_cast( - m_pStageStats->m_player[p].m_radarActual[r]); - if (possible > 1.0) { - actual /= possible; - possible /= possible; - } - m_sprPossibleBar[p][r].Load( - THEME->GetPathG(m_sName, ssprintf("BarPossible p%d", p + 1))); - m_sprPossibleBar[p][r].SetWidth( - m_sprPossibleBar[p][r].GetUnzoomedWidth() * possible * - fDivider); - m_sprPossibleBar[p][r].SetName( - ssprintf("BarPossible%dP%d", r + 1, p + 1)); - ActorUtil::LoadAllCommands(m_sprPossibleBar[p][r], m_sName); - SET_XY(m_sprPossibleBar[p][r]); - this->AddChild(&m_sprPossibleBar[p][r]); - - m_sprActualBar[p][r].Load( - THEME->GetPathG(m_sName, ssprintf("BarActual p%d", p + 1))); - // should be out of the possible bar, not actual (whatever value - // that is at) - m_sprActualBar[p][r].SetWidth( - m_sprPossibleBar[p][r].GetUnzoomedWidth() * actual * - fDivider); - - float value = 100.f * m_sprActualBar[p][r].GetUnzoomedWidth() / - m_sprPossibleBar[p][r].GetUnzoomedWidth(); - LOG->Trace("Radar bar %d of 5 - %f percent", r, value); - - m_sprActualBar[p][r].SetName( - ssprintf("BarActual%dP%d", r + 1, p + 1)); - ActorUtil::LoadAllCommands(m_sprActualBar[p][r], m_sName); - SET_XY(m_sprActualBar[p][r]); - - // .99999 is fairly close to 1.00, so we use that. - // todo: allow extra commands for AAA/AAAA? -aj - if (actual > 0.99999f) - m_sprActualBar[p][r].RunCommands(BAR_ACTUAL_MAX_COMMAND); - this->AddChild(&m_sprActualBar[p][r]); - } - } - } - - // init survived area - if (SHOW_SURVIVED_AREA) { - FOREACH_EnabledPlayer(p) - { - m_sprSurvivedFrame[p].Load( - THEME->GetPathG(m_sName, ssprintf("SurvivedFrame p%d", p + 1))); - m_sprSurvivedFrame[p]->SetName(ssprintf("SurvivedFrameP%d", p + 1)); - ActorUtil::LoadAllCommands(*m_sprSurvivedFrame[p], m_sName); - SET_XY(m_sprSurvivedFrame[p]); - this->AddChild(m_sprSurvivedFrame[p]); - - m_textSurvivedNumber[p].LoadFromFont( - THEME->GetPathF(m_sName, "SurvivedNumber")); - // curewater: edited the "# stages cleared" text so it deducts one - // if you failed. Should be accurate, but I'm not sure if its - // "standard" that (bool)true = 1. (assumption) - m_textSurvivedNumber[p].SetText( - ssprintf("%02d", m_pStageStats->m_player[p].m_iSongsPassed)); - m_textSurvivedNumber[p].SetName( - ssprintf("SurvivedNumberP%d", p + 1)); - ActorUtil::LoadAllCommands(m_textSurvivedNumber[p], m_sName); - SET_XY(m_textSurvivedNumber[p]); - this->AddChild(&m_textSurvivedNumber[p]); - } - } - - // init win area - if (SHOW_WIN_AREA) { - FOREACH_EnabledPlayer(p) - { - m_sprWinFrame[p].Load( - THEME->GetPathG(m_sName, ssprintf("win frame p%d", p + 1))); - m_sprWinFrame[p]->SetName(ssprintf("WinFrameP%d", p + 1)); - ActorUtil::LoadAllCommands(*m_sprWinFrame[p], m_sName); - SET_XY(m_sprWinFrame[p]); - this->AddChild(m_sprWinFrame[p]); - - } - } - - // init judgment area - ROLLING_NUMBERS_CLASS.Load(m_sName, "RollingNumbersClass"); - ROLLING_NUMBERS_MAX_COMBO_CLASS.Load(m_sName, - "RollingNumbersMaxComboClass"); - FOREACH_ENUM(JudgmentLine, l) - { - if (l == JudgmentLine_W1 && !GAMESTATE->ShowW1()) - continue; // skip - - if (SHOW_JUDGMENT_LINE(l)) { - if (SHOW_SHARED_JUDGMENT_LINE_LABELS) { - LuaThreadVariable var2("JudgmentLine", LuaReference::Create(l)); - m_sprSharedJudgmentLineLabels[l].Load(THEME->GetPathG( - m_sName, "JudgmentLabel " + JudgmentLineToString(l))); - m_sprSharedJudgmentLineLabels[l]->SetName( - JudgmentLineToString(l) + "Label"); - ActorUtil::LoadAllCommands(m_sprSharedJudgmentLineLabels[l], - m_sName); - SET_XY(m_sprSharedJudgmentLineLabels[l]); - this->AddChild(m_sprSharedJudgmentLineLabels[l]); - } - - FOREACH_EnabledPlayer(p) - { - m_textJudgmentLineNumber[l][p].LoadFromFont( - THEME->GetPathF(m_sName, "JudgmentLineNumber")); - m_textJudgmentLineNumber[l][p].SetName( - JudgmentLineToString(l) + ssprintf("NumberP%d", p + 1)); - if (JudgmentLineToString(l) == "MaxCombo") - m_textJudgmentLineNumber[l][p].Load( - ROLLING_NUMBERS_MAX_COMBO_CLASS); - else - m_textJudgmentLineNumber[l][p].Load(ROLLING_NUMBERS_CLASS); - ActorUtil::LoadAllCommands(m_textJudgmentLineNumber[l][p], - m_sName); - SET_XY(m_textJudgmentLineNumber[l][p]); - this->AddChild(&m_textJudgmentLineNumber[l][p]); - - int iValue; - switch (l) { - /* xxx: This doesn't seem to handle checkpoints correctly. - * Something about checkpoints needing to be tied into - * the correct judgments instead of just W1/W2. Misses are - * ok. */ - case JudgmentLine_W1: - iValue = - m_pStageStats->m_player[p].m_iTapNoteScores[TNS_W1]; - if (CHECKPOINTS_WITH_JUDGMENTS && GAMESTATE->ShowW1()) { - iValue += m_pStageStats->m_player[p] - .m_iTapNoteScores[TNS_CheckpointHit]; - } - break; - case JudgmentLine_W2: - iValue = - m_pStageStats->m_player[p].m_iTapNoteScores[TNS_W2]; - if (CHECKPOINTS_WITH_JUDGMENTS && - !GAMESTATE->ShowW1()) { - iValue += m_pStageStats->m_player[p] - .m_iTapNoteScores[TNS_CheckpointHit]; - } - break; - case JudgmentLine_W3: - iValue = - m_pStageStats->m_player[p].m_iTapNoteScores[TNS_W3]; - break; - case JudgmentLine_W4: - iValue = - m_pStageStats->m_player[p].m_iTapNoteScores[TNS_W4]; - break; - case JudgmentLine_W5: - iValue = - m_pStageStats->m_player[p].m_iTapNoteScores[TNS_W5]; - break; - case JudgmentLine_Miss: - iValue = - m_pStageStats->m_player[p].m_iTapNoteScores[TNS_Miss]; - if (CHECKPOINTS_WITH_JUDGMENTS) { - iValue += m_pStageStats->m_player[p] - .m_iTapNoteScores[TNS_CheckpointMiss]; - } - break; - case JudgmentLine_Held: - iValue = m_pStageStats->m_player[p] - .m_iHoldNoteScores[HNS_Held]; - break; - case JudgmentLine_MaxCombo: - iValue = m_pStageStats->m_player[p].GetMaxCombo().m_cnt; - break; - DEFAULT_FAIL(l); - } - - m_textJudgmentLineNumber[l][p].SetTargetNumber( - static_cast(iValue)); - } - } - } - - // init detail area - if (SHOW_DETAIL_AREA) { - FOREACH_EnabledPlayer(p) - { - m_sprDetailFrame[p].Load( - THEME->GetPathG(m_sName, ssprintf("DetailFrame p%d", p + 1))); - m_sprDetailFrame[p]->SetName(ssprintf("DetailFrameP%d", p + 1)); - ActorUtil::LoadAllCommands(*m_sprDetailFrame[p], m_sName); - SET_XY(m_sprDetailFrame[p]); - this->AddChild(m_sprDetailFrame[p]); - } - - FOREACH_ENUM(DetailLine, l) - { - FOREACH_EnabledPlayer(p) - { - m_textDetailText[l][p].LoadFromFont( - THEME->GetPathF(m_sName, "DetailLineNumber")); - m_textDetailText[l][p].SetName(DetailLineToString(l) + - ssprintf("NumberP%d", p + 1)); - ActorUtil::LoadAllCommands(m_textDetailText[l][p], m_sName); - SET_XY(m_textDetailText[l][p]); - this->AddChild(&m_textDetailText[l][p]); - - static const int indices[NUM_DetailLine] = { - RadarCategory_TapsAndHolds, RadarCategory_Jumps, - RadarCategory_Holds, RadarCategory_Mines, - RadarCategory_Hands, RadarCategory_Rolls, - RadarCategory_Lifts, RadarCategory_Fakes - }; - const int ind = indices[l]; - const int iActual = - lround(m_pStageStats->m_player[p].m_radarActual[ind]); - const int iPossible = - lround(m_pStageStats->m_player[p].m_radarPossible[ind]); - - // todo: check if format string is valid - // (two integer values in DETAILLINE_FORMAT) -aj - m_textDetailText[l][p].SetText( - ssprintf(DETAILLINE_FORMAT, iActual, iPossible)); - } - } - } - - // init score area - if (SHOW_SCORE_AREA) { - m_sprScoreLabel.Load(THEME->GetPathG(m_sName, "ScoreLabel")); - m_sprScoreLabel->SetName("ScoreLabel"); - ActorUtil::LoadAllCommands(*m_sprScoreLabel, m_sName); - SET_XY(m_sprScoreLabel); - this->AddChild(m_sprScoreLabel); - - FOREACH_EnabledPlayer(p) - { - m_textScore[p].LoadFromFont( - THEME->GetPathF(m_sName, "ScoreNumber")); - m_textScore[p].SetName(ssprintf("ScoreNumberP%d", p + 1)); - m_textScore[p].Load("RollingNumbersEvaluation"); - ActorUtil::LoadAllCommands(m_textScore[p], m_sName); - SET_XY(m_textScore[p]); - m_textScore[p].SetTargetNumber( - static_cast(m_pStageStats->m_player[p].m_iScore)); - this->AddChild(&m_textScore[p]); - } - } - - // init time area - if (SHOW_TIME_AREA) { - m_sprTimeLabel.Load(THEME->GetPathG(m_sName, "TimeLabel")); - m_sprTimeLabel->SetName("TimeLabel"); - ActorUtil::LoadAllCommands(*m_sprTimeLabel, m_sName); - SET_XY(m_sprTimeLabel); - this->AddChild(m_sprTimeLabel); - - FOREACH_EnabledPlayer(p) - { - m_textTime[p].LoadFromFont(THEME->GetPathF(m_sName, "time")); - m_textTime[p].SetShadowLength(0); - m_textTime[p].SetName(ssprintf("TimeNumberP%d", p + 1)); - ActorUtil::LoadAllCommands(m_textTime[p], m_sName); - SET_XY(m_textTime[p]); - m_textTime[p].SetText( - SecondsToMMSSMsMs(m_pStageStats->m_player[p].m_fAliveSeconds)); - this->AddChild(&m_textTime[p]); - } - } - // init records area bool bOneHasNewTopRecord = false; bool bOneHasFullW1Combo = false; @@ -693,16 +255,7 @@ ScreenEvaluation::Init() bOneHasFullW1Combo ? "W1" : (bOneHasFullW2Combo ? "W2" : "W3"); SOUND->PlayOnceFromDir( ANNOUNCER->GetPathTo("evaluation full combo " + sComboType)); - } else { - if (SUMMARY) { - SOUND->PlayOnceFromDir(ANNOUNCER->GetPathTo( - "evaluation final " + GradeToOldString(best_grade))); - } else { - SOUND->PlayOnceFromDir(ANNOUNCER->GetPathTo( - "evaluation " + GradeToOldString(best_grade))); - } - } - + } switch (best_grade) { case Grade_Tier01: case Grade_Tier02: diff --git a/src/ScreenEvaluation.h b/src/ScreenEvaluation.h index ca282cc32c..e0e9d9e44d 100644 --- a/src/ScreenEvaluation.h +++ b/src/ScreenEvaluation.h @@ -18,32 +18,7 @@ * If any extra stages are passed, those get shown as well. */ const int MAX_SONGS_TO_SHOW = 5; /** @brief The different judgment lines shown. */ -enum JudgmentLine -{ - JudgmentLine_W1, /**< The line showing absolutely perfect hits. */ - JudgmentLine_W2, /**< The line showing just-a-smidge-off perfect hits. */ - JudgmentLine_W3, /**< The line showing almost perfect hits. */ - JudgmentLine_W4, /**< The line showing hits that were not that good. */ - JudgmentLine_W5, /**< The line showing hits that were almost missed. */ - JudgmentLine_Miss, /**< The line showing missed notes. */ - JudgmentLine_Held, /**< The line showing held down notes. */ - JudgmentLine_MaxCombo, /**< The line showing the player's max combo. */ - NUM_JudgmentLine, /**< The number of judgment lines available. */ - JudgmentLine_Invalid -}; -/** @brief The number of details based on the radar categories. */ -enum DetailLine -{ - DetailLine_NumSteps, /**< The number of steps hit. */ - DetailLine_Jumps, /**< The number of jumps hit together. */ - DetailLine_Holds, /**< The number of holds held. */ - DetailLine_Mines, /**< The number of mines avoided. */ - DetailLine_Hands, /**< The number of hands hit (somehow) */ - DetailLine_Rolls, /**< The number of rolls hit repeatedly. */ - DetailLine_Lifts, /**< The number of lifts lifted up. */ - DetailLine_Fakes, /**< The number of fakes to be ignored. */ - NUM_DetailLine /**< The nuber of detailed lines. */ -}; + /** @brief Shows the player their score after gameplay has ended. */ class ScreenEvaluation : public ScreenWithMenuElements { @@ -62,57 +37,13 @@ class ScreenEvaluation : public ScreenWithMenuElements protected: void HandleMenuStart(); - bool m_bSummary; + StageStats* m_pStageStats; StageStats m_FinalEvalStageStats; - // banner area - Banner m_LargeBanner; - AutoActor m_sprLargeBannerFrame; - BitmapText m_textPlayerOptions[NUM_PLAYERS]; - BitmapText m_textSongOptions; - AutoActor m_sprDisqualified[NUM_PLAYERS]; - Banner m_SmallBanner[MAX_SONGS_TO_SHOW]; - AutoActor m_sprSmallBannerFrame[MAX_SONGS_TO_SHOW]; - - // points area - PercentageDisplay m_Percent[NUM_PLAYERS]; - AutoActor m_sprPercentFrame[NUM_PLAYERS]; - - // bonus area - AutoActor m_sprBonusFrame[NUM_PLAYERS]; - Sprite m_sprPossibleBar[NUM_PLAYERS][NUM_RadarCategory]; - Sprite m_sprActualBar[NUM_PLAYERS][NUM_RadarCategory]; - - // survived area - AutoActor m_sprSurvivedFrame[NUM_PLAYERS]; - BitmapText m_textSurvivedNumber[NUM_PLAYERS]; - - // win area - AutoActor m_sprWinFrame[NUM_PLAYERS]; - Sprite m_sprWin[NUM_PLAYERS]; - - // judgment area - AutoActor m_sprSharedJudgmentLineLabels[NUM_JudgmentLine]; - RollingNumbers m_textJudgmentLineNumber[NUM_JudgmentLine][NUM_PLAYERS]; - - // stats area - AutoActor m_sprDetailFrame[NUM_PLAYERS]; - BitmapText m_textDetailText[NUM_DetailLine][NUM_PLAYERS]; - - // score area - AutoActor m_sprScoreLabel; - RollingNumbers m_textScore[NUM_PLAYERS]; - - // time area - AutoActor m_sprTimeLabel; - BitmapText m_textTime[NUM_PLAYERS]; - RageSound m_soundStart; // sound played if the player passes or fails - ThemeMetric SUMMARY; - ThemeMetric ROLLING_NUMBERS_CLASS; - ThemeMetric ROLLING_NUMBERS_MAX_COMBO_CLASS; + /** @brief Did a player save a screenshot of their score? */ bool m_bSavedScreenshot[NUM_PLAYERS]; };