Add Inventory++ support
parent
010cabddce
commit
c57e5c0558
|
@ -14,6 +14,7 @@ To open the help, there are multiple ways:
|
||||||
- If you use one of these mods, there's a help button in the inventory menu:
|
- If you use one of these mods, there's a help button in the inventory menu:
|
||||||
- Unified Inventory [`unified_inventory`]
|
- Unified Inventory [`unified_inventory`]
|
||||||
- Simple Fast Inventory Buttons [`sfinv_buttons`]
|
- Simple Fast Inventory Buttons [`sfinv_buttons`]
|
||||||
|
- Inventory++ [`inventory_plus`]
|
||||||
|
|
||||||
The help itself should be more or less self-explanatory.
|
The help itself should be more or less self-explanatory.
|
||||||
|
|
||||||
|
|
11
init.lua
11
init.lua
|
@ -1147,6 +1147,11 @@ function doc.process_form(player,formname,fields)
|
||||||
local formspec = doc.formspec_core(3)..doc.formspec_entry(cid, eid, playername)
|
local formspec = doc.formspec_core(3)..doc.formspec_entry(cid, eid, playername)
|
||||||
minetest.show_formspec(playername, "doc:entry", formspec)
|
minetest.show_formspec(playername, "doc:entry", formspec)
|
||||||
end
|
end
|
||||||
|
else
|
||||||
|
if fields["doc_inventory_plus"] and minetest.get_modpath("inventory_plus") then
|
||||||
|
doc.show_doc(playername)
|
||||||
|
return
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -1209,6 +1214,11 @@ minetest.register_on_joinplayer(function(player)
|
||||||
playerdata.stored_data.revealed_count[cid] = rc
|
playerdata.stored_data.revealed_count[cid] = rc
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Add button for Inventory++
|
||||||
|
if minetest.get_modpath("inventory_plus") ~= nil then
|
||||||
|
inventory_plus.register_button(player, "doc_inventory_plus", S("Help"))
|
||||||
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
---[[ Add buttons for inventory mods ]]
|
---[[ Add buttons for inventory mods ]]
|
||||||
|
@ -1237,7 +1247,6 @@ if minetest.get_modpath("sfinv_buttons") ~= nil then
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
minetest.register_privilege("help_reveal", {
|
minetest.register_privilege("help_reveal", {
|
||||||
description = S("Allows you to reveal all hidden help entries with /help_reveal"),
|
description = S("Allows you to reveal all hidden help entries with /help_reveal"),
|
||||||
give_to_singleplayer = false
|
give_to_singleplayer = false
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 722 B |
Loading…
Reference in New Issue