mirror of
https://repo.or.cz/minetest_hudbars.git
synced 2024-11-23 23:53:54 +01:00
Fix add_all
This commit is contained in:
parent
377f194884
commit
0ac416ad49
14
init.lua
14
init.lua
@ -51,10 +51,10 @@ function hb.register_hudbar(identifier, text_color, label, textures, default_sta
|
||||
format_string = "%s: %d/%d"
|
||||
end
|
||||
|
||||
hudtable.add_all = function(player, start_value, start_max, start_hidden)
|
||||
if start_value == nil then start_value = default_start_value end
|
||||
if start_max == nil then start_max = default_start_max end
|
||||
if start_hidden == nil then start_hidden = default_start_hidden end
|
||||
hudtable.add_all = function(player, hudtable, start_value, start_max, start_hidden)
|
||||
if start_value == nil then start_value = hudtable.default_start_value end
|
||||
if start_max == nil then start_max = hudtable.default_start_max end
|
||||
if start_hidden == nil then start_hidden = hudtable.default_start_hidden end
|
||||
local ids = {}
|
||||
local state = {}
|
||||
local name = player:get_player_name()
|
||||
@ -137,6 +137,9 @@ function hb.register_hudbar(identifier, text_color, label, textures, default_sta
|
||||
hudtable.label = label
|
||||
hudtable.hudids = {}
|
||||
hudtable.hudstate = {}
|
||||
hudtable.default_start_hidden = default_start_hidden
|
||||
hudtable.default_start_value = default_start_value
|
||||
hudtable.default_start_max = default_start_max
|
||||
|
||||
hb.hudbars_count= hb.hudbars_count + 1
|
||||
|
||||
@ -144,7 +147,8 @@ function hb.register_hudbar(identifier, text_color, label, textures, default_sta
|
||||
end
|
||||
|
||||
function hb.init_hudbar(player, identifier, start_value, start_max, start_hidden)
|
||||
hb.hudtables[identifier].add_all(player, start_value, start_max, start_hidden)
|
||||
local hudtable = hb.get_hudtable(identifier)
|
||||
hb.hudtables[identifier].add_all(player, hudtable, start_value, start_max, start_hidden)
|
||||
end
|
||||
|
||||
function hb.change_hudbar(player, identifier, new_value, new_max_value)
|
||||
|
Loading…
Reference in New Issue
Block a user