mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 02:51:49 +00:00
content menu moved to xml (no icons yet)
This commit is contained in:
parent
49d57b307b
commit
64820020f8
14 changed files with 91 additions and 172 deletions
|
|
@ -102,18 +102,20 @@ static void _readUINode(UiXmlReader& reader, xml::xmlelement element, UINode& no
|
|||
}
|
||||
|
||||
if (element->has("onclick")) {
|
||||
auto callback = scripting::create_runnable(
|
||||
reader.getEnvironment().getId(),
|
||||
element->attr("onclick").getText(),
|
||||
reader.getFilename()
|
||||
);
|
||||
node.listenAction([callback](GUI*) {
|
||||
callback();
|
||||
});
|
||||
std::string text = element->attr("onclick").getText();
|
||||
if (!text.empty()) {
|
||||
auto callback = scripting::create_runnable(
|
||||
reader.getEnvironment().getId(),
|
||||
text,
|
||||
reader.getFilename()
|
||||
);
|
||||
node.listenAction([callback](GUI*) {
|
||||
callback();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void _readContainer(UiXmlReader& reader, xml::xmlelement element, Container& container) {
|
||||
_readUINode(reader, element, container);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue