jump to CHAR_BACK when try to enter another letter and name is full
This commit is contained in:
@@ -20,6 +20,7 @@
|
|||||||
#include "ProfileManager.h"
|
#include "ProfileManager.h"
|
||||||
#include "StageStats.h"
|
#include "StageStats.h"
|
||||||
#include "RageDisplay.h"
|
#include "RageDisplay.h"
|
||||||
|
#include "Foreach.h"
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -628,6 +629,7 @@ void ScreenNameEntryTraditional::MenuStart( PlayerNumber pn, const InputEventTyp
|
|||||||
if( (int) m_sSelection[pn].size() == MAX_RANKING_NAME_LENGTH )
|
if( (int) m_sSelection[pn].size() == MAX_RANKING_NAME_LENGTH )
|
||||||
{
|
{
|
||||||
m_soundInvalid.Play();
|
m_soundInvalid.Play();
|
||||||
|
SelectChar( pn, CHAR_BACK );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
m_sSelection[pn] += wchar_t(SelectedLetter);
|
m_sSelection[pn] += wchar_t(SelectedLetter);
|
||||||
@@ -642,11 +644,16 @@ void ScreenNameEntryTraditional::MenuStart( PlayerNumber pn, const InputEventTyp
|
|||||||
|
|
||||||
void ScreenNameEntryTraditional::SelectChar( PlayerNumber pn, int c )
|
void ScreenNameEntryTraditional::SelectChar( PlayerNumber pn, int c )
|
||||||
{
|
{
|
||||||
m_SelectedChar[pn] = 0;
|
FOREACH( int, m_AlphabetLetter[pn], letter )
|
||||||
while( m_AlphabetLetter[pn][m_SelectedChar[pn]] != CHAR_OK )
|
{
|
||||||
++m_SelectedChar[pn];
|
if( *letter == c ) // character found
|
||||||
ASSERT( m_AlphabetLetter[pn][m_SelectedChar[pn]] == CHAR_OK );
|
{
|
||||||
|
m_SelectedChar[pn] = letter - m_AlphabetLetter[pn].begin();
|
||||||
PositionCharsAndCursor( pn );
|
PositionCharsAndCursor( pn );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ASSERT( false ); // character not found
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScreenNameEntryTraditional::MenuLeft( PlayerNumber pn, const InputEventType type )
|
void ScreenNameEntryTraditional::MenuLeft( PlayerNumber pn, const InputEventType type )
|
||||||
|
|||||||
Reference in New Issue
Block a user