From 799bbc0a5c3723bd9ac2cbee042a438eee73bb32 Mon Sep 17 00:00:00 2001 From: Jason Felds Date: Sat, 7 May 2011 19:18:03 -0400 Subject: [PATCH] Make this use ScreenTextEntry. The rest will be fixed once I find out why I'm having compilation issues. --- Themes/_fallback/Languages/en.ini | 1 + src/ScreenEdit.cpp | 26 ++++++++++++++++++++++---- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/Themes/_fallback/Languages/en.ini b/Themes/_fallback/Languages/en.ini index 0847beabb8..51db471be3 100644 --- a/Themes/_fallback/Languages/en.ini +++ b/Themes/_fallback/Languages/en.ini @@ -1232,6 +1232,7 @@ Enter a new genre.=Enter a new genre. Enter a new credit.=Enter a new credit. Enter a new description.=Enter a new description. Enter a new chart style.=Enter a new chart style (e.g. "Pad", "Keyboard"). +Enter a new meter.=Enter the difficulty rating for this chart. Enter the author who made this step pattern.=Enter the author who made this step pattern. Enter the offset for the song.=Enter the beat 0 offset for the song. Enter a new last beat hint.=Enter a new last beat hint. diff --git a/src/ScreenEdit.cpp b/src/ScreenEdit.cpp index 52e9c62ea0..8f02b58eb9 100644 --- a/src/ScreenEdit.cpp +++ b/src/ScreenEdit.cpp @@ -73,6 +73,7 @@ AutoScreenMessage( SM_BackFromCourseModeMenu ); AutoScreenMessage( SM_DoRevertToLastSave ); AutoScreenMessage( SM_DoRevertFromDisk ); AutoScreenMessage( SM_BackFromTimingDataInformation ); +AutoScreenMessage( SM_BackFromDifficultyMeterChange ); AutoScreenMessage( SM_BackFromBPMChange ); AutoScreenMessage( SM_BackFromStopChange ); AutoScreenMessage( SM_BackFromDelayChange ); @@ -519,7 +520,7 @@ static MenuDef g_AreaMenu( static MenuDef g_StepsInformation( "ScreenMiniMenuStepsInformation", MenuRowDef( ScreenEdit::difficulty, "Difficulty", true, EditMode_Practice, true, true, 0, NULL ), - MenuRowDef( ScreenEdit::meter, "Meter", true, EditMode_Practice, true, false, 0, MIN_METER, MAX_METER ), + MenuRowDef( ScreenEdit::meter, "Meter", true, EditMode_Practice, true, false, 0, NULL ), MenuRowDef( ScreenEdit::description, "Description", true, EditMode_Practice, true, true, 0, NULL ), MenuRowDef( ScreenEdit::chartstyle, "Chart Style", true, EditMode_Practice, true, true, 0, NULL ), MenuRowDef( ScreenEdit::step_credit, "Step Author", true, EditMode_Practice, true, true, 0, NULL ), @@ -2614,6 +2615,14 @@ void ScreenEdit::HandleScreenMessage( const ScreenMessage SM ) { HandleTimingDataInformationChoice( (TimingDataInformationChoice)ScreenMiniMenu::s_iLastRowCode, ScreenMiniMenu::s_viLastAnswers ); } + else if( SM == SM_BackFromDifficultyMeterChange ) + { + int i; + std::istringstream ss( ScreenTextEntry::s_sLastAnswer ); + ss >> i; + GAMESTATE->m_pCurSteps[PLAYER_1]->SetMeter(i); + SetDirty( true ); + } else if( SM == SM_BackFromBPMChange ) { float fBPM = StringToFloat( ScreenTextEntry::s_sLastAnswer ); @@ -3126,7 +3135,7 @@ void ScreenEdit::HandleMainMenuChoice( MainMenuChoice c, const vector &iAns } g_StepsInformation.rows[difficulty].iDefaultChoice = pSteps->GetDifficulty(); g_StepsInformation.rows[difficulty].bEnabled = (EDIT_MODE.GetValue() >= EditMode_Full); - g_StepsInformation.rows[meter].iDefaultChoice = clamp( pSteps->GetMeter()-1, 0, MAX_METER+1 ); + g_StepsInformation.rows[meter].SetOneUnthemedChoice( ssprintf("%d", pSteps->GetMeter()-1) ); g_StepsInformation.rows[meter].bEnabled = (EDIT_MODE.GetValue() >= EditMode_Home); g_StepsInformation.rows[predict_meter].SetOneUnthemedChoice( ssprintf("%.2f",pSteps->PredictMeter()) ); g_StepsInformation.rows[description].bEnabled = (EDIT_MODE.GetValue() >= EditMode_Full); @@ -3590,13 +3599,12 @@ void ScreenEdit::HandleAreaMenuChoice( AreaMenuChoice c, const vector &iAns static LocalizedString ENTER_NEW_DESCRIPTION( "ScreenEdit", "Enter a new description." ); static LocalizedString ENTER_NEW_CHART_STYLE( "ScreenEdit", "Enter a new chart style." ); static LocalizedString ENTER_NEW_STEP_AUTHOR( "ScreenEdit", "Enter the author who made this step pattern." ); +static LocalizedString ENTER_NEW_METER( "ScreenEdit", "Enter a new meter." ); void ScreenEdit::HandleStepsInformationChoice( StepsInformationChoice c, const vector &iAnswers ) { Steps* pSteps = GAMESTATE->m_pCurSteps[PLAYER_1]; Difficulty dc = (Difficulty)iAnswers[difficulty]; pSteps->SetDifficulty( dc ); - int iMeter = iAnswers[meter]+1; - pSteps->SetMeter( iMeter ); switch( c ) { @@ -3633,6 +3641,16 @@ void ScreenEdit::HandleStepsInformationChoice( StepsInformationChoice c, const v NULL ); break; + case meter: + ScreenTextEntry::TextEntry( + SM_BackFromDifficultyMeterChange, + ENTER_NEW_METER, + ssprintf("%d", m_pSteps->GetMeter()), + 4 + ); + break; + default: + break; } }