[Rseding91] [2.0.12] choose-elem-button doesn't open filter menu when clicking with wrong item in cursor

This subforum contains all the issues which we already resolved.
User avatar
rimbas
Burner Inserter
Burner Inserter
Posts: 10
Joined: Thu May 18, 2017 10:00 pm
Contact:

[Rseding91] [2.0.12] choose-elem-button doesn't open filter menu when clicking with wrong item in cursor

Post by rimbas »

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?)
AckEmma
Burner Inserter
Burner Inserter
Posts: 5
Joined: Fri Feb 09, 2024 6:15 am
Contact:

Re: [2.0.12] choose-elem-button doesn't open filter menu when clicking with wrong item in cursor

Post by AckEmma »

+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.
Rseding91
Factorio Staff
Factorio Staff
Posts: 14339
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [2.0.12] choose-elem-button doesn't open filter menu when clicking with wrong item in cursor

Post by Rseding91 »

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.
User avatar
rimbas
Burner Inserter
Burner Inserter
Posts: 10
Joined: Thu May 18, 2017 10:00 pm
Contact:

Re: [2.0.12] choose-elem-button doesn't open filter menu when clicking with wrong item in cursor

Post by rimbas »

Rseding91 wrote: Tue Nov 12, 2024 6:36 pm Thanks for the report. Can you give me some example lua code I can test with where it should work but doesn't?

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"};
This creates a filtered choose-elem-button in top-left that only accepts modules.
In 1.1 clicking with a wrong item opens the filter UI.
Image
In 2.0 it silently fails.
Rseding91
Factorio Staff
Factorio Staff
Posts: 14339
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [Rseding91] [2.0.12] choose-elem-button doesn't open filter menu when clicking with wrong item in cursor

Post by Rseding91 »

Thanks, it's now fixed for the next release.
If you want to get ahold of me I'm almost always on Discord.
Post Reply

Return to “Resolved Problems and Bugs”