aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/interface/UI.hpp
diff options
context:
space:
mode:
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
commit34fbe27857d77d6f193d6d1848b953a4596cedd2 (patch)
tree7f07835485b877f3c01c52c188892499e5812f9b /src/openvic-simulation/interface/UI.hpp
parent1eb28bd4fb959b69a30013f6438f0257a2ee7b03 (diff)
parent4ef33d4df6198e613b0f27406d49978c8ea2fb97 (diff)
Merge pull request #91 from OpenVicProject/registry-macro
Improved identifier registry macro
Diffstat (limited to 'src/openvic-simulation/interface/UI.hpp')
-rw-r--r--src/openvic-simulation/interface/UI.hpp15
1 files changed, 4 insertions, 11 deletions
diff --git a/src/openvic-simulation/interface/UI.hpp b/src/openvic-simulation/interface/UI.hpp
index 045766b..12eadb5 100644
--- a/src/openvic-simulation/interface/UI.hpp
+++ b/src/openvic-simulation/interface/UI.hpp
@@ -4,21 +4,14 @@
namespace OpenVic {
- class UIManager {
-
- NamedInstanceRegistry<GFX::Sprite> sprites;
- NamedInstanceRegistry<GUI::Scene, UIManager const&> scenes;
- IdentifierRegistry<GFX::Font> fonts;
+ class UIManager {
+ NamedInstanceRegistry<GFX::Sprite> IDENTIFIER_REGISTRY(sprite);
+ NamedInstanceRegistry<GUI::Scene, UIManager const&> IDENTIFIER_REGISTRY(scene);
+ IdentifierRegistry<GFX::Font> IDENTIFIER_REGISTRY(font);
bool _load_font(ast::NodeCPtr node);
public:
- UIManager();
-
- IDENTIFIER_REGISTRY_ACCESSORS(sprite)
- IDENTIFIER_REGISTRY_ACCESSORS(scene)
- IDENTIFIER_REGISTRY_ACCESSORS(font)
-
bool add_font(std::string_view identifier, colour_t colour, std::string_view fontname);
bool load_gfx_file(ast::NodeCPtr root);