Sfinv: Rename navigation tabs to reduce chance of a conflict
authorrubenwardy <rubenwardy@gmail.com>
Wed, 7 Jun 2017 20:29:05 +0000 (21:29 +0100)
committersfan5 <sfan5@live.de>
Sun, 19 Nov 2017 22:03:38 +0000 (23:03 +0100)
mods/sfinv/api.lua

index bd6de1edfbce9178adccec22fd0aae08c2a0c556..c9b9d4a7a10d53ee51c3e68080f0ed686d6827fe 100644 (file)
@@ -29,7 +29,7 @@ end
 function sfinv.get_nav_fs(player, context, nav, current_idx)
        -- Only show tabs if there is more than one page
        if #nav > 1 then
-               return "tabheader[0,0;tabs;" .. table.concat(nav, ",") .. ";" .. current_idx .. ";true;false]"
+               return "tabheader[0,0;sfinv_nav_tabs;" .. table.concat(nav, ",") .. ";" .. current_idx .. ";true;false]"
        else
                return ""
        end
@@ -151,8 +151,8 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
        end
 
        -- Was a tab selected?
-       if fields.tabs and context.nav then
-               local tid = tonumber(fields.tabs)
+       if fields.sfinv_nav_tabs and context.nav then
+               local tid = tonumber(fields.sfinv_nav_tabs)
                if tid and tid > 0 then
                        local id = context.nav[tid]
                        local page = sfinv.pages[id]