Skip to content

Remove redundant music checks in frontend methods#3586

Merged
Geokureli merged 2 commits intoHaxeFlixel:devfrom
Geokureli:music-focus
Apr 12, 2026
Merged

Remove redundant music checks in frontend methods#3586
Geokureli merged 2 commits intoHaxeFlixel:devfrom
Geokureli:music-focus

Conversation

@Geokureli
Copy link
Copy Markdown
Member

@Geokureli Geokureli commented Apr 6, 2026

Fixes #3580

Introduced in #3558

Now that music is added to FlxG.sound.list (an unintended change, but not a bad thing) FlxG.sound.onFocusLost calls music.onFocusLost twice. the second would set _resumeOnFocus to false since it was already paused

I'm not sure why music was not added to the list, I'll check for any other unintended side effects of this change before merging. That may have been be a breaking change, as if anyone checked the if the list contains the music, it would have been false, but is now true, but that seems like an odd thing to do.

I don't think I can unit test this, but i'll look and see Added tests

@Geokureli Geokureli added this to the 6.2.0 milestone Apr 6, 2026
@Geokureli Geokureli marked this pull request as ready for review April 6, 2026 17:40
@Geokureli Geokureli merged commit da83ac9 into HaxeFlixel:dev Apr 12, 2026
10 checks passed
@Geokureli Geokureli deleted the music-focus branch April 12, 2026 15:12
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.

Music doesn't resume after onFocus in FlxSoundFrontEnd

1 participant