Add a bossbar limit setting

This commit is contained in:
Elias Fleckenstein 2021-04-07 17:02:03 +02:00
parent f282cd0c4d
commit 567f157541
2 changed files with 26 additions and 20 deletions

View file

@ -3,6 +3,7 @@ mcl_bossbars = {
huds = {},
static = {},
colors = {"light_purple", "blue", "red", "green", "yellow", "dark_purple", "white"},
max_bars = tonumber(minetest.settings:get("max_bossbars")) or 6
}
function mcl_bossbars.recalculate_colors()
@ -127,6 +128,7 @@ minetest.register_globalstep(function()
end
if bar and not hud then
if i < mcl_bossbars.max_bars then
hud = {
color = bar.color,
image = bar.image,
@ -148,6 +150,7 @@ minetest.register_globalstep(function()
scale = {x = 3, y = 3},
}),
}
end
elseif hud and not bar then
player:hud_remove(hud.text_id)
player:hud_remove(hud.image_id)

View file

@ -97,6 +97,9 @@ animated_chests (Animated chests) bool true
# Whether to preview the player in inventory in 3D (requires Minetest 5.4)
3d_player_preview (3D Player preview) bool true
# The maximum number of boss bars to simultaniously display on the screen
max_bossbars (Maximum Boss bars) int 6
[Experimental]
# Whether ice is translucent. If disabled, ice is fully opaque.
#