Overzealous non-deferred lambda fix

This commit is contained in:
Jack Andersen 2016-01-07 19:54:00 -10:00
parent c1367b2d6b
commit 639de93785
3 changed files with 33 additions and 16 deletions

View File

@ -18,11 +18,15 @@ bool ResourceBrowser::navigateToPath(const HECL::ProjectPath& pathIn)
m_state.sortDir==Specter::SortDirection::Descending, m_state.sortDir==Specter::SortDirection::Descending,
true); true);
m_fileListingBind.updateListing(dEnum); m_fileListingBind.updateListing(dEnum);
if (m_view)
{
m_view->m_fileListing.m_view->selectRow(-1); m_view->m_fileListing.m_view->selectRow(-1);
m_view->m_fileListing.m_view->updateData(); m_view->m_fileListing.m_view->updateData();
m_view->m_pathButtons.m_view->setButtons(m_comps); m_view->m_pathButtons.m_view->setButtons(m_comps);
m_view->updateSize(); m_view->updateSize();
}
return true; return true;
} }

View File

@ -44,6 +44,25 @@ void SplashScreen::think()
ModalWindow::think(); ModalWindow::think();
if (m_fileBrowser.m_view) if (m_fileBrowser.m_view)
m_fileBrowser.m_view->think(); m_fileBrowser.m_view->think();
if (m_newProjBind.m_deferPath.size())
{
Log.report(LogVisor::Info, _S("Making project '%s'"), m_newProjBind.m_deferPath.c_str());
m_vm.projectManager().newProject(m_newProjBind.m_deferPath);
m_newProjBind.m_deferPath.clear();
}
else if (m_openProjBind.m_deferPath.size())
{
Log.report(LogVisor::Info, _S("Opening project '%s'"), m_openProjBind.m_deferPath.c_str());
m_vm.projectManager().openProject(m_openProjBind.m_deferPath);
m_openProjBind.m_deferPath.clear();
}
else if (m_extractProjBind.m_deferPath.size())
{
Log.report(LogVisor::Info, _S("Extracting game '%s'"), m_extractProjBind.m_deferPath.c_str());
m_vm.projectManager().extractGame(m_extractProjBind.m_deferPath);
m_extractProjBind.m_deferPath.clear();
}
} }
void SplashScreen::updateContentOpacity(float opacity) void SplashScreen::updateContentOpacity(float opacity)

View File

@ -34,6 +34,7 @@ class SplashScreen : public Specter::ModalWindow
struct NewProjBinding : Specter::IButtonBinding struct NewProjBinding : Specter::IButtonBinding
{ {
SplashScreen& m_splash; SplashScreen& m_splash;
HECL::SystemString m_deferPath;
NewProjBinding(SplashScreen& splash) : m_splash(splash) {} NewProjBinding(SplashScreen& splash) : m_splash(splash) {}
const char* name(const Specter::Control* control) const {return m_splash.m_newString.c_str();} const char* name(const Specter::Control* control) const {return m_splash.m_newString.c_str();}
const char* help(const Specter::Control* control) const {return "Creates an empty project at selected path";} const char* help(const Specter::Control* control) const {return "Creates an empty project at selected path";}
@ -46,10 +47,7 @@ class SplashScreen : public Specter::ModalWindow
[&](bool ok, const HECL::SystemString& path) [&](bool ok, const HECL::SystemString& path)
{ {
if (ok) if (ok)
{ m_deferPath = path;
Log.report(LogVisor::Info, _S("Making project '%s'"), path.c_str());
m_splash.m_vm.projectManager().newProject(path);
}
})); }));
m_splash.updateSize(); m_splash.updateSize();
m_splash.m_newButt.mouseLeave(coord); m_splash.m_newButt.mouseLeave(coord);
@ -59,6 +57,7 @@ class SplashScreen : public Specter::ModalWindow
struct OpenProjBinding : Specter::IButtonBinding struct OpenProjBinding : Specter::IButtonBinding
{ {
SplashScreen& m_splash; SplashScreen& m_splash;
HECL::SystemString m_deferPath;
OpenProjBinding(SplashScreen& splash) : m_splash(splash) {} OpenProjBinding(SplashScreen& splash) : m_splash(splash) {}
const char* name(const Specter::Control* control) const {return m_splash.m_openString.c_str();} const char* name(const Specter::Control* control) const {return m_splash.m_openString.c_str();}
const char* help(const Specter::Control* control) const {return "Opens an existing project at selected path";} const char* help(const Specter::Control* control) const {return "Opens an existing project at selected path";}
@ -71,10 +70,7 @@ class SplashScreen : public Specter::ModalWindow
[&](bool ok, const HECL::SystemString& path) [&](bool ok, const HECL::SystemString& path)
{ {
if (ok) if (ok)
{ m_deferPath = path;
Log.report(LogVisor::Info, _S("Opening project '%s'"), path.c_str());
m_splash.m_vm.projectManager().openProject(path);
}
})); }));
m_splash.updateSize(); m_splash.updateSize();
m_splash.m_openButt.mouseLeave(coord); m_splash.m_openButt.mouseLeave(coord);
@ -84,6 +80,7 @@ class SplashScreen : public Specter::ModalWindow
struct ExtractProjBinding : Specter::IButtonBinding struct ExtractProjBinding : Specter::IButtonBinding
{ {
SplashScreen& m_splash; SplashScreen& m_splash;
HECL::SystemString m_deferPath;
ExtractProjBinding(SplashScreen& splash) : m_splash(splash) {} ExtractProjBinding(SplashScreen& splash) : m_splash(splash) {}
const char* name(const Specter::Control* control) const {return m_splash.m_extractString.c_str();} const char* name(const Specter::Control* control) const {return m_splash.m_extractString.c_str();}
const char* help(const Specter::Control* control) const {return "Extracts game image as project at selected path";} const char* help(const Specter::Control* control) const {return "Extracts game image as project at selected path";}
@ -96,10 +93,7 @@ class SplashScreen : public Specter::ModalWindow
[&](bool ok, const HECL::SystemString& path) [&](bool ok, const HECL::SystemString& path)
{ {
if (ok) if (ok)
{ m_deferPath = path;
Log.report(LogVisor::Info, _S("Extracting game '%s'"), path.c_str());
m_splash.m_vm.projectManager().extractGame(path);
}
})); }));
m_splash.updateSize(); m_splash.updateSize();
m_splash.m_extractButt.mouseLeave(coord); m_splash.m_extractButt.mouseLeave(coord);