refactor: add GUI instance reference to UI nodes

This commit is contained in:
MihailRis
2025-04-02 14:55:53 +03:00
parent 74a94f869c
commit 4c48afbb90
70 changed files with 1133 additions and 832 deletions
+21 -17
View File
@@ -1,38 +1,42 @@
#pragma once
#include "GUI.hpp"
#include "typedefs.hpp"
#include "delegates.hpp"
#include <memory>
#include <string>
#include "GUI.hpp"
#include "delegates.hpp"
#include "typedefs.hpp"
class Engine;
namespace guiutil {
/// @brief Create element from XML
/// @param source XML
std::shared_ptr<gui::UINode> create(const std::string& source, scriptenv env=0);
std::shared_ptr<gui::UINode> create(
gui::GUI& gui, const std::string& source, scriptenv env = 0
);
void alert(
Engine& engine,
const std::wstring& text,
const runnable& on_hidden=nullptr
const std::wstring& text,
const runnable& on_hidden = nullptr
);
void confirm(
Engine& engine,
const std::wstring& text,
const runnable& on_confirm=nullptr,
const runnable& on_deny=nullptr,
std::wstring yestext=L"",
std::wstring notext=L"");
const std::wstring& text,
const runnable& on_confirm = nullptr,
const runnable& on_deny = nullptr,
std::wstring yestext = L"",
std::wstring notext = L""
);
void confirm_with_memo(
const std::shared_ptr<gui::Menu>& menu,
const std::wstring& text,
Engine& engine,
const std::wstring& text,
const std::wstring& memo,
const runnable& on_confirm=nullptr,
std::wstring yestext=L"",
std::wstring notext=L"");
const runnable& on_confirm = nullptr,
std::wstring yestext = L"",
std::wstring notext = L""
);
}