Add dimming support.
This commit is contained in:
@@ -79,6 +79,7 @@ ScreenOptions::ScreenOptions( CString sBackgroundPath, CString sPagePath, CStrin
|
|||||||
m_framePage.SetX( SCREEN_LEFT-SCREEN_WIDTH );
|
m_framePage.SetX( SCREEN_LEFT-SCREEN_WIDTH );
|
||||||
m_framePage.BeginTweening( 0.3f, Actor::TWEEN_BIAS_BEGIN );
|
m_framePage.BeginTweening( 0.3f, Actor::TWEEN_BIAS_BEGIN );
|
||||||
m_framePage.SetTweenX( 0 );
|
m_framePage.SetTweenX( 0 );
|
||||||
|
ZeroMemory(&m_OptionDim, sizeof(m_OptionDim));
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScreenOptions::Init( InputMode im, OptionLineData optionLineData[], int iNumOptionLines )
|
void ScreenOptions::Init( InputMode im, OptionLineData optionLineData[], int iNumOptionLines )
|
||||||
@@ -193,6 +194,17 @@ void ScreenOptions::InitOptionsText()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ScreenOptions::DimOption(int line, int option, bool dim)
|
||||||
|
{
|
||||||
|
m_OptionDim[line][option] = dim;
|
||||||
|
m_textOptions[line][option].BeginTweening(.250);
|
||||||
|
if(m_OptionDim[line][option])
|
||||||
|
m_textOptions[line][option].SetTweenDiffuseColor( D3DXCOLOR(.5,.5,.5,1) );
|
||||||
|
else
|
||||||
|
m_textOptions[line][option].SetTweenDiffuseColor( D3DXCOLOR(1,1,1,1) );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void ScreenOptions::PositionUnderlines()
|
void ScreenOptions::PositionUnderlines()
|
||||||
{
|
{
|
||||||
// Set the position of the underscores showing the current choice for each option line.
|
// Set the position of the underscores showing the current choice for each option line.
|
||||||
@@ -322,10 +334,16 @@ void ScreenOptions::MenuLeft( const PlayerNumber pn )
|
|||||||
continue; // skip
|
continue; // skip
|
||||||
|
|
||||||
int iCurRow = m_iCurrentRow[p];
|
int iCurRow = m_iCurrentRow[p];
|
||||||
if( m_iSelectedOption[p][iCurRow] == 0 ) // can't go left any more
|
|
||||||
|
int new_opt = m_iSelectedOption[p][iCurRow];
|
||||||
|
do {
|
||||||
|
new_opt--;
|
||||||
|
} while(new_opt >= 0 && m_OptionDim[iCurRow][new_opt]);
|
||||||
|
|
||||||
|
if( new_opt < 0 ) // can't go left any more
|
||||||
return;
|
return;
|
||||||
|
|
||||||
m_iSelectedOption[p][iCurRow]--;
|
m_iSelectedOption[p][iCurRow] = new_opt;
|
||||||
|
|
||||||
TweenHighlight( (PlayerNumber)p );
|
TweenHighlight( (PlayerNumber)p );
|
||||||
}
|
}
|
||||||
@@ -341,10 +359,16 @@ void ScreenOptions::MenuRight( const PlayerNumber pn )
|
|||||||
continue; // skip
|
continue; // skip
|
||||||
|
|
||||||
int iCurRow = m_iCurrentRow[p];
|
int iCurRow = m_iCurrentRow[p];
|
||||||
if( m_iSelectedOption[p][iCurRow] == m_OptionLineData[iCurRow].iNumOptions-1 ) // can't go right any more
|
int new_opt = m_iSelectedOption[p][iCurRow];
|
||||||
|
do {
|
||||||
|
new_opt++;
|
||||||
|
} while(new_opt < m_OptionLineData[iCurRow].iNumOptions &&
|
||||||
|
m_OptionDim[iCurRow][new_opt]);
|
||||||
|
|
||||||
|
if( new_opt == m_OptionLineData[iCurRow].iNumOptions ) // can't go right any more
|
||||||
return;
|
return;
|
||||||
|
|
||||||
m_iSelectedOption[p][iCurRow]++;
|
m_iSelectedOption[p][iCurRow] = new_opt;
|
||||||
|
|
||||||
TweenHighlight( (PlayerNumber)p );
|
TweenHighlight( (PlayerNumber)p );
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ protected:
|
|||||||
void PositionUnderlines();
|
void PositionUnderlines();
|
||||||
void PositionHighlights();
|
void PositionHighlights();
|
||||||
void TweenHighlight( PlayerNumber player_no );
|
void TweenHighlight( PlayerNumber player_no );
|
||||||
void OnChange();
|
virtual void OnChange();
|
||||||
|
|
||||||
void MenuBack( const PlayerNumber p );
|
void MenuBack( const PlayerNumber p );
|
||||||
void MenuStart( const PlayerNumber p );
|
void MenuStart( const PlayerNumber p );
|
||||||
@@ -82,6 +82,8 @@ protected:
|
|||||||
Sprite m_sprPage;
|
Sprite m_sprPage;
|
||||||
BitmapText m_textOptionLineTitles[MAX_OPTION_LINES];
|
BitmapText m_textOptionLineTitles[MAX_OPTION_LINES];
|
||||||
BitmapText m_textOptions[MAX_OPTION_LINES][MAX_OPTIONS_PER_LINE]; // this array has to be big enough to hold all of the options
|
BitmapText m_textOptions[MAX_OPTION_LINES][MAX_OPTIONS_PER_LINE]; // this array has to be big enough to hold all of the options
|
||||||
|
bool m_OptionDim[MAX_OPTION_LINES][MAX_OPTIONS_PER_LINE];
|
||||||
|
void DimOption(int line, int option, bool dim);
|
||||||
|
|
||||||
int m_iSelectedOption[NUM_PLAYERS][MAX_OPTION_LINES];
|
int m_iSelectedOption[NUM_PLAYERS][MAX_OPTION_LINES];
|
||||||
int m_iCurrentRow[NUM_PLAYERS];
|
int m_iCurrentRow[NUM_PLAYERS];
|
||||||
|
|||||||
Reference in New Issue
Block a user