diff --git a/mods/rgt_player/init.lua b/mods/rgt_player/init.lua new file mode 100644 index 0000000..f979e14 --- /dev/null +++ b/mods/rgt_player/init.lua @@ -0,0 +1,31 @@ +local ns = rgt +ns.players = {} + +Player = { + new = function(p) + local e = setmetatable({ + name = p:get_player_name(), + object = p + }, {__index = Player}) + return e + end +} +setmetatable(Player, { + __call = function(_, ...) return Player.new(...) end +}) + +-- TODO: Replace builtin health system with custom health system +minetest.hud_replace_builtin("health", { + type = "statbar", + position = {x=0.5,y=1}, + offset = {x=-27 *10 -1,y=-96}, + scale = {x=4,y=4}, + alignment = {x=-1, y=-1}, + size = {x=27,y=27}, + text = "rgt_heart.png", + text2 = "rgt_heart_empty.png" +}) + +minetest.register_on_joinplayer(function(p) + ns.players[p:get_player_name()] = Player(p) +end) diff --git a/mods/rgt_player/textures/rgt_heart_empty.png b/mods/rgt_player/textures/rgt_heart_empty.png new file mode 100644 index 0000000..16faec5 Binary files /dev/null and b/mods/rgt_player/textures/rgt_heart_empty.png differ diff --git a/mods/rgt_towns/rgt_towns_core/textures/rgt_towns_constructor_bottom.png b/mods/rgt_towns/rgt_towns_core/textures/rgt_towns_constructor_bottom.png index 4f9f343..c94316a 100644 Binary files a/mods/rgt_towns/rgt_towns_core/textures/rgt_towns_constructor_bottom.png and b/mods/rgt_towns/rgt_towns_core/textures/rgt_towns_constructor_bottom.png differ