Button style background invisible.
Posted: Sat Dec 19, 2015 5:44 pm
I am trying to create button styles for each of the icons in the game, but for some reason when I use them, it just shows an empty button: http://screencloud.net/v/jc9m
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
Edit:
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...
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...