mirror of
https://repo.or.cz/minetest_hudbars.git
synced 2024-11-23 15:43:48 +01:00
Fix massive hud_change spam (hide/unhide)
This commit is contained in:
parent
0684bac45b
commit
a44de6230b
2
init.lua
2
init.lua
@ -404,6 +404,7 @@ function hb.hide_hudbar(player, identifier)
|
||||
local name = player:get_player_name()
|
||||
local hudtable = hb.get_hudtable(identifier)
|
||||
if hudtable == nil then return false end
|
||||
if hudtable.hudstate[name].hidden == true then return true end
|
||||
if hb.settings.bar_type == "progress_bar" then
|
||||
if hudtable.hudids[name].icon ~= nil then
|
||||
player:hud_change(hudtable.hudids[name].icon, "scale", {x=0,y=0})
|
||||
@ -422,6 +423,7 @@ function hb.unhide_hudbar(player, identifier)
|
||||
local name = player:get_player_name()
|
||||
local hudtable = hb.get_hudtable(identifier)
|
||||
if hudtable == nil then return false end
|
||||
if hudtable.hudstate[name].hidden == false then return true end
|
||||
local value = hudtable.hudstate[name].value
|
||||
local max = hudtable.hudstate[name].max
|
||||
if hb.settings.bar_type == "progress_bar" then
|
||||
|
Loading…
Reference in New Issue
Block a user