I received a bug report for Trackminia and it feels like a problem in the SDK, since it happens while my game's code isn't running! The crux of it is that it's possible to click a pause-menu item in a way that makes it fire its callback, but doesn't close the menu.
To reproduce, do the following as quickly as you can while playing a game:
- Open the pause menu
- Press down to select the "home" option
- Press A to select "home"
You can also reproduce this by selecting a game's custom addMenuItem()
option - it just needs to be a clickable menu item, and you have to click it extremely quickly after opening the menu. I assume that you have to click the menu-item before the menu transition animation has finished, but it's possible that it's some other time limit or something.
When you do this fast enough, you can hear the "clicked button" sound effect, and the button's callback gets fired, BUT the menu doesn't close. From this state, you can do one of two things:
- Press the Menu button to close the menu manually - the result of your earlier "partial choice" is applied when the game unpauses (for example, if you partial-picked the "home" option and then closed the menu manually, the game would unpause and then immediately quit)
- Pick a different menu option and click on that one, instead - the button works as intended, calling its callback and closing the menu, but now both of the buttons have been clicked, and both callbacks have been fired, which may cause strange behavior in the game (which is how I got the bug report in Trackminia).
This behavior can be reproduced in both C-SDK games and Lua-SDK games, on device and in the simulator. Thanks for your time!