From b059821156b512c3efec22e39b2551656d41d32d Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Wed, 7 Dec 2016 19:14:38 +0100 Subject: Add sfinv_buttons support --- init.lua | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'init.lua') diff --git a/init.lua b/init.lua index 57808ee..e18f345 100644 --- a/init.lua +++ b/init.lua @@ -1197,18 +1197,32 @@ minetest.register_on_leaveplayer(function(player) end) ---[[ Add buttons for inventory mods ]] +local button_action = function(player) + doc.show_doc(player:get_player_name()) +end + -- Unified Inventory if minetest.get_modpath("unified_inventory") ~= nil then unified_inventory.register_button("doc", { type = "image", image = "doc_button_icon_hires.png", tooltip = S("Documentation System"), - action = function(player) - doc.show_doc(player:get_player_name()) - end, + action = button_action, }) end +-- sfinv_buttons +if minetest.get_modpath("sfinv_buttons") ~= nil then + sfinv_buttons.register_button("doc", { + image = "doc_button_icon_lores.png", + tooltip = S("Collection of help texts"), + title = S("Documentation System"), + action = button_action, + }) +end + + + minetest.register_privilege("doc_reveal", { description = S("Allows you to reveal all hidden help entries with /doc_reveal"), give_to_singleplayer = false -- cgit v1.2.3