add Shift+Ctrl+F2 shortcut for reloading overlay screens (and metrics)
This commit is contained in:
@@ -307,6 +307,28 @@ void ScreenManager::ThemeChanged()
|
||||
this->RefreshCreditsMessages();
|
||||
}
|
||||
|
||||
void ScreenManager::ReloadOverlayScreens()
|
||||
{
|
||||
// unload overlay screens
|
||||
for( unsigned i=0; i<g_OverlayScreens.size(); i++ )
|
||||
SAFE_DELETE( g_OverlayScreens[i] );
|
||||
g_OverlayScreens.clear();
|
||||
|
||||
// reload overlay screens
|
||||
RString sOverlays = THEME->GetMetric( "Common","OverlayScreens" );
|
||||
vector<RString> asOverlays;
|
||||
split( sOverlays, ",", asOverlays );
|
||||
for( unsigned i=0; i<asOverlays.size(); i++ )
|
||||
{
|
||||
Screen *pScreen = MakeNewScreen( asOverlays[i] );
|
||||
LuaThreadVariable var2( "LoadingScreen", pScreen->GetName() );
|
||||
pScreen->BeginScreen();
|
||||
g_OverlayScreens.push_back( pScreen );
|
||||
}
|
||||
|
||||
this->RefreshCreditsMessages();
|
||||
}
|
||||
|
||||
Screen *ScreenManager::GetTopScreen()
|
||||
{
|
||||
if( g_ScreenStack.empty() )
|
||||
|
||||
+1
-1
@@ -46,7 +46,7 @@ public:
|
||||
|
||||
void RefreshCreditsMessages();
|
||||
void ThemeChanged();
|
||||
|
||||
void ReloadOverlayScreens();
|
||||
|
||||
/* Return true if the given screen is in the main screen stack, but not the
|
||||
* bottommost screen. If true, the screen should usually exit by popping
|
||||
|
||||
+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
|
||||
|
||||
+1
-3
@@ -99,9 +99,7 @@ public:
|
||||
|
||||
static RString GetBlankGraphicPath();
|
||||
|
||||
//
|
||||
// For self-registering metrics
|
||||
//
|
||||
static void Subscribe( IThemeMetric *p );
|
||||
static void Unsubscribe( IThemeMetric *p );
|
||||
|
||||
@@ -113,7 +111,7 @@ protected:
|
||||
void LoadThemeMetrics( const RString &sThemeName, const RString &sLanguage_ );
|
||||
RString GetMetricRaw( const IniFile &ini, const RString &sMetricsGroup, const RString &sValueName );
|
||||
bool GetMetricRawRecursive( const IniFile &ini, const RString &sMetricsGroup, const RString &sValueName, RString &sRet );
|
||||
|
||||
|
||||
bool GetPathInfoToAndFallback( PathInfo &out, ElementCategory category, const RString &sMetricsGroup, const RString &sFile );
|
||||
bool GetPathInfoToRaw( PathInfo &out, const RString &sThemeName, ElementCategory category, const RString &sMetricsGroup, const RString &sFile );
|
||||
static RString GetThemeDirFromName( const RString &sThemeName );
|
||||
|
||||
Reference in New Issue
Block a user