aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/interface/UI.hpp
blob: 32dba9c29ebb6bdf8083a9b4380d823e59958666 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#pragma once

#include "openvic-simulation/interface/GFXObject.hpp"
#include "openvic-simulation/interface/GUI.hpp"

namespace OpenVic {

   class UIManager {
      NamedInstanceRegistry<GFX::Sprite> IDENTIFIER_REGISTRY(sprite);
      IdentifierRegistry<GFX::Font> IDENTIFIER_REGISTRY(font);
      NamedInstanceRegistry<GFX::Object> IDENTIFIER_REGISTRY(object);

      NamedInstanceRegistry<GUI::Scene, UIManager const&> IDENTIFIER_REGISTRY(scene);

      bool _load_font(ast::NodeCPtr node);
      NodeTools::NodeCallback auto _load_fonts(std::string_view font_key);

   public:
      bool add_font(
         std::string_view identifier, colour_argb_t colour, std::string_view fontname, std::string_view charset,
         uint32_t height, GFX::Font::colour_codes_t&& colour_codes
      );

      void lock_gfx_registries();

      bool load_gfx_file(ast::NodeCPtr root);
      bool load_gui_file(std::string_view scene_name, ast::NodeCPtr root);
   };
}