[Request] dark_background_icon for recipes

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
Post Reply
User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2528
Joined: Fri Nov 06, 2015 7:41 pm

[Request] dark_background_icon for recipes

Post by Deadlock989 »

Hi,

dark_background_icon is only used by the item for coal in the base game, as far as I can tell.

The wiki says that you can also use a dark_background_icons table for items. However for recipes which specify their own icon and produce very dark items, with or without layered icons, you don't seem to be able to specify a dark background icon - it's not in the recipe prototype on the wiki and I've tried anyway, it seems to be ignored.

For example: you have a recipe which produces crushed coal from coal, with a chance of byproducts, i.e. it has multiple results. The crushed coal item has a dark_background_icon specifed. But the recipe uses icons to layer various things, e.g. the crushed coal item icon at the bottom and then some other byproducts drawn on top. This recipe icons overrides the main product dark background icon, but since the coal gravel is black, you can't really see it on the alt-info icon-with-a-black-fuzz-around-it drawn on the machine.

I know that's barely readable but hopefully you get what I mean. Having dark_background_icon and dark_background_icons for recipes on a par with items would be useful, is all. It seems inconsistent that the game will render an item's dark_background_icon when it's the product of a recipe that doesn't specify an icon, but you can't specify a dark icon for recipes themselves.
Image

User avatar
mrudat
Fast Inserter
Fast Inserter
Posts: 229
Joined: Fri Feb 16, 2018 5:21 am
Contact:

Re: [Request] dark_background_icon for recipes

Post by mrudat »

Would it work if the alt background came in a light version in addition to a dark version?

That way you wouldn't need to maintain two parallel sets of icons for some items/recipes. Instead, you could have an 'icon_is_dark' flag, perhaps?

Alternatively, could a shader be used to add a light highlight to the icon; it seems like it should be possible, and I don't think Factorio currently uses shaders particularly heavily at the moment, so there should be headroom available in terms of rendering performance.

User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2528
Joined: Fri Nov 06, 2015 7:41 pm

Re: [Request] dark_background_icon for recipes

Post by Deadlock989 »

mrudat wrote:
Sat May 04, 2019 12:33 am
Would it work if the alt background came in a light version in addition to a dark version?
I suppose. It would certainly save hassle for modders. I don't know if it would look as good.
Image

User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5150
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: [Request] dark_background_icon for recipes

Post by Klonan »

Deadlock989 wrote:
Fri May 03, 2019 10:58 pm
But the recipe uses icons to layer various things, e.g. the crushed coal item icon at the bottom and then some other byproducts drawn on top. This recipe icons overrides the main product dark background icon, but since the coal gravel is black, you can't really see it on the alt-info icon-with-a-black-fuzz-around-it drawn on the machine.
In this case, you can just use the 'dark_background_icon' in the recipe icons instead of the normal icon.

so instead of

Code: Select all

recipe.icons =
{
  {icon = coal.icon, icon_size = coal.icon_size},
  {icon = other_layer etc...}
}
Do

Code: Select all

recipe.icons =
{
  {icon = coal.dark_background_icon icon_size = coal.icon_size},
  {icon = other_layer etc...}
}
There also exists "dark_background_icons" for items too.

User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2528
Joined: Fri Nov 06, 2015 7:41 pm

Re: [Request] dark_background_icon for recipes

Post by Deadlock989 »

Klonan wrote:
Sat May 04, 2019 11:18 am
In this case, you can just use the 'dark_background_icon' in the recipe icons instead of the normal icon.
Then the recipe would always be shown with the optimised-for-dark-background icon, even on a light background, e.g. in crafting tabs. That's worse. I don't want glowing orange coal and coal-derived products everywhere, if I can avoid it.
Image

Post Reply

Return to “Modding interface requests”