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 income_enabled = core.settings:get_bool("emeraldbank.income_enabled", true)
local start_balance = tonumber(core.settings:get("emeraldbank.start_balance")) or 30 local start_balance = tonumber(core.settings:get("emeraldbank.start_balance")) or 30
local show_tab = core.settings:get_bool("emeraldbank.inv_tab", true)
atm = { atm = {
balance = {}, 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 .. "/receive_fields_wt.lua") -- file from atm mod
dofile(modpath .. "/bank.lua") dofile(modpath .. "/bank.lua")
dofile(modpath .. "/commands.lua") dofile(modpath .. "/commands.lua")
dofile(modpath .. "/invtab.lua")
if show_tab then
dofile(modpath .. "/invtab.lua")
end
if income_enabled then if income_enabled then
dofile(modpath .. "/income.lua") dofile(modpath .. "/income.lua")

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