fix CODE_CANCEL_ALL_PLAYER_OPTIONS resets both players

This commit is contained in:
Glenn Maynard
2004-04-02 00:58:26 +00:00
parent 47e7f08614
commit 56bd5bd008
3 changed files with 20 additions and 1 deletions
+18
View File
@@ -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++ )
+1
View File
@@ -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();
+1 -1
View File
@@ -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();
}