mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-06 17:41:04 +00:00
Mainmenu: Move core.on_before_close to s_mainmenu like other callbacks, and doc
This commit is contained in:
parent
2c83c67b7d
commit
4a8f84b259
6 changed files with 31 additions and 20 deletions
|
@ -114,20 +114,6 @@ bool MainMenuScripting::checkPathAccess(const std::string &abs_path, bool write_
|
|||
return !write_required;
|
||||
}
|
||||
|
||||
void MainMenuScripting::beforeClose()
|
||||
{
|
||||
SCRIPTAPI_PRECHECKHEADER
|
||||
|
||||
int error_handler = PUSH_ERROR_HANDLER(L);
|
||||
|
||||
lua_getglobal(L, "core");
|
||||
lua_getfield(L, -1, "on_before_close");
|
||||
|
||||
PCALL_RES(lua_pcall(L, 0, 0, error_handler));
|
||||
|
||||
lua_pop(L, 2); // Pop core, error handler
|
||||
}
|
||||
|
||||
void MainMenuScripting::step()
|
||||
{
|
||||
asyncEngine.step(getStack());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue