Use non-hot icon variants for the recipes
This commit is contained in:
parent
104312531b
commit
935ee5268e
1 changed files with 13 additions and 8 deletions
|
@ -1,22 +1,23 @@
|
|||
local defaultSpoilTicks = settings.startup["hot-metals-time"].value * 60
|
||||
|
||||
function createHotVariant(item)
|
||||
local itemName = item
|
||||
function createHotVariant(config)
|
||||
local itemName = config
|
||||
local spoilTicks = defaultSpoilTicks
|
||||
local iconFolder = "__hot-metals__/graphics/icons/"
|
||||
|
||||
if type(item) == "table" then
|
||||
itemName = item.name
|
||||
spoilTicks = item.spoilTicks or spoilTicks
|
||||
iconFolder = item.iconFolder or iconFolder
|
||||
if type(config) == "table" then
|
||||
itemName = config.name
|
||||
spoilTicks = config.spoilTicks or spoilTicks
|
||||
iconFolder = config.iconFolder or iconFolder
|
||||
end
|
||||
local item = data.raw.item[itemName]
|
||||
|
||||
-- Create new item
|
||||
local hotItem = table.deepcopy(data.raw.item[itemName])
|
||||
hotItem.name = "hot-" .. itemName
|
||||
hotItem.localised_name = { "", { "item-name.hot" }, " ", { "item-name." .. itemName } }
|
||||
if (item.icons) then
|
||||
hotItem.icons = item.icons
|
||||
if (config.icons) then
|
||||
hotItem.icons = config.icons
|
||||
else
|
||||
hotItem.icon = iconFolder .. "hot-" .. itemName .. ".png"
|
||||
end
|
||||
|
@ -37,9 +38,13 @@ function createHotVariant(item)
|
|||
result.name = hotItem.name
|
||||
end
|
||||
recipe.localised_name = { "item-name." .. itemName }
|
||||
recipe.icon = recipe.icon or item.icon
|
||||
recipe.icon_size = recipe.icon_size or item.icon_size
|
||||
recipe.icons = recipe.icons or item.icons
|
||||
if recipe.main_product == itemName then
|
||||
recipe.main_product = hotItem.name
|
||||
end
|
||||
|
||||
recipe.preserve_products_in_machine_output = true
|
||||
recipe.result_is_always_fresh = true
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue