From 32d5a011ee1cf338a559f95a8a6c9b2857515632 Mon Sep 17 00:00:00 2001 From: Jason Felds Date: Tue, 16 Oct 2012 21:05:27 -0400 Subject: [PATCH] Don't allow setting the meter to < 1. --- src/ScreenEdit.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/ScreenEdit.cpp b/src/ScreenEdit.cpp index 8b875b6738..eb7b460568 100644 --- a/src/ScreenEdit.cpp +++ b/src/ScreenEdit.cpp @@ -4062,6 +4062,17 @@ static void ChangeStepCredit( const RString &sNew ) pSteps->SetCredit(sNew); } +static void ChangeStepMeter( const RString &sNew ) +{ + int diff = StringToInt(sNew); + // TODO: What's the clamping function again, and what's our max level? + if (diff < 1) + { + diff = 1; + } + GAMESTATE->m_pCurSteps[PLAYER_1]->SetMeter(diff); +} + static void ChangeMainTitle( const RString &sNew ) { Song* pSong = GAMESTATE->m_pCurSong; @@ -5091,7 +5102,10 @@ void ScreenEdit::HandleStepsInformationChoice( StepsInformationChoice c, const v ScreenTextEntry::TextEntry(SM_BackFromDifficultyMeterChange, ENTER_NEW_METER, ssprintf("%d", m_pSteps->GetMeter()), - 4); + 4, + NULL, + ChangeStepMeter, + NULL); break; } case step_min_bpm: