mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 02:51:49 +00:00
Merge branch 'main' into devtools
This commit is contained in:
commit
46e9c7dbec
8 changed files with 132 additions and 16 deletions
|
|
@ -123,15 +123,25 @@ static void _readUINode(UiXmlReader& reader, xml::xmlelement element, UINode& no
|
|||
std::string text = element->attr("onclick").getText();
|
||||
if (!text.empty()) {
|
||||
auto callback = scripting::create_runnable(
|
||||
reader.getEnvironment(),
|
||||
text,
|
||||
reader.getFilename()
|
||||
reader.getEnvironment(), text, reader.getFilename()
|
||||
);
|
||||
node.listenAction([callback](GUI*) {
|
||||
callback();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if (element->has("ondoubleclick")) {
|
||||
std::string text = element->attr("ondoubleclick").getText();
|
||||
if (!text.empty()) {
|
||||
auto callback = scripting::create_runnable(
|
||||
reader.getEnvironment(), text, reader.getFilename()
|
||||
);
|
||||
node.listenDoubleClick([callback](GUI*) {
|
||||
callback();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void _readContainer(UiXmlReader& reader, xml::xmlelement element, Container& container) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue