Unravel Engine C++ Reference
Loading...
Searching...
No Matches
ui_document_component.h
Go to the documentation of this file.
1#pragma once
2
5#include <engine/ui/ui_tree.h>
6#include <string>
7#include <memory>
8
9// Forward declarations
10namespace Rml
11{
12 class ElementDocument;
13}
14
15namespace unravel
16{
17
25struct ui_document_component : public component_crtp<ui_document_component, owned_component>
26{
29
30
32 Rml::ElementDocument* document = nullptr;
33
34 uint64_t version = 0;
35
36
41 [[nodiscard]] auto is_loaded() const -> bool;
42
47 [[nodiscard]] auto is_enabled() const -> bool;
48
49
54 void set_enabled(bool enabled);
55
56private:
57
58 bool enabled_ = true;
59
60};
61
62} // namespace unravel
Represents a handle to an asset, providing access and management functions.
CRTP (Curiously Recurring Template Pattern) base structure for components.
Component that holds a reference to a UI document for RmlUi rendering.
asset_handle< ui_tree > asset
Path to the UI document file (HTML/RML)
void set_enabled(bool enabled)
Set the enabled state of the document.
Rml::ElementDocument * document
Shared pointer to the loaded RmlUi document.
auto is_enabled() const -> bool
Check if document is currently enabled.
auto is_loaded() const -> bool
Check if document is currently loaded.