summaryrefslogtreecommitdiff
path: root/init.lua
diff options
context:
space:
mode:
Diffstat (limited to 'init.lua')
-rw-r--r--init.lua20
1 files changed, 17 insertions, 3 deletions
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