ui scripting related fixes

This commit is contained in:
MihailRis
2024-02-13 14:36:10 +03:00
parent 7f17face73
commit 302b649634
8 changed files with 21 additions and 9 deletions
-3
View File
@@ -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)>;
+2 -2
View File
@@ -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);
}