mirror of
https://github.com/sys4-fr/server-nalc.git
synced 2024-12-25 02:00:37 +01:00
add statbar hud and new textures to mana mod
This commit is contained in:
parent
0b7251fdce
commit
d2264a7ebb
@ -278,24 +278,34 @@ else
|
|||||||
|
|
||||||
function mana.hud_add(playername)
|
function mana.hud_add(playername)
|
||||||
local player = minetest.get_player_by_name(playername)
|
local player = minetest.get_player_by_name(playername)
|
||||||
local id = player:hud_add({
|
player:hud_add({
|
||||||
hud_elem_type = "text",
|
hud_elem_type = "statbar",
|
||||||
position = {x=0.5,y=1},
|
position = {x=0.5,y=1},
|
||||||
text = mana.manastring(playername),
|
size = {x=24, y=24},
|
||||||
scale = { x = 0, y = 0 },
|
text = "mana_icon_bg_empty.png",
|
||||||
alignment = { x = -0.5, y = 0},
|
number = 20,
|
||||||
direction = 1,
|
alignment = {x=-1,y=-1},
|
||||||
number = 0xFFFFFF,
|
offset = {x=80, y=-186},
|
||||||
offset = {x=220, y=-165}
|
}
|
||||||
})
|
)
|
||||||
|
local id = player:hud_add({
|
||||||
|
hud_elem_type = "statbar",
|
||||||
|
position = {x=0.5,y=1},
|
||||||
|
size = {x=24, y=24},
|
||||||
|
text = "mana_icon_violet.png",
|
||||||
|
number = mana.get(playername)/10,
|
||||||
|
alignment = {x=-1,y=-1},
|
||||||
|
offset = {x=80, y=-186},
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
mana.playerlist[playername].hudid = id
|
mana.playerlist[playername].hudid = id
|
||||||
return id
|
return id
|
||||||
end
|
end
|
||||||
|
|
||||||
function mana.hud_update(playername)
|
function mana.hud_update(playername)
|
||||||
local player = minetest.get_player_by_name(playername)
|
local player = minetest.get_player_by_name(playername)
|
||||||
player:hud_change(mana.playerlist[playername].hudid, "number", mana.get(playername))
|
player:hud_change(mana.playerlist[playername].hudid, "number", mana.get(playername)/10)
|
||||||
player:hud_change(mana.playerlist[playername].hudid, "text", mana.manastring(playername))
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
BIN
mods/mana/textures/mana_icon_bg_empty.png
Normal file
BIN
mods/mana/textures/mana_icon_bg_empty.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.1 KiB |
BIN
mods/mana/textures/mana_icon_violet.png
Normal file
BIN
mods/mana/textures/mana_icon_violet.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.2 KiB |
Loading…
Reference in New Issue
Block a user