Toast Engine
Toggle main menu visibility
Loading...
Searching...
No Matches
panel.hpp
Go to the documentation of this file.
1
8
9
#pragma once
10
#include <memory>
11
#include <
toast/ui/assets.hpp
>
12
#include <
toast/world/node.hpp
>
13
14
// NOLINTNEXTLINE(readability-identifier-naming)
15
namespace
Rml {
16
class
Context;
17
class
ElementDocument;
18
}
19
20
namespace
ui {
21
class
UIBinds
;
22
class
UIBindStore
;
23
}
24
25
namespace
toast {
26
27
class
TOAST_API [[ToastNode, Icon(
"Window"
), Color(
"Blue"
)]] Panel :
public
Node {
28
public
:
29
Panel();
30
~Panel()
override
;
31
32
[[nodiscard]]
33
auto
rmlContext() -> Rml::Context* {
34
return
m_context;
35
}
36
37
[[nodiscard]]
38
auto
rmlDocument() -> Rml::ElementDocument* {
39
return
m_document;
40
}
41
42
[[nodiscard]]
43
auto
colorScheme()
const
->
const
assets::Handle<assets::ColorScheme>
& {
44
return
m_color_scheme;
45
}
46
47
void
reloadDocument();
48
49
private
:
50
void
onReflectedFieldChanged(std::string_view field_name)
override
;
51
void
updateInspectorMessages()
override
;
52
void
init();
53
void
begin();
54
void
destroy();
55
void
onEnable();
56
void
onDisable();
57
59
void
setup();
60
void
loadDocument();
61
void
unloadDocument();
62
63
[[
Reflect
]]
64
assets::Handle<assets::UIElement>
m_element;
65
66
[[
Reflect
]]
67
assets::Handle<assets::ColorScheme>
m_color_scheme;
68
69
[[
Reflect
]]
70
std::vector<assets::Handle<assets::Font>> m_fonts;
71
72
[[
Reflect
, Group(
"Data"
), Name(
"Table"
)]]
73
std::vector<assets::Handle<assets::Localization>> m_localizations;
74
75
[[
Reflect
, Group(
"Data"
), Name(
"Image table"
)]]
76
std::vector<assets::Handle<assets::ImageLocalization>> m_image_localizations;
77
78
Rml::Context* m_context =
nullptr
;
79
Rml::ElementDocument* m_document =
nullptr
;
80
std::unique_ptr<ui::UIBindStore> m_bind_store;
81
std::unique_ptr<ui::UIBinds> m_binds;
82
};
83
84
}
assets::Handle
Type-safe smart pointer for assets.
Definition
core_types.hpp:149
toast::Reflect
Definition
reflect.hpp:244
ui::UIBindStore
Persistent values shared by Lua and the active RmlUi data model.
Definition
ui_binds.hpp:33
ui::UIBinds
Definition
ui_binds.hpp:52
node.hpp
Base object type for the scene graph.
assets.hpp
Aggregate header for the UI asset types.
engine
src
toast
ui
nodes
panel.hpp
Generated by
1.17.0