From 40ce538aad9af8f7634c4ba7e9f12246fb23b31c Mon Sep 17 00:00:00 2001 From: Loïc Blot Date: Thu, 16 Mar 2017 10:34:54 +0100 Subject: [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 --- clientmods/preview/init.lua | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'clientmods/preview') 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) -- cgit v1.2.3