Add support for Unified Inventory

This commit is contained in:
Wuzzy 2016-08-01 21:38:19 +02:00 committed by rubenwardy
parent 5dec2fd60b
commit 00eeeb3eef
5 changed files with 22 additions and 0 deletions

View File

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

View File

@ -25,6 +25,7 @@ end
dofile(minetest.get_modpath("awards").."/api.lua")
dofile(minetest.get_modpath("awards").."/chat_commands.lua")
dofile(minetest.get_modpath("awards").."/unified_inventory.lua")
dofile(minetest.get_modpath("awards").."/triggers.lua")
awards.set_intllib(S)

View File

@ -59,3 +59,4 @@ Deep Down =
Die below -10000 =
In space, no one can hear you scream =
Die above 10000 =
Awards =

BIN
textures/awards_ui_icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

19
unified_inventory.lua Normal file
View File

@ -0,0 +1,19 @@
if minetest.get_modpath("unified_inventory") ~= nil then
local S
if (intllib) then
dofile(minetest.get_modpath("intllib").."/intllib.lua")
S = intllib.Getter(minetest.get_current_modname())
else
S = function ( s ) return s end
end
unified_inventory.register_button("awards", {
type = "image",
image = "awards_ui_icon.png",
tooltip = S("Awards"),
action = function(player)
local name = player:get_player_name()
awards.show_to(name, name, nil, false)
end,
})
end