mirror of
https://codeberg.org/usrib/emeraldbank.git
synced 2024-12-22 22:22:25 +01:00
inv tab file load in settings
This commit is contained in:
parent
674131651e
commit
85b8eecc34
4
init.lua
4
init.lua
@ -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")
|
||||||
|
|
||||||
|
if show_tab then
|
||||||
dofile(modpath .. "/invtab.lua")
|
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({
|
||||||
|
Loading…
Reference in New Issue
Block a user