LuaGuiElement (choose-elem-button) :: 'item-and-fluid' elem type

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
User avatar
raiguard
Factorio Staff
Factorio Staff
Posts: 579
Joined: Wed Dec 13, 2017 8:29 pm
Contact:

LuaGuiElement (choose-elem-button) :: 'item-and-fluid' elem type

Post by raiguard »

Hello. I would like to request that a new elem_type be added to choose-elem-buttons: item-and-fluid. The reason behind this is I'm making a Recipe Book ("better" version of FNEI), and I would like to be able to use one choose-elem-button for both items and fluids. Currently there is no way to do this.

I'm not the only one who has wanted this. FNEI itself just uses two different buttons to do the job, and Factory Planner has its own from-scratch implementation to make it work.

For now I'll just use signals, but I hope that this can be added! Thanks in advance.
Don't forget, you're here forever.
Rseding91
Factorio Staff
Factorio Staff
Posts: 14264
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: LuaGuiElement (choose-elem-button) :: 'item-and-fluid' elem type

Post by Rseding91 »

If I was to do this, I would have to implement the entire new GUI on the C++ game side and I don't really want to do that without a *really* good reason.
If you want to get ahold of me I'm almost always on Discord.
User avatar
raiguard
Factorio Staff
Factorio Staff
Posts: 579
Joined: Wed Dec 13, 2017 8:29 pm
Contact:

Re: LuaGuiElement (choose-elem-button) :: 'item-and-fluid' elem type

Post by raiguard »

It's actually fine, turns out that I don't need this feature anymore anyways. My "recipe book" mod has evolved into a full "encyclopedia" mod, and items and fluids are separated in the encyclopedia.

However, I would like to request something else: would it be possible to optionally show hidden items in the choose-elem-button? Right now, you can search for hidden items in the search box in my mod, but not through the choose-elem-button. It would be nice if I could achieve feature parity between the two methods.

Many thanks!

Image
Don't forget, you're here forever.
User avatar
Kuxynator
Inserter
Inserter
Posts: 33
Joined: Wed Sep 23, 2020 5:02 pm
Contact:

Re: LuaGuiElement (choose-elem-button) :: 'item-and-fluid' elem type

Post by Kuxynator »

It seems ChatGPT suggests "item-and-fluid" as a solution when you want to select items and fluids, but tough luck, that doesn't work.

Error while running event Kux-ProductionRates::on_gui_click (ID 1)
Unknown elem_type: item-and-fluid

Since I stumble over this for the second time, I thought I'd write this.

How to select both types?
As workaround I use "signal" but this can not be filtered and a lot of useless entries are selectable.
braxbro
Burner Inserter
Burner Inserter
Posts: 19
Joined: Sun Jan 01, 2023 2:54 am
Contact:

Re: LuaGuiElement (choose-elem-button) :: 'item-and-fluid' elem type

Post by braxbro »

Kuxynator wrote: Fri Oct 13, 2023 3:19 pm It seems ChatGPT suggests "item-and-fluid" as a solution when you want to select items and fluids, but tough luck, that doesn't work.

Error while running event Kux-ProductionRates::on_gui_click (ID 1)
Unknown elem_type: item-and-fluid

Since I stumble over this for the second time, I thought I'd write this.

How to select both types?
As workaround I use "signal" but this can not be filtered and a lot of useless entries are selectable.
ChatGPT will not be of assistance with Factorio modding. Its training data ends at September 2021. The latest possible Factorio version it can POSSIBLY know about right now is 1.1.41. If you ask it, it tells you the latest version it knows of is 1.1.35.

You have to handle the two separately, or create dummy items for fluids, or create dummy fluids for items, or some other hacky workaround.
User avatar
Kuxynator
Inserter
Inserter
Posts: 33
Joined: Wed Sep 23, 2020 5:02 pm
Contact:

Re: LuaGuiElement (choose-elem-button) :: 'item-and-fluid' elem type

Post by Kuxynator »

or use signals und ignore virtuals ;-) but this is hacky and bad for the useability.
Post Reply

Return to “Modding interface requests”