Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix touch device mod getting selected as a free mod in playlists #26492

Merged

Conversation

frenzibyte
Copy link
Member

@frenzibyte frenzibyte commented Jan 13, 2024

The cause of this issue laid in the way FooterButtonFreeMods determines available mods, which is the following code:

private IEnumerable<Mod> allAvailableAndValidMods => freeModSelectOverlay.AllAvailableMods
.Where(state => state.ValidForSelection.Value)
.Select(state => state.Mod);

Touch device has ValidForSelection = true, therefore being included in the above list and becoming selected when clicking the footer button.

At first, I considered removing system mods from being added to ModSelectOverlay.AvailableMods, but I'm not confident enough that this won't indirectly result in random issues when interacting with the mod select overlay (causing the touch device mod to be unintentionally deselected).

Instead, I settled down on setting ValidForSelection = false and using that as an indicator for both FooterButtonFreeMods and SelectAllModsButton (select all button in the overlay) to ignore such mods.

@bdach requesting your review as you're more knowledgable in this system. also worthy of note I cannot test on a touch device at the moment.

Copy link
Collaborator

@bdach bdach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems fine

@bdach bdach merged commit 9da3aeb into ppy:master Jan 15, 2024
13 of 17 checks passed
@frenzibyte frenzibyte deleted the fix-system-mods-selected-on-free-mods-overlay branch January 15, 2024 10:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Freemods incorrect mod count after deselecting all mods
2 participants