This commit is contained in:
Glenn Maynard
2006-11-21 03:48:12 +00:00
parent 8ab6be7bde
commit ffc66719f7
+13 -13
View File
@@ -1027,13 +1027,13 @@ public:
class OptionRowHandlerConfig : public OptionRowHandler class OptionRowHandlerConfig : public OptionRowHandler
{ {
public: public:
const ConfOption *opt; const ConfOption *m_pOpt;
OptionRowHandlerConfig() { Init(); } OptionRowHandlerConfig() { Init(); }
void Init() void Init()
{ {
OptionRowHandler::Init(); OptionRowHandler::Init();
opt = NULL; m_pOpt = NULL;
} }
virtual void LoadInternal( const Commands &cmds ) virtual void LoadInternal( const Commands &cmds )
{ {
@@ -1058,12 +1058,12 @@ public:
pConfOption->UpdateAvailableOptions(); pConfOption->UpdateAvailableOptions();
opt = pConfOption; m_pOpt = pConfOption;
opt->MakeOptionsList( m_Def.m_vsChoices ); m_pOpt->MakeOptionsList( m_Def.m_vsChoices );
m_Def.m_bAllowThemeItems = opt->m_bAllowThemeItems; m_Def.m_bAllowThemeItems = m_pOpt->m_bAllowThemeItems;
m_Def.m_sName = opt->name; m_Def.m_sName = m_pOpt->name;
} }
virtual void ImportOption( const vector<PlayerNumber> &vpns, vector<bool> vbSelectedOut[NUM_PLAYERS] ) const virtual void ImportOption( const vector<PlayerNumber> &vpns, vector<bool> vbSelectedOut[NUM_PLAYERS] ) const
{ {
@@ -1072,7 +1072,7 @@ public:
PlayerNumber p = *pn; PlayerNumber p = *pn;
vector<bool> &vbSelOut = vbSelectedOut[p]; vector<bool> &vbSelOut = vbSelectedOut[p];
int iSelection = opt->Get(); int iSelection = m_pOpt->Get();
OptionRowHandlerUtil::SelectExactlyOne( iSelection, vbSelOut ); OptionRowHandlerUtil::SelectExactlyOne( iSelection, vbSelOut );
} }
} }
@@ -1085,23 +1085,23 @@ public:
PlayerNumber p = *pn; PlayerNumber p = *pn;
const vector<bool> &vbSel = vbSelected[p]; const vector<bool> &vbSel = vbSelected[p];
int sel = OptionRowHandlerUtil::GetOneSelection(vbSel); int iSel = OptionRowHandlerUtil::GetOneSelection(vbSel);
/* Get the original choice. */ /* Get the original choice. */
int Original = opt->Get(); int iOriginal = m_pOpt->Get();
/* Apply. */ /* Apply. */
opt->Put( sel ); m_pOpt->Put( iSel );
/* Get the new choice. */ /* Get the new choice. */
int New = opt->Get(); int iNew = m_pOpt->Get();
/* If it didn't change, don't return any side-effects. */ /* If it didn't change, don't return any side-effects. */
if( Original != New ) if( iOriginal != iNew )
bChanged = true; bChanged = true;
} }
return bChanged ? opt->GetEffects() : 0; return bChanged ? m_pOpt->GetEffects() : 0;
} }
}; };