inv tab file load in settings

This commit is contained in:
Freeman 2024-08-08 23:14:03 +02:00
parent 674131651e
commit 85b8eecc34
2 changed files with 6 additions and 3 deletions

@ -25,6 +25,7 @@ emeraldbank = {}
local income_enabled = core.settings:get_bool("emeraldbank.income_enabled", true)
local start_balance = tonumber(core.settings:get("emeraldbank.start_balance")) or 30
local show_tab = core.settings:get_bool("emeraldbank.inv_tab", true)
atm = {
balance = {},
@ -42,7 +43,10 @@ dofile(modpath .. "/receive_fields.lua") -- file adapted from atm mod
dofile(modpath .. "/receive_fields_wt.lua") -- file from atm mod
dofile(modpath .. "/bank.lua")
dofile(modpath .. "/commands.lua")
dofile(modpath .. "/invtab.lua")
if show_tab then
dofile(modpath .. "/invtab.lua")
end
if income_enabled then
dofile(modpath .. "/income.lua")

@ -20,7 +20,6 @@
local S = core.get_translator(core.get_current_modname())
local show_tab = core.settings:get_bool("emeraldbank.inv_tab", true)
-- This function must return the tab's formspec for the player
local function build(player)
@ -41,7 +40,7 @@ end
-- This function will be called to know if a player can see the tab
-- Returns true by default
local function access(player)
return show_tab
return true
end
mcl_inventory.register_survival_inventory_tab({