Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add minetest.settings to CSM API and allow CSMs to provide settingtypes.txt #12131

Merged
merged 8 commits into from
Aug 2, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
expose minetest.settings to CSM API
  • Loading branch information
AFCMS committed May 5, 2022
commit d6e2b2901cc85ed70cb8cd96d27cf025241009c4
3 changes: 3 additions & 0 deletions src/script/lua_api/l_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -647,6 +647,9 @@ void ModApiUtil::InitializeClient(lua_State *L, int top)
API_FCT(sha1);
API_FCT(colorspec_to_colorstring);
API_FCT(colorspec_to_bytes);

LuaSettings::create(L, g_settings, g_settings_path);
lua_setfield(L, top, "settings");
}

void ModApiUtil::InitializeAsync(lua_State *L, int top)
Expand Down
2 changes: 2 additions & 0 deletions src/script/scripting_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "lua_api/l_nodemeta.h"
#include "lua_api/l_localplayer.h"
#include "lua_api/l_camera.h"
#include "lua_api/l_settings.h"

ClientScripting::ClientScripting(Client *client):
ScriptApiBase(ScriptingType::Client)
Expand Down Expand Up @@ -73,6 +74,7 @@ void ClientScripting::InitializeModApi(lua_State *L, int top)
LuaLocalPlayer::Register(L);
LuaCamera::Register(L);
ModChannelRef::Register(L);
LuaSettings::Register(L);

ModApiUtil::InitializeClient(L, top);
ModApiClient::Initialize(L, top);
Expand Down