More dimming support.
This commit is contained in:
@@ -204,6 +204,12 @@ void ScreenOptions::DimOption(int line, int option, bool dim)
|
|||||||
m_textOptions[line][option].SetTweenDiffuseColor( D3DXCOLOR(1,1,1,1) );
|
m_textOptions[line][option].SetTweenDiffuseColor( D3DXCOLOR(1,1,1,1) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool ScreenOptions::RowCompletelyDimmed(int line) const
|
||||||
|
{
|
||||||
|
for(int i = 0; i < m_OptionLineData[line].iNumOptions; ++i)
|
||||||
|
if(!m_OptionDim[line][i]) return true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
void ScreenOptions::PositionUnderlines()
|
void ScreenOptions::PositionUnderlines()
|
||||||
{
|
{
|
||||||
@@ -383,10 +389,14 @@ void ScreenOptions::MenuUp( const PlayerNumber pn )
|
|||||||
if( m_InputMode == INPUTMODE_PLAYERS && p != pn )
|
if( m_InputMode == INPUTMODE_PLAYERS && p != pn )
|
||||||
continue; // skip
|
continue; // skip
|
||||||
|
|
||||||
if( m_iCurrentRow[p] == 0 )
|
/* Find the prev row with any un-dimmed entries. */
|
||||||
m_iCurrentRow[p] = m_iNumOptionLines-1; // wrap around
|
int new_row = m_iCurrentRow[p];
|
||||||
else
|
do {
|
||||||
m_iCurrentRow[p]--;
|
if(--new_row < 0)
|
||||||
|
new_row = m_iNumOptionLines-1; // wrap around
|
||||||
|
if(RowCompletelyDimmed(new_row)) break;
|
||||||
|
} while(new_row != m_iCurrentRow[p]);
|
||||||
|
m_iCurrentRow[p] = new_row;
|
||||||
|
|
||||||
TweenHighlight( (PlayerNumber)p );
|
TweenHighlight( (PlayerNumber)p );
|
||||||
}
|
}
|
||||||
@@ -394,6 +404,7 @@ void ScreenOptions::MenuUp( const PlayerNumber pn )
|
|||||||
OnChange();
|
OnChange();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void ScreenOptions::MenuDown( const PlayerNumber pn )
|
void ScreenOptions::MenuDown( const PlayerNumber pn )
|
||||||
{
|
{
|
||||||
for( int p=0; p<NUM_PLAYERS; p++ )
|
for( int p=0; p<NUM_PLAYERS; p++ )
|
||||||
@@ -401,10 +412,14 @@ void ScreenOptions::MenuDown( const PlayerNumber pn )
|
|||||||
if( m_InputMode == INPUTMODE_PLAYERS && p != pn )
|
if( m_InputMode == INPUTMODE_PLAYERS && p != pn )
|
||||||
continue; // skip
|
continue; // skip
|
||||||
|
|
||||||
if( m_iCurrentRow[p] == m_iNumOptionLines-1 )
|
/* Find the next row with any un-dimmed entries. */
|
||||||
m_iCurrentRow[p] = 0; // wrap around
|
int new_row = m_iCurrentRow[p];
|
||||||
else
|
do {
|
||||||
m_iCurrentRow[p]++;
|
if( ++new_row == m_iNumOptionLines-1 )
|
||||||
|
new_row = 0; // wrap around
|
||||||
|
if(RowCompletelyDimmed(new_row)) break;
|
||||||
|
} while(new_row != m_iCurrentRow[p]);
|
||||||
|
m_iCurrentRow[p] = new_row;
|
||||||
|
|
||||||
TweenHighlight( (PlayerNumber)p );
|
TweenHighlight( (PlayerNumber)p );
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -84,6 +84,7 @@ protected:
|
|||||||
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];
|
bool m_OptionDim[MAX_OPTION_LINES][MAX_OPTIONS_PER_LINE];
|
||||||
void DimOption(int line, int option, bool dim);
|
void DimOption(int line, int option, bool dim);
|
||||||
|
bool RowCompletelyDimmed(int line) const;
|
||||||
|
|
||||||
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