|
@@ -35,10 +35,12 @@ minetest.register_entity("gauges:hp_bar", {
|
|
|
local breath = player:get_breath() <= 10 and player:get_breath() or 11
|
|
|
|
|
|
if self.hp ~= hp or self.breath ~= breath then
|
|
|
+ local hp_tex = hp < 20 and "health_"..tostring(hp)..".png" or "blank.png"
|
|
|
+ local breath_tex = breath < 10 and "breath_"..tostring(breath)..".png" or "blank.png"
|
|
|
+
|
|
|
gauge:set_properties({
|
|
|
textures = {
|
|
|
- "health_"..tostring(hp)..".png^"..
|
|
|
- "breath_"..tostring(breath)..".png"
|
|
|
+ hp_tex .. "^" .. breath_tex
|
|
|
}
|
|
|
})
|
|
|
self.hp = hp
|