mirror of https://github.com/AxioDL/metaforce.git
Merge pull request #34 from lioncash/override
Editor: Use override where applicable
This commit is contained in:
commit
ee1d595655
|
@ -13,14 +13,14 @@ class GameMode : public ViewerSpace {
|
|||
Value<bool> showToolbar = true;
|
||||
} m_state;
|
||||
|
||||
const Space::State& spaceState() const { return m_state; }
|
||||
const Space::State& spaceState() const override { return m_state; }
|
||||
|
||||
struct View : specter::View {
|
||||
GameMode& m_gMode;
|
||||
|
||||
View(GameMode& gMode, specter::ViewResources& res) : specter::View(res, gMode.m_vm.rootView()), m_gMode(gMode) {}
|
||||
|
||||
void draw(boo::IGraphicsCommandQueue* gfxQ);
|
||||
void draw(boo::IGraphicsCommandQueue* gfxQ) override;
|
||||
};
|
||||
|
||||
std::unique_ptr<View> m_view;
|
||||
|
@ -38,17 +38,17 @@ public:
|
|||
reloadState();
|
||||
}
|
||||
|
||||
void reloadState() {}
|
||||
void reloadState() override {}
|
||||
|
||||
virtual specter::View* buildContentView(specter::ViewResources& res) {
|
||||
specter::View* buildContentView(specter::ViewResources& res) override {
|
||||
m_view.reset(new View(*this, res));
|
||||
return m_view.get();
|
||||
}
|
||||
|
||||
void think();
|
||||
void think() override;
|
||||
|
||||
Space* copy(Space* parent) const { return new GameMode(m_vm, parent, *this); }
|
||||
Space* copy(Space* parent) const override { return new GameMode(m_vm, parent, *this); }
|
||||
|
||||
bool usesToolbar() const { return m_state.showToolbar; }
|
||||
bool usesToolbar() const override { return m_state.showToolbar; }
|
||||
};
|
||||
} // namespace urde
|
||||
|
|
|
@ -10,7 +10,7 @@ class InformationCenter : public ViewerSpace {
|
|||
Value<bool> showLog;
|
||||
} m_state;
|
||||
|
||||
const Space::State& spaceState() const { return m_state; }
|
||||
const Space::State& spaceState() const override { return m_state; }
|
||||
|
||||
struct View : specter::View {
|
||||
InformationCenter& m_ic;
|
||||
|
@ -36,15 +36,15 @@ public:
|
|||
reloadState();
|
||||
}
|
||||
|
||||
void reloadState() {}
|
||||
void reloadState() override {}
|
||||
|
||||
virtual specter::View* buildContentView(specter::ViewResources& res) {
|
||||
specter::View* buildContentView(specter::ViewResources& res) override {
|
||||
m_view.reset(new View(*this, res));
|
||||
return m_view.get();
|
||||
}
|
||||
|
||||
Space* copy(Space* parent) const { return new InformationCenter(m_vm, parent, *this); }
|
||||
Space* copy(Space* parent) const override { return new InformationCenter(m_vm, parent, *this); }
|
||||
|
||||
bool usesToolbar() const { return true; }
|
||||
bool usesToolbar() const override { return true; }
|
||||
};
|
||||
} // namespace urde
|
||||
|
|
|
@ -16,7 +16,7 @@ class ModelViewer : public ViewerSpace {
|
|||
|
||||
} m_state;
|
||||
|
||||
const Space::State& spaceState() const { return m_state; }
|
||||
const Space::State& spaceState() const override { return m_state; }
|
||||
std::unique_ptr<urde::CLineRenderer> m_lineRenderer;
|
||||
struct View : specter::View {
|
||||
ModelViewer& m_mv;
|
||||
|
@ -24,7 +24,7 @@ class ModelViewer : public ViewerSpace {
|
|||
|
||||
View(ModelViewer& mv, specter::ViewResources& res) : specter::View(res, mv.m_vm.rootView()), m_mv(mv) {}
|
||||
|
||||
void resized(const boo::SWindowRect& root, const boo::SWindowRect& sub);
|
||||
void resized(const boo::SWindowRect& root, const boo::SWindowRect& sub) override;
|
||||
};
|
||||
|
||||
Camera m_camera;
|
||||
|
@ -46,19 +46,19 @@ public:
|
|||
reloadState();
|
||||
}
|
||||
|
||||
void reloadState() {
|
||||
void reloadState() override {
|
||||
m_camera.setPosition(m_state.cameraPosition);
|
||||
m_camera.setOrientation(m_state.cameraOrientation);
|
||||
}
|
||||
|
||||
Space* copy(Space* parent) const { return new ModelViewer(m_vm, parent, *this); }
|
||||
Space* copy(Space* parent) const override { return new ModelViewer(m_vm, parent, *this); }
|
||||
|
||||
virtual specter::View* buildContentView(specter::ViewResources& res) {
|
||||
specter::View* buildContentView(specter::ViewResources& res) override {
|
||||
m_view.reset(new View(*this, res));
|
||||
return m_view.get();
|
||||
}
|
||||
|
||||
bool usesToolbar() const { return true; }
|
||||
bool usesToolbar() const override { return true; }
|
||||
};
|
||||
|
||||
} // namespace urde
|
||||
|
|
|
@ -9,13 +9,13 @@ class EffectEditor : public EditorSpace {
|
|||
AT_DECL_DNA_YAMLV
|
||||
String<-1> path;
|
||||
} m_state;
|
||||
const Space::State& spaceState() const { return m_state; }
|
||||
const Space::State& spaceState() const override { return m_state; }
|
||||
|
||||
struct View : specter::View {
|
||||
View(specter::ViewResources& res, specter::View& parent) : specter::View(res, parent) {}
|
||||
};
|
||||
|
||||
specter::View* buildContentView(specter::ViewResources& res) { return nullptr; }
|
||||
specter::View* buildContentView(specter::ViewResources& res) override { return nullptr; }
|
||||
|
||||
public:
|
||||
EffectEditor(ViewManager& vm, Space* parent) : EditorSpace(vm, Class::EffectEditor, parent) {}
|
||||
|
@ -24,9 +24,9 @@ public:
|
|||
m_state = other.m_state;
|
||||
}
|
||||
|
||||
Space* copy(Space* parent) const { return new EffectEditor(m_vm, parent, *this); }
|
||||
Space* copy(Space* parent) const override { return new EffectEditor(m_vm, parent, *this); }
|
||||
|
||||
bool usesToolbar() const { return true; }
|
||||
bool usesToolbar() const override { return true; }
|
||||
};
|
||||
|
||||
} // namespace urde
|
||||
|
|
|
@ -18,8 +18,8 @@ class ProjectResourcePool : public CSimplePool {
|
|||
|
||||
public:
|
||||
ProjectResourcePool(IFactory& factory, ProjectManager& parent) : CSimplePool(factory), m_parent(parent) {}
|
||||
CToken GetObj(std::string_view);
|
||||
CToken GetObj(std::string_view, const CVParamTransfer&);
|
||||
CToken GetObj(std::string_view) override;
|
||||
CToken GetObj(std::string_view, const CVParamTransfer&) override;
|
||||
};
|
||||
|
||||
class ProjectManager {
|
||||
|
|
|
@ -16,12 +16,12 @@ class ResourceBrowser : public Space, public specter::IPathButtonsBinding {
|
|||
Value<SortColumn> sortColumn = SortColumn::Name;
|
||||
Value<specter::SortDirection> sortDir = specter::SortDirection::Ascending;
|
||||
} m_state;
|
||||
const Space::State& spaceState() const { return m_state; }
|
||||
const Space::State& spaceState() const override { return m_state; }
|
||||
|
||||
hecl::ProjectPath m_path;
|
||||
std::vector<hecl::SystemString> m_comps;
|
||||
|
||||
void pathButtonActivated(size_t idx);
|
||||
void pathButtonActivated(size_t idx) override;
|
||||
|
||||
struct ResListingDataBind : specter::ITableDataBinding, specter::ITableStateBinding {
|
||||
ResourceBrowser& m_rb;
|
||||
|
@ -42,10 +42,10 @@ class ResourceBrowser : public Space, public specter::IPathButtonsBinding {
|
|||
std::string m_projStr;
|
||||
std::string m_fileStr;
|
||||
|
||||
size_t columnCount() const { return 3; }
|
||||
size_t rowCount() const { return m_entries.size(); }
|
||||
size_t columnCount() const override { return 3; }
|
||||
size_t rowCount() const override { return m_entries.size(); }
|
||||
|
||||
std::string_view header(size_t cIdx) const {
|
||||
std::string_view header(size_t cIdx) const override {
|
||||
switch (cIdx) {
|
||||
case 0:
|
||||
return m_nameCol;
|
||||
|
@ -59,7 +59,7 @@ class ResourceBrowser : public Space, public specter::IPathButtonsBinding {
|
|||
return {};
|
||||
}
|
||||
|
||||
std::string_view cell(size_t cIdx, size_t rIdx) const {
|
||||
std::string_view cell(size_t cIdx, size_t rIdx) const override {
|
||||
switch (cIdx) {
|
||||
case 0:
|
||||
return m_entries.at(rIdx).m_name;
|
||||
|
@ -73,11 +73,11 @@ class ResourceBrowser : public Space, public specter::IPathButtonsBinding {
|
|||
return {};
|
||||
}
|
||||
|
||||
bool columnSplitResizeAllowed() const { return true; }
|
||||
bool columnSplitResizeAllowed() const override { return true; }
|
||||
|
||||
float getColumnSplit(size_t cIdx) const { return m_rb.m_state.columnSplits[cIdx]; }
|
||||
float getColumnSplit(size_t cIdx) const override { return m_rb.m_state.columnSplits[cIdx]; }
|
||||
|
||||
void setColumnSplit(size_t cIdx, float split) { m_rb.m_state.columnSplits[cIdx] = split; }
|
||||
void setColumnSplit(size_t cIdx, float split) override { m_rb.m_state.columnSplits[cIdx] = split; }
|
||||
|
||||
void updateListing(const hecl::DirectoryEnumerator& dEnum) {
|
||||
m_entries.clear();
|
||||
|
@ -106,22 +106,22 @@ class ResourceBrowser : public Space, public specter::IPathButtonsBinding {
|
|||
|
||||
bool m_needsUpdate = false;
|
||||
|
||||
specter::SortDirection getSort(size_t& cIdx) const {
|
||||
specter::SortDirection getSort(size_t& cIdx) const override {
|
||||
cIdx = size_t(m_rb.m_state.sortColumn);
|
||||
if (cIdx > 2)
|
||||
cIdx = 0;
|
||||
return m_rb.m_state.sortDir;
|
||||
}
|
||||
|
||||
void setSort(size_t cIdx, specter::SortDirection dir) {
|
||||
void setSort(size_t cIdx, specter::SortDirection dir) override {
|
||||
m_rb.m_state.sortDir = dir;
|
||||
m_rb.m_state.sortColumn = State::SortColumn(cIdx);
|
||||
m_needsUpdate = true;
|
||||
}
|
||||
|
||||
void setSelectedRow(size_t rIdx) {}
|
||||
void setSelectedRow(size_t rIdx) override {}
|
||||
|
||||
void rowActivated(size_t rIdx) {}
|
||||
void rowActivated(size_t rIdx) override {}
|
||||
|
||||
ResListingDataBind(ResourceBrowser& rb, const specter::IViewManager& vm) : m_rb(rb) {
|
||||
m_nameCol = vm.translate<locale::name>();
|
||||
|
@ -142,13 +142,13 @@ class ResourceBrowser : public Space, public specter::IPathButtonsBinding {
|
|||
m_resListing.m_view.reset(new specter::Table(res, *this, &ro.m_resListingBind, &ro.m_resListingBind, 3));
|
||||
}
|
||||
|
||||
void mouseDown(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey);
|
||||
void mouseUp(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey);
|
||||
void mouseMove(const boo::SWindowCoord&);
|
||||
void mouseLeave(const boo::SWindowCoord&);
|
||||
void mouseDown(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey) override;
|
||||
void mouseUp(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey) override;
|
||||
void mouseMove(const boo::SWindowCoord&) override;
|
||||
void mouseLeave(const boo::SWindowCoord&) override;
|
||||
|
||||
void resized(const boo::SWindowRect& root, const boo::SWindowRect& sub);
|
||||
void draw(boo::IGraphicsCommandQueue* gfxQ);
|
||||
void resized(const boo::SWindowRect& root, const boo::SWindowRect& sub) override;
|
||||
void draw(boo::IGraphicsCommandQueue* gfxQ) override;
|
||||
};
|
||||
std::unique_ptr<View> m_view;
|
||||
|
||||
|
@ -168,7 +168,7 @@ public:
|
|||
reloadState();
|
||||
}
|
||||
|
||||
void reloadState() {
|
||||
void reloadState() override {
|
||||
hecl::ProjectPath pp(*m_vm.project(), m_state.path);
|
||||
if (m_state.path.empty() || pp.isNone()) {
|
||||
m_state.path = m_vm.project()->getProjectWorkingPath().getRelativePathUTF8();
|
||||
|
@ -177,29 +177,29 @@ public:
|
|||
navigateToPath(pp);
|
||||
}
|
||||
|
||||
void think() {
|
||||
void think() override {
|
||||
if (m_resListingBind.m_needsUpdate)
|
||||
reloadState();
|
||||
}
|
||||
|
||||
bool navigateToPath(const hecl::ProjectPath& path);
|
||||
|
||||
Space* copy(Space* parent) const { return new ResourceBrowser(m_vm, parent, *this); }
|
||||
Space* copy(Space* parent) const override { return new ResourceBrowser(m_vm, parent, *this); }
|
||||
|
||||
void buildToolbarView(specter::ViewResources& res, specter::Toolbar& tb) {
|
||||
void buildToolbarView(specter::ViewResources& res, specter::Toolbar& tb) override {
|
||||
m_pathButtons.reset(new specter::PathButtons(res, tb, *this, true));
|
||||
tb.push_back(m_pathButtons.get(), 1);
|
||||
reloadState();
|
||||
}
|
||||
|
||||
specter::View* buildContentView(specter::ViewResources& res) {
|
||||
specter::View* buildContentView(specter::ViewResources& res) override {
|
||||
m_view.reset(new View(*this, res));
|
||||
return m_view.get();
|
||||
}
|
||||
|
||||
bool usesToolbar() const { return true; }
|
||||
bool usesToolbar() const override { return true; }
|
||||
|
||||
unsigned toolbarUnits() const { return 2; }
|
||||
unsigned toolbarUnits() const override { return 2; }
|
||||
};
|
||||
|
||||
} // namespace urde
|
||||
|
|
|
@ -54,8 +54,8 @@ public:
|
|||
std::string m_text;
|
||||
specter::Icon& m_icon;
|
||||
zeus::CColor m_color;
|
||||
const std::string* text() const { return &m_text; }
|
||||
void activated(const boo::SWindowCoord& coord) {}
|
||||
const std::string* text() const override { return &m_text; }
|
||||
void activated(const boo::SWindowCoord& coord) override {}
|
||||
|
||||
SubNodeData(Class cls, const char* text, specter::Icon& icon, const zeus::CColor& color)
|
||||
: m_cls(cls), m_text(text), m_icon(icon), m_color(color) {}
|
||||
|
@ -65,8 +65,8 @@ public:
|
|||
struct SubNode final : specter::IMenuNode {
|
||||
Space& m_space;
|
||||
const SubNodeData& m_data;
|
||||
const std::string* text() const { return &m_data.m_text; }
|
||||
void activated(const boo::SWindowCoord& coord);
|
||||
const std::string* text() const override { return &m_data.m_text; }
|
||||
void activated(const boo::SWindowCoord& coord) override;
|
||||
|
||||
SubNode(Space& space, const SubNodeData& data) : m_space(space), m_data(data) {}
|
||||
};
|
||||
|
@ -79,10 +79,10 @@ public:
|
|||
}
|
||||
|
||||
static std::string s_text;
|
||||
const std::string* text() const { return &s_text; }
|
||||
const std::string* text() const override { return &s_text; }
|
||||
|
||||
size_t subNodeCount() const { return m_subNodes.size(); }
|
||||
IMenuNode* subNode(size_t idx) { return &m_subNodes[idx]; }
|
||||
size_t subNodeCount() const override { return m_subNodes.size(); }
|
||||
IMenuNode* subNode(size_t idx) override { return &m_subNodes[idx]; }
|
||||
|
||||
static void InitializeStrings(ViewManager& vm);
|
||||
static const std::string* LookupClassString(Class cls) {
|
||||
|
@ -107,10 +107,10 @@ public:
|
|||
|
||||
struct SpaceSelectBind : specter::IButtonBinding {
|
||||
Space& m_space;
|
||||
std::string_view name(const specter::Control* control) const { return SpaceMenuNode::s_text; }
|
||||
std::string_view name(const specter::Control* control) const override { return SpaceMenuNode::s_text; }
|
||||
|
||||
MenuStyle menuStyle(const specter::Button* button) const { return MenuStyle::Primary; }
|
||||
std::unique_ptr<specter::View> buildMenu(const specter::Button* button);
|
||||
MenuStyle menuStyle(const specter::Button* button) const override { return MenuStyle::Primary; }
|
||||
std::unique_ptr<specter::View> buildMenu(const specter::Button* button) override;
|
||||
|
||||
SpaceSelectBind(Space& space) : m_space(space) {}
|
||||
} m_spaceSelectBind;
|
||||
|
@ -143,9 +143,9 @@ public:
|
|||
virtual void think() {}
|
||||
|
||||
virtual Space* copy(Space* parent) const = 0;
|
||||
bool spaceSplitAllowed() const { return true; }
|
||||
bool spaceSplitAllowed() const override { return true; }
|
||||
|
||||
specter::ISplitSpaceController* spaceSplit(specter::SplitView::Axis axis, int thisSlot);
|
||||
specter::ISplitSpaceController* spaceSplit(specter::SplitView::Axis axis, int thisSlot) override;
|
||||
virtual std::unique_ptr<Space> exchangeSpaceSplitJoin(Space* removeSpace, std::unique_ptr<Space>&& keepSpace) {
|
||||
return std::unique_ptr<Space>();
|
||||
}
|
||||
|
@ -159,8 +159,9 @@ class RootSpace : public Space {
|
|||
friend class ViewManager;
|
||||
std::unique_ptr<specter::RootView> m_rootView;
|
||||
std::unique_ptr<Space> m_spaceTree;
|
||||
|
||||
struct State : Space::State{AT_DECL_DNA_YAMLV } m_state;
|
||||
const Space::State& spaceState() const { return m_state; }
|
||||
const Space::State& spaceState() const override { return m_state; }
|
||||
|
||||
public:
|
||||
RootSpace(ViewManager& vm) : Space(vm, Class::RootSpace, nullptr) {}
|
||||
|
@ -170,12 +171,12 @@ public:
|
|||
m_spaceTree.reset(NewSpaceFromConfigStream(vm, this, r));
|
||||
}
|
||||
|
||||
void think() {
|
||||
void think() override {
|
||||
if (m_spaceTree)
|
||||
m_spaceTree->think();
|
||||
}
|
||||
|
||||
void saveState(athena::io::IStreamWriter& w) const {
|
||||
void saveState(athena::io::IStreamWriter& w) const override {
|
||||
w.writeUint32Big(atUint32(m_class));
|
||||
m_state.write(w);
|
||||
|
||||
|
@ -185,7 +186,7 @@ public:
|
|||
w.writeUint32Big(0);
|
||||
}
|
||||
|
||||
void saveState(athena::io::YAMLDocWriter& w) const {
|
||||
void saveState(athena::io::YAMLDocWriter& w) const override {
|
||||
w.writeUint32("class", atUint32(m_class));
|
||||
m_state.write(w);
|
||||
|
||||
|
@ -202,15 +203,15 @@ public:
|
|||
m_spaceTree->m_parent = this;
|
||||
}
|
||||
|
||||
Space* copy(Space* parent) const { return nullptr; }
|
||||
bool spaceSplitAllowed() const { return false; }
|
||||
Space* copy(Space* parent) const override { return nullptr; }
|
||||
bool spaceSplitAllowed() const override { return false; }
|
||||
|
||||
specter::View* buildSpaceView(specter::ViewResources& res);
|
||||
specter::View* buildContentView(specter::ViewResources& res) { return m_spaceTree->buildSpaceView(res); }
|
||||
specter::View* buildSpaceView(specter::ViewResources& res) override;
|
||||
specter::View* buildContentView(specter::ViewResources& res) override { return m_spaceTree->buildSpaceView(res); }
|
||||
|
||||
std::unique_ptr<Space> exchangeSpaceSplitJoin(Space* removeSpace, std::unique_ptr<Space>&& keepSpace);
|
||||
std::unique_ptr<Space> exchangeSpaceSplitJoin(Space* removeSpace, std::unique_ptr<Space>&& keepSpace) override;
|
||||
|
||||
specter::View* basisView();
|
||||
specter::View* basisView() override;
|
||||
};
|
||||
|
||||
class SplitSpace : public Space, public specter::ISplitSpaceController {
|
||||
|
@ -222,7 +223,7 @@ class SplitSpace : public Space, public specter::ISplitSpaceController {
|
|||
Value<specter::SplitView::Axis> axis = specter::SplitView::Axis::Horizontal;
|
||||
Value<float> split = 0.5;
|
||||
} m_state;
|
||||
const Space::State& spaceState() const { return m_state; }
|
||||
const Space::State& spaceState() const override { return m_state; }
|
||||
|
||||
public:
|
||||
SplitSpace(ViewManager& vm, Space* parent, specter::SplitView::Axis axis) : Space(vm, Class::SplitSpace, parent) {
|
||||
|
@ -239,7 +240,7 @@ public:
|
|||
reloadState();
|
||||
}
|
||||
|
||||
void reloadState() {
|
||||
void reloadState() override {
|
||||
m_state.split = std::min(1.f, std::max(0.f, m_state.split));
|
||||
if (m_state.axis != specter::SplitView::Axis::Horizontal && m_state.axis != specter::SplitView::Axis::Vertical)
|
||||
m_state.axis = specter::SplitView::Axis::Horizontal;
|
||||
|
@ -249,14 +250,14 @@ public:
|
|||
}
|
||||
}
|
||||
|
||||
void think() {
|
||||
void think() override {
|
||||
if (m_slots[0])
|
||||
m_slots[0]->think();
|
||||
if (m_slots[1])
|
||||
m_slots[1]->think();
|
||||
}
|
||||
|
||||
void saveState(athena::io::IStreamWriter& w) const {
|
||||
void saveState(athena::io::IStreamWriter& w) const override {
|
||||
w.writeUint32Big(atUint32(m_class));
|
||||
m_state.write(w);
|
||||
|
||||
|
@ -271,7 +272,7 @@ public:
|
|||
w.writeUint32Big(0);
|
||||
}
|
||||
|
||||
void saveState(athena::io::YAMLDocWriter& w) const {
|
||||
void saveState(athena::io::YAMLDocWriter& w) const override {
|
||||
w.writeUint32("class", atUint32(m_class));
|
||||
m_state.write(w);
|
||||
|
||||
|
@ -292,11 +293,11 @@ public:
|
|||
|
||||
void setChildSlot(unsigned slot, std::unique_ptr<Space>&& space);
|
||||
|
||||
specter::View* buildSpaceView(specter::ViewResources& res) { return buildContentView(res); }
|
||||
specter::View* buildContentView(specter::ViewResources& res);
|
||||
specter::View* buildSpaceView(specter::ViewResources& res) override { return buildContentView(res); }
|
||||
specter::View* buildContentView(specter::ViewResources& res) override;
|
||||
|
||||
Space* copy(Space* parent) const { return nullptr; }
|
||||
bool spaceSplitAllowed() const { return false; }
|
||||
Space* copy(Space* parent) const override { return nullptr; }
|
||||
bool spaceSplitAllowed() const override { return false; }
|
||||
|
||||
ISpaceController* spaceJoin(int keepSlot) {
|
||||
if (m_parent) {
|
||||
|
@ -307,11 +308,11 @@ public:
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
std::unique_ptr<Space> exchangeSpaceSplitJoin(Space* removeSpace, std::unique_ptr<Space>&& keepSpace);
|
||||
std::unique_ptr<Space> exchangeSpaceSplitJoin(Space* removeSpace, std::unique_ptr<Space>&& keepSpace) override;
|
||||
|
||||
specter::SplitView* splitView() { return m_splitView.get(); }
|
||||
void updateSplit(float split) { m_state.split = split; }
|
||||
void joinViews(specter::SplitView* thisSplit, int thisSlot, specter::SplitView* otherSplit, int otherSlot);
|
||||
specter::SplitView* splitView() override { return m_splitView.get(); }
|
||||
void updateSplit(float split) override { m_state.split = split; }
|
||||
void joinViews(specter::SplitView* thisSplit, int thisSlot, specter::SplitView* otherSplit, int otherSlot) override;
|
||||
|
||||
void setAxis(specter::SplitView::Axis axis) {
|
||||
m_state.axis = axis;
|
||||
|
@ -321,7 +322,7 @@ public:
|
|||
specter::SplitView::Axis axis() const { return m_state.axis; }
|
||||
float split() const { return m_state.split; }
|
||||
|
||||
specter::View* basisView() { return m_splitView.get(); }
|
||||
specter::View* basisView() override { return m_splitView.get(); }
|
||||
};
|
||||
inline SplitSpace* Space::castToSplitSpace() {
|
||||
return cls() == Class::SplitSpace ? static_cast<SplitSpace*>(this) : nullptr;
|
||||
|
@ -356,16 +357,21 @@ public:
|
|||
specter::IButtonBinding* binding)
|
||||
: Space(vm, Class::TestSpace, parent), m_contentStr(content), m_buttonStr(button), m_binding(binding) {}
|
||||
|
||||
<<<<<<< HEAD
|
||||
struct State : Space::State{AT_DECL_DNA_YAMLV} m_state;
|
||||
const Space::State& spaceState() const { return m_state; }
|
||||
=======
|
||||
struct State : Space::State{AT_DECL_DNA_YAML AT_DECL_DNAV} m_state;
|
||||
const Space::State& spaceState() const override { return m_state; }
|
||||
>>>>>>> Editor: Use override where applicable
|
||||
|
||||
bool usesToolbar() const { return true; }
|
||||
void buildToolbarView(specter::ViewResources& res, specter::Toolbar& tb) {
|
||||
bool usesToolbar() const override { return true; }
|
||||
void buildToolbarView(specter::ViewResources& res, specter::Toolbar& tb) override {
|
||||
m_button.reset(new specter::Button(res, tb, m_binding, m_buttonStr));
|
||||
tb.push_back(m_button.get(), 0);
|
||||
}
|
||||
|
||||
specter::View* buildContentView(specter::ViewResources& res) {
|
||||
specter::View* buildContentView(specter::ViewResources& res) override {
|
||||
m_textView.reset(new specter::MultiLineTextView(res, *m_spaceView, res.m_heading14));
|
||||
m_textView->setBackground(res.themeData().viewportBackground());
|
||||
m_textView->typesetGlyphs(m_contentStr, res.themeData().uiText());
|
||||
|
|
|
@ -37,9 +37,11 @@ class SplashScreen : public specter::ModalWindow {
|
|||
SplashScreen& m_splash;
|
||||
hecl::SystemString m_deferPath;
|
||||
NewProjBinding(SplashScreen& splash) : m_splash(splash) {}
|
||||
std::string_view name(const specter::Control* control) const { return m_splash.m_newString.c_str(); }
|
||||
std::string_view help(const specter::Control* control) const { return "Creates an empty project at selected path"; }
|
||||
void activated(const specter::Button* button, const boo::SWindowCoord& coord) {
|
||||
std::string_view name(const specter::Control* control) const override { return m_splash.m_newString.c_str(); }
|
||||
std::string_view help(const specter::Control* control) const override {
|
||||
return "Creates an empty project at selected path";
|
||||
}
|
||||
void activated(const specter::Button* button, const boo::SWindowCoord& coord) override {
|
||||
m_splash.m_fileBrowser.m_view.reset(new specter::FileBrowser(
|
||||
m_splash.rootView().viewRes(), m_splash, m_splash.m_newString, specter::FileBrowser::Type::NewHECLProject,
|
||||
[&](bool ok, hecl::SystemStringView path) {
|
||||
|
@ -55,11 +57,11 @@ class SplashScreen : public specter::ModalWindow {
|
|||
SplashScreen& m_splash;
|
||||
hecl::SystemString m_deferPath;
|
||||
OpenProjBinding(SplashScreen& splash) : m_splash(splash), m_openRecentMenuRoot(*this) {}
|
||||
std::string_view name(const specter::Control* control) const { return m_splash.m_openString.c_str(); }
|
||||
std::string_view help(const specter::Control* control) const {
|
||||
std::string_view name(const specter::Control* control) const override { return m_splash.m_openString.c_str(); }
|
||||
std::string_view help(const specter::Control* control) const override {
|
||||
return "Opens an existing project at selected path";
|
||||
}
|
||||
void activated(const specter::Button* button, const boo::SWindowCoord& coord) {
|
||||
void activated(const specter::Button* button, const boo::SWindowCoord& coord) override {
|
||||
m_splash.m_fileBrowser.m_view.reset(new specter::FileBrowser(
|
||||
m_splash.rootView().viewRes(), m_splash, m_splash.m_openString, specter::FileBrowser::Type::OpenHECLProject,
|
||||
[&](bool ok, hecl::SystemStringView path) {
|
||||
|
@ -75,7 +77,7 @@ class SplashScreen : public specter::ModalWindow {
|
|||
OpenRecentMenuRoot(OpenProjBinding& openProjBind) : m_openProjBind(openProjBind) {}
|
||||
|
||||
std::string m_text;
|
||||
const std::string* text() const { return &m_text; }
|
||||
const std::string* text() const override { return &m_text; }
|
||||
|
||||
struct OpenRecentMenuItem final : specter::IMenuNode {
|
||||
OpenRecentMenuRoot& m_parent;
|
||||
|
@ -83,8 +85,8 @@ class SplashScreen : public specter::ModalWindow {
|
|||
hecl::SystemString m_path;
|
||||
std::string m_text;
|
||||
|
||||
const std::string* text() const { return &m_text; }
|
||||
void activated(const boo::SWindowCoord& coord) {
|
||||
const std::string* text() const override { return &m_text; }
|
||||
void activated(const boo::SWindowCoord& coord) override {
|
||||
m_parent.m_openProjBind.m_deferPath = m_path;
|
||||
m_parent.m_openProjBind.m_splash.m_openButt.m_view->closeMenu(coord);
|
||||
}
|
||||
|
@ -98,8 +100,8 @@ class SplashScreen : public specter::ModalWindow {
|
|||
};
|
||||
std::vector<OpenRecentMenuItem> m_items;
|
||||
|
||||
size_t subNodeCount() const { return m_items.size(); }
|
||||
specter::IMenuNode* subNode(size_t idx) { return &m_items[idx]; }
|
||||
size_t subNodeCount() const override { return m_items.size(); }
|
||||
specter::IMenuNode* subNode(size_t idx) override { return &m_items[idx]; }
|
||||
|
||||
void buildNodes(const std::vector<hecl::SystemString>* recentProjects) {
|
||||
m_items.clear();
|
||||
|
@ -111,8 +113,8 @@ class SplashScreen : public specter::ModalWindow {
|
|||
}
|
||||
} m_openRecentMenuRoot;
|
||||
|
||||
MenuStyle menuStyle(const specter::Button* button) const { return MenuStyle::Auxiliary; }
|
||||
std::unique_ptr<View> buildMenu(const specter::Button* button) {
|
||||
MenuStyle menuStyle(const specter::Button* button) const override { return MenuStyle::Auxiliary; }
|
||||
std::unique_ptr<View> buildMenu(const specter::Button* button) override {
|
||||
m_openRecentMenuRoot.buildNodes(m_splash.m_vm.recentProjects());
|
||||
return std::unique_ptr<View>(new specter::Menu(m_splash.rootView().viewRes(), m_splash, &m_openRecentMenuRoot));
|
||||
}
|
||||
|
@ -122,11 +124,11 @@ class SplashScreen : public specter::ModalWindow {
|
|||
SplashScreen& m_splash;
|
||||
hecl::SystemString m_deferPath;
|
||||
ExtractProjBinding(SplashScreen& splash) : m_splash(splash) {}
|
||||
std::string_view name(const specter::Control* control) const { return m_splash.m_extractString.c_str(); }
|
||||
std::string_view help(const specter::Control* control) const {
|
||||
std::string_view name(const specter::Control* control) const override { return m_splash.m_extractString.c_str(); }
|
||||
std::string_view help(const specter::Control* control) const override {
|
||||
return "Extracts game image as project at selected path";
|
||||
}
|
||||
void activated(const specter::Button* button, const boo::SWindowCoord& coord) {
|
||||
void activated(const specter::Button* button, const boo::SWindowCoord& coord) override {
|
||||
m_splash.m_fileBrowser.m_view.reset(
|
||||
new specter::FileBrowser(m_splash.rootView().viewRes(), m_splash, m_splash.m_extractString,
|
||||
specter::FileBrowser::Type::OpenFile, [&](bool ok, hecl::SystemStringView path) {
|
||||
|
@ -140,23 +142,23 @@ class SplashScreen : public specter::ModalWindow {
|
|||
|
||||
public:
|
||||
SplashScreen(ViewManager& vm, specter::ViewResources& res);
|
||||
void think();
|
||||
void updateContentOpacity(float opacity);
|
||||
void think() override;
|
||||
void updateContentOpacity(float opacity) override;
|
||||
|
||||
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&);
|
||||
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);
|
||||
void specialKeyDown(boo::ESpecialKey, boo::EModifierKey, bool);
|
||||
void mouseDown(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey) override;
|
||||
void mouseUp(const boo::SWindowCoord&, boo::EMouseButton, boo::EModifierKey) override;
|
||||
void mouseMove(const boo::SWindowCoord&) override;
|
||||
void mouseEnter(const boo::SWindowCoord&) override;
|
||||
void mouseLeave(const boo::SWindowCoord&) override;
|
||||
void scroll(const boo::SWindowCoord&, const boo::SScrollDelta&) override;
|
||||
void touchDown(const boo::STouchCoord&, uintptr_t) override;
|
||||
void touchUp(const boo::STouchCoord&, uintptr_t) override;
|
||||
void touchMove(const boo::STouchCoord&, uintptr_t) override;
|
||||
void charKeyDown(unsigned long, boo::EModifierKey, bool) override;
|
||||
void specialKeyDown(boo::ESpecialKey, boo::EModifierKey, bool) override;
|
||||
|
||||
void resized(const boo::SWindowRect& root, const boo::SWindowRect& sub);
|
||||
void draw(boo::IGraphicsCommandQueue* gfxQ);
|
||||
void resized(const boo::SWindowRect& root, const boo::SWindowRect& sub) override;
|
||||
void draw(boo::IGraphicsCommandQueue* gfxQ) override;
|
||||
};
|
||||
|
||||
} // namespace urde
|
||||
|
|
|
@ -60,47 +60,47 @@ class ViewManager final : public specter::IViewManager {
|
|||
|
||||
public:
|
||||
TestGameView(ViewManager& vm, specter::ViewResources& res, specter::View& parent) : View(res, parent), m_vm(vm) {}
|
||||
void resized(const boo::SWindowRect& root, const boo::SWindowRect& sub);
|
||||
void draw(boo::IGraphicsCommandQueue* gfxQ);
|
||||
void think();
|
||||
void resized(const boo::SWindowRect& root, const boo::SWindowRect& sub) override;
|
||||
void draw(boo::IGraphicsCommandQueue* gfxQ) override;
|
||||
void think() override;
|
||||
|
||||
void mouseDown(const boo::SWindowCoord& coord, boo::EMouseButton button, boo::EModifierKey mkey) {
|
||||
void mouseDown(const boo::SWindowCoord& coord, boo::EMouseButton button, boo::EModifierKey mkey) override {
|
||||
if (MP1::CMain* m = m_vm.m_projManager.gameMain())
|
||||
if (MP1::CGameArchitectureSupport* as = m->GetArchSupport())
|
||||
as->mouseDown(coord, button, mkey);
|
||||
}
|
||||
|
||||
void mouseUp(const boo::SWindowCoord& coord, boo::EMouseButton button, boo::EModifierKey mkey) {
|
||||
void mouseUp(const boo::SWindowCoord& coord, boo::EMouseButton button, boo::EModifierKey mkey) override {
|
||||
if (MP1::CMain* m = m_vm.m_projManager.gameMain())
|
||||
if (MP1::CGameArchitectureSupport* as = m->GetArchSupport())
|
||||
as->mouseUp(coord, button, mkey);
|
||||
}
|
||||
|
||||
void mouseMove(const boo::SWindowCoord& coord) {
|
||||
void mouseMove(const boo::SWindowCoord& coord) override {
|
||||
if (MP1::CMain* m = m_vm.m_projManager.gameMain())
|
||||
if (MP1::CGameArchitectureSupport* as = m->GetArchSupport())
|
||||
as->mouseMove(coord);
|
||||
}
|
||||
|
||||
void scroll(const boo::SWindowCoord& coord, const boo::SScrollDelta& sd) {
|
||||
void scroll(const boo::SWindowCoord& coord, const boo::SScrollDelta& sd) override {
|
||||
if (MP1::CMain* m = m_vm.m_projManager.gameMain())
|
||||
if (MP1::CGameArchitectureSupport* as = m->GetArchSupport())
|
||||
as->scroll(coord, sd);
|
||||
}
|
||||
|
||||
void charKeyDown(unsigned long cc, boo::EModifierKey mkey, bool repeat) {
|
||||
void charKeyDown(unsigned long cc, boo::EModifierKey mkey, bool repeat) override {
|
||||
if (MP1::CMain* m = m_vm.m_projManager.gameMain())
|
||||
if (MP1::CGameArchitectureSupport* as = m->GetArchSupport())
|
||||
as->charKeyDown(cc, mkey, repeat);
|
||||
}
|
||||
|
||||
void charKeyUp(unsigned long cc, boo::EModifierKey mkey) {
|
||||
void charKeyUp(unsigned long cc, boo::EModifierKey mkey) override {
|
||||
if (MP1::CMain* m = m_vm.m_projManager.gameMain())
|
||||
if (MP1::CGameArchitectureSupport* as = m->GetArchSupport())
|
||||
as->charKeyUp(cc, mkey);
|
||||
}
|
||||
|
||||
void specialKeyDown(boo::ESpecialKey skey, boo::EModifierKey mkey, bool repeat) {
|
||||
void specialKeyDown(boo::ESpecialKey skey, boo::EModifierKey mkey, bool repeat) override {
|
||||
if (MP1::CMain* m = m_vm.m_projManager.gameMain())
|
||||
if (MP1::CGameArchitectureSupport* as = m->GetArchSupport())
|
||||
as->specialKeyDown(skey, mkey, repeat);
|
||||
|
@ -109,7 +109,7 @@ class ViewManager final : public specter::IViewManager {
|
|||
m_vm.m_skipWait = true;
|
||||
}
|
||||
|
||||
void specialKeyUp(boo::ESpecialKey skey, boo::EModifierKey mkey) {
|
||||
void specialKeyUp(boo::ESpecialKey skey, boo::EModifierKey mkey) override {
|
||||
if (MP1::CMain* m = m_vm.m_projManager.gameMain())
|
||||
if (MP1::CGameArchitectureSupport* as = m->GetArchSupport())
|
||||
as->specialKeyUp(skey, mkey);
|
||||
|
@ -166,21 +166,21 @@ public:
|
|||
|
||||
ProjectManager& projectManager() { return m_projManager; }
|
||||
hecl::Database::Project* project() { return m_projManager.project(); }
|
||||
locale::ELocale getTranslatorLocale() const { return m_locale; }
|
||||
locale::ELocale getTranslatorLocale() const override { return m_locale; }
|
||||
|
||||
void deferSpaceSplit(specter::ISpaceController* split, specter::SplitView::Axis axis, int thisSlot,
|
||||
const boo::SWindowCoord& coord) {
|
||||
const boo::SWindowCoord& coord) override {
|
||||
m_deferSplit = static_cast<Space*>(split);
|
||||
m_deferSplitAxis = axis;
|
||||
m_deferSplitThisSlot = thisSlot;
|
||||
m_deferSplitCoord = coord;
|
||||
}
|
||||
|
||||
const std::vector<hecl::SystemString>* recentProjects() const { return &m_recentProjects; }
|
||||
void pushRecentProject(hecl::SystemStringView path);
|
||||
const std::vector<hecl::SystemString>* recentProjects() const override { return &m_recentProjects; }
|
||||
void pushRecentProject(hecl::SystemStringView path) override;
|
||||
|
||||
const std::vector<hecl::SystemString>* recentFiles() const { return &m_recentFiles; }
|
||||
void pushRecentFile(hecl::SystemStringView path);
|
||||
const std::vector<hecl::SystemString>* recentFiles() const override { return &m_recentFiles; }
|
||||
void pushRecentFile(hecl::SystemStringView path) override;
|
||||
|
||||
void init(boo::IApplication* app);
|
||||
const boo::SystemChar* platformName() { return m_mainPlatformName; }
|
||||
|
|
|
@ -60,7 +60,7 @@ struct Application : boo::IApplicationCallback {
|
|||
|
||||
virtual ~Application() = default;
|
||||
|
||||
int appMain(boo::IApplication* app) {
|
||||
int appMain(boo::IApplication* app) override {
|
||||
initialize(app);
|
||||
m_viewManager->init(app);
|
||||
while (m_running.load()) {
|
||||
|
@ -73,8 +73,8 @@ struct Application : boo::IApplicationCallback {
|
|||
m_viewManager.reset();
|
||||
return 0;
|
||||
}
|
||||
void appQuitting(boo::IApplication*) { m_running.store(false); }
|
||||
void appFilesOpen(boo::IApplication*, const std::vector<boo::SystemString>& paths) {
|
||||
void appQuitting(boo::IApplication*) override { m_running.store(false); }
|
||||
void appFilesOpen(boo::IApplication*, const std::vector<boo::SystemString>& paths) override {
|
||||
for (const auto& path : paths) {
|
||||
hecl::ProjectRootPath projPath = hecl::SearchForProject(path);
|
||||
if (projPath) {
|
||||
|
|
Loading…
Reference in New Issue