Fixed bug preventing second formspecs from showing in sequences of interactions
This commit is contained in:
@ -27,7 +27,5 @@ request_id = test_org:make_request(add_josh)
|
|||||||
|
|
||||||
print('\nHave the two members vote on it')
|
print('\nHave the two members vote on it')
|
||||||
modpol.interactions.org_dashboard("nathan","test_org")
|
modpol.interactions.org_dashboard("nathan","test_org")
|
||||||
modpol.interactions.org_dashboard("nathan","test_org")
|
modpol.interactions.org_dashboard("luke","test_org")
|
||||||
|
|
||||||
|
|
||||||
-- check a member's dashboard for the process, try to initialize it
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
-- CONTEXTUAL STUFF
|
-- CONTEXTUAL STUFF
|
||||||
-- ================
|
-- ================
|
||||||
|
|
||||||
-- First, set up contexts to enable passing across formspecs
|
-- _contexts to enable passing across formspecs
|
||||||
-- https://rubenwardy.com/minetest_modding_book/en/players/formspecs.html#contexts
|
-- https://rubenwardy.com/minetest_modding_book/en/players/formspecs.html#contexts
|
||||||
|
|
||||||
local _contexts = {}
|
local _contexts = {}
|
||||||
@ -252,7 +252,6 @@ minetest.register_on_player_receive_fields(function (player, formname, fields)
|
|||||||
if formname == "modpol:text_query" then
|
if formname == "modpol:text_query" then
|
||||||
local pname = player:get_player_name()
|
local pname = player:get_player_name()
|
||||||
local input = fields.input
|
local input = fields.input
|
||||||
minetest.close_formspec(pname, formname)
|
|
||||||
if not input then
|
if not input then
|
||||||
-- no input, do nothing
|
-- no input, do nothing
|
||||||
else
|
else
|
||||||
@ -263,6 +262,7 @@ minetest.register_on_player_receive_fields(function (player, formname, fields)
|
|||||||
modpol.interactions.message(pname, "text_query: " .. input)
|
modpol.interactions.message(pname, "text_query: " .. input)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
minetest.close_formspec(pname, formname)
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
@ -291,7 +291,6 @@ minetest.register_on_player_receive_fields(function (player, formname, fields)
|
|||||||
if formname == "modpol:dropdown_query" then
|
if formname == "modpol:dropdown_query" then
|
||||||
local pname = player:get_player_name()
|
local pname = player:get_player_name()
|
||||||
local choice = fields.input
|
local choice = fields.input
|
||||||
minetest.close_formspec(pname, formname)
|
|
||||||
local func = _contexts[pname]["dropdown_query_func"]
|
local func = _contexts[pname]["dropdown_query_func"]
|
||||||
if not choice then
|
if not choice then
|
||||||
-- no choice, do nothing
|
-- no choice, do nothing
|
||||||
@ -300,6 +299,7 @@ minetest.register_on_player_receive_fields(function (player, formname, fields)
|
|||||||
else
|
else
|
||||||
modpol.interactions.message(pname, "dropdown_query: " .. choice)
|
modpol.interactions.message(pname, "dropdown_query: " .. choice)
|
||||||
end
|
end
|
||||||
|
minetest.close_formspec(pname, formname)
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
@ -339,12 +339,12 @@ minetest.register_on_player_receive_fields(function (player, formname, fields)
|
|||||||
if fields.yes then vote = fields.yes
|
if fields.yes then vote = fields.yes
|
||||||
elseif fields.no then vote = fields.no
|
elseif fields.no then vote = fields.no
|
||||||
end
|
end
|
||||||
minetest.close_formspec(pname, formname)
|
|
||||||
if vote then
|
if vote then
|
||||||
modpol.interactions.message(pname, "Voted " .. vote)
|
modpol.interactions.message(pname, "Voted " .. vote)
|
||||||
local func = _contexts[pname]["binary_poll_func"]
|
local func = _contexts[pname]["binary_poll_func"]
|
||||||
func(vote)
|
func(vote)
|
||||||
end
|
end
|
||||||
|
minetest.close_formspec(pname, formname)
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user