From c52fef876743ff4d995f44fd2948f842d072a9c2 Mon Sep 17 00:00:00 2001 From: Jason Felds Date: Wed, 13 Jul 2011 16:07:33 -0400 Subject: [PATCH] Display more accurate couple/routine data. Also include minor speed boost courtesy of vyhd. --- Docs/Changelog_sm5.txt | 2 + Themes/_fallback/metrics.ini | 8 +++ src/ScreenEdit.cpp | 110 +++++++++++++++++++++++++++++------ 3 files changed, 101 insertions(+), 19 deletions(-) diff --git a/Docs/Changelog_sm5.txt b/Docs/Changelog_sm5.txt index 81e01eebf0..7f632cfb55 100644 --- a/Docs/Changelog_sm5.txt +++ b/Docs/Changelog_sm5.txt @@ -13,6 +13,8 @@ StepMania 5.0 ????????? | 20110??? * [Difficulty] Allow ALL StepsTypes to use CustomDifficulty properly. There was some unfair targeting of Couple and Routine. [Wolfman2000] * [Steps] Calculate accurate radar values for Couple charts. [Wolfman2000] +* [ScreenEdit] Display more accurate chart data for Couple and Routine charts + for the future. No more having (almost) every row as a jump! [Wolfman2000] 2011/07/12 ---------- diff --git a/Themes/_fallback/metrics.ini b/Themes/_fallback/metrics.ini index 4d3f9d6514..70800b55a3 100644 --- a/Themes/_fallback/metrics.ini +++ b/Themes/_fallback/metrics.ini @@ -3641,6 +3641,14 @@ NumHandsFormat="%s: %d\n" NumRollsFormat="%s: %d\n" NumLiftsFormat="%s: %d\n" NumFakesFormat="%s: %d\n" +NumStepsFormatTwoPlayer="%s: %d/%d\n" +NumJumpsFormatTwoPlayer="%s: %d/%d\n" +NumHoldsFormatTwoPlayer="%s: %d/%d\n" +NumMinesFormatTwoPlayer="%s: %d/%d\n" +NumHandsFormatTwoPlayer="%s: %d/%d\n" +NumRollsFormatTwoPlayer="%s: %d/%d\n" +NumLiftsFormatTwoPlayer="%s: %d/%d\n" +NumFakesFormatTwoPlayer="%s: %d/%d\n" TimingModeFormat="%s:\n %s\n" Beat0OffsetFormat="%s:\n %.6f secs\n" PreviewStartFormat="%s:\n %.6f secs\n" diff --git a/src/ScreenEdit.cpp b/src/ScreenEdit.cpp index 346aaa5e11..f0dacde5c0 100644 --- a/src/ScreenEdit.cpp +++ b/src/ScreenEdit.cpp @@ -1190,6 +1190,14 @@ static ThemeMetric NUM_HANDS_FORMAT("ScreenEdit", "NumHandsFormat"); static ThemeMetric NUM_ROLLS_FORMAT("ScreenEdit", "NumRollsFormat"); static ThemeMetric NUM_LIFTS_FORMAT("ScreenEdit", "NumLiftsFormat"); static ThemeMetric NUM_FAKES_FORMAT("ScreenEdit", "NumFakesFormat"); +static ThemeMetric NUM_STEPS_FORMAT_TWO_PLAYER("ScreenEdit", "NumStepsFormatTwoPlayer"); +static ThemeMetric NUM_JUMPS_FORMAT_TWO_PLAYER("ScreenEdit", "NumJumpsFormatTwoPlayer"); +static ThemeMetric NUM_HOLDS_FORMAT_TWO_PLAYER("ScreenEdit", "NumHoldsFormatTwoPlayer"); +static ThemeMetric NUM_MINES_FORMAT_TWO_PLAYER("ScreenEdit", "NumMinesFormatTwoPlayer"); +static ThemeMetric NUM_HANDS_FORMAT_TWO_PLAYER("ScreenEdit", "NumHandsFormatTwoPlayer"); +static ThemeMetric NUM_ROLLS_FORMAT_TWO_PLAYER("ScreenEdit", "NumRollsFormatTwoPlayer"); +static ThemeMetric NUM_LIFTS_FORMAT_TWO_PLAYER("ScreenEdit", "NumLiftsFormatTwoPlayer"); +static ThemeMetric NUM_FAKES_FORMAT_TWO_PLAYER("ScreenEdit", "NumFakesFormatTwoPlayer"); static ThemeMetric TIMING_MODE_FORMAT("ScreenEdit", "TimingModeFormat"); static ThemeMetric BEAT_0_OFFSET_FORMAT("ScreenEdit", "Beat0OffsetFormat"); static ThemeMetric PREVIEW_START_FORMAT("ScreenEdit", "PreviewStartFormat"); @@ -1259,15 +1267,53 @@ void ScreenEdit::UpdateTextInfo() } GAMESTATE->SetProcessedTimingData(&m_pSteps->m_Timing); - - sText += ssprintf( NUM_STEPS_FORMAT.GetValue(), TAP_STEPS.GetValue().c_str(), m_NoteDataEdit.GetNumTapNotes() ); - sText += ssprintf( NUM_JUMPS_FORMAT.GetValue(), JUMPS.GetValue().c_str(), m_NoteDataEdit.GetNumJumps() ); - sText += ssprintf( NUM_HANDS_FORMAT.GetValue(), HANDS.GetValue().c_str(), m_NoteDataEdit.GetNumHands() ); - sText += ssprintf( NUM_HOLDS_FORMAT.GetValue(), HOLDS.GetValue().c_str(), m_NoteDataEdit.GetNumHoldNotes() ); - sText += ssprintf( NUM_MINES_FORMAT.GetValue(), MINES.GetValue().c_str(), m_NoteDataEdit.GetNumMines() ); - sText += ssprintf( NUM_ROLLS_FORMAT.GetValue(), ROLLS.GetValue().c_str(), m_NoteDataEdit.GetNumRolls() ); - sText += ssprintf( NUM_LIFTS_FORMAT.GetValue(), LIFTS.GetValue().c_str(), m_NoteDataEdit.GetNumLifts() ); - sText += ssprintf( NUM_FAKES_FORMAT.GetValue(), FAKES.GetValue().c_str(), m_NoteDataEdit.GetNumFakes() ); + const StepsTypeCategory &cat = GAMEMAN->GetStepsTypeInfo(m_pSteps->m_StepsType).m_StepsTypeCategory; + if (cat == StepsTypeCategory_Couple || cat == StepsTypeCategory_Routine) + { + pair tmp = m_NoteDataEdit.GetNumTapNotesTwoPlayer(); + sText += ssprintf(NUM_STEPS_FORMAT_TWO_PLAYER.GetValue(), + TAP_STEPS.GetValue().c_str(), + tmp.first, tmp.second); + tmp = m_NoteDataEdit.GetNumJumpsTwoPlayer(); + sText += ssprintf(NUM_JUMPS_FORMAT_TWO_PLAYER.GetValue(), + JUMPS.GetValue().c_str(), + tmp.first, tmp.second); + tmp = m_NoteDataEdit.GetNumHandsTwoPlayer(); + sText += ssprintf(NUM_HANDS_FORMAT_TWO_PLAYER.GetValue(), + HANDS.GetValue().c_str(), + tmp.first, tmp.second); + tmp = m_NoteDataEdit.GetNumHoldNotesTwoPlayer(); + sText += ssprintf(NUM_HOLDS_FORMAT_TWO_PLAYER.GetValue(), + HOLDS.GetValue().c_str(), + tmp.first, tmp.second); + tmp = m_NoteDataEdit.GetNumMinesTwoPlayer(); + sText += ssprintf(NUM_MINES_FORMAT_TWO_PLAYER.GetValue(), + MINES.GetValue().c_str(), + tmp.first, tmp.second); + tmp = m_NoteDataEdit.GetNumRollsTwoPlayer(); + sText += ssprintf(NUM_ROLLS_FORMAT_TWO_PLAYER.GetValue(), + ROLLS.GetValue().c_str(), + tmp.first, tmp.second); + tmp = m_NoteDataEdit.GetNumLiftsTwoPlayer(); + sText += ssprintf(NUM_LIFTS_FORMAT_TWO_PLAYER.GetValue(), + LIFTS.GetValue().c_str(), + tmp.first, tmp.second); + tmp = m_NoteDataEdit.GetNumFakesTwoPlayer(); + sText += ssprintf(NUM_FAKES_FORMAT_TWO_PLAYER.GetValue(), + FAKES.GetValue().c_str(), + tmp.first, tmp.second); + } + else + { + sText += ssprintf( NUM_STEPS_FORMAT.GetValue(), TAP_STEPS.GetValue().c_str(), m_NoteDataEdit.GetNumTapNotes() ); + sText += ssprintf( NUM_JUMPS_FORMAT.GetValue(), JUMPS.GetValue().c_str(), m_NoteDataEdit.GetNumJumps() ); + sText += ssprintf( NUM_HANDS_FORMAT.GetValue(), HANDS.GetValue().c_str(), m_NoteDataEdit.GetNumHands() ); + sText += ssprintf( NUM_HOLDS_FORMAT.GetValue(), HOLDS.GetValue().c_str(), m_NoteDataEdit.GetNumHoldNotes() ); + sText += ssprintf( NUM_MINES_FORMAT.GetValue(), MINES.GetValue().c_str(), m_NoteDataEdit.GetNumMines() ); + sText += ssprintf( NUM_ROLLS_FORMAT.GetValue(), ROLLS.GetValue().c_str(), m_NoteDataEdit.GetNumRolls() ); + sText += ssprintf( NUM_LIFTS_FORMAT.GetValue(), LIFTS.GetValue().c_str(), m_NoteDataEdit.GetNumLifts() ); + sText += ssprintf( NUM_FAKES_FORMAT.GetValue(), FAKES.GetValue().c_str(), m_NoteDataEdit.GetNumFakes() ); + } switch( EDIT_MODE.GetValue() ) { DEFAULT_FAIL( EDIT_MODE.GetValue() ); @@ -3738,15 +3784,41 @@ void ScreenEdit::HandleMainMenuChoice( MainMenuChoice c, const vector &iAns case view_steps_data: { float fMusicSeconds = m_pSoundMusic->GetLengthSeconds(); - g_StepsData.rows[tap_notes].SetOneUnthemedChoice( ssprintf("%d", m_NoteDataEdit.GetNumTapNotes()) ); - g_StepsData.rows[jumps].SetOneUnthemedChoice( ssprintf("%d", m_NoteDataEdit.GetNumJumps()) ); - g_StepsData.rows[hands].SetOneUnthemedChoice( ssprintf("%d", m_NoteDataEdit.GetNumHands()) ); - g_StepsData.rows[quads].SetOneUnthemedChoice( ssprintf("%d", m_NoteDataEdit.GetNumQuads()) ); - g_StepsData.rows[holds].SetOneUnthemedChoice( ssprintf("%d", m_NoteDataEdit.GetNumHoldNotes()) ); - g_StepsData.rows[mines].SetOneUnthemedChoice( ssprintf("%d", m_NoteDataEdit.GetNumMines()) ); - g_StepsData.rows[rolls].SetOneUnthemedChoice( ssprintf("%d", m_NoteDataEdit.GetNumRolls()) ); - g_StepsData.rows[lifts].SetOneUnthemedChoice( ssprintf("%d", m_NoteDataEdit.GetNumLifts()) ); - g_StepsData.rows[fakes].SetOneUnthemedChoice( ssprintf("%d", m_NoteDataEdit.GetNumFakes()) ); + Steps* pSteps = GAMESTATE->m_pCurSteps[PLAYER_1]; + const StepsTypeCategory &cat = GAMEMAN->GetStepsTypeInfo(pSteps->m_StepsType).m_StepsTypeCategory; + if (cat == StepsTypeCategory_Couple || cat == StepsTypeCategory_Routine) + { + pair tmp = m_NoteDataEdit.GetNumTapNotesTwoPlayer(); + g_StepsData.rows[tap_notes].SetOneUnthemedChoice( ssprintf("%d / %d", tmp.first, tmp.second) ); + tmp = m_NoteDataEdit.GetNumJumpsTwoPlayer(); + g_StepsData.rows[jumps].SetOneUnthemedChoice( ssprintf("%d / %d", tmp.first, tmp.second) ); + tmp = m_NoteDataEdit.GetNumHandsTwoPlayer(); + g_StepsData.rows[hands].SetOneUnthemedChoice( ssprintf("%d / %d", tmp.first, tmp.second) ); + tmp = m_NoteDataEdit.GetNumQuadsTwoPlayer(); + g_StepsData.rows[quads].SetOneUnthemedChoice( ssprintf("%d / %d", tmp.first, tmp.second) ); + tmp = m_NoteDataEdit.GetNumHoldNotesTwoPlayer(); + g_StepsData.rows[holds].SetOneUnthemedChoice( ssprintf("%d / %d", tmp.first, tmp.second) ); + tmp = m_NoteDataEdit.GetNumMinesTwoPlayer(); + g_StepsData.rows[mines].SetOneUnthemedChoice( ssprintf("%d / %d", tmp.first, tmp.second) ); + tmp = m_NoteDataEdit.GetNumRollsTwoPlayer(); + g_StepsData.rows[rolls].SetOneUnthemedChoice( ssprintf("%d / %d", tmp.first, tmp.second) ); + tmp = m_NoteDataEdit.GetNumLiftsTwoPlayer(); + g_StepsData.rows[lifts].SetOneUnthemedChoice( ssprintf("%d / %d", tmp.first, tmp.second) ); + tmp = m_NoteDataEdit.GetNumFakesTwoPlayer(); + g_StepsData.rows[fakes].SetOneUnthemedChoice( ssprintf("%d / %d", tmp.first, tmp.second) ); + } + else + { + g_StepsData.rows[tap_notes].SetOneUnthemedChoice( ssprintf("%d", m_NoteDataEdit.GetNumTapNotes()) ); + g_StepsData.rows[jumps].SetOneUnthemedChoice( ssprintf("%d", m_NoteDataEdit.GetNumJumps()) ); + g_StepsData.rows[hands].SetOneUnthemedChoice( ssprintf("%d", m_NoteDataEdit.GetNumHands()) ); + g_StepsData.rows[quads].SetOneUnthemedChoice( ssprintf("%d", m_NoteDataEdit.GetNumQuads()) ); + g_StepsData.rows[holds].SetOneUnthemedChoice( ssprintf("%d", m_NoteDataEdit.GetNumHoldNotes()) ); + g_StepsData.rows[mines].SetOneUnthemedChoice( ssprintf("%d", m_NoteDataEdit.GetNumMines()) ); + g_StepsData.rows[rolls].SetOneUnthemedChoice( ssprintf("%d", m_NoteDataEdit.GetNumRolls()) ); + g_StepsData.rows[lifts].SetOneUnthemedChoice( ssprintf("%d", m_NoteDataEdit.GetNumLifts()) ); + g_StepsData.rows[fakes].SetOneUnthemedChoice( ssprintf("%d", m_NoteDataEdit.GetNumFakes()) ); + } g_StepsData.rows[stream].SetOneUnthemedChoice( ssprintf("%.2f", NoteDataUtil::GetStreamRadarValue(m_NoteDataEdit,fMusicSeconds)) ); g_StepsData.rows[voltage].SetOneUnthemedChoice( ssprintf("%.2f", NoteDataUtil::GetVoltageRadarValue(m_NoteDataEdit,fMusicSeconds)) ); g_StepsData.rows[air].SetOneUnthemedChoice( ssprintf("%.2f", NoteDataUtil::GetAirRadarValue(m_NoteDataEdit,fMusicSeconds)) ); @@ -5123,7 +5195,7 @@ void ScreenEdit::DoHelp() RString sDescription = THEME->GetString( "EditHelpDescription", hl.szEnglishDescription ); // TODO: Better way of hiding routine only key on non-routine. - if( sDescription.Left(13) == "Switch player" && m_InputPlayerNumber == PLAYER_INVALID ) + if( hl.veb[0] == EDIT_BUTTON_SWITCH_PLAYERS && m_InputPlayerNumber == PLAYER_INVALID ) { continue; }