move bExportOnChange into OptionRowDef from OptionRowHandler
This commit is contained in:
@@ -40,6 +40,7 @@ struct OptionRowDefinition
|
|||||||
LayoutType layoutType;
|
LayoutType layoutType;
|
||||||
vector<CString> choices;
|
vector<CString> choices;
|
||||||
set<PlayerNumber> m_vEnabledForPlayers; // only players in this set may change focus to this row
|
set<PlayerNumber> m_vEnabledForPlayers; // only players in this set may change focus to this row
|
||||||
|
bool m_bExportOnChange;
|
||||||
|
|
||||||
void UpdateEnabledForPlayers(
|
void UpdateEnabledForPlayers(
|
||||||
set<PlayerNumber> vEnabledForPlayers,
|
set<PlayerNumber> vEnabledForPlayers,
|
||||||
@@ -63,6 +64,7 @@ struct OptionRowDefinition
|
|||||||
m_vEnabledForPlayers.clear();
|
m_vEnabledForPlayers.clear();
|
||||||
FOREACH_PlayerNumber( pn )
|
FOREACH_PlayerNumber( pn )
|
||||||
m_vEnabledForPlayers.insert( pn );
|
m_vEnabledForPlayers.insert( pn );
|
||||||
|
m_bExportOnChange = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
OptionRowDefinition( const char *n, bool b, const char *c0=NULL, const char *c1=NULL, const char *c2=NULL, const char *c3=NULL, const char *c4=NULL, const char *c5=NULL, const char *c6=NULL, const char *c7=NULL, const char *c8=NULL, const char *c9=NULL, const char *c10=NULL, const char *c11=NULL, const char *c12=NULL, const char *c13=NULL, const char *c14=NULL, const char *c15=NULL, const char *c16=NULL, const char *c17=NULL, const char *c18=NULL, const char *c19=NULL ) :
|
OptionRowDefinition( const char *n, bool b, const char *c0=NULL, const char *c1=NULL, const char *c2=NULL, const char *c3=NULL, const char *c4=NULL, const char *c5=NULL, const char *c6=NULL, const char *c7=NULL, const char *c8=NULL, const char *c9=NULL, const char *c10=NULL, const char *c11=NULL, const char *c12=NULL, const char *c13=NULL, const char *c14=NULL, const char *c15=NULL, const char *c16=NULL, const char *c17=NULL, const char *c18=NULL, const char *c19=NULL ) :
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ class OptionRowHandler
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CString m_sName;
|
CString m_sName;
|
||||||
bool m_bExportOnChange;
|
|
||||||
vector<CString> m_vsRefreshRowNames; // refresh these rows when the value of this row changes
|
vector<CString> m_vsRefreshRowNames; // refresh these rows when the value of this row changes
|
||||||
|
|
||||||
OptionRowHandler::OptionRowHandler() { Init(); }
|
OptionRowHandler::OptionRowHandler() { Init(); }
|
||||||
@@ -21,7 +20,6 @@ public:
|
|||||||
{
|
{
|
||||||
m_sName = "";
|
m_sName = "";
|
||||||
m_vsRefreshRowNames.clear();
|
m_vsRefreshRowNames.clear();
|
||||||
m_bExportOnChange = false;
|
|
||||||
}
|
}
|
||||||
virtual void ImportOption( const OptionRowDefinition &row, PlayerNumber pn, vector<bool> &vbSelectedOut ) const = 0;
|
virtual void ImportOption( const OptionRowDefinition &row, PlayerNumber pn, vector<bool> &vbSelectedOut ) const = 0;
|
||||||
/* Returns an OPT mask. */
|
/* Returns an OPT mask. */
|
||||||
|
|||||||
@@ -1023,6 +1023,9 @@ void ScreenOptions::ChangeValueInRow( PlayerNumber pn, int iDelta, bool Repeat )
|
|||||||
|
|
||||||
if( m_OptionsNavigation != NAV_THREE_KEY_MENU )
|
if( m_OptionsNavigation != NAV_THREE_KEY_MENU )
|
||||||
m_SoundChangeCol.Play();
|
m_SoundChangeCol.Play();
|
||||||
|
|
||||||
|
if( row.GetRowDef().m_bExportOnChange )
|
||||||
|
ExportOptions( iCurRow );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -289,9 +289,6 @@ void ScreenOptionsMaster::ChangeValueInRow( PlayerNumber pn, int iDelta, bool Re
|
|||||||
|
|
||||||
const OptionRowHandler *pHand = OptionRowHandlers[iRow];
|
const OptionRowHandler *pHand = OptionRowHandlers[iRow];
|
||||||
|
|
||||||
if( pHand->m_bExportOnChange || !pHand->m_vsRefreshRowNames.empty() )
|
|
||||||
ExportOptions( iRow );
|
|
||||||
|
|
||||||
FOREACH_CONST( CString, pHand->m_vsRefreshRowNames, sRowToRefreshName )
|
FOREACH_CONST( CString, pHand->m_vsRefreshRowNames, sRowToRefreshName )
|
||||||
{
|
{
|
||||||
for( unsigned r=0; r<m_Rows.size(); r++ )
|
for( unsigned r=0; r<m_Rows.size(); r++ )
|
||||||
|
|||||||
Reference in New Issue
Block a user