Add luinotify function
This commit is contained in:
parent
03e5a9b00f
commit
cc1297170a
@ -12,6 +12,9 @@
|
|||||||
#include "../../../component/fastfiles.hpp"
|
#include "../../../component/fastfiles.hpp"
|
||||||
#include "../../../component/mods.hpp"
|
#include "../../../component/mods.hpp"
|
||||||
#include "../../../component/localized_strings.hpp"
|
#include "../../../component/localized_strings.hpp"
|
||||||
|
#include "../../../component/scheduler.hpp"
|
||||||
|
|
||||||
|
#include "game/ui_scripting/execution.hpp"
|
||||||
|
|
||||||
#include <utils/string.hpp>
|
#include <utils/string.hpp>
|
||||||
#include <utils/io.hpp>
|
#include <utils/io.hpp>
|
||||||
@ -777,6 +780,14 @@ namespace scripting::lua
|
|||||||
scripting::get_dvar_int_overrides.erase(dvar);
|
scripting::get_dvar_int_overrides.erase(dvar);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
game_type["luinotify"] = [](const game&, const std::string& name, const std::string& data)
|
||||||
|
{
|
||||||
|
::scheduler::once([=]()
|
||||||
|
{
|
||||||
|
ui_scripting::notify(name, {{"data", data}});
|
||||||
|
}, ::scheduler::pipeline::lui);
|
||||||
|
};
|
||||||
|
|
||||||
auto function_ptr_type = state.new_usertype<function_ptr>("functionptr",
|
auto function_ptr_type = state.new_usertype<function_ptr>("functionptr",
|
||||||
sol::constructors<function_ptr(const std::string&, const std::string&)>());
|
sol::constructors<function_ptr(const std::string&, const std::string&)>());
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user