attempt to fix a crash when pressing ctrl+letter during the transition
This commit is contained in:
+33
-33
@@ -384,39 +384,6 @@ void ScreenSelectMusic::Input( const InputEventPlus &input )
|
|||||||
{
|
{
|
||||||
// LOG->Trace( "ScreenSelectMusic::Input()" );
|
// LOG->Trace( "ScreenSelectMusic::Input()" );
|
||||||
|
|
||||||
bool bHoldingCtrl =
|
|
||||||
INPUTFILTER->IsBeingPressed(DeviceInput(DEVICE_KEYBOARD, KEY_LCTRL)) ||
|
|
||||||
INPUTFILTER->IsBeingPressed(DeviceInput(DEVICE_KEYBOARD, KEY_RCTRL));
|
|
||||||
|
|
||||||
wchar_t c = INPUTMAN->DeviceInputToChar(input.DeviceI,false);
|
|
||||||
MakeUpper( &c, 1 );
|
|
||||||
|
|
||||||
if( bHoldingCtrl && ( c >= 'A' ) && ( c <= 'Z' ) )
|
|
||||||
{
|
|
||||||
// Only allow changing the sort order if the wheel is not locked
|
|
||||||
// and we're not in course mode. -aj
|
|
||||||
if( !m_MusicWheel.WheelIsLocked() && !GAMESTATE->IsCourseMode() )
|
|
||||||
{
|
|
||||||
SortOrder so = GAMESTATE->m_SortOrder;
|
|
||||||
// When in Artist sort, this means first letter of the artist.
|
|
||||||
// Otherwise, if not in Title sort already, switch to Title sort.
|
|
||||||
if ( so != SORT_ARTIST )
|
|
||||||
so = SORT_TITLE;
|
|
||||||
|
|
||||||
GAMESTATE->m_PreferredSortOrder = so;
|
|
||||||
GAMESTATE->m_SortOrder.Set( so );
|
|
||||||
// Odd, changing the sort order requires us to call SetOpenSection more than once
|
|
||||||
m_MusicWheel.ChangeSort( so );
|
|
||||||
m_MusicWheel.SetOpenSection( ssprintf("%c", c ) );
|
|
||||||
|
|
||||||
m_MusicWheel.SelectSection( ssprintf("%c", c ) );
|
|
||||||
m_MusicWheel.ChangeSort( so );
|
|
||||||
m_MusicWheel.SetOpenSection( ssprintf("%c", c ) );
|
|
||||||
AfterMusicChange();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// debugging?
|
// debugging?
|
||||||
// I just like being able to see untransliterated titles occasionally.
|
// I just like being able to see untransliterated titles occasionally.
|
||||||
if( input.DeviceI.device == DEVICE_KEYBOARD && input.DeviceI.button == KEY_F9 )
|
if( input.DeviceI.device == DEVICE_KEYBOARD && input.DeviceI.button == KEY_F9 )
|
||||||
@@ -470,6 +437,39 @@ void ScreenSelectMusic::Input( const InputEventPlus &input )
|
|||||||
if( IsTransitioning() )
|
if( IsTransitioning() )
|
||||||
return; // ignore
|
return; // ignore
|
||||||
|
|
||||||
|
bool bHoldingCtrl =
|
||||||
|
INPUTFILTER->IsBeingPressed(DeviceInput(DEVICE_KEYBOARD, KEY_LCTRL)) ||
|
||||||
|
INPUTFILTER->IsBeingPressed(DeviceInput(DEVICE_KEYBOARD, KEY_RCTRL));
|
||||||
|
|
||||||
|
wchar_t c = INPUTMAN->DeviceInputToChar(input.DeviceI,false);
|
||||||
|
MakeUpper( &c, 1 );
|
||||||
|
|
||||||
|
if( bHoldingCtrl && ( c >= 'A' ) && ( c <= 'Z' ) )
|
||||||
|
{
|
||||||
|
// Only allow changing the sort order if the wheel is not locked
|
||||||
|
// and we're not in course mode. -aj
|
||||||
|
if( !m_MusicWheel.WheelIsLocked() && !GAMESTATE->IsCourseMode() )
|
||||||
|
{
|
||||||
|
SortOrder so = GAMESTATE->m_SortOrder;
|
||||||
|
// When in Artist sort, this means first letter of the artist.
|
||||||
|
// Otherwise, if not in Title sort already, switch to Title sort.
|
||||||
|
if ( so != SORT_ARTIST )
|
||||||
|
so = SORT_TITLE;
|
||||||
|
|
||||||
|
GAMESTATE->m_PreferredSortOrder = so;
|
||||||
|
GAMESTATE->m_SortOrder.Set( so );
|
||||||
|
// Odd, changing the sort order requires us to call SetOpenSection more than once
|
||||||
|
m_MusicWheel.ChangeSort( so );
|
||||||
|
m_MusicWheel.SetOpenSection( ssprintf("%c", c ) );
|
||||||
|
|
||||||
|
m_MusicWheel.SelectSection( ssprintf("%c", c ) );
|
||||||
|
m_MusicWheel.ChangeSort( so );
|
||||||
|
m_MusicWheel.SetOpenSection( ssprintf("%c", c ) );
|
||||||
|
AfterMusicChange();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Handle unselect steps
|
// Handle unselect steps
|
||||||
// xxx: select button could conflict with OptionsList here -aj
|
// xxx: select button could conflict with OptionsList here -aj
|
||||||
if( m_SelectionState == SelectionState_SelectingSteps && m_bStepsChosen[input.pn]
|
if( m_SelectionState == SelectionState_SelectingSteps && m_bStepsChosen[input.pn]
|
||||||
|
|||||||
Reference in New Issue
Block a user