run profile's CustomLoadFunction when changing theme or assigning a local profile to a player

This should make the custom load functions a lot more useful.
This commit is contained in:
sigatrev
2014-04-30 21:30:30 -05:00
parent bea5f1cef9
commit f1fc291989
4 changed files with 40 additions and 22 deletions
+10
View File
@@ -12,6 +12,8 @@
#include "RageFile.h"
#if !defined(SMPACKAGE)
#include "ScreenManager.h"
#include "ProfileManager.h"
#include "Profile.h"
#include "ActorUtil.h"
#endif
#include "Foreach.h"
@@ -415,12 +417,20 @@ void ThemeManager::SwitchThemeAndLanguage( const RString &sThemeName_, const RSt
// reload common sounds
if( SCREENMAN != NULL )
SCREENMAN->ThemeChanged();
#endif
/* Lua globals can use metrics which are cached, and vice versa. Update Lua
* globals first; it's Lua's job to explicitly update cached metrics that it
* uses. */
UpdateLuaGlobals();
// Reload MachineProfile with new theme's CustomLoadFunction
if( PROFILEMAN != NULL )
{
Profile* pProfile = PROFILEMAN->GetMachineProfile();
pProfile->LoadCustomFunction( "/Save/MachineProfile/" );
}
}
// Use theme metrics for localization.