mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
In-game settings menu using separate Lua environment (#15614)
This commit is contained in:
parent
3cb07d5fb6
commit
eeb6cab4c4
48 changed files with 652 additions and 290 deletions
20
src/script/cpp_api/s_pause_menu.cpp
Normal file
20
src/script/cpp_api/s_pause_menu.cpp
Normal file
|
@ -0,0 +1,20 @@
|
|||
// Luanti
|
||||
// SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
// Copyright (C) 2025 grorp
|
||||
|
||||
#include "s_pause_menu.h"
|
||||
#include "cpp_api/s_internal.h"
|
||||
|
||||
void ScriptApiPauseMenu::open_settings()
|
||||
{
|
||||
SCRIPTAPI_PRECHECKHEADER
|
||||
|
||||
int error_handler = PUSH_ERROR_HANDLER(L);
|
||||
|
||||
lua_getglobal(L, "core");
|
||||
lua_getfield(L, -1, "open_settings");
|
||||
|
||||
PCALL_RES(lua_pcall(L, 0, 0, error_handler));
|
||||
|
||||
lua_pop(L, 2); // Pop core, error handler
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue