From c3f619cb01e32b4c9dcb99bd637ae3428a24b704 Mon Sep 17 00:00:00 2001 From: AliasAlreadyTaken Date: Wed, 26 Apr 2023 17:14:15 +0200 Subject: [PATCH] Move all settings to yl_template.settings --- chatcommand_admin.lua | 2 +- config.lua | 8 +++++--- setup.lua | 4 ++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/chatcommand_admin.lua b/chatcommand_admin.lua index fbc90e3..b274f80 100644 --- a/chatcommand_admin.lua +++ b/chatcommand_admin.lua @@ -2,7 +2,7 @@ local chatcommand_cmd = "admin_example" local chatcommand_definition = { params = " ", -- Short parameter description description = "Example description", -- Full description - privs = {[yl_template.admin_priv] = true}, -- Require the "privs" privilege to run + privs = {[yl_template.settings.admin_priv] = true}, -- Require the "privs" privilege to run func = function(name, param) local success = true if success then diff --git a/config.lua b/config.lua index a8a6bf2..b42cdf3 100644 --- a/config.lua +++ b/config.lua @@ -1,8 +1,10 @@ -- Setting a configuration, switch the order in which the settings shall take precedence. First valid one taken. -yl_template.external_value = "mod_default" or minetest.settings:get("yl_template.external_value") or "default" +yl_template.settings = {} -yl_template.save_path = "yl_template" or minetest.settings:get("yl_template.save_path") or "default" +yl_template.settings.external_value = "mod_default" or minetest.settings:get("yl_template.external_value") or "default" -yl_template.admin_priv = "admin_priv" or minetest.settings:get("yl_template.admin_priv") or "server" \ No newline at end of file +yl_template.settings.save_path = "yl_template" or minetest.settings:get("yl_template.save_path") or "default" + +yl_template.settings.admin_priv = "admin_priv" or minetest.settings:get("yl_template.admin_priv") or "server" \ No newline at end of file diff --git a/setup.lua b/setup.lua index 494602d..ac4c614 100644 --- a/setup.lua +++ b/setup.lua @@ -3,13 +3,13 @@ local function run_once() local create = true for _, v in ipairs(dl) do - if v == yl_template.save_path then + if v == yl_template.settings.save_path then create = false end end if create then - minetest.mkdir(yl_template.worldpath .. DIR_DELIM .. yl_template.save_path) + minetest.mkdir(yl_template.worldpath .. DIR_DELIM .. yl_template.settings.save_path) end end