Have OptionRows subscribe to a Message in order to refresh
This commit is contained in:
@@ -105,9 +105,7 @@ void ScreenOptionsMaster::Init()
|
||||
|
||||
ASSERT( OptionRowHandlers.size() == asLineNames.size() );
|
||||
|
||||
vector<OptionRowHandler*> vHands( m_OptionRowAlloc.size(), NULL );
|
||||
|
||||
InitMenu( im, m_OptionRowAlloc, vHands, bShowUnderlines );
|
||||
InitMenu( im, m_OptionRowAlloc, OptionRowHandlers, bShowUnderlines );
|
||||
}
|
||||
|
||||
ScreenOptionsMaster::~ScreenOptionsMaster()
|
||||
@@ -283,35 +281,6 @@ void ScreenOptionsMaster::RefreshIcons()
|
||||
}
|
||||
}
|
||||
|
||||
void ScreenOptionsMaster::ChangeValueInRow( PlayerNumber pn, int iDelta, bool Repeat )
|
||||
{
|
||||
ScreenOptions::ChangeValueInRow( pn, iDelta, Repeat );
|
||||
|
||||
int iRow = m_iCurrentRow[pn];
|
||||
|
||||
const OptionRowHandler *pHand = OptionRowHandlers[iRow];
|
||||
|
||||
FOREACH_CONST( CString, pHand->m_vsRefreshRowNames, sRowToRefreshName )
|
||||
{
|
||||
for( unsigned r=0; r<m_Rows.size(); r++ )
|
||||
{
|
||||
OptionRow &rowOther = *m_Rows[r];
|
||||
|
||||
if( rowOther.GetRowType() == OptionRow::ROW_EXIT )
|
||||
continue;
|
||||
|
||||
OptionRowHandler *pHandOther = OptionRowHandlers[r];
|
||||
OptionRowDefinition &defOther = m_OptionRowAlloc[r];
|
||||
|
||||
if( *sRowToRefreshName == pHandOther->m_sName )
|
||||
{
|
||||
pHandOther->Reload( defOther );
|
||||
ScreenOptions::RefreshRowChoices( r, defOther );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ScreenOptionsMaster::HandleScreenMessage( const ScreenMessage SM )
|
||||
{
|
||||
switch( SM )
|
||||
|
||||
Reference in New Issue
Block a user