Skip to content

Fix focus sound playing repeatedly on mouse hover#890

Open
MCbabel wants to merge 1 commit intosmartcmd:mainfrom
MCbabel:fix/focus-sound-spam
Open

Fix focus sound playing repeatedly on mouse hover#890
MCbabel wants to merge 1 commit intosmartcmd:mainfrom
MCbabel:fix/focus-sound-spam

Conversation

@MCbabel
Copy link
Contributor

@MCbabel MCbabel commented Mar 8, 2026

Description

Fixes the hover sound spamming rapidly when moving the mouse over the Texture Pack selector in the Create World menu. Reported on Discord.

Changes

Previous Behavior

The focus sound (eSFX_Focus) played on every focus event from IggyPlayer, even when the focus didn't actually change. Moving the mouse over the Texture Pack icons triggered dozens of focus events per second, causing a loud buzzing sound.

Root Cause

UIScene::_handleFocusChange() unconditionally played the sound without checking if controlId/childId actually differed from the current focus.

New Behavior

Sound only plays when the focus target actually changes. Hovering over the same element does not repeat the sound.

Fix Implementation

Added a check in _handleFocusChange() that compares the new controlId/childId against the stored m_iFocusControl/m_iFocusChild. Only updates and plays the sound if they differ.

Related Issues

  • Reported on Discord (no GitHub issue)

Only play eSFX_Focus when the focus control or child actually changes. Previously the sound fired on every focus event even when hovering over the same element, causing rapid sound spam over Texture Pack icons in the Create World menu.

Fixes a bug reported on Discord.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant