From d2264a7ebb7e5321c4cb8d8763ff2dd607c8ccb7 Mon Sep 17 00:00:00 2001 From: crabman77 Date: Mon, 30 Mar 2015 23:06:56 +0200 Subject: [PATCH] add statbar hud and new textures to mana mod --- mods/mana/init.lua | 32 ++++++++++++++-------- mods/mana/textures/mana_icon_bg_empty.png | Bin 0 -> 3173 bytes mods/mana/textures/mana_icon_violet.png | Bin 0 -> 3246 bytes 3 files changed, 21 insertions(+), 11 deletions(-) create mode 100644 mods/mana/textures/mana_icon_bg_empty.png create mode 100644 mods/mana/textures/mana_icon_violet.png diff --git a/mods/mana/init.lua b/mods/mana/init.lua index 79fdde4a..ed3c2387 100644 --- a/mods/mana/init.lua +++ b/mods/mana/init.lua @@ -278,24 +278,34 @@ else function mana.hud_add(playername) local player = minetest.get_player_by_name(playername) - local id = player:hud_add({ - hud_elem_type = "text", + player:hud_add({ + hud_elem_type = "statbar", position = {x=0.5,y=1}, - text = mana.manastring(playername), - scale = { x = 0, y = 0 }, - alignment = { x = -0.5, y = 0}, - direction = 1, - number = 0xFFFFFF, - offset = {x=220, y=-165} - }) + size = {x=24, y=24}, + text = "mana_icon_bg_empty.png", + number = 20, + alignment = {x=-1,y=-1}, + offset = {x=80, y=-186}, + } + ) + 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 return id end function mana.hud_update(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, "text", mana.manastring(playername)) + player:hud_change(mana.playerlist[playername].hudid, "number", mana.get(playername)/10) end end diff --git a/mods/mana/textures/mana_icon_bg_empty.png b/mods/mana/textures/mana_icon_bg_empty.png new file mode 100644 index 0000000000000000000000000000000000000000..1a8c3eb4d8274e688596d8281b52451962884853 GIT binary patch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~}dH($JdO7W!r-+t^LY&Mlmy&bS000000 LNkvXXu0mjf=KkHv literal 0 HcmV?d00001 diff --git a/mods/mana/textures/mana_icon_violet.png b/mods/mana/textures/mana_icon_violet.png new file mode 100644 index 0000000000000000000000000000000000000000..38d644f413f67c231b284fff6718cf12fbc5a55b GIT binary patch literal 3246 zcmV;f3{mrmP)EX>4Tx0C?J+Q)g6D=@vcr-tj1^HV42lZa2jn55j)S9!ipu-pd!uXCy!YnK{> z2n?1;Gf_2w45>mM5#WQz#Kz&|EGkvK~TfD`~gdX7S-06<0ofSs5oQvjd@0AR~wV&ec% zEdXFAf9BHwfSvf6djSAjlpz%XppgI|6J>}*0BAb^tj|`8MF3bZ02F3R#5n-iEdVe{ zS7t~6u(trf&JYW-00;~KFj0twDF6g}0AR=?BX|IWnE(_<@>e|ZE3OddDgXd@nX){& zBsoQaTL>+22Uk}v9w^R97b_GtVFF>AKrX_0nHe&HG!NkO%m4tOkrff(gY*4(&JM25 z&Nhy=4qq+mzXtyzVq)X|<DpKGaQJ>aJVl|9x!Kv}EM4F8AGNmGkLXs)P zCDQ+7;@>R$13uq10I+I40eg`xs9j?N_Dd%aSaiVR_W%I$yKlkNCzL=651DUOSSq$Ed=-((3YAKgCY2j1FI1_jrmEhm z3sv(~%T$l4UQ>OpMpZLYTc&xiMv2YpRx)mRPGut5K^*>%BIv?Wdil zy+ylO`+*KY$4Vz$Cr4+G&IO(4Q`uA9rwXSQO+7mGt}d!;r5mBUM0dY#r|y`ZzFvTy zOmC;&dA;ZQ9DOhSRQ+xGr}ak+SO&8UBnI0I&KNw!HF0k|9WTe*@liuv!$3o&VU=N* z;e?U7(LAHoMvX=fjA_PP<0Rv4#%;!P6gpNq-kQ#w?mvCS^p@!_XIRe=&)75LwiC-K#A%&Vo6|>U7iYP1 zgY$@siA#dZE|)$on;XX6$i3uBboFsv;d;{botv|p!tJQrukJSPY3_&IpUgC$DV|v~ zbI`-cL*P;6(LW2Hl`w1HtbR{JPl0E(=OZs;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