Previously, changing themes attempted to preserve Lua data by
serializing data and tables while reinstantiating Lua. That's ugly, and can't serialize some things (eg. functions). Instead, when changing themes, shut down the high-level objects and unregister as much as we can from Lua, change the theme, then reregister things. This doesn't clean the slate as much; globals won't be erased, etc. A better way would be to clear everything that uses Lua (delete singletons), then reload it all. Singleton creation is a bit of a mess currently so that would break a lot, and we don't want to reload songs.
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
#include "OptionRowHandler.h"
|
||||
#include "ScreenOptionsMasterPrefs.h"
|
||||
#include "CommonMetrics.h"
|
||||
#include "GameLoop.h"
|
||||
|
||||
#define LINE_NAMES THEME->GetMetric (m_sName,"LineNames")
|
||||
#define LINE(sLineName) THEME->GetMetric (m_sName,ssprintf("Line%s",sLineName.c_str()))
|
||||
@@ -123,6 +124,8 @@ void ScreenOptionsMaster::HandleScreenMessage( const ScreenMessage SM )
|
||||
(m_iChangeMask & OPT_APPLY_GRAPHICS) ||
|
||||
(m_iChangeMask & OPT_APPLY_ASPECT_RATIO) )
|
||||
{
|
||||
RString sNewTheme = PREFSMAN->m_sTheme.Get();
|
||||
GameLoop::ChangeTheme( sNewTheme, this->GetNextScreen() );
|
||||
StepMania::ApplyGraphicOptions();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user