summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUberi <azhang9@gmail.com>2014-01-02 18:17:28 -0500
committerUberi <azhang9@gmail.com>2014-01-02 18:17:28 -0500
commit2ac049c823b75e5a348b180f6a76110d1a1c54bd (patch)
treee4c03b23251a4960bc55a7ebcb9378eba4032a1c
parentd73b93d8dd11c5c98fe67c8eab97b05fcda25c51 (diff)
Oops, broke the back button with that last commit.
-rw-r--r--worldedit_gui/init.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/worldedit_gui/init.lua b/worldedit_gui/init.lua
index fe51720..d309d7e 100644
--- a/worldedit_gui/init.lua
+++ b/worldedit_gui/init.lua
@@ -151,13 +151,17 @@ else --fallback button
player_formspecs[player:get_player_name()] = nil
end)
+ local gui_player_formspecs = {}
minetest.register_on_player_receive_fields(function(player, formname, fields)
local name = player:get_player_name()
if fields.worldedit_gui then --main page
+ gui_player_formspecs[name] = player:get_inventory_formspec()
worldedit.show_page(name, "worldedit_gui")
return true
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
else --deal with creative_inventory setting the formspec on every single message
minetest.after(0.01,function()