Browse Source

Set bar_size to nil in progress_bar again

See the lengthy comment to learn why
tags/2.1.0
Wuzzy 5 months ago
parent
commit
1e3def3cfa
1 changed files with 7 additions and 1 deletions
  1. +7
    -1
      init.lua

+ 7
- 1
init.lua View File

@@ -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}

Loading…
Cancel
Save