don't set up actors that we're not using; we create lots of OptionRows
This commit is contained in:
@@ -134,8 +134,10 @@ void OptionRowType::Load( const CString &sType )
|
|||||||
THEME_TITLES .Load(sType,"ThemeTitles");
|
THEME_TITLES .Load(sType,"ThemeTitles");
|
||||||
SHOW_BPM_IN_SPEED_TITLE .Load(sType,"ShowBpmInSpeedTitle");
|
SHOW_BPM_IN_SPEED_TITLE .Load(sType,"ShowBpmInSpeedTitle");
|
||||||
SHOW_OPTION_ICONS .Load(sType,"ShowOptionIcons");
|
SHOW_OPTION_ICONS .Load(sType,"ShowOptionIcons");
|
||||||
|
SHOW_UNDERLINES .Load(sType,"ShowUnderlines");
|
||||||
|
|
||||||
m_textItemParent.LoadFromFont( THEME->GetPathF(sType,"item") );
|
m_textItemParent.LoadFromFont( THEME->GetPathF(sType,"item") );
|
||||||
|
if( SHOW_UNDERLINES )
|
||||||
m_UnderlineParent.Load( sType, OptionsCursor::underline );
|
m_UnderlineParent.Load( sType, OptionsCursor::underline );
|
||||||
m_textTitle.LoadFromFont( THEME->GetPathF(sType,"title") );
|
m_textTitle.LoadFromFont( THEME->GetPathF(sType,"title") );
|
||||||
//m_sprBullet.Load( THEME->GetPathG(sType,"bullet") );
|
//m_sprBullet.Load( THEME->GetPathG(sType,"bullet") );
|
||||||
@@ -317,6 +319,8 @@ void OptionRow::InitText()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// init underlines
|
// init underlines
|
||||||
|
if( m_pParentType->SHOW_UNDERLINES )
|
||||||
|
{
|
||||||
FOREACH_HumanPlayer( p )
|
FOREACH_HumanPlayer( p )
|
||||||
{
|
{
|
||||||
OptionsCursor *ul = new OptionsCursor( m_pParentType->m_UnderlineParent );
|
OptionsCursor *ul = new OptionsCursor( m_pParentType->m_UnderlineParent );
|
||||||
@@ -330,6 +334,7 @@ void OptionRow::InitText()
|
|||||||
if( GetRowType() == OptionRow::ROW_EXIT )
|
if( GetRowType() == OptionRow::ROW_EXIT )
|
||||||
ul->SetHidden( true );
|
ul->SetHidden( true );
|
||||||
}
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LAYOUT_SHOW_ALL_IN_ROW:
|
case LAYOUT_SHOW_ALL_IN_ROW:
|
||||||
@@ -352,6 +357,8 @@ void OptionRow::InitText()
|
|||||||
bt->SetX( fX );
|
bt->SetX( fX );
|
||||||
|
|
||||||
// init underlines
|
// init underlines
|
||||||
|
if( m_pParentType->SHOW_UNDERLINES )
|
||||||
|
{
|
||||||
FOREACH_HumanPlayer( p )
|
FOREACH_HumanPlayer( p )
|
||||||
{
|
{
|
||||||
OptionsCursor *ul = new OptionsCursor( m_pParentType->m_UnderlineParent );
|
OptionsCursor *ul = new OptionsCursor( m_pParentType->m_UnderlineParent );
|
||||||
@@ -360,6 +367,7 @@ void OptionRow::InitText()
|
|||||||
ul->SetX( fX );
|
ul->SetX( fX );
|
||||||
ul->SetWidth( truncf(fItemWidth) );
|
ul->SetWidth( truncf(fItemWidth) );
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fX += fItemWidth/2 + m_pParentType->ITEMS_GAP_X;
|
fX += fItemWidth/2 + m_pParentType->ITEMS_GAP_X;
|
||||||
}
|
}
|
||||||
@@ -470,6 +478,8 @@ void OptionRow::PositionUnderlines( PlayerNumber pn )
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
vector<OptionsCursor*> &vpUnderlines = m_Underline[pn];
|
vector<OptionsCursor*> &vpUnderlines = m_Underline[pn];
|
||||||
|
if( vpUnderlines.empty() )
|
||||||
|
return;
|
||||||
|
|
||||||
PlayerNumber pnTakeSelectedFrom = m_RowDef.m_bOneChoiceForAllPlayers ? PLAYER_1 : pn;
|
PlayerNumber pnTakeSelectedFrom = m_RowDef.m_bOneChoiceForAllPlayers ? PLAYER_1 : pn;
|
||||||
|
|
||||||
@@ -619,6 +629,16 @@ void OptionRow::UpdateEnabledDisabled()
|
|||||||
m_textItems[j]->BeginTweening( m_pParentType->TWEEN_SECONDS );
|
m_textItems[j]->BeginTweening( m_pParentType->TWEEN_SECONDS );
|
||||||
m_textItems[j]->SetDiffuse( color );
|
m_textItems[j]->SetDiffuse( color );
|
||||||
}
|
}
|
||||||
|
for( unsigned j=0; j<m_Underline[0].size(); j++ )
|
||||||
|
{
|
||||||
|
OptionsCursor *pUnderline = m_Underline[0][j];
|
||||||
|
if( pUnderline->DestTweenState().diffuse[0].a != color.a )
|
||||||
|
continue;
|
||||||
|
pUnderline->StopTweening();
|
||||||
|
pUnderline->BeginTweening( m_pParentType->TWEEN_SECONDS );
|
||||||
|
pUnderline->SetDiffuseAlpha( color.a );
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case LAYOUT_SHOW_ONE_IN_ROW:
|
case LAYOUT_SHOW_ONE_IN_ROW:
|
||||||
FOREACH_HumanPlayer( pn )
|
FOREACH_HumanPlayer( pn )
|
||||||
@@ -644,11 +664,14 @@ void OptionRow::UpdateEnabledDisabled()
|
|||||||
bt.StopTweening();
|
bt.StopTweening();
|
||||||
bt.BeginTweening( m_pParentType->TWEEN_SECONDS );
|
bt.BeginTweening( m_pParentType->TWEEN_SECONDS );
|
||||||
bt.SetDiffuse( color );
|
bt.SetDiffuse( color );
|
||||||
|
}
|
||||||
|
|
||||||
OptionsCursor &ul = *m_Underline[pn][0];
|
OptionsCursor *pUnderline = m_Underline[pn].size()? m_Underline[pn][0]:NULL;
|
||||||
ul.StopTweening();
|
if( pUnderline != NULL && pUnderline->DestTweenState().diffuse[0].a != color.a )
|
||||||
ul.BeginTweening( m_pParentType->TWEEN_SECONDS );
|
{
|
||||||
ul.SetDiffuseAlpha( color.a );
|
pUnderline->StopTweening();
|
||||||
|
pUnderline->BeginTweening( m_pParentType->TWEEN_SECONDS );
|
||||||
|
pUnderline->SetDiffuseAlpha( color.a );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -123,6 +123,7 @@ private:
|
|||||||
ThemeMetric<bool> THEME_TITLES;
|
ThemeMetric<bool> THEME_TITLES;
|
||||||
ThemeMetric<bool> SHOW_BPM_IN_SPEED_TITLE;
|
ThemeMetric<bool> SHOW_BPM_IN_SPEED_TITLE;
|
||||||
ThemeMetric<bool> SHOW_OPTION_ICONS;
|
ThemeMetric<bool> SHOW_OPTION_ICONS;
|
||||||
|
ThemeMetric<bool> SHOW_UNDERLINES;
|
||||||
|
|
||||||
friend class OptionRow;
|
friend class OptionRow;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user