This commit is contained in:
Brevven 2023-04-10 00:21:58 -07:00
parent f61c5ec5c2
commit 4255e2d9f8
2 changed files with 46 additions and 28 deletions

View file

@ -20,4 +20,10 @@ function util.get_list()
end
end
function util.force_enable_recipe(event, recipe_name)
if game.players[event.player_index].force.recipes[recipe_name] then
game.players[event.player_index].force.recipes[recipe_name].enabled=true
end
end
return util

View file

@ -130,6 +130,7 @@ function util.k2matter(params)
if not params.k2matter.minimum_conversion_quantity then
params.k2matter.minimum_conversion_quantity = 10
end
if not data.raw.technology[params.k2matter.unlocked_by_technology] then
data:extend(
{
{
@ -157,6 +158,7 @@ function util.k2matter(params)
}
},
})
end
matter.createMatterRecipe(params.k2matter)
end
@ -533,6 +535,8 @@ end
function add_product(recipe, product)
if recipe ~= nil then
if (product[1] and data.raw.item[product[1]]) or
(product.name and data.raw[product.type][product.name]) then
if not recipe.normal then
if recipe.results == nil then
recipe.results = {{recipe.result, recipe.result_count and recipe.result_count or 1}}
@ -542,6 +546,7 @@ function add_product(recipe, product)
table.insert(recipe.results, product)
end
end
end
end
-- Get the amount of the ingredient, will check base/normal not expensive
@ -1045,6 +1050,13 @@ function util.add_icon(recipe_name, icon, options)
icon_size=data.raw.item[data.raw.recipe[recipe_name].result].icon_size,
icon_mipmaps=data.raw.item[data.raw.recipe[recipe_name].result].icon_mipmaps,
}}
elseif data.raw.recipe[recipe_name].normal and
data.raw.item[data.raw.recipe[recipe_name].normal.result] then
data.raw.recipe[recipe_name].icons = {{
icon=data.raw.item[data.raw.recipe[recipe_name].normal.result].icon,
icon_size=data.raw.item[data.raw.recipe[recipe_name].normal.result].icon_size,
icon_mipmaps=data.raw.item[data.raw.recipe[recipe_name].normal.result].icon_mipmaps,
}}
end
data.raw.recipe[recipe_name].icon = nil
data.raw.recipe[recipe_name].icon_size = nil