Add sfinv_buttons support

This commit is contained in:
Wuzzy 2016-12-07 19:14:38 +01:00
parent 2b0c044b13
commit b059821156
5 changed files with 22 additions and 5 deletions

View File

@ -10,8 +10,8 @@ Current version: 0.9.0
To open the help, there are multiple ways: To open the help, there are multiple ways:
- Use the `/doc` chat command. This works always. - Use the `/doc` chat command. This works always.
- If you use Unified Inventory, click on the blue question mark icon in the - If you use Unified Inventory or Minetest Game, you will find an extra
inventory menu button in the inventory
The documentation system itself should be more or less self-explanatory. The documentation system itself should be more or less self-explanatory.

View File

@ -1,3 +1,4 @@
intllib? intllib?
unified_inventory? unified_inventory?
sfinv_buttons?
central_message? central_message?

View File

@ -1197,18 +1197,32 @@ minetest.register_on_leaveplayer(function(player)
end) end)
---[[ Add buttons for inventory mods ]] ---[[ Add buttons for inventory mods ]]
local button_action = function(player)
doc.show_doc(player:get_player_name())
end
-- Unified Inventory -- Unified Inventory
if minetest.get_modpath("unified_inventory") ~= nil then if minetest.get_modpath("unified_inventory") ~= nil then
unified_inventory.register_button("doc", { unified_inventory.register_button("doc", {
type = "image", type = "image",
image = "doc_button_icon_hires.png", image = "doc_button_icon_hires.png",
tooltip = S("Documentation System"), tooltip = S("Documentation System"),
action = function(player) action = button_action,
doc.show_doc(player:get_player_name())
end,
}) })
end 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", { minetest.register_privilege("doc_reveal", {
description = S("Allows you to reveal all hidden help entries with /doc_reveal"), description = S("Allows you to reveal all hidden help entries with /doc_reveal"),
give_to_singleplayer = false give_to_singleplayer = false

View File

@ -38,3 +38,4 @@ This is the Documentation System, Version %s. = Dies ist das Dokumentationssyste
You haven't chosen a category yet. Please choose one in the category list first. = Sie haben noch keine Kategorie gewählt. Bitte wählen Sie zuerst eine Kategorie in der Kategorienliste aus. You haven't chosen a category yet. Please choose one in the category list first. = Sie haben noch keine Kategorie gewählt. Bitte wählen Sie zuerst eine Kategorie in der Kategorienliste aus.
You haven't chosen an entry yet. Please choose one in the entry list first. = Sie haben noch keinen Eintrag gewählt. Bitte wählen Sie zuerst einen Eintrag in der Eintragsliste aus. You haven't chosen an entry yet. Please choose one in the entry list first. = Sie haben noch keinen Eintrag gewählt. Bitte wählen Sie zuerst einen Eintrag in der Eintragsliste aus.
Nameless entry (%s) = Namenloser Eintrag (%s) Nameless entry (%s) = Namenloser Eintrag (%s)
Collection of help texts = Sammlung von Hilfetexten

View File

@ -38,3 +38,4 @@ This category is empty. =
This is the Documentation System, Version %s. = This is the Documentation System, Version %s. =
You haven't chosen a category yet. Please choose one in the category list first. = You haven't chosen a category yet. Please choose one in the category list first. =
You haven't chosen an entry yet. Please choose one in the entry list first. = You haven't chosen an entry yet. Please choose one in the entry list first. =
Collection of help texts =