Skip to content

Commit

Permalink
Oops, broke the back button with that last commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
Uberi committed Jan 2, 2014
1 parent d73b93d commit 2ac049c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion worldedit_gui/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 2ac049c

Please sign in to comment.