mirror of
https://repo.or.cz/minetest_hudbars.git
synced 2025-06-28 22:46:06 +02:00
Compare commits
10 Commits
2.2.0
...
nalc-1.2.0
Author | SHA1 | Date | |
---|---|---|---|
28dcf8af65 | |||
a250d2a350 | |||
7993feac07 | |||
b19b5f090a | |||
9a8a3f0f8c | |||
2eb2df946b | |||
c4ddef312e | |||
7f6ed309b3 | |||
7cd5940c68 | |||
67ca481f7c |
@ -11,7 +11,7 @@ this mod will place them accordingly.
|
||||
position should be displayed correctly on every screen size.
|
||||
|
||||
## Current version
|
||||
The current version is 2.2.0.
|
||||
The current version is 2.2.2.
|
||||
|
||||
This software uses [semantic versioning](http://semver.org), as defined by version 2.0.0 of the SemVer
|
||||
standard.
|
||||
|
10
init.lua
10
init.lua
@ -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({
|
||||
@ -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
|
||||
@ -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
|
||||
@ -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({
|
||||
@ -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
|
||||
@ -316,6 +321,9 @@ function hb.change_hudbar(player, identifier, new_value, new_max_value, new_icon
|
||||
|
||||
local name = player:get_player_name()
|
||||
local hudtable = hb.get_hudtable(identifier)
|
||||
if not hudtable.hudstate[name] then
|
||||
return false
|
||||
end
|
||||
local value_changed, max_changed = false, false
|
||||
|
||||
if new_value ~= nil then
|
||||
@ -567,3 +575,5 @@ minetest.register_globalstep(function(dtime)
|
||||
end
|
||||
if timer > 4 then timer = 0 end
|
||||
end)
|
||||
|
||||
minetest.log("action", "[hudbars] loaded.")
|
||||
|
Reference in New Issue
Block a user