Basic support for advanced inventories
This commit is contained in:
parent
0ce1a9cd18
commit
6b51cf000b
@ -1,2 +1,3 @@
|
|||||||
intllib?
|
intllib?
|
||||||
unified_inventory?
|
unified_inventory?
|
||||||
|
inventory_plus?
|
||||||
|
2
init.lua
2
init.lua
@ -27,6 +27,8 @@ dofile(minetest.get_modpath("quests") .. "/formspecs.lua")
|
|||||||
-- support for unified_inventory
|
-- support for unified_inventory
|
||||||
if (minetest.get_modpath("unified_inventory") ~= nil) then
|
if (minetest.get_modpath("unified_inventory") ~= nil) then
|
||||||
dofile(minetest.get_modpath("quests") .. "/unified_inventory.lua")
|
dofile(minetest.get_modpath("quests") .. "/unified_inventory.lua")
|
||||||
|
elseif (minetest.get_modpath("inventory_plus") ~= nil) then
|
||||||
|
dofile(minetest.get_modpath("quests") .. "/inventory_plus.lua")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
9
inventory_plus.lua
Normal file
9
inventory_plus.lua
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
minetest.register_on_joinplayer(function(player)
|
||||||
|
inventory_plus.register_button(player, "quests")
|
||||||
|
end)
|
||||||
|
|
||||||
|
minetest.register_on_player_receive_fields(function(player, formname, fields)
|
||||||
|
if (fields.quests) then
|
||||||
|
quests.show_formspec(player:get_player_name())
|
||||||
|
end
|
||||||
|
end)
|
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.3 KiB |
@ -1,6 +1,6 @@
|
|||||||
unified_inventory.register_button("quests", {
|
unified_inventory.register_button("quests", {
|
||||||
type = "image",
|
type = "image",
|
||||||
image = "quests_ui_button.png",
|
image = "inventory_plus_quests.png",
|
||||||
tooltip = "Show the questlog",
|
tooltip = "Show the questlog",
|
||||||
action = function(player)
|
action = function(player)
|
||||||
quests.show_formspec(player:get_player_name())
|
quests.show_formspec(player:get_player_name())
|
||||||
|
Loading…
Reference in New Issue
Block a user