From b4de48370a43bea1dc7623a46ab9af0271b6dd25 Mon Sep 17 00:00:00 2001 From: Jean-Patrick Guerrero Date: Wed, 14 Sep 2022 15:30:31 +0200 Subject: [PATCH] HUD: small tweak --- src/callbacks.lua | 4 ---- src/hud.lua | 10 +++++++++- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/callbacks.lua b/src/callbacks.lua index 528d521..166d6f6 100644 --- a/src/callbacks.lua +++ b/src/callbacks.lua @@ -148,10 +148,6 @@ if core.global_exists"skins" then i3.modules.skins = true end -if core.global_exists"hb" then - i3.modules.hudbars = true -end - if core.global_exists"awards" then i3.modules.awards = true diff --git a/src/hud.lua b/src/hud.lua index 28eb09a..9044351 100644 --- a/src/hud.lua +++ b/src/hud.lua @@ -4,6 +4,14 @@ local function init_hud(player) local name = player:get_player_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 = { bg = player:hud_add { hud_elem_type = "image", @@ -36,7 +44,7 @@ local function init_hud(player) wielditem = player:hud_add { hud_elem_type = "text", 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}, number = 0xffffff, text = "",