is_visible filter for choose-elem-button filters

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
Derim422
Burner Inserter
Burner Inserter
Posts: 16
Joined: Wed Jul 07, 2021 11:16 am
Contact:

is_visible filter for choose-elem-button filters

Post by Derim422 »

There is currently no easy way to create a selectable UI like choose-elem-button that only shows items (or recipes) that are visible to the current force.

In short, I am looking to create a UI element that would show the same as what a player force sees in the crafting side of the inventory for certain groups and returns an item that they select. If this is already implemented in some element, I would use that instead. The only options I can think of are either a choose-elem-button with a new filter for is_visible or a custom UI, right now.

Possibly a custom-managed inventory, I guess? If there is an on-clicked/selected event for each slot.
Rseding91
Factorio Staff
Factorio Staff
Posts: 17561
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: is_visible filter for choose-elem-button filters

Post by Rseding91 »

Unfortunately the current filter system doesn't support runtime information. All of the filters and filtering provided for mods to use references values that don't change runtime. That's to say: the filters do not have any reference to the force-based visibility of things and adding it would require reworking the filter system. I don't see that happening any time soon, if ever.
If you want to get ahold of me I'm almost always on Discord.
Derim422
Burner Inserter
Burner Inserter
Posts: 16
Joined: Wed Jul 07, 2021 11:16 am
Contact:

Re: is_visible filter for choose-elem-button filters

Post by Derim422 »

Awesome -- I appreciate the details. I can work with that.
Post Reply

Return to “Modding interface requests”