support bOneChoiceForAllPlayers

This commit is contained in:
Glenn Maynard
2007-03-19 00:03:20 +00:00
parent 5b56042069
commit 48d631d6ca
3 changed files with 24 additions and 5 deletions
+17 -5
View File
@@ -168,6 +168,7 @@ void OptionListRow::PositionCursor( Actor *pCursor, int iSelection )
OptionsList::OptionsList()
{
m_iCurrentRow = 0;
m_pLinked = NULL;
}
OptionsList::~OptionsList()
@@ -595,13 +596,24 @@ void OptionsList::SelectItem( const RString &sRowName, int iMenuItem )
bSelections[iMenuItem] = true;
}
if( pHandler->m_Def.m_bOneChoiceForAllPlayers && m_pLinked != NULL )
{
vector<bool> &bLinkedSelections = m_pLinked->m_bSelections[sRowName];
bLinkedSelections = bSelections;
if( m_pLinked->IsOpened() )
m_pLinked->UpdateMenuFromSelections();
}
ExportRow( sRowName );
{
const vector<bool> &bCurrentSelections = m_bSelections.find(GetCurrentRow())->second;
m_Row[m_iCurrentRow].SetUnderlines( bCurrentSelections, GetCurrentHandler() );
m_Row[m_iCurrentRow].SetTextFromHandler( GetCurrentHandler() );
}
UpdateMenuFromSelections();
}
void OptionsList::UpdateMenuFromSelections()
{
const vector<bool> &bCurrentSelections = m_bSelections.find(GetCurrentRow())->second;
m_Row[m_iCurrentRow].SetUnderlines( bCurrentSelections, GetCurrentHandler() );
m_Row[m_iCurrentRow].SetTextFromHandler( GetCurrentHandler() );
}
bool OptionsList::Start()
+5
View File
@@ -45,6 +45,8 @@ public:
void Load( RString sType, PlayerNumber pn );
void Link( OptionsList *pLink ) { m_pLinked = pLink; }
/* Show the top-level menu. */
void Open();
@@ -61,6 +63,7 @@ private:
void MoveItem( const RString &sRowName, int iMove );
void SwitchMenu( int iDir );
void PositionCursor();
void UpdateMenuFromSelections();
RString GetCurrentRow() const;
const OptionRowHandler *GetCurrentHandler();
int GetOneSelection( RString sRow, bool bAllowFail=false ) const;
@@ -75,6 +78,8 @@ private:
InputQueueCodeSet m_Codes;
OptionsList *m_pLinked;
bool m_bStartIsDown;
bool m_bAcceptStartRelease;
+2
View File
@@ -140,6 +140,8 @@ void ScreenSelectMusic::Init()
ActorUtil::LoadAllCommands( m_OptionsList[p], m_sName );
this->AddChild( &m_OptionsList[p] );
}
m_OptionsList[PLAYER_1].Link( &m_OptionsList[PLAYER_2] );
m_OptionsList[PLAYER_2].Link( &m_OptionsList[PLAYER_1] );
}
// this is loaded SetSong and TweenToSong