mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
[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
This commit is contained in:
parent
eb88e5dd4b
commit
40ce538aad
14 changed files with 349 additions and 53 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue