mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 11:01:49 +00:00
fix gui.load_document environment extension
This commit is contained in:
parent
cfacc3dd48
commit
b1974405c6
7 changed files with 44 additions and 40 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue