Created mod UI API functions for setting visibility, setting text, and destroying elements

This commit is contained in:
Mr-Wiseguy
2025-03-11 19:05:25 -04:00
parent 2dffaf6148
commit bb10d5d090
12 changed files with 117 additions and 15 deletions
+10 -1
View File
@@ -33,7 +33,7 @@ namespace recompui {
Rml::ElementDocument* document;
Element root_element;
std::vector<Element*> loose_elements;
std::unordered_set<ResourceId> to_update;
std::unordered_set<ResourceId> to_update;
bool captures_input = true;
bool captures_mouse = true;
Context(Rml::ElementDocument* document) : document(document), root_element(document) {}
@@ -309,6 +309,15 @@ void recompui::ContextId::open() {
opened_context_id = *this;
}
bool recompui::ContextId::open_if_not_already() {
if (opened_context_id == *this) {
return false;
}
open();
return true;
}
void recompui::ContextId::close() {
// Ensure a context is currently opened by this thread.
if (opened_context_id == ContextId::null()) {