Register the exit function for Lua (#1318)

This commit is contained in:
Stanislav Denisov
2025-11-21 16:45:40 +01:00
committed by GitHub
parent 9ddad740b8
commit bad16f7aa1
+11
View File
@@ -550,6 +550,16 @@ namespace wi::lua
wi::profiler::SetEnabled(!wi::profiler::IsEnabled());
return 0;
}
int exit(lua_State* L)
{
lua_getglobal(L, "application");
Application_BindLua* app = Luna<Application_BindLua>::lightcheck(L, -1);
if (app && app->component)
{
app->component->Exit();
}
return 0;
}
void Application_BindLua::Bind()
{
@@ -561,6 +571,7 @@ namespace wi::lua
wi::lua::RegisterFunc("SetProfilerEnabled", SetProfilerEnabled);
wi::lua::RegisterFunc("prof", prof);
wi::lua::RegisterFunc("exit", exit);
wi::lua::RunText(R"(
FadeType = {