Implement the “return” buttons
This commit is contained in:
parent
786d7a7d5d
commit
4b052c050f
12
init.lua
12
init.lua
@ -155,6 +155,10 @@ function doc.process_form(player,formname,fields)
|
|||||||
minetest.show_formspec(playername, "doc:entry", formspec)
|
minetest.show_formspec(playername, "doc:entry", formspec)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
if fields["doc_button_goto_main"] then
|
||||||
|
local formspec = doc.formspec_core(1)..doc.formspec_main()
|
||||||
|
minetest.show_formspec(playername, "doc:main", formspec)
|
||||||
|
end
|
||||||
if fields["doc_catlist"] then
|
if fields["doc_catlist"] then
|
||||||
local event = minetest.explode_textlist_event(fields["doc_catlist"])
|
local event = minetest.explode_textlist_event(fields["doc_catlist"])
|
||||||
if event.type == "CHG" then
|
if event.type == "CHG" then
|
||||||
@ -163,7 +167,13 @@ function doc.process_form(player,formname,fields)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
elseif(formname == "doc:entry") then
|
elseif(formname == "doc:entry") then
|
||||||
|
if fields["doc_button_goto_main"] then
|
||||||
|
local formspec = doc.formspec_core(1)..doc.formspec_main()
|
||||||
|
minetest.show_formspec(playername, "doc:main", formspec)
|
||||||
|
elseif fields["doc_button_goto_category"] then
|
||||||
|
local formspec = doc.formspec_core(2)..doc.formspec_category(doc.data.players[playername].category, playername)
|
||||||
|
minetest.show_formspec(playername, "doc:category", formspec)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user