summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWuzzy <almikes@aol.com>2015-02-11 20:55:22 +0100
committerWuzzy <almikes@aol.com>2015-02-11 20:55:22 +0100
commit7912e6b4ec82d37ef39432f4fea909d05cf5ba11 (patch)
treed14b43f1819a1611b0d068dabc5267c9c7396f83
parent4b1c38fdcf6ba5dab86d8f1ff5d0927136d479d2 (diff)
Rename “start_hide” to “start_hidden”
-rw-r--r--API.md6
-rw-r--r--init.lua4
2 files changed, 5 insertions, 5 deletions
diff --git a/API.md b/API.md
index 5e2d55d..0f20ff7 100644
--- a/API.md
+++ b/API.md
@@ -49,7 +49,7 @@ a vertical gradient.
### Icon
A 16×16 image shown left of the HUD bar. This is optional.
-### `hb.register_hudbar(identifier, text_color, label, textures, default_start_value, default_start_max, start_hide, format_string)`
+### `hb.register_hudbar(identifier, text_color, label, textures, default_start_value, default_start_max, start_hidden, format_string)`
This function registers a new custom HUD bar definition to the HUD bars mod, so it can be later used to be displayed, changed, hidden
and unhidden on a per-player basis.
Note this does not yet display the HUD bar.
@@ -67,7 +67,7 @@ manually in a reliable way.
* `icon`: The file name of the icon, as string. This field can be `nil`, in which case no icon will be used.
* `default_start_value`: If this HUD bar is added to a player, and no initial value is specified, this value will be used as initial current value
* `default_max_value`: If this HUD bar is added to a player, and no initial maximum value is specified, this value will be used as initial maximum value
-* `start_hide`: The HUD bar will be initially start hidden when added to a player. Use `hb.unhide_hudbar` to unhide it.
+* `start_hidden`: The HUD bar will be initially start hidden when added to a player. Use `hb.unhide_hudbar` to unhide it.
* `format_string`: This is optional; You can specify an alternative format string display the final text on the HUD bar. The default format string is “`%s: %d/%d`” (in this order: Label, current value, maximum value). See also the Lua documentation of `string.format`.
#### Return value
@@ -85,7 +85,7 @@ This function initialzes and activates a previously registered HUD bar and assig
certain client/player. This has only to be done once per player and after that, you can change
the values using `hb.change_hudbar`.
-However, if `start_hide` was set to `true` for the HUD bar (in `hb.register_hudbar`), the HUD bar
+However, if `start_hidden` was set to `true` for the HUD bar (in `hb.register_hudbar`), the HUD bar
will initially be hidden, but the HUD elements are still sent to the client. Otherwise,
the HUD bar will be initially be shown to the player.
diff --git a/init.lua b/init.lua
index fc2b2c1..de37e38 100644
--- a/init.lua
+++ b/init.lua
@@ -65,7 +65,7 @@ function hb.get_hudtable(identifier)
return hb.hudtables[identifier]
end
-function hb.register_hudbar(identifier, text_color, label, textures, default_start_value, default_start_max, start_hide, format_string)
+function hb.register_hudbar(identifier, text_color, label, textures, default_start_value, default_start_max, start_hidden, format_string)
local hudtable = {}
local pos, offset
if hb.hudbars_count % 2 == 0 then
@@ -133,7 +133,7 @@ function hb.register_hudbar(identifier, text_color, label, textures, default_sta
direction = 0,
offset = { x = offset.x + 2, y = offset.y },
})
- state.hidden = start_hide
+ state.hidden = start_hidden
state.value = start_value
state.max = start_max
state.text = text