flixel icon indicating copy to clipboard operation
flixel copied to clipboard

Replace `FlxSound.onComplete` with `FlxSound.onFinish`

Open DetectiveBaldi opened this issue 1 year ago • 2 comments

Adjusts FlxSound to comply with new changes in flixel involving changing a bunch of single callbacks to use FlxSignals instead.

DetectiveBaldi avatar Jan 10 '25 22:01 DetectiveBaldi

I also wanna make sure init() can't be called multiple times, I.E. via recycling or something. if it can then we would need to find a way to remove the listener added there, but not any added externally

I did some more testing with recycling. I noticed that the callbacks would not be cleared if you killed a sound, and it got recycled. That is fixed with commits I'm pushing now, however I do want to note that some of the line ordering may look a bit inconsistent due to when FlxSound calls certain functions, which might be a problem

Also regarding making onFinish a final: It requires me to assign the variable in the constructor compared to in the reset method like all other variables in the class, might not be important, just something to considered

DetectiveBaldi avatar Jan 11 '25 00:01 DetectiveBaldi

Thanks, won't be able to test this for a short while, though

Geokureli avatar Jan 11 '25 01:01 Geokureli