Block space switching when requested space type matches current

This commit is contained in:
Phillip Stephens 2016-07-08 23:53:20 -07:00
parent 4f401acdca
commit 48bcecff9a
2 changed files with 26 additions and 9 deletions

View File

@ -243,10 +243,22 @@ void Space::SpaceMenuNode::SubNode::activated(const boo::SWindowCoord &coord)
std::unique_ptr<Space> newSpace; std::unique_ptr<Space> newSpace;
switch(m_data.m_cls) switch(m_data.m_cls)
{ {
case Class::InformationCenter: newSpace.reset(new InformationCenter(m_space.m_parent->m_vm, m_space.m_parent)); break; case Class::InformationCenter:
case Class::EffectEditor: newSpace.reset(new EffectEditor(m_space.m_parent->m_vm, m_space.m_parent)); break; if (typeid(InformationCenter) != typeid(m_space))
case Class::ResourceBrowser: newSpace.reset(new ResourceBrowser(m_space.m_parent->m_vm, m_space.m_parent)); break; newSpace.reset(new InformationCenter(m_space.m_parent->m_vm, m_space.m_parent));
case Class::ModelViewer: newSpace.reset(new ModelViewer(m_space.m_parent->m_vm, m_space.m_parent)); break; break;
case Class::EffectEditor:
if (typeid(EffectEditor) != typeid(m_space))
newSpace.reset(new EffectEditor(m_space.m_parent->m_vm, m_space.m_parent));
break;
case Class::ResourceBrowser:
if (typeid(ResourceBrowser) != typeid(m_space))
newSpace.reset(new ResourceBrowser(m_space.m_parent->m_vm, m_space.m_parent));
break;
case Class::ModelViewer:
if (typeid(ModelViewer) != typeid(m_space))
newSpace.reset(new ModelViewer(m_space.m_parent->m_vm, m_space.m_parent));
break;
default: break; default: break;
} }
if (newSpace) if (newSpace)

View File

@ -35,6 +35,8 @@ struct Application : boo::IApplicationCallback
m_viewManager.reset(new ViewManager(m_fileMgr, m_cvarManager)); m_viewManager.reset(new ViewManager(m_fileMgr, m_cvarManager));
} }
virtual ~Application() = default;
int appMain(boo::IApplication* app) int appMain(boo::IApplication* app)
{ {
initialize(app); initialize(app);
@ -53,12 +55,9 @@ struct Application : boo::IApplicationCallback
{ {
m_running = false; m_running = false;
} }
void appFilesOpen(boo::IApplication*, const std::vector<boo::SystemString>&) void appFilesOpen(boo::IApplication*, const std::vector<boo::SystemString>&);
{
} void initialize(boo::IApplication* /*app*/)
void initialize(boo::IApplication* app)
{ {
zeus::detectCPU(); zeus::detectCPU();
//hecl::VerbosityLevel = 1; //hecl::VerbosityLevel = 1;
@ -102,6 +101,12 @@ struct Application : boo::IApplicationCallback
} }
}; };
/* This is here to prevent a vtable being dumped into every translation unit */
void Application::appFilesOpen(boo::IApplication *, const std::vector<boo::SystemString> &)
{
}
} }
#if _WIN32 #if _WIN32