2017-08-06 18:43:41 +02:00
|
|
|
-- support for i18n
|
2020-08-31 05:47:57 +02:00
|
|
|
local S = minetest.get_translator(minetest.get_current_modname())
|
2017-08-06 18:43:41 +02:00
|
|
|
|
2017-03-19 19:39:58 +01:00
|
|
|
if not minetest.global_exists("sfinv") then
|
2022-12-25 18:23:49 +01:00
|
|
|
minetest.log("warning", "3d_armor_sfinv: Mod loaded but unused.")
|
2017-03-19 19:39:58 +01:00
|
|
|
return
|
|
|
|
end
|
|
|
|
|
|
|
|
sfinv.register_page("3d_armor:armor", {
|
2017-08-06 18:43:41 +02:00
|
|
|
title = S("Armor"),
|
2017-03-19 19:39:58 +01:00
|
|
|
get = function(self, player, context)
|
|
|
|
local name = player:get_player_name()
|
|
|
|
local formspec = armor:get_armor_formspec(name, true)
|
|
|
|
return sfinv.make_formspec(player, context, formspec, false)
|
|
|
|
end
|
|
|
|
})
|
|
|
|
armor:register_on_update(function(player)
|
|
|
|
if sfinv.enabled then
|
|
|
|
sfinv.set_player_inventory_formspec(player)
|
|
|
|
end
|
|
|
|
end)
|