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

Fix squeak and save spam in gamepad menu #1219

Merged
merged 1 commit into from
Dec 22, 2024

Conversation

Daaaav
Copy link
Contributor

@Daaaav Daaaav commented Dec 21, 2024

Changes:

If you push a button to set a controller binding, you may either hear one Viridian squeak, two Viridian squeaks (a louder one), or Viridian doesn't stop squeaking until you let go of the button. While you hear the continuous squeaking, your save file is also repeatedly saved.

(Don't forget to unmute the video:)

2024-12-21_04-59-22.mp4

There are two small bugs at play here:

  • the squeak is actually played in two different places at the same time (both in titleinput() whenever a button is pressed, and in updatebuttonmappings() when a mapping is succesfully changed)
  • titleinput() doesn't register that a button is held down and applies the button (and saves to file) every frame for as long as the button is held

This PR fixes both these issues. Now a single button press always causes one squeak, and only if the bindings actually changed. Your save file is also no longer saved repeatedly from holding down the button.

Legal Stuff:

By submitting this pull request, I confirm that...

  • My changes may be used in a future commercial release of VVVVVV
  • I will be credited in a CONTRIBUTORS file and the "GitHub Friends"
    section of the credits for all of said releases, but will NOT be compensated
    for these changes unless there is a prior written agreement

If you push a button to set a controller binding, you may either hear
one Viridian squeak, two Viridian squeaks (a louder one), or Viridian
doesn't stop squeaking until you let go of the button. While you hear
the continuous squeaking, your save file is also repeatedly saved.

There are two small bugs at play here:
- the squeak is actually played in two different places at the same
  time (both in titleinput() whenever a button is pressed, and in
  updatebuttonmappings() when a mapping is succesfully changed)
- titleinput() doesn't register that a button is held down and applies
  the button (and saves to file) every frame for as long as the button
  is held

This commit fixes both these issues. Now a single button press always
causes one squeak, and only if the bindings actually changed. Your save
file is also no longer saved repeatedly from holding down the button.
@Daaaav
Copy link
Contributor Author

Daaaav commented Dec 21, 2024

(I think this might be nice as a 2.4 backport by the way, since it's a small fix to a pretty noticeable bug in this menu)

@flibitijibibo flibitijibibo self-assigned this Dec 21, 2024
@flibitijibibo flibitijibibo merged commit d709db4 into TerryCavanagh:master Dec 22, 2024
3 checks passed
@flibitijibibo
Copy link
Collaborator

Backported via e72d59d

@Daaaav Daaaav deleted the gpmenu-fix-soundspam branch December 22, 2024 21:21
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.

2 participants