Page 1 of 1

Icons parameter

Posted: Mon Oct 10, 2016 9:20 am
by Doublespin
Due to a bug in my mod i encountered this item from reactors by GotLag

Code: Select all

  {
    type = "item",
    name = "steam-turbine",
    icons =
    {
      {
        icon = "__base__/graphics/icons/steam-engine.png",
      },
      {
        icon = "__base__/graphics/icons/steam-engine.png",
        tint = turbine_tint
      }
    },
    flags = {"goes-to-quickbar"},
    subgroup = "energy",
    order = "b[steam-power]-e[steam-turbine]",
    place_result = "steam-turbine",
    stack_size = 10
  },
I cant find any documentation about the parameter "icons".
I know it does tint the vanilla steam turbine but what is the exact structure
Why two icons for one item. It doesnt make sense to me.
Are there more options to alter an icon?

Re: Icons parameter

Posted: Mon Oct 10, 2016 9:30 am
by aubergine18
if you comprehend the .icon property, then the .icons property is just an array of those

personally I now always use the array form of properties as they help gather related settings (like the filename and tint being in same table within the .icons property, rather than being separate).

.tint applies a color tint to the icon contained in .filename

You can have at least 2 icons in a .icons array, perhaps more (I've not tested more than 2). they will be layered.

Here's some infos I found whilst investigating that property:

* https://github.com/aubergine10/Style/is ... -247590994
* viewtopic.php?p=197790#p197790

Re: Icons parameter

Posted: Mon Oct 10, 2016 2:04 pm
by LuziferSenpai
Look in these two MODs:

Click

Click

Greetz,

Senpai

Re: Icons parameter

Posted: Tue Oct 11, 2016 12:28 pm
by Doublespin
Thanks for your replys :)
I tested a little bit and ...
-yes you can have more than 2 layers.
-not every prototype that have icon will accept icons. For example the techs. The game will throw an error if the icon node is missing. Is this intended or bug?

Re: Icons parameter

Posted: Tue Oct 11, 2016 2:31 pm
by aubergine18
Techs are an outlier in many ways, quite different to other prototypes. I'll add the fact that they don't support .icons to my notes, as I will be working on tech prototypes again in a few weeks. It might be worth you creating an API interface request to see if game devs can update techs to accept .icons list.

From my testing so far, GUI element (styles), entities, recipes, items, etc. all support the .icons field.