mirror of https://github.com/AxioDL/metaforce.git
Update submodules
This commit is contained in:
parent
c826fc58ab
commit
2053734e9e
|
@ -35,12 +35,20 @@ SplashScreen::SplashScreen(ViewManager& vm, Specter::ViewResources& res)
|
|||
m_extractString(m_vm.translateOr("extract_game", "Extract Game")),
|
||||
m_extractProjBind(*this)
|
||||
{
|
||||
m_openProjBind.m_openRecentMenuRoot.m_text = vm.translateOr("recent_projects", "Recent Projects");
|
||||
m_textColorClear[3] = 0.0;
|
||||
commitResources(res);
|
||||
}
|
||||
|
||||
void SplashScreen::think()
|
||||
{
|
||||
if (phase() == Phase::Done)
|
||||
{
|
||||
if (m_fileBrowser.m_view)
|
||||
m_fileBrowser.m_view.reset();
|
||||
return;
|
||||
}
|
||||
|
||||
ModalWindow::think();
|
||||
if (m_fileBrowser.m_view)
|
||||
m_fileBrowser.m_view->think();
|
||||
|
@ -245,6 +253,8 @@ void SplashScreen::resized(const boo::SWindowRect& root, const boo::SWindowRect&
|
|||
|
||||
void SplashScreen::draw(boo::IGraphicsCommandQueue* gfxQ)
|
||||
{
|
||||
if (phase() == Phase::Done)
|
||||
return;
|
||||
ModalWindow::draw(gfxQ);
|
||||
|
||||
if (m_title)
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
#include <Specter/ModalWindow.hpp>
|
||||
#include <Specter/MultiLineTextView.hpp>
|
||||
#include <Specter/FileBrowser.hpp>
|
||||
#include <Specter/Menu.hpp>
|
||||
#include "ViewManager.hpp"
|
||||
|
||||
namespace URDE
|
||||
|
@ -58,7 +59,7 @@ class SplashScreen : public Specter::ModalWindow
|
|||
{
|
||||
SplashScreen& m_splash;
|
||||
HECL::SystemString m_deferPath;
|
||||
OpenProjBinding(SplashScreen& splash) : m_splash(splash) {}
|
||||
OpenProjBinding(SplashScreen& splash) : m_splash(splash), m_openRecentMenuRoot(*this) {}
|
||||
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";}
|
||||
void activated(const Specter::Button* button, const boo::SWindowCoord& coord)
|
||||
|
@ -75,6 +76,57 @@ class SplashScreen : public Specter::ModalWindow
|
|||
m_splash.updateSize();
|
||||
m_splash.m_openButt.mouseLeave(coord);
|
||||
}
|
||||
|
||||
struct OpenRecentMenuRoot : Specter::IMenuNode
|
||||
{
|
||||
OpenProjBinding& m_openProjBind;
|
||||
OpenRecentMenuRoot(OpenProjBinding& openProjBind) : m_openProjBind(openProjBind) {}
|
||||
|
||||
std::string m_text;
|
||||
const std::string* text() const {return &m_text;}
|
||||
|
||||
struct OpenRecentMenuItem : Specter::IMenuNode
|
||||
{
|
||||
OpenRecentMenuRoot& m_parent;
|
||||
|
||||
HECL::SystemString m_path;
|
||||
std::string m_text;
|
||||
|
||||
const std::string* text() const {return &m_text;}
|
||||
void activated() {m_parent.m_openProjBind.m_deferPath = m_path;}
|
||||
|
||||
OpenRecentMenuItem(OpenRecentMenuRoot& parent, const HECL::SystemString& path)
|
||||
: m_parent(parent), m_path(path)
|
||||
{
|
||||
std::vector<HECL::SystemString> pathComps = Specter::FileBrowser::PathComponents(path);
|
||||
if (pathComps.size())
|
||||
m_text = HECL::SystemUTF8View(pathComps.back()).str();
|
||||
}
|
||||
};
|
||||
std::vector<OpenRecentMenuItem> m_items;
|
||||
|
||||
size_t subNodeCount() const {return m_items.size();}
|
||||
Specter::IMenuNode* subNode(size_t idx) {return &m_items[idx];}
|
||||
|
||||
void buildNodes(const std::vector<HECL::SystemString>* recentProjects)
|
||||
{
|
||||
m_items.clear();
|
||||
if (recentProjects)
|
||||
{
|
||||
m_items.reserve(recentProjects->size());
|
||||
for (const HECL::SystemString& path : *recentProjects)
|
||||
m_items.emplace_back(*this, path);
|
||||
}
|
||||
}
|
||||
} m_openRecentMenuRoot;
|
||||
|
||||
MenuStyle menuStyle(const Specter::Button* button) const {return MenuStyle::Auxiliary;}
|
||||
std::unique_ptr<View> buildMenu(const Specter::Button* button)
|
||||
{
|
||||
m_openRecentMenuRoot.buildNodes(m_splash.m_vm.recentProjects());
|
||||
return std::unique_ptr<View>(new Specter::Menu(m_splash.rootView().viewRes(),
|
||||
m_splash, &m_openRecentMenuRoot));
|
||||
}
|
||||
} m_openProjBind;
|
||||
|
||||
struct ExtractProjBinding : Specter::IButtonBinding
|
||||
|
|
2
hecl
2
hecl
|
@ -1 +1 @@
|
|||
Subproject commit f9edbe58261c36b9e7f02a3f6c6d07708187cd25
|
||||
Subproject commit 5d0c80b9e603ecb2762b281d8736d21a324c3e76
|
|
@ -1 +1 @@
|
|||
Subproject commit b1a8603a85ebc0b762a30391e1db5b43d93215b9
|
||||
Subproject commit 2490aa3bb82860fa2969d2cc797324d846e3b51c
|
Loading…
Reference in New Issue