Basic support for advanced inventories

This commit is contained in:
TeTpaAka 2015-03-04 19:06:59 +01:00
parent 0ce1a9cd18
commit 6b51cf000b
5 changed files with 13 additions and 1 deletions

View File

@ -1,2 +1,3 @@
intllib? intllib?
unified_inventory? unified_inventory?
inventory_plus?

View File

@ -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
View 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)

View File

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

View File

@ -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())