From e3798432d4841ff3e2320b349c6a9eb6a0c79807 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Wed, 18 Jan 2006 06:44:13 +0000 Subject: [PATCH] implement OptionRowHandlerListSteps::Reload --- stepmania/src/OptionRowHandler.cpp | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/stepmania/src/OptionRowHandler.cpp b/stepmania/src/OptionRowHandler.cpp index 6771fc35ae..5c41f5edf5 100644 --- a/stepmania/src/OptionRowHandler.cpp +++ b/stepmania/src/OptionRowHandler.cpp @@ -285,6 +285,17 @@ class OptionRowHandlerListSteps : public OptionRowHandlerList m_Def.m_sName = "Steps"; m_Def.m_bAllowThemeItems = false; // we theme the text ourself + Reload(); + + // don't call default + // OptionRowHandlerList::LoadInternal( cmds ); + } + + virtual bool Reload() + { + m_Def.m_vsChoices.clear(); + m_aListEntries.clear(); + // fill in difficulty names if( GAMESTATE->IsEditing() ) { @@ -309,7 +320,7 @@ class OptionRowHandlerListSteps : public OptionRowHandlerList m_aListEntries.push_back( mc ); } } - else // !GAMESTATE->IsCourseMode(), playing a song + else if( GAMESTATE->m_pCurSong ) // playing a song { vector vpSteps; Song *pSong = GAMESTATE->m_pCurSong; @@ -333,9 +344,15 @@ class OptionRowHandlerListSteps : public OptionRowHandlerList m_aListEntries.push_back( mc ); } } + else + { + /* We have neither a song nor a course. We may be preloading the screen + * for future use. */ + m_Def.m_vsChoices.push_back( "n/a" ); + m_aListEntries.push_back( GameCommand() ); + } - // don't call default - // OptionRowHandlerList::LoadInternal( cmds ); + return true; } };