2018-10-07 03:42:33 +00:00
|
|
|
#pragma once
|
2016-02-02 08:31:05 +00:00
|
|
|
|
|
|
|
#include "Space.hpp"
|
|
|
|
#include "ViewManager.hpp"
|
|
|
|
|
2016-03-05 00:03:41 +00:00
|
|
|
namespace urde
|
2016-02-02 08:31:05 +00:00
|
|
|
{
|
|
|
|
class InformationCenter : public ViewerSpace
|
|
|
|
{
|
|
|
|
struct State : Space::State
|
|
|
|
{
|
2018-02-22 07:24:51 +00:00
|
|
|
AT_DECL_DNA_YAML
|
|
|
|
AT_DECL_DNAV
|
2016-02-02 08:31:05 +00:00
|
|
|
Value<bool> showLog;
|
|
|
|
} m_state;
|
|
|
|
|
|
|
|
const Space::State& spaceState() const { return m_state; }
|
|
|
|
|
2016-03-04 23:04:53 +00:00
|
|
|
struct View : specter::View
|
2016-02-02 08:31:05 +00:00
|
|
|
{
|
|
|
|
InformationCenter& m_ic;
|
2016-03-04 23:04:53 +00:00
|
|
|
std::vector<hecl::SystemString> m_log;
|
2016-02-02 08:31:05 +00:00
|
|
|
|
2016-03-04 23:04:53 +00:00
|
|
|
View(InformationCenter& ic, specter::ViewResources& res)
|
2016-03-30 19:16:01 +00:00
|
|
|
: specter::View(res, ic.m_vm.rootView()), m_ic(ic) {}
|
2016-02-02 08:31:05 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
std::unique_ptr<View> m_view;
|
|
|
|
|
|
|
|
public:
|
|
|
|
InformationCenter(ViewManager& vm, Space* parent)
|
|
|
|
: ViewerSpace(vm, Class::InformationCenter, parent)
|
|
|
|
{
|
|
|
|
reloadState();
|
|
|
|
}
|
|
|
|
|
|
|
|
InformationCenter(ViewManager& vm, Space* parent, const InformationCenter& other)
|
|
|
|
: InformationCenter(vm, parent)
|
|
|
|
{
|
|
|
|
m_state = other.m_state;
|
|
|
|
reloadState();
|
|
|
|
}
|
|
|
|
|
|
|
|
InformationCenter(ViewManager& vm, Space* parent, ConfigReader& r)
|
|
|
|
: InformationCenter(vm, parent)
|
|
|
|
{
|
|
|
|
m_state.read(r);
|
|
|
|
reloadState();
|
|
|
|
}
|
|
|
|
|
|
|
|
void reloadState()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2016-03-04 23:04:53 +00:00
|
|
|
virtual specter::View* buildContentView(specter::ViewResources& res)
|
2016-02-02 08:31:05 +00:00
|
|
|
{
|
|
|
|
m_view.reset(new View(*this, res));
|
|
|
|
return m_view.get();
|
|
|
|
}
|
|
|
|
|
|
|
|
Space* copy(Space *parent) const
|
|
|
|
{
|
|
|
|
return new InformationCenter(m_vm, parent, *this);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool usesToolbar() const { return true; }
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|