Skip to content

Commit

Permalink
hide the cube when hud is off (#59)
Browse files Browse the repository at this point in the history
* hide the cube when hud is off
* Update entities.lua
Co-authored-by: OgelGames <olliverdc28@gmail.com>
  • Loading branch information
SwissalpS committed Dec 8, 2021
1 parent e02e0c4 commit 0847ce5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions entities.lua
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ xp_redo.update_rank_entity = function(player, rank)
return
end

local state = player:get_meta():get(xp_redo.HUD_DISPLAY_STATE_NAME)
if state == "off" then return end

local playername = player:get_player_name()
local data = player_data[playername]

Expand Down
1 change: 1 addition & 0 deletions hud.lua
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ minetest.register_chatcommand("xp_hud", {
setup_hud(player)
elseif param == "off" then
remove_hud(player)
xp_redo.remove_rank_entity(player)
else
return true, "Usage: xp_hud on|off"
end
Expand Down

0 comments on commit 0847ce5

Please sign in to comment.