mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-10 05:21:49 +00:00
ui scripting related fixes
This commit is contained in:
parent
7f17face73
commit
302b649634
8 changed files with 21 additions and 9 deletions
|
|
@ -17,9 +17,6 @@ class Batch2D;
|
|||
class Assets;
|
||||
|
||||
namespace gui {
|
||||
using wstringsupplier = std::function<std::wstring()>;
|
||||
using wstringconsumer = std::function<void(std::wstring)>;
|
||||
|
||||
using doublesupplier = std::function<double()>;
|
||||
using doubleconsumer = std::function<void(double)>;
|
||||
|
||||
|
|
|
|||
|
|
@ -133,7 +133,7 @@ static std::shared_ptr<UINode> readButton(UiXmlReader& reader, xml::xmlelement e
|
|||
auto callback = scripting::create_runnable(
|
||||
reader.getEnvironment().getId(),
|
||||
element->attr("onclick").getText(),
|
||||
"<onclick>"
|
||||
reader.getFilename()+".lua"
|
||||
);
|
||||
button->listenAction([callback](GUI*) {
|
||||
callback();
|
||||
|
|
@ -156,7 +156,7 @@ static std::shared_ptr<UINode> readTextBox(UiXmlReader& reader, xml::xmlelement
|
|||
auto consumer = scripting::create_wstring_consumer(
|
||||
reader.getEnvironment().getId(),
|
||||
element->attr("consumer").getText(),
|
||||
reader.getFilename()
|
||||
reader.getFilename()+"lua"
|
||||
);
|
||||
textbox->textConsumer(consumer);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue