diff options
author | Hop311 <Hop3114@gmail.com> | 2023-11-13 13:42:37 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-13 13:42:37 +0100 |
commit | f572664cbe1aa5ec2cb6907de3083f058c20af7e (patch) | |
tree | c9a61c5dd15fb1eae1555f47119423dbba315e76 /src/openvic-simulation/interface/UI.hpp | |
parent | ba7bfc52803781c970d6e8afc84c7d3d3e843726 (diff) | |
parent | ce84886cb931975f622134d6c8d32a69c675d975 (diff) |
Merge pull request #71 from OpenVicProject/gui-loading
GUI and GFX file loading
Diffstat (limited to 'src/openvic-simulation/interface/UI.hpp')
-rw-r--r-- | src/openvic-simulation/interface/UI.hpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/openvic-simulation/interface/UI.hpp b/src/openvic-simulation/interface/UI.hpp new file mode 100644 index 0000000..045766b --- /dev/null +++ b/src/openvic-simulation/interface/UI.hpp @@ -0,0 +1,27 @@ +#pragma once + +#include "openvic-simulation/interface/GUI.hpp" + +namespace OpenVic { + + class UIManager { + + NamedInstanceRegistry<GFX::Sprite> sprites; + NamedInstanceRegistry<GUI::Scene, UIManager const&> scenes; + IdentifierRegistry<GFX::Font> fonts; + + 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); + bool load_gui_file(std::string_view scene_name, ast::NodeCPtr root); + }; +} |