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

FlxUICursor: prevent/remove references to disconnected gamepads #265

Merged
merged 4 commits into from
Jan 2, 2024

Conversation

Geokureli
Copy link
Member

@Geokureli Geokureli commented Dec 22, 2023

FlxUICursor is oddly written, when there's no gamepads it adds gamepad listeners with a null gamepad, then checks for null gamepads every frame for dozens of inputs. this change will simply not add useless button listeners unless theres a connected gamepad. It also checks whether the current gamepad is disconnected, and removes listeners when that gamepad is disconnected, fixing HaxeFlixel/flixel#2991

@DigiEggz please try this out, or lmk if you don't have time

@Geokureli Geokureli changed the title Cursor gamepad FlxUICursor: prevent/remove references to disconnected gamepads Dec 22, 2023
@DigiEggz
Copy link
Contributor

I did some quick tests and no longer encountered any crashes. If any other problems crop up I'll let you know or make another PR. Thank you for working on this.

@Geokureli Geokureli merged commit cb642a8 into dev Jan 2, 2024
30 checks passed
@Geokureli Geokureli deleted the cursor-gamepad branch January 2, 2024 15:03
@Geokureli Geokureli added this to the 2.6.0 milestone Mar 10, 2024
@Geokureli Geokureli added the Bug label Mar 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants