aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/interface/GUI.hpp
diff options
context:
space:
mode:
author zaaarf <me@zaaarf.foo>2023-12-10 23:15:41 +0100
committer zaaarf <me@zaaarf.foo>2023-12-10 23:15:41 +0100
commit4ef33d4df6198e613b0f27406d49978c8ea2fb97 (patch)
tree7f07835485b877f3c01c52c188892499e5812f9b /src/openvic-simulation/interface/GUI.hpp
parent1eb28bd4fb959b69a30013f6438f0257a2ee7b03 (diff)
feat: improved identifier registry macro
Diffstat (limited to 'src/openvic-simulation/interface/GUI.hpp')
-rw-r--r--src/openvic-simulation/interface/GUI.hpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/openvic-simulation/interface/GUI.hpp b/src/openvic-simulation/interface/GUI.hpp
index f8434f6..47bd57d 100644
--- a/src/openvic-simulation/interface/GUI.hpp
+++ b/src/openvic-simulation/interface/GUI.hpp
@@ -40,10 +40,10 @@ namespace OpenVic::GUI {
class Scene : public Named<UIManager const&> {
friend std::unique_ptr<Scene> std::make_unique<Scene>();
- NamedInstanceRegistry<Element, UIManager const&> elements;
+ NamedInstanceRegistry<Element, UIManager const&> IDENTIFIER_REGISTRY(scene_element);
protected:
- Scene();
+ Scene() = default;
bool _fill_key_map(NodeTools::key_map_t& key_map, UIManager const& ui_manager) override;
@@ -57,13 +57,12 @@ namespace OpenVic::GUI {
std::string_view scene_name, NodeTools::callback_t<std::unique_ptr<Scene>&&> callback, UIManager const& ui_manager
);
- IDENTIFIER_REGISTRY_ACCESSORS(element)
};
class Window final : public Element {
friend std::unique_ptr<Window> std::make_unique<Window>();
- NamedInstanceRegistry<Element, UIManager const&> elements;
+ NamedInstanceRegistry<Element, UIManager const&> IDENTIFIER_REGISTRY(window_element);
fvec2_t PROPERTY(size);
bool PROPERTY(moveable);
@@ -80,8 +79,6 @@ namespace OpenVic::GUI {
virtual ~Window() = default;
OV_DETAIL_GET_TYPE
-
- IDENTIFIER_REGISTRY_ACCESSORS(element)
};
class Icon final : public Element {
@@ -127,7 +124,7 @@ namespace OpenVic::GUI {
// TODO - clicksound
protected:
- Button() ;
+ Button();
bool _fill_key_map(NodeTools::key_map_t& key_map, UIManager const& ui_manager) override;