1
0
Fork 0
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:
grorp 2025-01-19 13:07:04 -05:00 committed by GitHub
parent 3cb07d5fb6
commit eeb6cab4c4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
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