GDevelop-extensions
GDevelop-extensions copied to clipboard
Bug Fix and Enhancement
Bug Fix: The onScenePostEvents was not resetting the pressed state to false for unpressed buttons which made the C_button_released call return true always after releasing a button once.
Enhancement: Updated the onSceneFirstLoaded and onScenePostEvents to keep track of the last activated controller id. Also added a condition to get the last activated controller id.
This makes it possible to dynamically switch between gamepads and just use whichever controller the user picks up instead of having to designate a static controller/player id. Sorry for the whitespace differences.
I'm not a big github user.
@Bouh I wasn't sure this was the correct way to share changes with you, but I hope you will consider them.
This look good! That mean the C_button_released condition return true only once when the button has been released. And it doesn't stay on false. This is a breaking change in a good way because this mimic how it's done with the key released condition. Thanks for this fix :+1:
Also if you can edit the version from 0.3.0
to 1.0.0
.
I think there still might be a lingering bug where calling "Any Gamepad button was released" or "Any gamepad button was pressed" before called "Was button X released?" will prevent getting an accurate response. There are also rare times where button presses are not detected. I have not done problem isolation or debugging on either of these, so just letting you know for now.
Indeed I found an issue with "Any Gamepad button was released".
I fixed it by adding a case in C_any_button_released
where if the button is released or not I save the appropriate value in the previousFrameStateButtons
of the button.
You can try it with this example. Let me know if you see something else. gamepad 1.0.0 - example.zip
This seems like something that should get merged.
@krunkster were you able to test @Bouh latest update of the example game?
The merge will be made into a cleaner branch here: https://github.com/GDevelopApp/GDevelop-extensions/pull/692