If I change the button to a checkbox, it works flawlessly, but changing it to a button makes the background invisible.
Here is my data-final-fixes.lua
Code: Select all
for _,entitytype in pairs(data.raw) do
for _,entity in pairs(entitytype) do
if entity.stack_size and entity.icon then
local style =
{
type = "button_style",
parent = "item-icon-style",
default_background =
{
filename = entity.icon,
priority = "extra-high-no-scale",
width = 32,
height = 32,
x = 0,
y = 0
},
hovered_background =
{
filename = entity.icon,
priority = "extra-high-no-scale",
width = 32,
height = 32,
x = 0,
y = 0
},
clicked_background =
{
filename = entity.icon,
priority = "extra-high-no-scale",
width = 32,
height = 32,
x = 0,
y = 0
}
}
print(entity.name)
data.raw["gui-style"].default["jei-item-icons-" .. entity.name] = style
end
end
end
Another problem I've encountered is where I am trying to get the localised name of the item, but if I use the 'localised_name' field in item prototype, it returns a table with the unlocalised name, and game.get_localised_item_name no longer exists...