Skip to content

Commit

Permalink
add "mark" option for the controller
Browse files Browse the repository at this point in the history
  • Loading branch information
BuckarooBanzay committed Jan 6, 2021
1 parent c5a6dc0 commit 3d5916f
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion nodes/controller.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ local function show_formspec(pos, playername)

"button_exit[0,2.5;7,1;download;Download from blockexchange]" ..
"button_exit[0,3.5;7,1;upload;Upload to blockexchange]" ..
"button_exit[0,4.5;7,1;abort;Abort]" ..
"button_exit[0,4.5;7,1;mark;Mark area]" ..
"button_exit[0,5.5;7,1;abort;Abort]" ..
""

minetest.show_formspec(playername,
Expand Down Expand Up @@ -48,6 +49,13 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
blockexchange.upload(playername, pos1, pos2, schemaname)
end

if fields.mark then
local pos1 = minetest.string_to_pos(meta:get_string("pos1"))
local pos2 = minetest.string_to_pos(meta:get_string("pos2"))

blockexchange.set_pos(1, playername, pos1)
blockexchange.set_pos(2, playername, pos2)
end
end)


Expand Down

0 comments on commit 3d5916f

Please sign in to comment.