From 85b8eecc34b15e1d7676448bcdf637b2c0a4319d Mon Sep 17 00:00:00 2001 From: Freeman Date: Thu, 8 Aug 2024 23:14:03 +0200 Subject: [PATCH] inv tab file load in settings --- init.lua | 6 +++++- invtab.lua | 3 +-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/init.lua b/init.lua index bf33c1d..cc9689c 100644 --- a/init.lua +++ b/init.lua @@ -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") diff --git a/invtab.lua b/invtab.lua index 6c71369..34fac1e 100644 --- a/invtab.lua +++ b/invtab.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({