rename: AllStepsTypeInOneList -> AutoSetStyle
set m_pCurStyle based on the chosen Steps
This commit is contained in:
@@ -23,7 +23,7 @@ ThemeMetric<RString> CommonMetrics::DEFAULT_NOTESKIN_NAME ("Common","DefaultN
|
||||
ThemeMetricDifficultiesToShow CommonMetrics::DIFFICULTIES_TO_SHOW ("Common","DifficultiesToShow");
|
||||
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
|
||||
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 ) :
|
||||
|
||||
@@ -62,7 +62,7 @@ namespace CommonMetrics
|
||||
extern ThemeMetricDifficultiesToShow DIFFICULTIES_TO_SHOW;
|
||||
extern ThemeMetricCourseDifficultiesToShow COURSE_DIFFICULTIES_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 );
|
||||
};
|
||||
|
||||
@@ -106,7 +106,7 @@ void ScreenSelectMusic::Init()
|
||||
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;
|
||||
GAMEMAN->GetStepsTypesForGame( GAMESTATE->m_pCurGame, vst );
|
||||
@@ -810,10 +810,6 @@ void ScreenSelectMusic::MenuStart( const InputEventPlus &input )
|
||||
return;
|
||||
}
|
||||
|
||||
m_SelectionState = GetNextSelectionState();
|
||||
|
||||
m_soundStart.Play();
|
||||
|
||||
MESSAGEMAN->Broadcast("SongChosen");
|
||||
|
||||
break;
|
||||
@@ -821,9 +817,28 @@ void ScreenSelectMusic::MenuStart( const InputEventPlus &input )
|
||||
case SelectionState_SelectingSteps:
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
m_SelectionState = GetNextSelectionState();
|
||||
m_soundStart.Play();
|
||||
|
||||
|
||||
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
|
||||
* start the music, so if we make a choice quickly before background requests
|
||||
* come through, the music will still start. */
|
||||
|
||||
@@ -815,7 +815,7 @@ void SongUtil::FilterSongs( const SongCriteria &sc, const vector<Song*> &in, vec
|
||||
static void GetPlayableStepsTypes( set<StepsType> &vOut )
|
||||
{
|
||||
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 );
|
||||
else
|
||||
vpPossibleStyles.push_back( GAMESTATE->m_pCurStyle );
|
||||
|
||||
Reference in New Issue
Block a user