1
0
mirror of https://github.com/Uberi/Minetest-WorldEdit.git synced 2024-12-25 10:10:41 +01:00

Oops, broke the back button with that last commit.

This commit is contained in:
Uberi 2014-01-02 18:17:28 -05:00
parent d73b93d8dd
commit 2ac049c823

View File

@ -151,13 +151,17 @@ else --fallback button
player_formspecs[player:get_player_name()] = nil player_formspecs[player:get_player_name()] = nil
end) end)
local gui_player_formspecs = {}
minetest.register_on_player_receive_fields(function(player, formname, fields) minetest.register_on_player_receive_fields(function(player, formname, fields)
local name = player:get_player_name() local name = player:get_player_name()
if fields.worldedit_gui then --main page if fields.worldedit_gui then --main page
gui_player_formspecs[name] = player:get_inventory_formspec()
worldedit.show_page(name, "worldedit_gui") worldedit.show_page(name, "worldedit_gui")
return true return true
elseif fields.worldedit_gui_exit then --return to original page elseif fields.worldedit_gui_exit then --return to original page
update_main_formspec(name) if gui_player_formspecs[name] then
player:set_inventory_formspec(gui_player_formspecs[name])
end
return true return true
else --deal with creative_inventory setting the formspec on every single message else --deal with creative_inventory setting the formspec on every single message
minetest.after(0.01,function() minetest.after(0.01,function()