From e54eca031c813721a98f4075377b9e745b49880c Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Mon, 27 Feb 2006 06:02:54 +0000 Subject: [PATCH] ugly: apply just the alpha to m_Underline. This is what used to be done in UpdateEnabledDisabled, but we don't want to update this tweening in two places; they collide and cancel each other. --- stepmania/src/OptionRow.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/stepmania/src/OptionRow.cpp b/stepmania/src/OptionRow.cpp index 96928b1d8c..6e7b9f31b0 100644 --- a/stepmania/src/OptionRow.cpp +++ b/stepmania/src/OptionRow.cpp @@ -503,6 +503,19 @@ void OptionRow::PositionUnderlines( PlayerNumber pn ) int iChoiceWithFocus = (m_pHand->m_Def.m_layoutType == LAYOUT_SHOW_ONE_IN_ROW) ? GetChoiceInRowWithFocus(pn) : i; + float fAlpha = 1.0f; + if( m_pHand->m_Def.m_layoutType == LAYOUT_SHOW_ONE_IN_ROW ) + { + bool bRowEnabled = m_pHand->m_Def.m_vEnabledForPlayers.find(pn) != m_pHand->m_Def.m_vEnabledForPlayers.end(); + + if( !m_pHand->m_Def.m_bOneChoiceForAllPlayers ) + { + if( m_bRowHasFocus[pn] ) fAlpha = m_pParentType->COLOR_SELECTED.GetValue().a; + else if( bRowEnabled ) fAlpha = m_pParentType->COLOR_NOT_SELECTED.GetValue().a; + else fAlpha = m_pParentType->COLOR_DISABLED.GetValue().a; + } + } + /* Don't tween X movement and color changes. */ int iWidth, iX, iY; GetWidthXY( pn, iChoiceWithFocus, iWidth, iX, iY ); @@ -515,6 +528,7 @@ void OptionRow::PositionUnderlines( PlayerNumber pn ) bool bHidden = !bSelected || !GAMESTATE->IsHumanPlayer(pn); ul.StopTweening(); + ul.SetDiffuseAlpha( fAlpha ); ul.BeginTweening( m_pParentType->TWEEN_SECONDS ); ul.SetHidden( bHidden ); ul.SetBarWidth( iWidth );