From e85313f96aa8e2c05f4951afde49dc00dfc9f304 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Fri, 22 Jul 2005 20:24:38 +0000 Subject: [PATCH] hide/show player-specific elements --- stepmania/src/OptionRow.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/stepmania/src/OptionRow.cpp b/stepmania/src/OptionRow.cpp index 3cfd8a3544..0f4154d4da 100644 --- a/stepmania/src/OptionRow.cpp +++ b/stepmania/src/OptionRow.cpp @@ -404,6 +404,22 @@ void OptionRow::InitText() /* After importing options, choose which item is focused. */ void OptionRow::AfterImportOptions() { + /* We load items for both players on start, since we don't know at that point + * which players will be joined when we're displayed. Hide items for inactive + * players. */ + FOREACH_PlayerNumber( p ) + { + if( m_RowDef.m_layoutType == LAYOUT_SHOW_ONE_IN_ROW && + !m_RowDef.m_bOneChoiceForAllPlayers ) + m_textItems[p]->SetHidden( !GAMESTATE->IsHumanPlayer(p) ); + + if( m_RowType != OptionRow::ROW_EXIT ) + { + for( unsigned c=0; cSetHidden( !GAMESTATE->IsHumanPlayer(p) ); + } + } + // Make all selections the same if bOneChoiceForAllPlayers // Hack: we only import active players, so if only player 2 is imported, // we need to copy p2 to p1, not p1 to p2.