
minetest.register_chatcommand("/hud", {
	params = "",
	description = "Toggles the helper heads-up display.",
	func = function(player_name, params_text)
		worldedit_hud_helper.info[player_name].enabled = not worldedit_hud_helper.info[player_name].enabled
		
		local player = minetest.get_player_by_name(player_name)
		local message = "HUD "
		
		if worldedit_hud_helper.info[player_name].enabled then
			worldedit_hud_helper.initialise_hud(player)
			message = message .. "shown"
		else
			worldedit_hud_helper.hide_hud(player)
			message = message .. "hidden"
		end
		
		worldedit_hud_helper.player_notify(player_name, message)
	end
})
