1
1
-- saved state for each player
2
- local gui_nodename1 = {} -- mapping of player names to node names (arbitrary strings may also appear as values)
3
- local gui_nodename2 = {} -- mapping of player names to node names (arbitrary strings may also appear as values)
2
+ local gui_nodename1 = {} -- mapping of player names to node names
3
+ local gui_nodename2 = {} -- mapping of player names to node names
4
4
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)
5
5
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)
6
6
local gui_distance1 = {} -- mapping of player names to a distance (arbitrary strings may also appear as values)
@@ -10,9 +10,7 @@ local gui_count1 = {} --mapping of player names to a quantity (arbitrary strings
10
10
local gui_count2 = {} -- mapping of player names to a quantity (arbitrary strings may also appear as values)
11
11
local gui_count3 = {} -- mapping of player names to a quantity (arbitrary strings may also appear as values)
12
12
local gui_angle = {} -- mapping of player names to an angle (one of 90, 180, 270, representing the angle in degrees clockwise)
13
- local gui_filename = {} -- mapping of player names to file names (arbitrary strings may also appear as values)
14
- local gui_formspec = {} -- mapping of player names to formspecs
15
- local gui_code = {} -- mapping of player names to formspecs
13
+ local gui_filename = {} -- mapping of player names to file names
16
14
17
15
-- set default values
18
16
setmetatable (gui_nodename1 , {__index = function () return " Cobblestone" end })
@@ -27,8 +25,6 @@ setmetatable(gui_count2, {__index = function() return "6" end})
27
25
setmetatable (gui_count3 , {__index = function () return " 4" end })
28
26
setmetatable (gui_angle , {__index = function () return 90 end })
29
27
setmetatable (gui_filename , {__index = function () return " building" end })
30
- setmetatable (gui_formspec , {__index = function () return " size[5,5]\n label[0,0;Hello, world!]" end })
31
- setmetatable (gui_code , {__index = function () return " minetest.chat_send_player(\" singleplayer\" , \" Hello, world!\" )" end })
32
28
33
29
local axis_indices = {[" X axis" ]= 1 , [" Y axis" ]= 2 , [" Z axis" ]= 3 , [" Look direction" ]= 4 }
34
30
local axis_values = {" x" , " y" , " z" , " ?" }
@@ -739,32 +735,6 @@ worldedit.register_gui_handler("worldedit_gui_save_load", function(name, fields)
739
735
return false
740
736
end )
741
737
742
- worldedit .register_gui_function (" worldedit_gui_lua" , {
743
- name = " Run Lua" ,
744
- privs = we_privs (" lua" ),
745
- get_formspec = function (name )
746
- local code = gui_code [name ]
747
- return " size[8,6.5]" .. worldedit .get_formspec_header (" worldedit_gui_lua" ) ..
748
- string.format (" textarea[0.5,1;7.5,5.5;worldedit_gui_lua_code;Lua Code;%s]" , minetest .formspec_escape (code )) ..
749
- " button_exit[0,6;3,0.8;worldedit_gui_lua_run;Run Lua]" ..
750
- " button_exit[5,6;3,0.8;worldedit_gui_lua_transform;Lua Transform]"
751
- end ,
752
- })
753
-
754
- worldedit .register_gui_handler (" worldedit_gui_lua" , function (name , fields )
755
- if fields .worldedit_gui_lua_run or fields .worldedit_gui_lua_transform then
756
- gui_code [name ] = fields .worldedit_gui_lua_code
757
- worldedit .show_page (name , " worldedit_gui_lua" )
758
- if fields .worldedit_gui_lua_run then
759
- minetest .chatcommands [" /lua" ].func (name , gui_code [name ])
760
- else -- fields.worldedit_gui_lua_transform
761
- minetest .chatcommands [" /luatransform" ].func (name , gui_code [name ])
762
- end
763
- return true
764
- end
765
- return false
766
- end )
767
-
768
738
worldedit .register_gui_function (" worldedit_gui_clearobjects" , {
769
739
name = " Clear Objects" ,
770
740
privs = we_privs (" clearobjects" ),
0 commit comments