Add support for custom icons
https://mods.factorio.com/mod/hot-metals/discussion/6773ea5e1c4d7b0e4bba85b6
This commit is contained in:
parent
ee97c9cb52
commit
1b24772cbb
2 changed files with 6 additions and 2 deletions
|
@ -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.
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue