diff --git a/README.md b/README.md index 48fbd32..3d4ab68 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ This mod adds a global variable named `HotMetals`. Add things to it to add suppo It has the following properties. ### `items` -Add an item name as string or a table with `name` and optional `spoilTicks` and `iconFolder`. The icon file will be `iconFolder .. "hot-" .. itemName .. ".png"`. +Add an item name as string or a table with `name` and optional `spoilTicks` and `iconFolder`. The icon file will be `iconFolder .. "hot-" .. itemName .. ".png"`. If you need more control over the icons, provide a table `icons` instead of `iconFolder`. ### `craftingCategories` A table containing all supported crafting categories. This mod uses a white list to prevent unwanted categories by default. Only categories used by smelting buildings like the furnace and the foundry should be added. diff --git a/hot-metals/prototypes/hot-metals.lua b/hot-metals/prototypes/hot-metals.lua index 95e6ceb..5c6fc58 100644 --- a/hot-metals/prototypes/hot-metals.lua +++ b/hot-metals/prototypes/hot-metals.lua @@ -15,7 +15,11 @@ function createHotVariant(item) local hotItem = table.deepcopy(data.raw.item[itemName]) hotItem.name = "hot-" .. itemName hotItem.localised_name = { "", { "item-name.hot" }, " ", { "item-name." .. itemName } } - hotItem.icon = iconFolder .. "hot-" .. itemName .. ".png" + if (item.icons) then + hotItem.icons = item.icons + else + hotItem.icon = iconFolder .. "hot-" .. itemName .. ".png" + end hotItem.order = hotItem.order .. "-hot" hotItem.spoil_result = itemName hotItem.spoil_ticks = spoilTicks