Add item_name support for hudbars mod

Does the same thing as 8bb1c8288b
This commit is contained in:
MT-Modder 2015-10-02 14:01:07 -04:00 committed by Diego Martinez
parent 758b643c4d
commit bdf9b61779

@ -6,12 +6,15 @@ local dtimes = {}
local dlimit = 3 -- HUD element will be hidden after this many seconds local dlimit = 3 -- HUD element will be hidden after this many seconds
local air_hud_mod = minetest.get_modpath("4air") local air_hud_mod = minetest.get_modpath("4air")
local hud_mod = minetest.get_modpath("hud") local hud_mod = minetest.get_modpath("hud")
local hudbars_mod = minetest.get_modpath("hudbars")
local function set_hud(player) local function set_hud(player)
local player_name = player:get_player_name() local player_name = player:get_player_name()
local off = {x=0, y=-70} local off = {x=0, y=-70}
if air_hud_mod or hud_mod then if air_hud_mod or hud_mod then
off.y = off.y - 20 off.y = off.y - 20
elseif hudbars_mod then
off.y = off.y + 13
end end
huds[player_name] = player:hud_add({ huds[player_name] = player:hud_add({
hud_elem_type = "text", hud_elem_type = "text",