From e931f6121c40077b9ea50a1487d99835aa84b8f7 Mon Sep 17 00:00:00 2001 From: Jean-Patrick Guerrero Date: Sat, 16 Jan 2021 04:01:30 +0100 Subject: [PATCH] SHow grey hearts when damaged disabled --- init.lua | 9 +++++++-- textures/i3_heart_grey.png | Bin 0 -> 4093 bytes 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 textures/i3_heart_grey.png diff --git a/init.lua b/init.lua index 56a6698..5f2274f 100644 --- a/init.lua +++ b/init.lua @@ -13,6 +13,7 @@ local toolrepair local tabs = {} local progressive_mode = core.settings:get_bool "i3_progressive_mode" +local damage_enabled = core.settings:get_bool "enable_damage" local __3darmor, __skinsdb, __awards local http = core.request_http_api() @@ -82,6 +83,9 @@ local PNG = { bg = "i3_bg.png", bg_full = "i3_bg_full.png", search = "i3_search.png", + heart = "i3_heart.png", + heart_half = "i3_heart_half.png", + heart_grey = "i3_heart_grey.png", prev = "i3_next.png^\\[transformFX", next = "i3_next.png", arrow = "i3_arrow.png", @@ -1817,14 +1821,15 @@ local function get_ctn_content(fs, data, player, xoffset, yoffset, ctn_len, awar local name = player:get_player_name() add_subtitle(fs, ESC(name), xoffset, yoffset + 0.2, ctn_len, "+6") - local hp = data.hp or player:get_hp() + local hp = damage_enabled and (data.hp or player:get_hp()) or 20 local half = ceil((hp / 2) % 1) local hearts = (hp / 2) + half local yextra = 5.6 for i = 1, hearts do fs(fmt("image", xoffset + ((i - 1) * 0.4), yoffset + 0.7, 0.4, 0.4, - (half == 1 and i == floor(hearts)) and "i3_heart_half.png" or "i3_heart.png")) + (half == 1 and i == floor(hearts)) and PNG.heart_half or + (damage_enabled and PNG.heart or PNG.heart_grey))) end fs(fmt("list[current_player;craft;%f,%f;3,3;]", xoffset, yoffset + 1.45), diff --git a/textures/i3_heart_grey.png b/textures/i3_heart_grey.png new file mode 100644 index 0000000000000000000000000000000000000000..c2e8720d5ce79e0483a8ccfd9e74a81783937950 GIT binary patch literal 4093 zcmV zaB^>EX>4U6ba`-P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