Button style background invisible.

Place to get help with not working mods / modding interface.
Vilsol
Burner Inserter
Burner Inserter
Posts: 6
Joined: Thu Aug 06, 2015 5:27 pm
Contact:

Button style background invisible.

Post by Vilsol »

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

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
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...
Post Reply

Return to “Modding help”