summaryrefslogtreecommitdiff
path: root/builtin/game
diff options
context:
space:
mode:
authorWuzzy <wuzzy2@mail.ru>2020-05-11 21:40:45 +0200
committerGitHub <noreply@github.com>2020-05-11 21:40:45 +0200
commit6e1372bd894d955300c40d69e5c882e9cc7d7523 (patch)
tree6273a8c2ddfec5efbc5b69fa49b088368dd78c15 /builtin/game
parent88bb8e57e6780130df1877e7a89bb56c9561ea6a (diff)
downloadminetest-6e1372bd894d955300c40d69e5c882e9cc7d7523.tar.gz
minetest-6e1372bd894d955300c40d69e5c882e9cc7d7523.tar.bz2
minetest-6e1372bd894d955300c40d69e5c882e9cc7d7523.zip
Add support for statbar “off state” icons (#9462)
This adds support for optional “off state” icons for statbars. “off state icons” can be used to denote the lack of something, like missing hearts or bubbles. Add "off state" textures to the builtin statbars. Co-authored-by: SmallJoker <mk939@ymail.com>
Diffstat (limited to 'builtin/game')
-rw-r--r--builtin/game/statbars.lua4
1 files changed, 4 insertions, 0 deletions
diff --git a/builtin/game/statbars.lua b/builtin/game/statbars.lua
index 6b5b54428..d192029c5 100644
--- a/builtin/game/statbars.lua
+++ b/builtin/game/statbars.lua
@@ -5,7 +5,9 @@ local health_bar_definition = {
hud_elem_type = "statbar",
position = {x = 0.5, y = 1},
text = "heart.png",
+ text2 = "heart_gone.png",
number = core.PLAYER_MAX_HP_DEFAULT,
+ item = core.PLAYER_MAX_HP_DEFAULT,
direction = 0,
size = {x = 24, y = 24},
offset = {x = (-10 * 24) - 25, y = -(48 + 24 + 16)},
@@ -15,7 +17,9 @@ local breath_bar_definition = {
hud_elem_type = "statbar",
position = {x = 0.5, y = 1},
text = "bubble.png",
+ text2 = "bubble_gone.png",
number = core.PLAYER_MAX_BREATH_DEFAULT,
+ item = core.PLAYER_MAX_BREATH_DEFAULT * 2,
direction = 0,
size = {x = 24, y = 24},
offset = {x = 25, y= -(48 + 24 + 16)},