Move all settings to yl_template.settings

This commit is contained in:
AliasAlreadyTaken 2023-04-26 17:14:15 +02:00
parent 18bf5d5cd0
commit c3f619cb01
3 changed files with 8 additions and 6 deletions

View File

@ -2,7 +2,7 @@ local chatcommand_cmd = "admin_example"
local chatcommand_definition = {
params = "<name> <privilege>", -- 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

View File

@ -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"
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"

View File

@ -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