1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-16 09:55:22 +02:00

In-game settings menu using separate Lua environment (#15614)

This commit is contained in:
grorp
2025-01-19 13:07:04 -05:00
committed by GitHub
parent 3cb07d5fb6
commit eeb6cab4c4
48 changed files with 652 additions and 290 deletions

View File

@@ -30,8 +30,9 @@
static inline int checkSettingSecurity(lua_State* L, const std::string &name)
{
#if CHECK_CLIENT_BUILD()
// Main menu is allowed everything
if (ModApiBase::getGuiEngine(L) != nullptr)
// Main menu and pause menu are allowed everything
auto context = ModApiBase::getScriptApiBase(L)->getType();
if (context == ScriptingType::MainMenu || context == ScriptingType::PauseMenu)
return 0;
#endif