mirror of
git://repo.or.cz/minetest_mana.git
synced 2025-06-29 21:50:24 +02:00
Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
45eb047016 | |||
b152b04601 | |||
f4a0c31301 |
10
init.lua
10
init.lua
@ -25,17 +25,17 @@ mana.settings.default_regen = 1
|
||||
mana.settings.regen_timer = 0.2
|
||||
|
||||
do
|
||||
local default_max = tonumber(minetest.setting_get("mana_default_max"))
|
||||
local default_max = tonumber(minetest.settings:get("mana_default_max"))
|
||||
if default_max ~= nil then
|
||||
mana.settings.default_max = default_max
|
||||
end
|
||||
|
||||
local default_regen = tonumber(minetest.setting_get("mana_default_regen"))
|
||||
local default_regen = tonumber(minetest.settings:get("mana_default_regen"))
|
||||
if default_regen ~= nil then
|
||||
mana.settings.default_regen = default_regen
|
||||
end
|
||||
|
||||
local regen_timer = tonumber(minetest.setting_get("mana_regen_timer"))
|
||||
local regen_timer = tonumber(minetest.settings:get("mana_regen_timer"))
|
||||
if regen_timer ~= nil then
|
||||
mana.settings.regen_timer = regen_timer
|
||||
end
|
||||
@ -276,7 +276,7 @@ end)
|
||||
]===]
|
||||
|
||||
if minetest.get_modpath("hudbars") ~= nil then
|
||||
hb.register_hudbar("mana", 0xFFFFFF, S("Mana"), { bar = "mana_bar.png", icon = "mana_icon.png", bgicon = "mana_bgicon.png" }, 0, mana.settings.default_max, false)
|
||||
hb.register_hudbar("mana", 0xFFFFFF, S("Mana"), { bar = "mana_bar_purple.png", icon = "mana_icon_purple.png", bgicon = "mana_icon_bg_empty.png" }, 0, mana.settings.default_max, false)
|
||||
|
||||
function mana.hud_update(playername)
|
||||
local player = minetest.get_player_by_name(playername)
|
||||
@ -326,3 +326,5 @@ end
|
||||
mana.round = function(x)
|
||||
return math.ceil(math.floor(x+0.5))
|
||||
end
|
||||
|
||||
minetest.log("action", "[mana] loaded.")
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 80 B |
BIN
textures/mana_bar_purple.png
Executable file
BIN
textures/mana_bar_purple.png
Executable file
Binary file not shown.
After Width: | Height: | Size: 82 B |
Binary file not shown.
Before Width: | Height: | Size: 2.9 KiB |
Binary file not shown.
Before Width: | Height: | Size: 2.9 KiB |
BIN
textures/mana_icon_bg_empty.png
Executable file
BIN
textures/mana_icon_bg_empty.png
Executable file
Binary file not shown.
After Width: | Height: | Size: 635 B |
BIN
textures/mana_icon_purple.png
Executable file
BIN
textures/mana_icon_purple.png
Executable file
Binary file not shown.
After Width: | Height: | Size: 600 B |
Reference in New Issue
Block a user