diff options
author | Loïc Blot <nerzhul@users.noreply.github.com> | 2017-03-16 10:34:54 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-16 10:34:54 +0100 |
commit | 40ce538aad9af8f7634c4ba7e9f12246fb23b31c (patch) | |
tree | da8788a581acbc18bb9f5e35a2be620ba0125471 /src/script/clientscripting.cpp | |
parent | eb88e5dd4b181a90b382c036cf6c4f42e63e8cc2 (diff) | |
download | minetest-40ce538aad9af8f7634c4ba7e9f12246fb23b31c.tar.gz minetest-40ce538aad9af8f7634c4ba7e9f12246fb23b31c.tar.bz2 minetest-40ce538aad9af8f7634c4ba7e9f12246fb23b31c.zip |
[CSM] Add minimap API modifiers (#5399)
* Rename Mapper (too generic) to Minimap
* Add lua functions to get/set position, angle, mode for minimap
* Client: rename m_mapper to m_minimap
* Add minimap to core.ui namespace (core.ui.minimap)
* Add various functions to manage minimap (show, hide, toggle_shape)
* Cleanup trivial declaration in client
Diffstat (limited to 'src/script/clientscripting.cpp')
-rw-r--r-- | src/script/clientscripting.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/script/clientscripting.cpp b/src/script/clientscripting.cpp index ccdcb928d..1b73fdf0d 100644 --- a/src/script/clientscripting.cpp +++ b/src/script/clientscripting.cpp @@ -22,6 +22,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "client.h" #include "cpp_api/s_internal.h" #include "lua_api/l_client.h" +#include "lua_api/l_minimap.h" #include "lua_api/l_storage.h" #include "lua_api/l_sound.h" #include "lua_api/l_util.h" @@ -40,9 +41,14 @@ ClientScripting::ClientScripting(Client *client): lua_getglobal(L, "core"); int top = lua_gettop(L); + lua_newtable(L); + lua_setfield(L, -2, "ui"); + InitializeModApi(L, top); lua_pop(L, 1); + LuaMinimap::create(L, client->getMinimap()); + // Push builtin initialization type lua_pushstring(L, "client"); lua_setglobal(L, "INIT"); @@ -59,4 +65,5 @@ void ClientScripting::InitializeModApi(lua_State *L, int top) LuaItemStack::Register(L); StorageRef::Register(L); + LuaMinimap::Register(L); } |