commit
3866132e3e
4 changed files with 28 additions and 5 deletions
|
|
@ -8,13 +8,22 @@ if mods["crafting-efficiency-2"] then
|
||||||
for i, recipe in pairs(util.me.recipes) do
|
for i, recipe in pairs(util.me.recipes) do
|
||||||
-- add remaining recipes with direct items to find the icons
|
-- add remaining recipes with direct items to find the icons
|
||||||
if data.raw.recipe[recipe] and (data.raw.item[recipe] or data.raw.fluid[recipe])
|
if data.raw.recipe[recipe] and (data.raw.item[recipe] or data.raw.fluid[recipe])
|
||||||
and not eff_data[recipe] and
|
and not eff_data[recipe] then
|
||||||
(data.raw.recipe[recipe].main_product or util.get_result_count(recipe) == 1) then
|
local research_level = 1
|
||||||
|
if not data.raw.recipe[recipe].enabled then
|
||||||
|
for tech, tbl in pairs(data.raw.technology) do
|
||||||
|
for _, effect in pairs(tbl.effects or {}) do
|
||||||
|
if effect.type == "unlock-recipe" and effect.recipe == recipe then
|
||||||
|
research_level = math.min(#tbl.unit.ingredients, 6)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
eff_data[recipe] = {
|
eff_data[recipe] = {
|
||||||
max = 15,
|
max = 15,
|
||||||
icon = data.raw.item[recipe] and data.raw.item[recipe].icon or data.raw.fluid[recipe].icon,
|
icon = util.get_item_or_fluid_icon(recipe),
|
||||||
crafting = { efficiency = 10 },
|
crafting = { efficiency = 10 },
|
||||||
research = { level = 6 },
|
research = { level = research_level },
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -963,6 +963,19 @@ function util.set_item_icons(item_name, icons)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Gets an item or fluid icon
|
||||||
|
function util.get_item_or_fluid_icon(name)
|
||||||
|
icon = ""
|
||||||
|
if data.raw.item[name] then
|
||||||
|
icon = data.raw.item[name].icon
|
||||||
|
if not icon then icon = data.raw.item[name].icons[1].icon end
|
||||||
|
elseif data.raw.fluid[name] then
|
||||||
|
icon = data.raw.fluid[name].icon
|
||||||
|
if not icon then icon = data.raw.fluid[name].icons[1].icon end
|
||||||
|
end
|
||||||
|
return icon
|
||||||
|
end
|
||||||
|
|
||||||
function util.set_to_founding(recipe, options)
|
function util.set_to_founding(recipe, options)
|
||||||
util.set_category(recipe, "founding", options)
|
util.set_category(recipe, "founding", options)
|
||||||
util.set_subgroup(recipe, "foundry-intermediate", options)
|
util.set_subgroup(recipe, "foundry-intermediate", options)
|
||||||
|
|
|
||||||
2
me.lua
2
me.lua
|
|
@ -7,7 +7,7 @@ me.recipes = {"tin-plate", "solder", "organotins",
|
||||||
"enriched-tin-plate",
|
"enriched-tin-plate",
|
||||||
"tin-smelting-vulcanite",
|
"tin-smelting-vulcanite",
|
||||||
"molten-tin",
|
"molten-tin",
|
||||||
"enriched-tin-smelting-vulcanite",}
|
"enriched-tin-smelting-vulcanite", "bronze-plate", "tinned-cable"}
|
||||||
|
|
||||||
|
|
||||||
function me.use_cable()
|
function me.use_cable()
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,7 @@ data:extend(
|
||||||
always_show_made_in = true,
|
always_show_made_in = true,
|
||||||
always_show_products = true,
|
always_show_products = true,
|
||||||
allow_productivity = true,
|
allow_productivity = true,
|
||||||
|
subgroup = "raw-material",
|
||||||
ingredients =
|
ingredients =
|
||||||
{
|
{
|
||||||
mods.bzcarbon and {type = "item", name = "graphite", amount = 1}
|
mods.bzcarbon and {type = "item", name = "graphite", amount = 1}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue