diff options
author | orwell <orwell@bleipb.de> | 2025-02-18 01:01:31 +0100 |
---|---|---|
committer | orwell <orwell@bleipb.de> | 2025-02-18 01:01:31 +0100 |
commit | d9a9318806fe1835ff1423ee29dd5abd7c546031 (patch) | |
tree | adccdafbd3ed5764b0e1b5bcccf35cd50726319c | |
parent | 9d3c9c07d115a8d2a07d9f1162ac664245cc951e (diff) | |
download | poshud-master.tar.gz poshud-master.tar.bz2 poshud-master.zip |
-rw-r--r-- | init.lua | 18 | ||||
-rw-r--r-- | readme.md | 8 | ||||
-rw-r--r-- | settingtypes.txt | 8 |
3 files changed, 24 insertions, 10 deletions
@@ -11,9 +11,9 @@ poshud = { -- Position of hud - posx = tonumber(minetest.settings:get("poshud.hud.offsetx") or 0.8), - posy = tonumber(minetest.settings:get("poshud.hud.offsety") or 0.95), - enable_mapblock = minetest.settings:get_bool("poshud.mapblock.enable") + posx = tonumber(minetest.settings:get("poshud_hud_offsetx") or 0.8), + posy = tonumber(minetest.settings:get("poshud_hud_offsety") or 0.95), + enable_mapblock = minetest.settings:get_bool("poshud_mapblock_enable") } --settings @@ -79,11 +79,17 @@ local function removehud(player) end end +local function removecache(name) + if player_hud[name] then + player_hud[name] = nil + end +end + minetest.register_on_leaveplayer(function(player) - minetest.after(1,removehud,player) + local name = player:get_player_name() + minetest.after(1, removecache, name) end) - -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -- hud enabled/disable @@ -129,7 +135,7 @@ local function get_time() end -- rotating star -local star={"\\", "|", "/", "-"} +local star={"\\\\", "|", "/", "-"} -- New lagometry algorithm: -- Make a list of N samples @@ -10,10 +10,10 @@ Adds hud elements for current position, lag and optional mapblock coordinates Settings with default values: ``` # hud offsets -poshud.hud.offsetx = 0.8 -poshud.hud.offsetx = 0.95 +poshud_hud_offsetx = 0.8 +poshud_hud_offsetx = 0.95 # enable current mapblock display -poshud.mapblock.enable = true +poshud_mapblock_enable = true -```
\ No newline at end of file +``` diff --git a/settingtypes.txt b/settingtypes.txt new file mode 100644 index 0000000..0c3a537 --- /dev/null +++ b/settingtypes.txt @@ -0,0 +1,8 @@ +# X position of the HUD +poshud_hud_offsetx (HUD X offset) float 0.8 0.0 1.0 + +# Y position of the HUD +poshud_hud_offsety (HUD Y offset) float 0.95 0.0 1.0 + +# Enable displaying the current map-block coordinates (16x16x16 nodes) +poshud_mapblock_enable (Display Mapblock) bool false
\ No newline at end of file |