diff --git a/stepmania/Themes/default/Graphics/ScreenCourseManager header.redir b/stepmania/Themes/default/Graphics/ScreenCourseManager header.redir new file mode 100644 index 0000000000..05fbd67250 --- /dev/null +++ b/stepmania/Themes/default/Graphics/ScreenCourseManager header.redir @@ -0,0 +1 @@ +_shared menu header diff --git a/stepmania/src/OptionRow.cpp b/stepmania/src/OptionRow.cpp index 59675dbb4f..f27b948e5b 100644 --- a/stepmania/src/OptionRow.cpp +++ b/stepmania/src/OptionRow.cpp @@ -697,15 +697,12 @@ void OptionRow::SetExitText( CString sExitText ) bt->SetText( sExitText ); } -void OptionRow::Reload() +void OptionRow::Reload( const OptionRowDefinition &def ) { switch( GetRowType() ) { case OptionRow::ROW_NORMAL: { - if( m_pHand == NULL ) - return; - vector vpns; FOREACH_HumanPlayer( p ) vpns.push_back( p ); @@ -718,7 +715,10 @@ void OptionRow::Reload() // ExportOptions( vpns, bRowHasFocus ); //} - m_pHand->Reload( m_RowDef ); + if( m_pHand == NULL ) + m_RowDef = def; + else + m_pHand->Reload( m_RowDef ); ASSERT( !m_RowDef.choices.empty() ); FOREACH_PlayerNumber( p ) @@ -765,7 +765,7 @@ void OptionRow::Reload() void OptionRow::HandleMessage( const CString& sMessage ) { - Reload(); + Reload( m_RowDef ); } diff --git a/stepmania/src/OptionRow.h b/stepmania/src/OptionRow.h index efe44712e1..6fa2de4891 100644 --- a/stepmania/src/OptionRow.h +++ b/stepmania/src/OptionRow.h @@ -160,7 +160,7 @@ public: void SetExitText( CString sExitText ); - void Reload(); + void Reload( const OptionRowDefinition &def ); // // Messages diff --git a/stepmania/src/ScreenCourseManager.cpp b/stepmania/src/ScreenCourseManager.cpp index 836a767039..c191a77581 100644 --- a/stepmania/src/ScreenCourseManager.cpp +++ b/stepmania/src/ScreenCourseManager.cpp @@ -15,8 +15,8 @@ enum CourseManagerAction { ACTION_EDIT, ACTION_DELETE, - ACTION_CREATE_NEW, ACTION_COPY_TO_NEW, + ACTION_CREATE_NEW, NUM_CourseManagerAction }; static const CString CourseManagerActionNames[] = { @@ -27,6 +27,20 @@ static const CString CourseManagerActionNames[] = { }; XToString( CourseManagerAction, NUM_CourseManagerAction ); +static void GetPossibleActions( Course *pCourse, vector &vActionsOut ) +{ + if( pCourse ) + { + vActionsOut.push_back( ACTION_EDIT ); + vActionsOut.push_back( ACTION_DELETE ); + vActionsOut.push_back( ACTION_COPY_TO_NEW ); + } + else + { + vActionsOut.push_back( ACTION_CREATE_NEW ); + } +} + REGISTER_SCREEN_CLASS( ScreenCourseManager ); ScreenCourseManager::ScreenCourseManager( CString sName ) : ScreenOptions( sName ) @@ -96,6 +110,7 @@ void ScreenCourseManager::OnChange( PlayerNumber pn ) FOREACH_CONST( Course*, vpCourses, c ) def.choices.push_back( (*c)->GetTranslitFullTitle() ); def.choices.push_back( NULL ); // new course + row.Reload( def ); } // fall through case ROW_COURSE: @@ -111,13 +126,13 @@ void ScreenCourseManager::OnChange( PlayerNumber pn ) // refresh actions { OptionRow &row = *m_pRows[ROW_ACTION]; - vector vpCourses; - SONGMAN->GetCoursesInGroup( vpCourses, GAMESTATE->m_sPreferredCourseGroup.Get(), false ); OptionRowDefinition def = row.GetRowDef(); def.choices.clear(); - FOREACH_CONST( Course*, vpCourses, c ) - def.choices.push_back( (*c)->GetTranslitFullTitle() ); - def.choices.push_back( NULL ); // new course + vector vActions; + GetPossibleActions( GAMESTATE->m_pCurCourse, vActions ); + FOREACH_CONST( CourseManagerAction, vActions, a ) + def.choices.push_back( CourseManagerActionToString(*a) ); + row.Reload( def ); } // fall through case ROW_ACTION: