diff options
author | Wuzzy <almikes@aol.com> | 2015-02-12 19:50:23 +0100 |
---|---|---|
committer | Wuzzy <almikes@aol.com> | 2015-02-12 19:50:23 +0100 |
commit | 0ac416ad49210daf3b7703bd0239a8ca9e1fd5d7 (patch) | |
tree | b7875997bd40d8a640f07396b11a425cf508e6ec | |
parent | 377f194884958aebd9b1495cb93e76446330b1e8 (diff) |
Fix add_all
-rw-r--r-- | init.lua | 14 |
1 files changed, 9 insertions, 5 deletions
@@ -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) |