version
This commit is contained in:
parent
45e41c4281
commit
2ce7597761
3 changed files with 32 additions and 2 deletions
|
|
@ -1,4 +1,9 @@
|
||||||
---------------------------------------------------------------------------------------------------
|
---------------------------------------------------------------------------------------------------
|
||||||
|
Version: 0.3.2
|
||||||
|
Date: 2021-12-31
|
||||||
|
Changes:
|
||||||
|
- JA l10n updates
|
||||||
|
---------------------------------------------------------------------------------------------------
|
||||||
Version: 0.3.1
|
Version: 0.3.1
|
||||||
Date: 2021-12-24
|
Date: 2021-12-24
|
||||||
Changes:
|
Changes:
|
||||||
|
|
|
||||||
|
|
@ -109,7 +109,7 @@ end
|
||||||
-- Add a given quantity of product to a given recipe.
|
-- Add a given quantity of product to a given recipe.
|
||||||
-- Only works for recipes with multiple products
|
-- Only works for recipes with multiple products
|
||||||
function util.add_product(recipe_name, product)
|
function util.add_product(recipe_name, product)
|
||||||
if data.raw.recipe[recipe_name] and data.raw.item[product] then
|
if data.raw.recipe[recipe_name] and (data.raw.item[product[1]] or data.raw.item[product.name]) then
|
||||||
add_product(data.raw.recipe[recipe_name], product)
|
add_product(data.raw.recipe[recipe_name], product)
|
||||||
add_product(data.raw.recipe[recipe_name].normal, product)
|
add_product(data.raw.recipe[recipe_name].normal, product)
|
||||||
add_product(data.raw.recipe[recipe_name].expensive, product)
|
add_product(data.raw.recipe[recipe_name].expensive, product)
|
||||||
|
|
@ -274,6 +274,31 @@ function has_ingredient(recipe, ingredient)
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Remove a product from a recipe, WILL NOT remove the only product
|
||||||
|
function util.remove_product(recipe_name, old)
|
||||||
|
if me.bypass[recipe_name] then return end
|
||||||
|
if data.raw.recipe[recipe_name] then
|
||||||
|
remove_product(data.raw.recipe[recipe_name], old)
|
||||||
|
remove_product(data.raw.recipe[recipe_name].normal, old)
|
||||||
|
remove_product(data.raw.recipe[recipe_name].expensive, old)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function remove_product(recipe, old)
|
||||||
|
index = -1
|
||||||
|
if recipe ~= nil and recipe.results ~= nil then
|
||||||
|
for i, result in pairs(recipe.results) do
|
||||||
|
if result.name == old or result[1] == old then
|
||||||
|
index = i
|
||||||
|
break
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if index > -1 then
|
||||||
|
table.remove(recipe.results, index)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
-- Replace one product with another in a recipe
|
-- Replace one product with another in a recipe
|
||||||
function util.replace_product(recipe_name, old, new)
|
function util.replace_product(recipe_name, old, new)
|
||||||
if data.raw.recipe[recipe_name] then
|
if data.raw.recipe[recipe_name] then
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "bzzirconium",
|
"name": "bzzirconium",
|
||||||
"version": "0.3.1",
|
"version": "0.3.2",
|
||||||
"factorio_version": "1.1",
|
"factorio_version": "1.1",
|
||||||
"title": "Zirconium",
|
"title": "Zirconium",
|
||||||
"author": "Brevven",
|
"author": "Brevven",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue