2015-12-13 02:27:34 +00:00
|
|
|
#ifndef RUDE_SPLASH_SCREEN_HPP
|
|
|
|
#define RUDE_SPLASH_SCREEN_HPP
|
|
|
|
|
|
|
|
#include <Specter/View.hpp>
|
2015-12-15 21:56:40 +00:00
|
|
|
#include <Specter/ModalWindow.hpp>
|
2015-12-13 02:27:34 +00:00
|
|
|
#include <Specter/MultiLineTextView.hpp>
|
2015-12-15 21:56:40 +00:00
|
|
|
#include <Specter/FileBrowser.hpp>
|
2015-12-13 02:27:34 +00:00
|
|
|
#include "ViewManager.hpp"
|
|
|
|
|
|
|
|
namespace RUDE
|
|
|
|
{
|
2015-12-15 21:56:40 +00:00
|
|
|
class SplashScreen : public Specter::ModalWindow
|
2015-12-13 02:27:34 +00:00
|
|
|
{
|
|
|
|
ViewManager& m_vm;
|
|
|
|
|
|
|
|
Zeus::CColor m_textColor;
|
|
|
|
Zeus::CColor m_textColorClear;
|
|
|
|
|
|
|
|
std::unique_ptr<Specter::TextView> m_title;
|
2015-12-13 21:01:32 +00:00
|
|
|
std::unique_ptr<Specter::MultiLineTextView> m_buildInfo;
|
|
|
|
|
2015-12-20 22:00:07 +00:00
|
|
|
Specter::ViewChild<std::unique_ptr<Specter::Button>> m_newButt;
|
|
|
|
Specter::ViewChild<std::unique_ptr<Specter::Button>> m_openButt;
|
|
|
|
Specter::ViewChild<std::unique_ptr<Specter::Button>> m_extractButt;
|
2015-12-13 02:27:34 +00:00
|
|
|
|
2015-12-20 22:00:07 +00:00
|
|
|
Specter::ViewChild<std::unique_ptr<Specter::FileBrowser>> m_fileBrowser;
|
2015-12-13 21:01:32 +00:00
|
|
|
|
|
|
|
struct NewProjBinding : Specter::IButtonBinding
|
|
|
|
{
|
2015-12-15 21:56:40 +00:00
|
|
|
SplashScreen& m_splash;
|
|
|
|
NewProjBinding(SplashScreen& splash) : m_splash(splash) {}
|
2015-12-13 21:01:32 +00:00
|
|
|
const char* name() const {return "New Project";}
|
|
|
|
const char* help() const {return "Creates an empty project at selected path";}
|
2015-12-14 04:56:25 +00:00
|
|
|
void activated(const boo::SWindowCoord& coord)
|
2015-12-13 21:01:32 +00:00
|
|
|
{
|
2015-12-15 21:56:40 +00:00
|
|
|
m_splash.m_fileBrowser.m_view.reset(new Specter::FileBrowser(m_splash.rootView().viewRes(), m_splash));
|
|
|
|
m_splash.updateSize();
|
|
|
|
m_splash.m_newButt.mouseLeave(coord);
|
2015-12-13 21:01:32 +00:00
|
|
|
}
|
|
|
|
} m_newProjBind;
|
|
|
|
|
|
|
|
struct OpenProjBinding : Specter::IButtonBinding
|
|
|
|
{
|
2015-12-15 21:56:40 +00:00
|
|
|
SplashScreen& m_splash;
|
|
|
|
OpenProjBinding(SplashScreen& splash) : m_splash(splash) {}
|
2015-12-13 21:01:32 +00:00
|
|
|
const char* name() const {return "Open Project";}
|
|
|
|
const char* help() const {return "Opens an existing project at selected path";}
|
2015-12-14 04:56:25 +00:00
|
|
|
void activated(const boo::SWindowCoord& coord)
|
2015-12-13 21:01:32 +00:00
|
|
|
{
|
2015-12-15 21:56:40 +00:00
|
|
|
m_splash.m_fileBrowser.m_view.reset(new Specter::FileBrowser(m_splash.rootView().viewRes(), m_splash));
|
|
|
|
m_splash.updateSize();
|
|
|
|
m_splash.m_openButt.mouseLeave(coord);
|
2015-12-13 21:01:32 +00:00
|
|
|
}
|
|
|
|
} m_openProjBind;
|
|
|
|
|
|
|
|
struct ExtractProjBinding : Specter::IButtonBinding
|
|
|
|
{
|
2015-12-15 21:56:40 +00:00
|
|
|
SplashScreen& m_splash;
|
|
|
|
ExtractProjBinding(SplashScreen& splash) : m_splash(splash) {}
|
2015-12-13 21:01:32 +00:00
|
|
|
const char* name() const {return "Extract Game";}
|
|
|
|
const char* help() const {return "Extracts game image as project at selected path";}
|
2015-12-14 04:56:25 +00:00
|
|
|
void activated(const boo::SWindowCoord& coord)
|
2015-12-13 21:01:32 +00:00
|
|
|
{
|
2015-12-15 21:56:40 +00:00
|
|
|
m_splash.m_fileBrowser.m_view.reset(new Specter::FileBrowser(m_splash.rootView().viewRes(), m_splash));
|
|
|
|
m_splash.updateSize();
|
|
|
|
m_splash.m_extractButt.mouseLeave(coord);
|
2015-12-13 21:01:32 +00:00
|
|
|
}
|
|
|
|
} m_extractProjBind;
|
|
|
|
|
2015-12-13 02:27:34 +00:00
|
|
|
public:
|
|
|
|
SplashScreen(ViewManager& vm, Specter::ViewResources& res);
|
|
|
|
void think();
|
2015-12-15 21:56:40 +00:00
|
|
|
void updateContentOpacity(float opacity);
|
2015-12-13 02:27:34 +00:00
|
|
|
|
2015-12-13 21:01:32 +00:00
|
|
|
void mouseDown(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey);
|
|
|
|
void mouseUp(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey);
|
|
|
|
void mouseMove(const boo::SWindowCoord&);
|
|
|
|
void mouseEnter(const boo::SWindowCoord&);
|
|
|
|
void mouseLeave(const boo::SWindowCoord&);
|
2015-12-20 19:20:07 +00:00
|
|
|
void scroll(const boo::SWindowCoord&, const boo::SScrollDelta&);
|
|
|
|
void touchDown(const boo::STouchCoord&, uintptr_t);
|
|
|
|
void touchUp(const boo::STouchCoord&, uintptr_t);
|
|
|
|
void touchMove(const boo::STouchCoord&, uintptr_t);
|
|
|
|
void charKeyDown(unsigned long, boo::EModifierKey, bool);
|
|
|
|
|
2015-12-13 02:27:34 +00:00
|
|
|
void resized(const boo::SWindowRect& root, const boo::SWindowRect& sub);
|
|
|
|
void draw(boo::IGraphicsCommandQueue* gfxQ);
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#endif // RUDE_SPLASH_SCREEN_HPP
|