add 'onselect' callback & remove 'default' tag

This commit is contained in:
MihailRis
2025-06-28 02:46:54 +03:00
parent 47f7259c72
commit f17167f8c9
6 changed files with 60 additions and 19 deletions
@@ -69,6 +69,17 @@ wstringconsumer scripting::create_wstring_consumer(
};
}
stringconsumer scripting::create_string_consumer(
const scriptenv& env, const std::string& src, const std::string& file
) {
return [=](const std::string& x) {
if (auto L = process_callback(env, src, file)) {
lua::pushstring(L, x);
lua::call_nothrow(L, 1);
}
};
}
wstringsupplier scripting::create_wstring_supplier(
const scriptenv& env, const std::string& src, const std::string& file
) {
@@ -23,6 +23,12 @@ namespace scripting {
const std::string& file = "[string]"
);
stringconsumer create_string_consumer(
const scriptenv& env,
const std::string& src,
const std::string& file = "[string]"
);
wstringconsumer create_wstring_consumer(
const scriptenv& env,
const std::string& src,