From 1e3def3cfa5467627b65e4f08f984b8faddd2474 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Fri, 13 Sep 2019 19:56:22 +0200 Subject: [PATCH] Set bar_size to nil in progress_bar again See the lengthy comment to learn why --- init.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 0a02532..0f91960 100644 --- a/init.lua +++ b/init.lua @@ -228,7 +228,13 @@ function hb.register_hudbar(identifier, text_color, label, textures, default_sta local bar_image, bar_size if hb.settings.bar_type == "progress_bar" then bar_image = textures.bar - bar_size = {x=2, y=16} + -- NOTE: Intentionally set to nil. For some reason, on some systems, + -- the progress bar is displaced when the bar_size is set explicitly here. + -- On the other hand, setting this to nil is deprecated in MT 5.0.0 due to + -- a debug log warning, but nothing is explained in lua_api.txt. + -- This section is a potential bug magnet, please watch with care! + -- The size of the bar image is expected to be exactly 2×16 pixels. + bar_size = nil elseif hb.settings.bar_type == "statbar_classic" or hb.settings.bar_type == "statbar_modern" then bar_image = textures.icon bar_size = {x=24, y=24}