metaforce/Editor/ResourceOutliner.hpp

48 lines
1.0 KiB
C++
Raw Normal View History

#ifndef RUDE_RESOURCE_OUTLINER_HPP
#define RUDE_RESOURCE_OUTLINER_HPP
#include "Space.hpp"
2016-01-05 00:01:02 +00:00
#include "ViewManager.hpp"
namespace RUDE
{
class ResourceOutliner : public Space
{
2016-01-04 05:31:02 +00:00
struct State : Space::State
{
DECL_YAML
} m_state;
2016-01-05 00:01:02 +00:00
const Space::State& spaceState() const {return m_state;}
struct View : public Specter::View
{
ResourceOutliner& m_ro;
View(ResourceOutliner& ro, Specter::ViewResources& res)
: Specter::View(res, ro.m_vm.rootView()), m_ro(ro)
{
commitResources(res);
setBackground(Zeus::CColor::skBlue);
}
};
std::unique_ptr<View> m_view;
2016-01-04 05:31:02 +00:00
public:
ResourceOutliner(ViewManager& vm) : Space(vm, Class::ResourceOutliner) {}
2016-01-05 00:01:02 +00:00
ResourceOutliner(ViewManager& vm, ConfigReader& r)
2016-01-04 05:31:02 +00:00
: ResourceOutliner(vm)
{
m_state.read(r);
}
2016-01-05 00:01:02 +00:00
Specter::View* buildContentView(Specter::ViewResources& res)
{
m_view.reset(new View(*this, res));
return m_view.get();
}
};
}
#endif // RUDE_RESOURCE_OUTLINER_HPP