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
+3 -1
View File
@@ -15,13 +15,14 @@ namespace gui {
std::shared_ptr<UINode>(UiXmlReader&, const xml::xmlelement&)>;
class UiXmlReader {
gui::GUI& gui;
std::unordered_map<std::string, uinode_reader> readers;
std::unordered_set<std::string> ignored;
std::stack<std::string> contextStack;
std::string filename;
const scriptenv& env;
public:
UiXmlReader(const scriptenv& env);
UiXmlReader(gui::GUI& gui, const scriptenv& env);
void add(const std::string& tag, uinode_reader reader);
bool hasReader(const std::string& tag) const;
@@ -54,5 +55,6 @@ namespace gui {
const std::string& getContext() const;
const scriptenv& getEnvironment() const;
const std::string& getFilename() const;
gui::GUI& getGUI() const;
};
}