This seems to work as a "startup" setting, but when I try to change it to "runtime-global", the game fails to load the mod.
If settings.lua has this :
data:extend({
{
type = "bool-setting",
name = "TOPT-AllowLongHandedInserter",
setting_type = "startup",
default_value = true,
order = "a",
},
Then it works fine, but you can NOT update the setting during a game, only before loading the world.
However, if settings.lua has this :
data:extend({
{
type = "bool-setting",
name = "TOPT-AllowLongHandedInserter",
setting_type = "runtime-global",
default_value = true,
order = "a",
},
Then the game fails to load regardless of the syntax of the invoking line in data.lua :
if not settings.startup["TOPT-AllowLongHandedInserter"].value then
data.raw.recipe["long-handed-inserter"].hidden = true
end
OR
if not settings.runtime-global["TOPT-AllowLongHandedInserter"].value then
data.raw.recipe["long-handed-inserter"].hidden = true
end