]> git.lizzy.rs Git - worldedit.git/commitdiff
Remove Lua functions from WorldEdit GUI
authorsfan5 <sfan5@live.de>
Tue, 12 Sep 2017 10:58:44 +0000 (12:58 +0200)
committersfan5 <sfan5@live.de>
Tue, 12 Sep 2017 11:04:25 +0000 (13:04 +0200)
worldedit_gui/functionality.lua

index d957c123d3e77342f4d51091a7dfd692fb69522f..2d6c6c64623df24671d57d7a0cc94642c96b0ef7 100644 (file)
@@ -1,6 +1,6 @@
 --saved state for each player\r
-local gui_nodename1 = {} --mapping of player names to node names (arbitrary strings may also appear as values)\r
-local gui_nodename2 = {} --mapping of player names to node names (arbitrary strings may also appear as values)\r
+local gui_nodename1 = {} --mapping of player names to node names\r
+local gui_nodename2 = {} --mapping of player names to node names\r
 local gui_axis1 = {} --mapping of player names to axes (one of 1, 2, 3, or 4, representing the axes in the `axis_indices` table below)\r
 local gui_axis2 = {} --mapping of player names to axes (one of 1, 2, 3, or 4, representing the axes in the `axis_indices` table below)\r
 local gui_distance1 = {} --mapping of player names to a distance (arbitrary strings may also appear as values)\r
@@ -10,9 +10,7 @@ local gui_count1 = {} --mapping of player names to a quantity (arbitrary strings
 local gui_count2 = {} --mapping of player names to a quantity (arbitrary strings may also appear as values)\r
 local gui_count3 = {} --mapping of player names to a quantity (arbitrary strings may also appear as values)\r
 local gui_angle = {} --mapping of player names to an angle (one of 90, 180, 270, representing the angle in degrees clockwise)\r
-local gui_filename = {} --mapping of player names to file names (arbitrary strings may also appear as values)\r
-local gui_formspec = {} --mapping of player names to formspecs\r
-local gui_code = {} --mapping of player names to formspecs\r
+local gui_filename = {} --mapping of player names to file names\r
 \r
 --set default values\r
 setmetatable(gui_nodename1, {__index = function() return "Cobblestone" end})\r
@@ -27,8 +25,6 @@ setmetatable(gui_count2,     {__index = function() return "6" end})
 setmetatable(gui_count3,     {__index = function() return "4" end})\r
 setmetatable(gui_angle,     {__index = function() return 90 end})\r
 setmetatable(gui_filename,  {__index = function() return "building" end})\r
-setmetatable(gui_formspec,  {__index = function() return "size[5,5]\nlabel[0,0;Hello, world!]" end})\r
-setmetatable(gui_code,  {__index = function() return "minetest.chat_send_player(\"singleplayer\", \"Hello, world!\")" end})\r
 \r
 local axis_indices = {["X axis"]=1, ["Y axis"]=2, ["Z axis"]=3, ["Look direction"]=4}\r
 local axis_values = {"x", "y", "z", "?"}\r
@@ -739,32 +735,6 @@ worldedit.register_gui_handler("worldedit_gui_save_load", function(name, fields)
        return false\r
 end)\r
 \r
-worldedit.register_gui_function("worldedit_gui_lua", {\r
-       name = "Run Lua",\r
-       privs = we_privs("lua"),\r
-       get_formspec = function(name)\r
-               local code = gui_code[name]\r
-               return "size[8,6.5]" .. worldedit.get_formspec_header("worldedit_gui_lua") ..\r
-                       string.format("textarea[0.5,1;7.5,5.5;worldedit_gui_lua_code;Lua Code;%s]", minetest.formspec_escape(code)) ..\r
-                       "button_exit[0,6;3,0.8;worldedit_gui_lua_run;Run Lua]" ..\r
-                       "button_exit[5,6;3,0.8;worldedit_gui_lua_transform;Lua Transform]"\r
-       end,\r
-})\r
-\r
-worldedit.register_gui_handler("worldedit_gui_lua", function(name, fields)\r
-       if fields.worldedit_gui_lua_run or fields.worldedit_gui_lua_transform then\r
-               gui_code[name] = fields.worldedit_gui_lua_code\r
-               worldedit.show_page(name, "worldedit_gui_lua")\r
-               if fields.worldedit_gui_lua_run then\r
-                       minetest.chatcommands["/lua"].func(name, gui_code[name])\r
-               else --fields.worldedit_gui_lua_transform\r
-                       minetest.chatcommands["/luatransform"].func(name, gui_code[name])\r
-               end\r
-               return true\r
-       end\r
-       return false\r
-end)\r
-\r
 worldedit.register_gui_function("worldedit_gui_clearobjects", {\r
        name = "Clear Objects",\r
        privs = we_privs("clearobjects"),\r