summaryrefslogtreecommitdiff
path: root/clientmods
diff options
context:
space:
mode:
authorLoïc Blot <nerzhul@users.noreply.github.com>2017-03-16 10:34:54 +0100
committerGitHub <noreply@github.com>2017-03-16 10:34:54 +0100
commit40ce538aad9af8f7634c4ba7e9f12246fb23b31c (patch)
treeda8788a581acbc18bb9f5e35a2be620ba0125471 /clientmods
parenteb88e5dd4b181a90b382c036cf6c4f42e63e8cc2 (diff)
downloadminetest-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 'clientmods')
-rw-r--r--clientmods/preview/init.lua12
1 files changed, 12 insertions, 0 deletions
diff --git a/clientmods/preview/init.lua b/clientmods/preview/init.lua
index 60dccf304..bdda7fe4e 100644
--- a/clientmods/preview/init.lua
+++ b/clientmods/preview/init.lua
@@ -47,9 +47,21 @@ core.register_chatcommand("test_node", {
end,
})
+local function preview_minimap()
+ local minimap = core.ui.minimap
+ minimap:show()
+ minimap:set_mode(4)
+ minimap:set_pos({x=5, y=50, z=5})
+ minimap:toggle_shape()
+
+ print("[PREVIEW] Minimap: mode => " .. dump(minimap:get_mode()) ..
+ " position => " .. dump(minimap:get_pos()) ..
+ " angle => " .. dump(minimap:get_angle()))
+end
core.after(2, function()
print("[PREVIEW] loaded " .. modname .. " mod")
+ preview_minimap()
modstorage:set_string("current_mod", modname)
print(modstorage:get_string("current_mod"))
end)