rename: AllStepsTypeInOneList -> AutoSetStyle

set m_pCurStyle based on the chosen Steps
This commit is contained in:
Chris Danford
2007-03-06 10:05:51 +00:00
parent 490a8dd437
commit ca2222990c
4 changed files with 24 additions and 9 deletions
+1 -1
View File
@@ -23,7 +23,7 @@ ThemeMetric<RString> CommonMetrics::DEFAULT_NOTESKIN_NAME ("Common","DefaultN
ThemeMetricDifficultiesToShow CommonMetrics::DIFFICULTIES_TO_SHOW ("Common","DifficultiesToShow"); ThemeMetricDifficultiesToShow CommonMetrics::DIFFICULTIES_TO_SHOW ("Common","DifficultiesToShow");
ThemeMetricCourseDifficultiesToShow CommonMetrics::COURSE_DIFFICULTIES_TO_SHOW ("Common","CourseDifficultiesToShow"); ThemeMetricCourseDifficultiesToShow CommonMetrics::COURSE_DIFFICULTIES_TO_SHOW ("Common","CourseDifficultiesToShow");
ThemeMetricStepsTypesToShow CommonMetrics::STEPS_TYPES_TO_SHOW ("Common","StepsTypesToHide"); // This metric takes a list of StepsTypes to hide and returns a list of StepsTypes to show ThemeMetricStepsTypesToShow CommonMetrics::STEPS_TYPES_TO_SHOW ("Common","StepsTypesToHide"); // This metric takes a list of StepsTypes to hide and returns a list of StepsTypes to show
ThemeMetric<bool> CommonMetrics::ALL_STEPS_TYPES_IN_ONE_LIST ("Common","AllStepsTypeInOneList"); ThemeMetric<bool> CommonMetrics::AUTO_SET_STYLE ("Common","AutoSetStyle");
ThemeMetricDifficultiesToShow::ThemeMetricDifficultiesToShow( const RString& sGroup, const RString& sName ) : ThemeMetricDifficultiesToShow::ThemeMetricDifficultiesToShow( const RString& sGroup, const RString& sName ) :
+1 -1
View File
@@ -62,7 +62,7 @@ namespace CommonMetrics
extern ThemeMetricDifficultiesToShow DIFFICULTIES_TO_SHOW; extern ThemeMetricDifficultiesToShow DIFFICULTIES_TO_SHOW;
extern ThemeMetricCourseDifficultiesToShow COURSE_DIFFICULTIES_TO_SHOW; extern ThemeMetricCourseDifficultiesToShow COURSE_DIFFICULTIES_TO_SHOW;
extern ThemeMetricStepsTypesToShow STEPS_TYPES_TO_SHOW; extern ThemeMetricStepsTypesToShow STEPS_TYPES_TO_SHOW;
extern ThemeMetric<bool> ALL_STEPS_TYPES_IN_ONE_LIST; extern ThemeMetric<bool> AUTO_SET_STYLE;
RString LocalizeOptionItem( const RString &s, bool bOptional ); RString LocalizeOptionItem( const RString &s, bool bOptional );
}; };
+21 -6
View File
@@ -106,7 +106,7 @@ void ScreenSelectMusic::Init()
m_TexturePreload.Load( Banner::SongBannerTexture(THEME->GetPathG("Banner","mode")) ); m_TexturePreload.Load( Banner::SongBannerTexture(THEME->GetPathG("Banner","mode")) );
} }
if( CommonMetrics::ALL_STEPS_TYPES_IN_ONE_LIST ) if( CommonMetrics::AUTO_SET_STYLE )
{ {
vector<StepsType> vst; vector<StepsType> vst;
GAMEMAN->GetStepsTypesForGame( GAMESTATE->m_pCurGame, vst ); GAMEMAN->GetStepsTypesForGame( GAMESTATE->m_pCurGame, vst );
@@ -810,10 +810,6 @@ void ScreenSelectMusic::MenuStart( const InputEventPlus &input )
return; return;
} }
m_SelectionState = GetNextSelectionState();
m_soundStart.Play();
MESSAGEMAN->Broadcast("SongChosen"); MESSAGEMAN->Broadcast("SongChosen");
break; break;
@@ -821,9 +817,28 @@ void ScreenSelectMusic::MenuStart( const InputEventPlus &input )
case SelectionState_SelectingSteps: case SelectionState_SelectingSteps:
break; break;
} }
m_SelectionState = GetNextSelectionState();
m_soundStart.Play();
if( m_SelectionState == SelectionState_Finalized ) if( m_SelectionState == SelectionState_Finalized )
{ {
if( CommonMetrics::AUTO_SET_STYLE )
{
/* Now that Steps have been chosen, set a Style that can play them. */
StepsType stCurrent;
PlayerNumber pn = GAMESTATE->m_MasterPlayerNumber;
if( GAMESTATE->IsCourseMode() )
stCurrent = GAMESTATE->m_pCurTrail[pn]->m_StepsType;
else
stCurrent = GAMESTATE->m_pCurSteps[pn]->m_StepsType;
vector<StepsType> vst;
const Style *pStyle = GAMEMAN->GetFirstCompatibleStyle( GAMESTATE->m_pCurGame, GAMESTATE->GetNumSidesJoined(), stCurrent );
GAMESTATE->m_pCurStyle.Set( pStyle );
}
/* If we're currently waiting on song assets, abort all except the music and /* If we're currently waiting on song assets, abort all except the music and
* start the music, so if we make a choice quickly before background requests * start the music, so if we make a choice quickly before background requests
* come through, the music will still start. */ * come through, the music will still start. */
+1 -1
View File
@@ -815,7 +815,7 @@ void SongUtil::FilterSongs( const SongCriteria &sc, const vector<Song*> &in, vec
static void GetPlayableStepsTypes( set<StepsType> &vOut ) static void GetPlayableStepsTypes( set<StepsType> &vOut )
{ {
vector<const Style*> vpPossibleStyles; vector<const Style*> vpPossibleStyles;
if( CommonMetrics::ALL_STEPS_TYPES_IN_ONE_LIST ) if( CommonMetrics::AUTO_SET_STYLE )
GAMEMAN->GetCompatibleStyles( GAMESTATE->m_pCurGame, GAMESTATE->GetNumPlayersEnabled(), vpPossibleStyles ); GAMEMAN->GetCompatibleStyles( GAMESTATE->m_pCurGame, GAMESTATE->GetNumPlayersEnabled(), vpPossibleStyles );
else else
vpPossibleStyles.push_back( GAMESTATE->m_pCurStyle ); vpPossibleStyles.push_back( GAMESTATE->m_pCurStyle );