Skip to content

Commit

Permalink
Merge pull request #73 from est31/hidebutton
Browse files Browse the repository at this point in the history
Make inventory++ hide button for players without worldedit priv
  • Loading branch information
Uberi committed Feb 17, 2015
2 parents b0fbcf1 + eca54f0 commit 4336e7c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion worldedit_gui/init.lua
Expand Up @@ -102,7 +102,10 @@ if unified_inventory then --unified inventory installed
end
elseif inventory_plus then --inventory++ installed
minetest.register_on_joinplayer(function(player)
inventory_plus.register_button(player, "worldedit_gui", "WorldEdit")
local can_worldedit = minetest.check_player_privs(player:get_player_name(), {worldedit=true})
if can_worldedit then
inventory_plus.register_button(player, "worldedit_gui", "WorldEdit")
end
end)

--show the form when the button is pressed and hide it when done
Expand Down

0 comments on commit 4336e7c

Please sign in to comment.