Fixed SwitchThemeAndLanguage to run lua scripts when reloading the theme. Removed ForceThemeReload param from GameLoop::ChangeTheme.

This commit is contained in:
Kyzentun
2014-08-24 03:21:01 -06:00
parent 1ca6154c1a
commit 01442d193f
4 changed files with 7 additions and 8 deletions
+4 -4
View File
@@ -115,12 +115,10 @@ static void CheckFocus()
// On the next update, change themes, and load sNewScreen.
static RString g_NewTheme;
static bool g_bForceThemeReload;
static RString g_NewGame;
void GameLoop::ChangeTheme( const RString &sNewTheme, bool bForced )
void GameLoop::ChangeTheme(const RString &sNewTheme)
{
g_NewTheme = sNewTheme;
g_bForceThemeReload = bForced;
}
void GameLoop::ChangeGame(const RString& new_game, const RString& new_theme)
@@ -142,7 +140,9 @@ namespace
// In case the previous theme overloaded class bindings, reinitialize them.
LUA->RegisterTypes();
THEME->SwitchThemeAndLanguage( g_NewTheme, THEME->GetCurLanguage(), PREFSMAN->m_bPseudoLocalize, g_bForceThemeReload );
// We always need to force the theme to reload because we cleared the lua
// state by calling RegisterTypes so the scripts in Scripts/ need to run.
THEME->SwitchThemeAndLanguage( g_NewTheme, THEME->GetCurLanguage(), PREFSMAN->m_bPseudoLocalize, true );
PREFSMAN->m_sTheme.Set( g_NewTheme );
// Apply the new window title, icon and aspect ratio.