aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/interface/UI.hpp
diff options
context:
space:
mode:
author hop311 <hop3114@gmail.com>2023-11-07 23:18:08 +0100
committer hop311 <hop3114@gmail.com>2023-11-12 17:55:39 +0100
commitfd686eadf81e85bd4993a483adcefd6a153d259f (patch)
treee59e8a1531d96a37872373f6262eff8ed45da1ff /src/openvic-simulation/interface/UI.hpp
parentc8983f5cda0b396b76c9d1491cf4c8ff5997d420 (diff)
GUI and GFX file loading
Diffstat (limited to 'src/openvic-simulation/interface/UI.hpp')
-rw-r--r--src/openvic-simulation/interface/UI.hpp27
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);
+ };
+}