data.lua
Code: Select all
ores = {
"infinite-iron-ore",
"infinite-copper-ore",
"infinite-coal",
"infinite-stone"
}
fluids = {
["Sulfuric Acid"] = "sulfuric-acid",
["Steam"] = "steam",
["Water"] = "water",
["None"] = nil
}
for _, ore in ipairs(ores) do
if settings.global["fluidrequirementoptions-" .. ore .. "-requires"].value ~= nil then
data.raw.resource[ore].minable.required_fluid = fluids[settings.global["fluidrequirementoptions-" .. ore .. "-requires"].value]
data.raw.resource[ore].minable.fluid_amount = 10
end
end
Code: Select all
premade_types = {
"Sulfuric Acid",
"Steam",
"Water",
"None"
}
data:extend(
{
{
type = "string-setting",
name = "fluidrequirementoptions-infinite-iron-ore-requires",
order = "a",
setting_type = "runtime-global",
default_value = "Sulfuric Acid",
allowed_values = premade_types
},{
type = "string-setting",
name = "fluidrequirementoptions-infinite-copper-ore-requires",
order = "b",
setting_type = "runtime-global",
default_value = "Sulfuric Acid",
allowed_values = premade_types
},{
type = "string-setting",
name = "fluidrequirementoptions-infinite-stone-ore-requires",
order = "c",
setting_type = "runtime-global",
default_value = "Water",
allowed_values = premade_types
},{
type = "string-setting",
name = "fluidrequirementoptions-infinite-coal-ore-requires",
order = "d",
setting_type = "runtime-global",
default_value = "None",
allowed_values = premade_types
},
})