Page 1 of 1

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

Posted: Mon Dec 23, 2019 4:37 pm
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.

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

Posted: Thu Dec 26, 2019 8:33 pm
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.

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

Posted: Sat Dec 28, 2019 1:15 am
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

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

Posted: Fri Oct 13, 2023 3:19 pm
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.

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

Posted: Sun Oct 15, 2023 4:25 am
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.

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

Posted: Wed Oct 25, 2023 10:42 am
by Kuxynator
or use signals und ignore virtuals ;-) but this is hacky and bad for the useability.