mirror of https://github.com/AxioDL/metaforce.git
InformationCenter stubs
This commit is contained in:
parent
5868a45f50
commit
9b762849e7
|
@ -20,6 +20,7 @@ atdna(atdna_Space.cpp Space.hpp)
|
|||
atdna(atdna_ResourceBrowser.cpp ResourceBrowser.hpp)
|
||||
atdna(atdna_ModelViewer.cpp ModelViewer.hpp)
|
||||
atdna(atdna_ParticleEditor.cpp ParticleEditor.hpp)
|
||||
atdna(atdna_InformationCenter.cpp InformationCenter.hpp)
|
||||
|
||||
if(WIN32)
|
||||
set(PLAT_SRCS platforms/win/urde.rc)
|
||||
|
@ -40,6 +41,7 @@ add_executable(urde WIN32 MACOSX_BUNDLE
|
|||
ResourceBrowser.hpp ResourceBrowser.cpp atdna_ResourceBrowser.cpp
|
||||
ModelViewer.hpp ModelViewer.cpp atdna_ModelViewer.cpp
|
||||
ParticleEditor.hpp ParticleEditor.cpp atdna_ParticleEditor.cpp
|
||||
InformationCenter.hpp InformationCenter.hpp atdna_InformationCenter.cpp
|
||||
ProjectManager.hpp ProjectManager.cpp
|
||||
ViewManager.hpp ViewManager.cpp
|
||||
Resource.hpp Resource.cpp
|
||||
|
|
|
@ -16,19 +16,14 @@ class Camera
|
|||
Zeus::CQuaternion m_orientation;
|
||||
public:
|
||||
|
||||
Camera(const Zeus::CVector3f& position, Zeus::EProjType projType=Zeus::EProjType::Perspective,
|
||||
const Zeus::CVector3f& up=Zeus::Math::kUpVec)
|
||||
: m_position(position)
|
||||
{
|
||||
}
|
||||
void setPosition(const Zeus::CVector3f& position) { m_position = position; }
|
||||
void setOrientation(const Zeus::CQuaternion& orientation) { m_orientation = orientation; }
|
||||
|
||||
const Zeus::CMatrix4f& projectionMatrix() const { return m_projection.getCachedMatrix(); }
|
||||
const Zeus::CProjection& projection() const { return m_projection; }
|
||||
|
||||
virtual void think()
|
||||
{
|
||||
|
||||
}
|
||||
{}
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
#include "InformationCenter.hpp"
|
||||
|
||||
namespace URDE
|
||||
{
|
||||
}
|
|
@ -0,0 +1,73 @@
|
|||
#ifndef INFORMATIONCENTER_HPP
|
||||
#define INFORMATIONCENTER_HPP
|
||||
|
||||
#include "Space.hpp"
|
||||
#include "ViewManager.hpp"
|
||||
|
||||
namespace URDE
|
||||
{
|
||||
class InformationCenter : public ViewerSpace
|
||||
{
|
||||
struct State : Space::State
|
||||
{
|
||||
DECL_YAML
|
||||
Value<bool> showLog;
|
||||
} m_state;
|
||||
|
||||
const Space::State& spaceState() const { return m_state; }
|
||||
|
||||
struct View : Specter::View
|
||||
{
|
||||
InformationCenter& m_ic;
|
||||
std::vector<HECL::SystemString> m_log;
|
||||
|
||||
View(InformationCenter& ic, Specter::ViewResources& res)
|
||||
: Specter::View(res, ic.m_vm.rootView()), m_ic(ic)
|
||||
{
|
||||
commitResources(res);
|
||||
}
|
||||
};
|
||||
|
||||
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()
|
||||
{
|
||||
}
|
||||
|
||||
virtual Specter::View* buildContentView(Specter::ViewResources& res)
|
||||
{
|
||||
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; }
|
||||
};
|
||||
}
|
||||
|
||||
#endif // INFORMATIONCENTER_HPP
|
|
@ -3,8 +3,7 @@
|
|||
|
||||
#include "Space.hpp"
|
||||
#include "ViewManager.hpp"
|
||||
#include "CVector3f.hpp"
|
||||
#include "CProjection.hpp"
|
||||
#include "Camera.hpp"
|
||||
|
||||
namespace URDE
|
||||
{
|
||||
|
@ -30,12 +29,14 @@ class ModelViewer : public ViewerSpace
|
|||
|
||||
struct View : Specter::View
|
||||
{
|
||||
ModelViewer& m_mv;
|
||||
View(ModelViewer& mv, Specter::ViewResources& res)
|
||||
: Specter::View(res, mv.m_vm.rootView()), m_mv(mv)
|
||||
{}
|
||||
};
|
||||
|
||||
virtual Specter::View* buildContentView(Specter::ViewResources& res)
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
Camera m_camera;
|
||||
std::unique_ptr<View> m_view;
|
||||
|
||||
public:
|
||||
ModelViewer(ViewManager& vm, Space* parent)
|
||||
|
@ -59,13 +60,22 @@ public:
|
|||
}
|
||||
|
||||
void reloadState()
|
||||
{}
|
||||
{
|
||||
m_camera.setPosition(m_state.cameraPosition);
|
||||
m_camera.setOrientation(m_state.cameraOrientation);
|
||||
}
|
||||
|
||||
Space* copy(Space *parent) const
|
||||
{
|
||||
return new ModelViewer(m_vm, parent, *this);
|
||||
}
|
||||
|
||||
virtual Specter::View* buildContentView(Specter::ViewResources& res)
|
||||
{
|
||||
m_view.reset(new View(*this, res));
|
||||
return m_view.get();
|
||||
}
|
||||
|
||||
bool usesToolbar() const { return true; }
|
||||
};
|
||||
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
#include "ViewManager.hpp"
|
||||
#include "ResourceBrowser.hpp"
|
||||
#include "ParticleEditor.hpp"
|
||||
#include "ModelViewer.hpp"
|
||||
#include "InformationCenter.hpp"
|
||||
#include "icons/icons.hpp"
|
||||
|
||||
namespace URDE
|
||||
|
@ -42,7 +44,9 @@ Specter::View* Space::buildSpaceView(Specter::ViewResources& res)
|
|||
std::vector<Space::SpaceMenuNode::SubNodeData> Space::SpaceMenuNode::s_subNodeDats =
|
||||
{
|
||||
{Class::ResourceBrowser, "resource_browser", "Resource Browser", GetIcon(SpaceIcon::ResourceBrowser), {0.0,1.0,0.0,1.0}},
|
||||
{Class::EffectEditor, "effect_editor", "Effect Editor", GetIcon(SpaceIcon::ParticleEditor), {1.0,0.5,0.0,1.0}}
|
||||
{Class::EffectEditor, "effect_editor", "Effect Editor", GetIcon(SpaceIcon::ParticleEditor), {1.0,0.5,0.0,1.0}},
|
||||
{Class::ModelViewer, "model_viewer", "Model Viewer", GetIcon(SpaceIcon::ModelViewer), {0.5, 0.5, 0.0, 1.0}},
|
||||
{Class::InformationCenter, "information_center", "Information Center", GetIcon(SpaceIcon::InformationCenter), {0.0, 1.0, 1.0, 1.0}}
|
||||
};
|
||||
std::string Space::SpaceMenuNode::s_text = "Space Types";
|
||||
|
||||
|
@ -199,6 +203,10 @@ static Space* BuildNewSpace(ViewManager& vm, Space::Class cls, Space* parent, Re
|
|||
return new ResourceBrowser(vm, parent, r);
|
||||
case Class::EffectEditor:
|
||||
return new EffectEditor(vm, parent, r);
|
||||
case Class::ModelViewer:
|
||||
return new ModelViewer(vm, parent, r);
|
||||
case Class::InformationCenter:
|
||||
return new InformationCenter(vm, parent, r);
|
||||
default: break;
|
||||
}
|
||||
return nullptr;
|
||||
|
|
|
@ -34,7 +34,8 @@ public:
|
|||
TestSpace,
|
||||
ResourceBrowser,
|
||||
ModelViewer,
|
||||
EffectEditor
|
||||
EffectEditor,
|
||||
InformationCenter
|
||||
};
|
||||
|
||||
struct State : Athena::io::DNAYaml<Athena::BigEndian> {Delete _d;};
|
||||
|
|
|
@ -45,6 +45,8 @@ Specter::Icon& GetIcon(SpaceIcon icon)
|
|||
return g_IconAtlas.getIcon(0, 2);
|
||||
case SpaceIcon::InformationCenter:
|
||||
return g_IconAtlas.getIcon(0, 3);
|
||||
case SpaceIcon::ModelViewer:
|
||||
return g_IconAtlas.getIcon(0, 4);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -13,6 +13,7 @@ enum class SpaceIcon
|
|||
ResourceBrowser,
|
||||
ParticleEditor,
|
||||
WorldEditor,
|
||||
ModelViewer,
|
||||
InformationCenter
|
||||
};
|
||||
Specter::Icon& GetIcon(SpaceIcon icon);
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 2adc2f1c6c0b6770955fcf46ab1bba2ac091ac23
|
||||
Subproject commit 8ab78bf19dcaa322700eb03a201942c43d38ac91
|
Loading…
Reference in New Issue