diff --git a/Editor/CMakeLists.txt b/Editor/CMakeLists.txt index 530a23f5a..f6c2ed2ee 100644 --- a/Editor/CMakeLists.txt +++ b/Editor/CMakeLists.txt @@ -19,6 +19,7 @@ endif() atdna(atdna_Space.cpp Space.hpp) atdna(atdna_ResourceBrowser.cpp ResourceBrowser.hpp) atdna(atdna_ModelViewer.cpp ModelViewer.hpp) +atdna(atdna_EffectEditor.cpp EffectEditor.hpp) if(WIN32) set(PLAT_SRCS platforms/win/urde.rc) @@ -38,6 +39,7 @@ add_executable(urde WIN32 MACOSX_BUNDLE SplashScreen.hpp SplashScreen.cpp ResourceBrowser.hpp ResourceBrowser.cpp atdna_ResourceBrowser.cpp ModelViewer.hpp ModelViewer.cpp atdna_ModelViewer.cpp + EffectEditor.hpp EffectEditor.cpp atdna_EffectEditor.cpp ProjectManager.hpp ProjectManager.cpp ViewManager.hpp ViewManager.cpp Camera.hpp Camera.cpp) diff --git a/Editor/EffectEditor.cpp b/Editor/EffectEditor.cpp new file mode 100644 index 000000000..2f6e60a72 --- /dev/null +++ b/Editor/EffectEditor.cpp @@ -0,0 +1,6 @@ +#include "EffectEditor.hpp" + +namespace URDE +{ + +} diff --git a/Editor/EffectEditor.hpp b/Editor/EffectEditor.hpp new file mode 100644 index 000000000..159f6e86f --- /dev/null +++ b/Editor/EffectEditor.hpp @@ -0,0 +1,39 @@ +#ifndef URDE_EFFECT_EDITOR_HPP +#define URDE_EFFECT_EDITOR_HPP + +#include "Space.hpp" + +namespace URDE +{ + +class EffectEditor : public EditorSpace +{ + struct State : Space::State + { + DECL_YAML + String<-1> path; + } m_state; + const Space::State& spaceState() const {return m_state;} + + Specter::View* buildContentView(Specter::ViewResources& res) + { + return nullptr; + } + +public: + EffectEditor(ViewManager& vm, Space* parent) + : EditorSpace(vm, Class::EffectEditor, parent) {} + EffectEditor(ViewManager& vm, Space* parent, ConfigReader& r) + : EffectEditor(vm, parent) {m_state.read(r);} + EffectEditor(ViewManager& vm, Space* parent, const EffectEditor& other) + : EffectEditor(vm, parent) {m_state = other.m_state;} + + Space* copy(Space* parent) const + { + return new EffectEditor(m_vm, parent, *this); + } +}; + +} + +#endif // URDE_EFFECT_EDITOR_HPP diff --git a/Editor/ModelViewer.hpp b/Editor/ModelViewer.hpp index 82406e01e..37f0a1799 100644 --- a/Editor/ModelViewer.hpp +++ b/Editor/ModelViewer.hpp @@ -36,10 +36,6 @@ class ModelViewer : public Space { return nullptr; } - virtual Specter::View* buildSpaceView(Specter::ViewResources& res) - { - return nullptr; - } public: ModelViewer(ViewManager& vm, Space* parent) diff --git a/Editor/Space.cpp b/Editor/Space.cpp index 6788da6d9..67cd1b265 100644 --- a/Editor/Space.cpp +++ b/Editor/Space.cpp @@ -1,6 +1,7 @@ #include "Space.hpp" #include "ViewManager.hpp" #include "ResourceBrowser.hpp" +#include "EffectEditor.hpp" #include "icons/icons.hpp" namespace URDE @@ -19,9 +20,9 @@ Specter::View* Space::buildSpaceView(Specter::ViewResources& res) Specter::View* sview = buildContentView(res); m_spaceView->setContentView(sview); Specter::Toolbar& tb = *m_spaceView->toolbar(); - const std::string* classStr = SpaceMenuNode::lookupClassString(m_class); - Specter::Icon* classIcon = SpaceMenuNode::lookupClassIcon(m_class); - const Zeus::CColor* classColor = SpaceMenuNode::lookupClassColor(m_class); + const std::string* classStr = SpaceMenuNode::LookupClassString(m_class); + Specter::Icon* classIcon = SpaceMenuNode::LookupClassIcon(m_class); + const Zeus::CColor* classColor = SpaceMenuNode::LookupClassColor(m_class); m_spaceSelectButton.reset(new Specter::Button(res, tb, &m_spaceSelectBind, "", classIcon, Specter::Button::Style::Block, classColor?*classColor:Zeus::CColor::skWhite)); @@ -40,11 +41,12 @@ Specter::View* Space::buildSpaceView(Specter::ViewResources& res) std::vector Space::SpaceMenuNode::s_subNodeDats = { - {Class::ResourceBrowser, "resource_browser", "Resource Browser", GetIcon(SpaceIcon::ResourceBrowser), {0.0,1.0,0.0,1.0}} + {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}} }; std::string Space::SpaceMenuNode::s_text = "Space Types"; -void Space::SpaceMenuNode::initializeStrings(ViewManager& vm) +void Space::SpaceMenuNode::InitializeStrings(ViewManager& vm) { s_text = vm.translateOr("space_types", s_text.c_str()); for (SubNodeData& sn : s_subNodeDats) @@ -69,7 +71,7 @@ Specter::View* RootSpace::basisView() {return &m_vm.rootView();} Specter::View* SplitSpace::buildContentView(Specter::ViewResources& res) { int clearance = res.pixelFactor() * SPECTER_TOOLBAR_GAUGE; - m_splitView.reset(new Specter::SplitView(res, m_vm.rootView(), this, m_state.axis, + m_splitView.reset(new Specter::SplitView(res, *m_parent->basisView(), this, m_state.axis, m_state.split, clearance, clearance)); if (m_slots[0]) m_splitView->setContentView(0, m_slots[0]->buildSpaceView(res)); @@ -195,6 +197,8 @@ static Space* BuildNewSpace(ViewManager& vm, Space::Class cls, Space* parent, Re return new SplitSpace(vm, parent, r); case Class::ResourceBrowser: return new ResourceBrowser(vm, parent, r); + case Class::EffectEditor: + return new EffectEditor(vm, parent, r); default: break; } return nullptr; diff --git a/Editor/Space.hpp b/Editor/Space.hpp index a0797dd7a..83d3908fb 100644 --- a/Editor/Space.hpp +++ b/Editor/Space.hpp @@ -25,6 +25,7 @@ public: Space(const Space& other) = delete; Space& operator=(const Space& other) = delete; + /** Common encoded-enumeration for all space classes */ enum class Class { None, @@ -32,7 +33,8 @@ public: SplitSpace, TestSpace, ResourceBrowser, - ModelViewer + ModelViewer, + EffectEditor }; struct State : Athena::io::DNAYaml {Delete _d;}; @@ -80,22 +82,22 @@ public: size_t subNodeCount() const {return m_subNodes.size();} IMenuNode* subNode(size_t idx) {return &m_subNodes[idx];} - static void initializeStrings(ViewManager& vm); - static const std::string* lookupClassString(Class cls) + static void InitializeStrings(ViewManager& vm); + static const std::string* LookupClassString(Class cls) { for (const SubNodeData& sn : s_subNodeDats) if (sn.m_cls == cls) return &sn.m_text; return nullptr; } - static Specter::Icon* lookupClassIcon(Class cls) + static Specter::Icon* LookupClassIcon(Class cls) { for (SubNodeData& sn : s_subNodeDats) if (sn.m_cls == cls) return &sn.m_icon; return nullptr; } - static const Zeus::CColor* lookupClassColor(Class cls) + static const Zeus::CColor* LookupClassColor(Class cls) { for (SubNodeData& sn : s_subNodeDats) if (sn.m_cls == cls) @@ -343,6 +345,20 @@ public: Specter::View* basisView() {return m_splitView.get();} }; +class ViewerSpace : public Space +{ +public: + ViewerSpace(ViewManager& vm, Class cls, Space* parent) + : Space(vm, cls, parent) {} +}; + +class EditorSpace : public Space +{ +public: + EditorSpace(ViewManager& vm, Class cls, Space* parent) + : Space(vm, cls, parent) {} +}; + class TestSpace : public Space { std::unique_ptr m_button; diff --git a/Editor/ViewManager.cpp b/Editor/ViewManager.cpp index 7b2d7e930..b5cc274da 100644 --- a/Editor/ViewManager.cpp +++ b/Editor/ViewManager.cpp @@ -82,7 +82,7 @@ ViewManager::ViewManager(HECL::Runtime::FileStoreManager& fileMgr, HECL::CVarMan m_recentProjectsPath(HECL::SysFormat(_S("%s/recent_projects.txt"), fileMgr.getStoreRoot().c_str())), m_recentFilesPath(HECL::SysFormat(_S("%s/recent_files.txt"), fileMgr.getStoreRoot().c_str())) { - Space::SpaceMenuNode::initializeStrings(*this); + Space::SpaceMenuNode::InitializeStrings(*this); char path[2048]; HECL::Sstat theStat; diff --git a/libSpecter b/libSpecter index a4272a09a..2adc2f1c6 160000 --- a/libSpecter +++ b/libSpecter @@ -1 +1 @@ -Subproject commit a4272a09a349a1b9ff5ae921960f44470e31b47a +Subproject commit 2adc2f1c6c0b6770955fcf46ab1bba2ac091ac23