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 )
|
int GetOneSelection( const vector<bool> &vbSelected )
|
||||||
{
|
{
|
||||||
for( unsigned i=0; i<vbSelected.size(); i++ )
|
for( unsigned i=0; i<vbSelected.size(); i++ )
|
||||||
|
|||||||
@@ -54,6 +54,7 @@ private:
|
|||||||
protected:
|
protected:
|
||||||
virtual void ImportOptions();
|
virtual void ImportOptions();
|
||||||
virtual void ExportOptions();
|
virtual void ExportOptions();
|
||||||
|
virtual void ImportOptionsForPlayer( PlayerNumber pn ); // used by ScreenPlayerOptions
|
||||||
|
|
||||||
virtual void GoToNextState();
|
virtual void GoToNextState();
|
||||||
virtual void GoToPrevState();
|
virtual void GoToPrevState();
|
||||||
|
|||||||
@@ -130,7 +130,7 @@ void ScreenPlayerOptions::Input( const DeviceInput& DeviceI, const InputEventTyp
|
|||||||
|
|
||||||
UtilCommand( m_sprCancelAll[pn], m_sName, "Show" );
|
UtilCommand( m_sprCancelAll[pn], m_sName, "Show" );
|
||||||
|
|
||||||
this->ImportOptions();
|
this->ImportOptionsForPlayer( pn );
|
||||||
this->PositionUnderlines();
|
this->PositionUnderlines();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user