HUD: small tweak

This commit is contained in:
Jean-Patrick Guerrero 2022-09-14 15:30:31 +02:00
parent 477efe56d3
commit b4de48370a
2 changed files with 9 additions and 5 deletions

View File

@ -148,10 +148,6 @@ if core.global_exists"skins" then
i3.modules.skins = true i3.modules.skins = true
end end
if core.global_exists"hb" then
i3.modules.hudbars = true
end
if core.global_exists"awards" then if core.global_exists"awards" then
i3.modules.awards = true i3.modules.awards = true

View File

@ -4,6 +4,14 @@ local function init_hud(player)
local name = player:get_player_name() local name = player:get_player_name()
local data = i3.data[name] local data = i3.data[name]
local wdesc_y = -90
if core.global_exists"hb" then
wdesc_y -= ceil(hb.hudbars_count / 2) * 5
elseif not i3.settings.damage_enabled then
wdesc_y += 15
end
data.hud = { data.hud = {
bg = player:hud_add { bg = player:hud_add {
hud_elem_type = "image", hud_elem_type = "image",
@ -36,7 +44,7 @@ local function init_hud(player)
wielditem = player:hud_add { wielditem = player:hud_add {
hud_elem_type = "text", hud_elem_type = "text",
position = {x = 0.5, y = 1}, position = {x = 0.5, y = 1},
offset = {x = 0, y = -65 - (i3.modules.hudbars and (ceil(hb.hudbars_count / 2) * 25) or 25)}, offset = {x = 0, y = wdesc_y},
alignment = {x = 0, y = -1}, alignment = {x = 0, y = -1},
number = 0xffffff, number = 0xffffff,
text = "", text = "",