Skip to content

Commit

Permalink
update hudbars from master
Browse files Browse the repository at this point in the history
  • Loading branch information
Michiel1973 committed Jun 1, 2020
1 parent 4efa99e commit 39563ec
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions mods/hudbars/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ function hb.register_hudbar(identifier, text_color, label, textures, default_sta
text = "hudbars_bar_background.png",
alignment = {x=1,y=1},
offset = { x = offset.x - 1, y = offset.y - 1 },
z_index = 0,
})
if textures.icon ~= nil then
ids.icon = player:hud_add({
Expand All @@ -209,6 +210,7 @@ function hb.register_hudbar(identifier, text_color, label, textures, default_sta
text = textures.icon,
alignment = {x=-1,y=1},
offset = { x = offset.x - 3, y = offset.y },
z_index = 1,
})
end
elseif hb.settings.bar_type == "statbar_modern" then
Expand All @@ -222,6 +224,7 @@ function hb.register_hudbar(identifier, text_color, label, textures, default_sta
offset = { x = offset.x, y = offset.y },
direction = 0,
size = {x=24, y=24},
z_index = 0,
})
end
end
Expand All @@ -248,6 +251,7 @@ function hb.register_hudbar(identifier, text_color, label, textures, default_sta
offset = offset,
direction = 0,
size = bar_size,
z_index = 1,
})
if hb.settings.bar_type == "progress_bar" then
ids.text = player:hud_add({
Expand All @@ -258,6 +262,7 @@ function hb.register_hudbar(identifier, text_color, label, textures, default_sta
number = text_color,
direction = 0,
offset = { x = offset.x + 2, y = offset.y - 1},
z_index = 2,
})
end
-- Do not forget to update hb.get_hudbar_state if you add new fields to the state table
Expand Down
2 changes: 1 addition & 1 deletion mods/hunger_ng/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ hunger_ng = {
},
settings = {
hunger_bar = {
image = get('hunger_bar_image', 'farming_bread.png'),
image = get('hunger_bar_image', 'hunger_icon.png'),
use = minetest.is_yes(get('use_hunger_bar', true))
},
timers = {
Expand Down
Binary file added mods/hunger_ng/textures/hunger_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 39563ec

Please sign in to comment.