fix CODE_CANCEL_ALL_PLAYER_OPTIONS resets both players
This commit is contained in:
@@ -438,6 +438,24 @@ void ScreenOptionsMaster::ImportOptions()
|
||||
}
|
||||
}
|
||||
|
||||
/* Import only settings specific to the given player. */
|
||||
void ScreenOptionsMaster::ImportOptionsForPlayer( PlayerNumber pn )
|
||||
{
|
||||
if( !GAMESTATE->IsHumanPlayer(pn) )
|
||||
return;
|
||||
|
||||
for( unsigned i = 0; i < OptionRowHandlers.size(); ++i )
|
||||
{
|
||||
const OptionRowHandler &hand = OptionRowHandlers[i];
|
||||
const OptionRowData &data = m_OptionRowAlloc[i];
|
||||
Row &row = *m_Rows[i];
|
||||
|
||||
if( data.bOneChoiceForAllPlayers )
|
||||
continue;
|
||||
ImportOption( data, hand, pn, i, row.m_vbSelected[pn] );
|
||||
}
|
||||
}
|
||||
|
||||
int GetOneSelection( const vector<bool> &vbSelected )
|
||||
{
|
||||
for( unsigned i=0; i<vbSelected.size(); i++ )
|
||||
|
||||
@@ -54,6 +54,7 @@ private:
|
||||
protected:
|
||||
virtual void ImportOptions();
|
||||
virtual void ExportOptions();
|
||||
virtual void ImportOptionsForPlayer( PlayerNumber pn ); // used by ScreenPlayerOptions
|
||||
|
||||
virtual void GoToNextState();
|
||||
virtual void GoToPrevState();
|
||||
|
||||
@@ -130,7 +130,7 @@ void ScreenPlayerOptions::Input( const DeviceInput& DeviceI, const InputEventTyp
|
||||
|
||||
UtilCommand( m_sprCancelAll[pn], m_sName, "Show" );
|
||||
|
||||
this->ImportOptions();
|
||||
this->ImportOptionsForPlayer( pn );
|
||||
this->PositionUnderlines();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user