If the player has an item in cursor and clicks a choose-elem-button that doesn't pass the filter it silently fails.
In Factorio 1.1 clicking a choose-elem-button with a wrong item would open the filter menu.
I can't recall if 1.1 vanilla has any filtered choose-elem-buttons to test but in 2.0 there are two cases:
Trying to use a wrong item in a pump filter silently fails. (weirdly, it also fails if clicking with a parameter item in cursor but can be otherwise picked from the filter menu)
Trying to use a wrong item in roboport worker request filter it shows an error. (but this element seems different as it has quantity selection, and parameter items also fail)
This would also fix mods that work in 1.1 that have UI open only when specific items are in cursor and use choose-elem-buttons.
(I now realize that I have been wrong when I reported about .hidden item property discrepancy. Something was changed to match 1.1 behaviour but the filter menu still doesn't open. Did it also/instead by default filtered for "only-in-cursor" flag or something?)
[Rseding91] [2.0.12] choose-elem-button doesn't open filter menu when clicking with wrong item in cursor
Re: [2.0.12] choose-elem-button doesn't open filter menu when clicking with wrong item in cursor
+1 have the same issue
I have tested in 1.1.110 -> it will open the filter.
In 2.0+ it will silently fail.
> This would also fix mods that work in 1.1 that have UI open only when specific items are in cursor and use choose-elem-buttons.
I do this for my mod.
I have tested in 1.1.110 -> it will open the filter.
In 2.0+ it will silently fail.
> This would also fix mods that work in 1.1 that have UI open only when specific items are in cursor and use choose-elem-buttons.
I do this for my mod.
Re: [2.0.12] choose-elem-button doesn't open filter menu when clicking with wrong item in cursor
Thanks for the report. Can you give me some example lua code I can test with where it should work but doesn't?
If you want to get ahold of me I'm almost always on Discord.
Re: [2.0.12] choose-elem-button doesn't open filter menu when clicking with wrong item in cursor
Code: Select all
/c game.player.gui.screen.add{type="frame", name="ceb_frame"}.add{type="choose-elem-button", elem_type="item", elem_filters={{filter="type", type="module" }},item="speed-module"};
In 1.1 clicking with a wrong item opens the filter UI.
In 2.0 it silently fails.
Re: [Rseding91] [2.0.12] choose-elem-button doesn't open filter menu when clicking with wrong item in cursor
Thanks, it's now fixed for the next release.
If you want to get ahold of me I'm almost always on Discord.