From 5f9efb1205fe9802f859548fc9220f98dd0fd12e Mon Sep 17 00:00:00 2001
From: Sebastien Ponce <Sebastien.Ponce@cern.ch>
Date: Sun, 13 Sep 2015 11:31:47 +0200
Subject: Added hollow pyramids

---
 worldedit_gui/functionality.lua | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

(limited to 'worldedit_gui')

diff --git a/worldedit_gui/functionality.lua b/worldedit_gui/functionality.lua
index 989c9eb..d3b78f6 100644
--- a/worldedit_gui/functionality.lua
+++ b/worldedit_gui/functionality.lua
@@ -295,18 +295,21 @@ worldedit.register_gui_function("worldedit_gui_pyramid", {
 				or "image[5.5,1.1;1,1;unknown_node.png]") ..
 			string.format("field[0.5,2.5;4,0.8;worldedit_gui_pyramid_length;Length;%s]", minetest.formspec_escape(length)) ..
 			string.format("dropdown[4,2.18;2.5;worldedit_gui_pyramid_axis;X axis,Y axis,Z axis,Look direction;%d]", axis) ..
-			"button_exit[0,3.5;3,0.8;worldedit_gui_pyramid_submit;Pyramid]"
+			"button_exit[0,3.5;3,0.8;worldedit_gui_pyramid_submit_hollow;Hollow Pyramid]" ..
+			"button_exit[3.5,3.5;3,0.8;worldedit_gui_pyramid_submit_solid;Solid Pyramid]"
 	end,
 })
 
 worldedit.register_gui_handler("worldedit_gui_pyramid", function(name, fields)
-	if fields.worldedit_gui_pyramid_search or fields.worldedit_gui_pyramid_submit then
+	if fields.worldedit_gui_pyramid_search or fields.worldedit_gui_pyramid_submit_solid or fields.worldedit_gui_pyramid_submit_hollow or fields.worldedit_gui_pyramid_axis then
 		gui_nodename1[name] = tostring(fields.worldedit_gui_pyramid_node)
 		gui_axis1[name] = axis_indices[fields.worldedit_gui_pyramid_axis]
 		gui_distance1[name] = tostring(fields.worldedit_gui_pyramid_length)
 		worldedit.show_page(name, "worldedit_gui_pyramid")
-		if fields.worldedit_gui_pyramid_submit then
+		if fields.worldedit_gui_pyramid_submit_solid then
 			minetest.chatcommands["/pyramid"].func(name, string.format("%s %s %s", axis_values[gui_axis1[name]], gui_distance1[name], gui_nodename1[name]))
+		elseif fields.worldedit_gui_pyramid_submit_hollow then
+			minetest.chatcommands["/hollowpyramid"].func(name, string.format("%s %s %s", axis_values[gui_axis1[name]], gui_distance1[name], gui_nodename1[name]))
 		end
 		return true
 	end
-- 
cgit v1.2.3