PictureTab

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

PictureTab

Post by Deadlock989 »

The new crafting gui uses a new kind of tab, which the style inspector identifies as "class PictureTab".

Is there any chance we could use these in custom GUIs?

You can fake them to an extent by using a regular tab and then specifying a rich text img tag, with a specific font size scaled to your intended sprite size, as the caption. This works for most things - except that in the crafting gui, a disabled PictureTab has the picture rendered in greyscale, and there is no way I know of to achieve that with rich text (or sprites for that matter) short of generating actual duplicate monochrome versions of the desired sprites as a resource and then setting them as the caption ... I suppose you could do that with rich text but it'd be a faff. You also couldn't do it that way if your mod provides tabs of, e.g. item groups, because you can't prepare monochrome versions of every modded item group on the portal.

I had a look at the style defined for the crafting gui tabs (filter_group_tab) and it's a regular type tab_style definition, but there is no way to instance a PictureTab in the current API that I'm aware of.
Image

Rseding91
Factorio Staff
Factorio Staff
Posts: 13226
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: PictureTab

Post by Rseding91 »

There are literal hundreds of different custom-created GUI elements. It's not realistic to add all of them to the Lua API: that would essentially be duplicating the entire GUI structure and around a months work; not something I'm looking to sign up for.
If you want to get ahold of me I'm almost always on Discord.

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

Re: PictureTab

Post by Deadlock989 »

OK - I wasn't asking for all of them, just one, but fine, we'll work around it.
Image

Rseding91
Factorio Staff
Factorio Staff
Posts: 13226
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: PictureTab

Post by Rseding91 »

Deadlock989 wrote:
Thu Mar 19, 2020 3:37 pm
OK - I wasn't asking for all of them, just one, but fine, we'll work around it.
That's how it starts, one new one the next release, then 3 from someone else because "oh they added that, now what about these" and then in the end it's all of them.

I don't have a problem if someone else did that, just I don't want to do it.
If you want to get ahold of me I'm almost always on Discord.

Post Reply

Return to “Modding interface requests”