]> git.lizzy.rs Git - worldedit.git/commitdiff
Adjust GUI compatibility code
authorsfan5 <sfan5@live.de>
Tue, 16 Jul 2019 23:44:15 +0000 (01:44 +0200)
committersfan5 <sfan5@live.de>
Tue, 16 Jul 2019 23:44:15 +0000 (01:44 +0200)
worldedit_gui/init.lua

index b88a82ec510af358e7b84013c6c34d0aee7fcd79..181adf684471131b2d2352697ffbc4859038c04d 100644 (file)
@@ -194,21 +194,13 @@ elseif rawget(_G, "sfinv") then --sfinv installed (part of minetest_game since 0
                end
        })
 
-       --compatibility with pre-0.4.16 sfinv
-       local set_page = sfinv.set_page or function(player, name)
-               --assumptions: src pg has no leave callback, dst pg has no enter callback
-               local ctx = {page=name}
-               sfinv.contexts[player:get_player_name()] = ctx
-               sfinv.set_player_inventory_formspec(player, ctx)
-       end
-
        --show the form when the button is pressed and hide it when done
        minetest.register_on_player_receive_fields(function(player, formname, fields)
                if fields.worldedit_gui then --main page
                        worldedit.show_page(player:get_player_name(), "worldedit_gui")
                        return true
                elseif fields.worldedit_gui_exit then --return to original page
-                       set_page(player, "sfinv:crafting")
+                       sfinv.set_page(player, "sfinv:crafting")
                        return true
                end
                return false
@@ -222,11 +214,11 @@ elseif rawget(_G, "sfinv") then --sfinv installed (part of minetest_game since 0
        end
 else
        error(
-               "worldedit_gui requires a supported \"gui management\" mod to be installed\n"..
-               "To use the GUI you need to either\n"..
-               "* Use minetest_game (at least 0.4.15) or a subgame with compatible sfinv\n"..
-               "* Install Unified Inventory or Inventory++\n"..
-               "If you do not want to use worldedit_gui, disable it by editing world.mt or from the Main Menu"
+               "worldedit_gui requires a supported gui management mod to be installed.\n"..
+               "To use the it you need to either:\n"..
+               "* use minetest_game or another sfinv-compatible subgame\n"..
+               "* install Unified Inventory, Inventory++ or Smart Inventory\n"..
+               "If you don't want to use worldedit_gui, disable it by editing world.mt or from the main menu."
        )
 end