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.
This commit is contained in:
Glenn Maynard
2006-02-27 06:02:54 +00:00
parent bbf668ab97
commit e54eca031c
+14
View File
@@ -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 );