refresh icons per-row, per-player
This commit is contained in:
@@ -267,13 +267,12 @@ void ScreenOptions::InitMenu( InputMode im, const vector<OptionRowDefinition> &v
|
|||||||
PositionItems();
|
PositionItems();
|
||||||
PositionAllUnderlines();
|
PositionAllUnderlines();
|
||||||
PositionIcons();
|
PositionIcons();
|
||||||
RefreshIcons();
|
RefreshAllIcons();
|
||||||
PositionCursors();
|
PositionCursors();
|
||||||
UpdateEnabledDisabled();
|
UpdateEnabledDisabled();
|
||||||
{
|
|
||||||
FOREACH_PlayerNumber( p )
|
FOREACH_PlayerNumber( p )
|
||||||
OnChange( p );
|
OnChange( p );
|
||||||
}
|
|
||||||
|
|
||||||
CHECKPOINT;
|
CHECKPOINT;
|
||||||
|
|
||||||
@@ -391,11 +390,17 @@ void ScreenOptions::PositionIcons()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScreenOptions::RefreshIcons()
|
void ScreenOptions::RefreshIcons( int row, PlayerNumber pn )
|
||||||
{
|
{
|
||||||
// handled by ScreenOptionsMaster
|
// overridden by ScreenOptionsMaster
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ScreenOptions::RefreshAllIcons()
|
||||||
|
{
|
||||||
|
FOREACH_HumanPlayer( p )
|
||||||
|
for( unsigned r=0; r<m_Rows.size(); ++r )
|
||||||
|
this->RefreshIcons( r, p );
|
||||||
|
}
|
||||||
|
|
||||||
void ScreenOptions::PositionCursors()
|
void ScreenOptions::PositionCursors()
|
||||||
{
|
{
|
||||||
@@ -667,7 +672,7 @@ void ScreenOptions::OnChange( PlayerNumber pn )
|
|||||||
|
|
||||||
/* Do positioning. */
|
/* Do positioning. */
|
||||||
PositionUnderlines( iCurRow, pn );
|
PositionUnderlines( iCurRow, pn );
|
||||||
RefreshIcons();
|
RefreshIcons( iCurRow, pn );
|
||||||
PositionIcons();
|
PositionIcons();
|
||||||
UpdateEnabledDisabled();
|
UpdateEnabledDisabled();
|
||||||
|
|
||||||
@@ -827,7 +832,7 @@ void ScreenOptions::MenuStart( PlayerNumber pn, const InputEventType selectType
|
|||||||
m_SoundToggleOff.Play();
|
m_SoundToggleOff.Play();
|
||||||
|
|
||||||
PositionUnderlines( iCurRow, pn );
|
PositionUnderlines( iCurRow, pn );
|
||||||
RefreshIcons();
|
RefreshIcons( iCurRow, pn );
|
||||||
|
|
||||||
if( row.GetFirstItemGoesDown() )
|
if( row.GetFirstItemGoesDown() )
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -43,7 +43,8 @@ protected:
|
|||||||
void PositionUnderlines( int row, PlayerNumber pn );
|
void PositionUnderlines( int row, PlayerNumber pn );
|
||||||
void PositionAllUnderlines();
|
void PositionAllUnderlines();
|
||||||
void PositionIcons();
|
void PositionIcons();
|
||||||
virtual void RefreshIcons();
|
virtual void RefreshIcons( int row, PlayerNumber pn );
|
||||||
|
void RefreshAllIcons();
|
||||||
void PositionCursors();
|
void PositionCursors();
|
||||||
void PositionItems();
|
void PositionItems();
|
||||||
void TweenCursor( PlayerNumber pn );
|
void TweenCursor( PlayerNumber pn );
|
||||||
|
|||||||
@@ -185,42 +185,36 @@ void ScreenOptionsMaster::GoToPrevScreen()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScreenOptionsMaster::RefreshIcons()
|
void ScreenOptionsMaster::RefreshIcons( int r, PlayerNumber pn )
|
||||||
{
|
{
|
||||||
FOREACH_HumanPlayer( p )
|
if( m_Rows[r]->GetRowType() == OptionRow::ROW_EXIT )
|
||||||
|
return; // skip
|
||||||
|
|
||||||
|
OptionRow &row = *m_Rows[r];
|
||||||
|
const OptionRowDefinition &def = row.GetRowDef();
|
||||||
|
|
||||||
|
// find first selection and whether multiple are selected
|
||||||
|
int iFirstSelection = row.GetOneSelection( pn, true );
|
||||||
|
|
||||||
|
// set icon name
|
||||||
|
CString sIcon;
|
||||||
|
|
||||||
|
if( iFirstSelection == -1 )
|
||||||
{
|
{
|
||||||
for( unsigned i=0; i<m_Rows.size(); ++i ) // foreach options line
|
sIcon = "Multi";
|
||||||
{
|
|
||||||
if( m_Rows[i]->GetRowType() == OptionRow::ROW_EXIT )
|
|
||||||
continue; // skip
|
|
||||||
|
|
||||||
OptionRow &row = *m_Rows[i];
|
|
||||||
const OptionRowDefinition &def = row.GetRowDef();
|
|
||||||
|
|
||||||
// find first selection and whether multiple are selected
|
|
||||||
int iFirstSelection = row.GetOneSelection( p, true );
|
|
||||||
|
|
||||||
// set icon name
|
|
||||||
CString sIcon;
|
|
||||||
|
|
||||||
if( iFirstSelection == -1 )
|
|
||||||
{
|
|
||||||
sIcon = "Multi";
|
|
||||||
}
|
|
||||||
else if( iFirstSelection != -1 )
|
|
||||||
{
|
|
||||||
const OptionRowHandler *pHand = OptionRowHandlers[i];
|
|
||||||
sIcon = pHand->GetIconText( def, iFirstSelection+(m_OptionsNavigation==NAV_TOGGLE_THREE_KEY?-1:0) );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* XXX: hack to not display text in the song options menu */
|
|
||||||
if( def.bOneChoiceForAllPlayers )
|
|
||||||
sIcon = "";
|
|
||||||
|
|
||||||
LoadOptionIcon( p, i, sIcon );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
else if( iFirstSelection != -1 )
|
||||||
|
{
|
||||||
|
const OptionRowHandler *pHand = OptionRowHandlers[r];
|
||||||
|
sIcon = pHand->GetIconText( def, iFirstSelection+(m_OptionsNavigation==NAV_TOGGLE_THREE_KEY?-1:0) );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* XXX: hack to not display text in the song options menu */
|
||||||
|
if( def.bOneChoiceForAllPlayers )
|
||||||
|
sIcon = "";
|
||||||
|
|
||||||
|
LoadOptionIcon( pn, r, sIcon );
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScreenOptionsMaster::HandleScreenMessage( const ScreenMessage SM )
|
void ScreenOptionsMaster::HandleScreenMessage( const ScreenMessage SM )
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ protected:
|
|||||||
virtual void GoToNextScreen();
|
virtual void GoToNextScreen();
|
||||||
virtual void GoToPrevScreen();
|
virtual void GoToPrevScreen();
|
||||||
|
|
||||||
virtual void RefreshIcons();
|
virtual void RefreshIcons( int row, PlayerNumber pn );
|
||||||
|
|
||||||
ThemeMetric<bool> PLAY_MUSIC;
|
ThemeMetric<bool> PLAY_MUSIC;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user