diff options
author | zaaarf <80046572+zaaarf@users.noreply.github.com> | 2023-12-10 23:17:04 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-10 23:17:04 +0100 |
commit | 34fbe27857d77d6f193d6d1848b953a4596cedd2 (patch) | |
tree | 7f07835485b877f3c01c52c188892499e5812f9b /src/openvic-simulation/interface/GUI.hpp | |
parent | 1eb28bd4fb959b69a30013f6438f0257a2ee7b03 (diff) | |
parent | 4ef33d4df6198e613b0f27406d49978c8ea2fb97 (diff) |
Merge pull request #91 from OpenVicProject/registry-macro
Improved identifier registry macro
Diffstat (limited to 'src/openvic-simulation/interface/GUI.hpp')
-rw-r--r-- | src/openvic-simulation/interface/GUI.hpp | 11 |
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; |