fix song backgrounds, probably other things
This commit is contained in:
@@ -152,6 +152,10 @@ void Lua::UpdateGlobals()
|
||||
|
||||
ASSERT( L );
|
||||
|
||||
/* Important: eplicitly refresh cached metrics that we use. */
|
||||
SCREEN_WIDTH.Read();
|
||||
SCREEN_HEIGHT.Read();
|
||||
|
||||
lua_pushnumber( L, SCREEN_WIDTH );
|
||||
lua_setglobal( L, "SCREEN_WIDTH" );
|
||||
lua_pushnumber( L, SCREEN_HEIGHT );
|
||||
|
||||
@@ -290,10 +290,13 @@ void ThemeManager::SwitchThemeAndLanguage( const CString &sThemeName, const CStr
|
||||
if ( SCREENMAN != NULL )
|
||||
SCREENMAN->ThemeChanged();
|
||||
|
||||
/* 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. */
|
||||
Lua::UpdateGlobals();
|
||||
|
||||
// reload subscribers
|
||||
FOREACH( IThemeMetric*, *g_pvpSubscribers, p ) (*p)->Read();
|
||||
|
||||
Lua::UpdateGlobals();
|
||||
}
|
||||
|
||||
CString ThemeManager::GetThemeDirFromName( const CString &sThemeName )
|
||||
|
||||
Reference in New Issue
Block a user