depctrl global config: use OR helper function i forgor 💀 about
>write function specifically to help do a thing >time passes >have to do the thing again >dont use function i wrote genius
This commit is contained in:
parent
6a91197b54
commit
b7f76f4caf
|
@ -1,7 +1,7 @@
|
||||||
script_name="DepCtrl Global Config"
|
script_name="DepCtrl Global Config"
|
||||||
script_description="the future is now"
|
script_description="the future is now"
|
||||||
script_author = "garret"
|
script_author = "garret"
|
||||||
script_version = "1.3.0"
|
script_version = "1.3.1"
|
||||||
script_namespace = "garret.depctrl_config"
|
script_namespace = "garret.depctrl_config"
|
||||||
|
|
||||||
local DependencyControl = require("l0.DependencyControl")
|
local DependencyControl = require("l0.DependencyControl")
|
||||||
|
@ -183,7 +183,7 @@ end
|
||||||
local function write_config(new)
|
local function write_config(new)
|
||||||
for k, v in pairs(new) do
|
for k, v in pairs(new) do
|
||||||
if (v == nil) -- allow nil, so the reset to defaults button works
|
if (v == nil) -- allow nil, so the reset to defaults button works
|
||||||
or v ~= (DependencyControl.config.c[k] or DependencyControl.config.defaults[k]) -- check it's not the current value anyway
|
or v ~= get_bool(DependencyControl.config.c[k], DependencyControl.config.defaults[k]) -- check it's not the current value anyway
|
||||||
then
|
then
|
||||||
-- changed, save
|
-- changed, save
|
||||||
DependencyControl.config.c[k] = v
|
DependencyControl.config.c[k] = v
|
||||||
|
|
Loading…
Reference in New Issue