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,
true);
m_fileListingBind.updateListing(dEnum);
m_view->m_fileListing.m_view->selectRow(-1);
m_view->m_fileListing.m_view->updateData();
m_view->m_pathButtons.m_view->setButtons(m_comps);
m_view->updateSize();
if (m_view)
{
m_view->m_fileListing.m_view->selectRow(-1);
m_view->m_fileListing.m_view->updateData();
m_view->m_pathButtons.m_view->setButtons(m_comps);
m_view->updateSize();
}
return true;
}

View File

@ -44,6 +44,25 @@ void SplashScreen::think()
ModalWindow::think();
if (m_fileBrowser.m_view)
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)

View File

@ -34,6 +34,7 @@ class SplashScreen : public Specter::ModalWindow
struct NewProjBinding : Specter::IButtonBinding
{
SplashScreen& m_splash;
HECL::SystemString m_deferPath;
NewProjBinding(SplashScreen& splash) : m_splash(splash) {}
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";}
@ -46,10 +47,7 @@ class SplashScreen : public Specter::ModalWindow
[&](bool ok, const HECL::SystemString& path)
{
if (ok)
{
Log.report(LogVisor::Info, _S("Making project '%s'"), path.c_str());
m_splash.m_vm.projectManager().newProject(path);
}
m_deferPath = path;
}));
m_splash.updateSize();
m_splash.m_newButt.mouseLeave(coord);
@ -59,6 +57,7 @@ class SplashScreen : public Specter::ModalWindow
struct OpenProjBinding : Specter::IButtonBinding
{
SplashScreen& m_splash;
HECL::SystemString m_deferPath;
OpenProjBinding(SplashScreen& splash) : m_splash(splash) {}
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";}
@ -71,10 +70,7 @@ class SplashScreen : public Specter::ModalWindow
[&](bool ok, const HECL::SystemString& path)
{
if (ok)
{
Log.report(LogVisor::Info, _S("Opening project '%s'"), path.c_str());
m_splash.m_vm.projectManager().openProject(path);
}
m_deferPath = path;
}));
m_splash.updateSize();
m_splash.m_openButt.mouseLeave(coord);
@ -84,6 +80,7 @@ class SplashScreen : public Specter::ModalWindow
struct ExtractProjBinding : Specter::IButtonBinding
{
SplashScreen& m_splash;
HECL::SystemString m_deferPath;
ExtractProjBinding(SplashScreen& splash) : m_splash(splash) {}
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";}
@ -96,10 +93,7 @@ class SplashScreen : public Specter::ModalWindow
[&](bool ok, const HECL::SystemString& path)
{
if (ok)
{
Log.report(LogVisor::Info, _S("Extracting game '%s'"), path.c_str());
m_splash.m_vm.projectManager().extractGame(path);
}
m_deferPath = path;
}));
m_splash.updateSize();
m_splash.m_extractButt.mouseLeave(coord);