add Shift+Ctrl+F2 shortcut for reloading overlay screens (and metrics)
This commit is contained in:
+15
-4
@@ -1277,6 +1277,7 @@ static LocalizedString SERVICE_SWITCH_PRESSED ( "StepMania", "Service switch pre
|
||||
static LocalizedString RELOADED_METRICS( "ThemeManager", "Reloaded metrics" );
|
||||
static LocalizedString RELOADED_METRICS_AND_TEXTURES( "ThemeManager", "Reloaded metrics and textures" );
|
||||
static LocalizedString RELOADED_SCRIPTS( "ThemeManager", "Reloaded scripts" );
|
||||
static LocalizedString RELOADED_OVERLAY_SCREENS( "ThemeManager", "Reloaded overlay screens" );
|
||||
bool HandleGlobalInputs( const InputEventPlus &input )
|
||||
{
|
||||
// None of the globals keys act on types other than FIRST_PRESS
|
||||
@@ -1312,23 +1313,33 @@ bool HandleGlobalInputs( const InputEventPlus &input )
|
||||
// re-added for StepMania 3.9 veterans, plus it's just plain old faster
|
||||
// than the debug menu. However, this is without the LShift capability
|
||||
// that was in 3.9; if we get enough requests, we'll re-add it, but meh. -aj
|
||||
bool bIsShiftHeld = INPUTFILTER->IsBeingPressed( DeviceInput(DEVICE_KEYBOARD, KEY_LSHIFT), &input.InputList) ||
|
||||
INPUTFILTER->IsBeingPressed( DeviceInput(DEVICE_KEYBOARD, KEY_RSHIFT), &input.InputList);
|
||||
bool bIsCtrlHeld = INPUTFILTER->IsBeingPressed( DeviceInput(DEVICE_KEYBOARD, KEY_LCTRL), &input.InputList) ||
|
||||
INPUTFILTER->IsBeingPressed( DeviceInput(DEVICE_KEYBOARD, KEY_RCTRL), &input.InputList);
|
||||
if( input.DeviceI == DeviceInput(DEVICE_KEYBOARD, KEY_F2) )
|
||||
{
|
||||
if( INPUTFILTER->IsBeingPressed( DeviceInput(DEVICE_KEYBOARD, KEY_LSHIFT), &input.InputList) ||
|
||||
INPUTFILTER->IsBeingPressed( DeviceInput(DEVICE_KEYBOARD, KEY_RSHIFT), &input.InputList))
|
||||
if( bIsShiftHeld && !bIsCtrlHeld )
|
||||
{
|
||||
// Shift+F2: refresh metrics and CodeDetector cache only
|
||||
THEME->ReloadMetrics();
|
||||
CodeDetector::RefreshCacheItems();
|
||||
SCREENMAN->SystemMessage( RELOADED_METRICS );
|
||||
}
|
||||
else if(INPUTFILTER->IsBeingPressed( DeviceInput(DEVICE_KEYBOARD, KEY_LCTRL), &input.InputList) ||
|
||||
INPUTFILTER->IsBeingPressed( DeviceInput(DEVICE_KEYBOARD, KEY_RCTRL), &input.InputList))
|
||||
else if( bIsCtrlHeld && !bIsShiftHeld )
|
||||
{
|
||||
// Ctrl+F2: reload scripts only
|
||||
THEME->UpdateLuaGlobals();
|
||||
SCREENMAN->SystemMessage( RELOADED_SCRIPTS );
|
||||
}
|
||||
else if( bIsCtrlHeld && bIsShiftHeld )
|
||||
{
|
||||
// Shift+Ctrl+F2: reload overlay screens (and metrics, since themers
|
||||
// are likely going to do this after changing metrics and be lazy.)
|
||||
THEME->ReloadMetrics();
|
||||
SCREENMAN->ReloadOverlayScreens();
|
||||
SCREENMAN->SystemMessage( RELOADED_OVERLAY_SCREENS );
|
||||
}
|
||||
else
|
||||
{
|
||||
// F2 alone: refresh metrics, textures, noteskins, codedetector cache
|
||||
|
||||
Reference in New Issue
Block a user