Add support for Inventory++
parent
c4976ca4df
commit
34af0a95f5
11
README.md
11
README.md
|
@ -3,9 +3,14 @@ and power users.
|
|||
|
||||
Current version: 1.3.0
|
||||
|
||||
If you use Minetest Game or Unified Inventory there's a new button in your
|
||||
inventory menu for opening the form. Alternatively, you can always Use the
|
||||
server command `/treeform`.
|
||||
If you use one of the following mods, there's a new button in your inventory
|
||||
menu for opening the form:
|
||||
|
||||
* Unified Inventory [`unified_inventory`]
|
||||
* Simple Fast Inventory Buttons [`sfinv_buttons`]
|
||||
* Inventory++ [`inventory_plus`]
|
||||
|
||||
Alternatively, you can always use the server command `/treeform`.
|
||||
|
||||
Usage help for this form is provided in the form itself.
|
||||
|
||||
|
|
|
@ -1,2 +1,3 @@
|
|||
unified_inventory?
|
||||
sfinv_buttons?
|
||||
inventory_plus?
|
||||
|
|
12
init.lua
12
init.lua
|
@ -830,6 +830,12 @@ end
|
|||
|
||||
function ltool.process_form(player,formname,fields)
|
||||
local playername = player:get_player_name()
|
||||
|
||||
if fields.ltool and minetest.get_modpath("inventory_plus") then
|
||||
ltool.show_treeform(playername)
|
||||
return
|
||||
end
|
||||
|
||||
local seltree = ltool.get_selected_tree(playername)
|
||||
local seltree_id = ltool.get_selected_tree_id(playername)
|
||||
local privs = minetest.get_player_privs(playername)
|
||||
|
@ -1241,6 +1247,10 @@ function ltool.join(player)
|
|||
infotable.treeform.help = {}
|
||||
infotable.treeform.help.tab = 1
|
||||
ltool.playerinfos[player:get_player_name()] = infotable
|
||||
|
||||
if minetest.get_modpath("inventory_plus") then
|
||||
inventory_plus.register_button(player, "ltool", "L-System Tree Utility")
|
||||
end
|
||||
end
|
||||
|
||||
function ltool.save_to_file()
|
||||
|
@ -1290,3 +1300,5 @@ if minetest.get_modpath("sfinv_buttons") ~= nil then
|
|||
action = button_action,
|
||||
})
|
||||
end
|
||||
|
||||
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 191 B |
Binary file not shown.
Before Width: | Height: | Size: 227 B After Width: | Height: | Size: 191 B |
Loading…
Reference in New Issue