fix gui.load_document environment extension

This commit is contained in:
MihailRis 2026-05-31 22:09:14 +03:00
parent cfacc3dd48
commit b1974405c6
7 changed files with 44 additions and 40 deletions

View file

@ -889,8 +889,8 @@ static std::shared_ptr<UINode> read_iframe(
return iframe;
}
UiXmlReader::UiXmlReader(gui::GUI& gui, scriptenv&& env)
: gui(gui), env(std::move(env)) {
UiXmlReader::UiXmlReader(gui::GUI& gui, const scriptenv& env)
: gui(gui), env(env) {
contextStack.emplace("");
add("image", read_image);
add("canvas", read_canvas);
@ -922,8 +922,7 @@ void UiXmlReader::addIgnore(const std::string& tag) {
ignored.insert(tag);
}
std::shared_ptr<UINode> UiXmlReader::readUINode(const xml::xmlelement& element
) {
std::shared_ptr<UINode> UiXmlReader::readUINode(const xml::xmlelement& element) {
if (element.has("if")) {
const auto& cond = element.attr("if").getText();
if (cond.empty() || cond == "false" || cond == "nil") return nullptr;