From 309056e2c824252446cbd266555cbc8c220eb7cc Mon Sep 17 00:00:00 2001 From: DS-Minetest Date: Tue, 2 Jan 2018 17:09:32 +0100 Subject: [PATCH] copy settingtypes from other PR --- mesecons/settings.lua | 9 +++------ settingtypes.txt | 43 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 6 deletions(-) create mode 100644 settingtypes.txt diff --git a/mesecons/settings.lua b/mesecons/settings.lua index 40d33b2..7a00694 100644 --- a/mesecons/settings.lua +++ b/mesecons/settings.lua @@ -8,7 +8,7 @@ minetest.settings = minetest.settings or { get_bool = function(_, k, default) local s = minetest.setting_getbool(k) if s == nil then - s = default + return default end return s end, @@ -31,12 +31,9 @@ minetest.settings = minetest.settings or { function mesecon.setting(setting, default) if type(default) == "boolean" then local read = minetest.settings:get_bool("mesecon."..setting, default) - -- legacy: - if read == nil then + if read == nil then -- legacy return default - else - return read - end + return read elseif type(default) == "string" then return minetest.settings:get("mesecon."..setting) or default elseif type(default) == "number" then diff --git a/settingtypes.txt b/settingtypes.txt new file mode 100644 index 0000000..5bb15b2 --- /dev/null +++ b/settingtypes.txt @@ -0,0 +1,43 @@ +[mesecons] + +mesecon.resumetime (Resume time) int 4 +mesecon.overheat_max (Overheat max) int 20 +mesecon.cooldown_time (Cooldown time) float 2.0 +mesecon.cooldown_granularity (Cooldown granularity) float 0.5 + + +[mesecons_blinkyplant] + +mesecon.blinky_plant_interval (Plant interval) int 3 + + +[mesecons_detector] + +mesecon.detector_radius (Detector radius) int 6 +mesecon.node_detector_distance_max (Detector max distance) int 10 + + +[mesecons_luacontroller] + +mesecon.luacontroller_string_rep_max (Max) int 64000 +mesecon.luacontroller_digiline_maxlen (Digiline max length) int 50000 +mesecon.luacontroller_maxevents (Max events) int 10000 +mesecon.luacontroller_memsize (Memory size) int 100000 + + +[mesecons_movestones] + +mesecon.movestone_speed (Speed) int 3 +mesecon.movestone_max_push (Max push) int 50 +mesecon.movestone_max_pull (Max pull) int 50 + + +[mesecons_pistons] + +mesecon.piston_max_push (Max push) int 15 +mesecon.piston_max_pull (Max pull) int 15 + + +[mesecons_pressureplates] + +mesecon.pplate_interval (Interval) float 0.1