mirror of
https://github.com/Uberi/Minetest-WorldEdit.git
synced 2024-12-25 18:20:38 +01:00
Update worldedit_gui to work with latest unified_inventory (thanks LazyJ!).
This commit is contained in:
parent
4e78ced693
commit
df6ab06e74
@ -67,7 +67,6 @@ local get_formspec = function(name, identifier)
|
|||||||
return worldedit.pages["worldedit_gui"].get_formspec(name) --default to showing main page if an unknown page is given
|
return worldedit.pages["worldedit_gui"].get_formspec(name) --default to showing main page if an unknown page is given
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
if unified_inventory then
|
if unified_inventory then
|
||||||
local old_func = worldedit.register_gui_function
|
local old_func = worldedit.register_gui_function
|
||||||
worldedit.register_gui_function = function(identifier, options)
|
worldedit.register_gui_function = function(identifier, options)
|
||||||
@ -82,7 +81,10 @@ if unified_inventory then
|
|||||||
|
|
||||||
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_exit then
|
if fields.worldedit_gui then --main page
|
||||||
|
worldedit.show_page(name, "worldedit_gui")
|
||||||
|
return true
|
||||||
|
elseif fields.worldedit_gui_exit then --return to original page
|
||||||
unified_inventory.set_inventory_formspec(minetest.get_player_by_name(name), "craft")
|
unified_inventory.set_inventory_formspec(minetest.get_player_by_name(name), "craft")
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user