Saplings-Projects / Birthday-2024

Game project for birthday in 2024 : a puzzle game where you must fit the pieces on the space you have
GNU General Public License v3.0
1 stars 6 forks source link

Button flicker fix #172

Closed Mikotey closed 5 months ago

Mikotey commented 5 months ago

Description

Buttons would sometime flicker between pressed and hovered state depending on how fast you clicked and when the screen gets captured. Most noticeable on the Campaign Select screen. Additionally, the wait made it so you can still give inputs in that 0.05 seconds time before the animation puts up a blocker.

Moved the wait to the popup close functionality. Now the transition has instant response again.

Related issue(s)

https://github.com/Saplings-Projects/Birthday-2024/issues/169

List of changes

The darken on popups remains when transitioning, but it's not that bad. At least, it didn't seem to flicker

Mikotey commented 5 months ago

Looking at the logic, I don't know how this is functionally different than not waiting. The popup still must close in order to prompt the previous screen to transition. Adding wait proves that the darken remains even after the animation finishes, but disappears when popup is closed.

So either case should still be the same process of: 1) Close Popup 2) Animate close 3) Delete Popup 4) Transition Animation

Between steps 3 and 4, I expect the screen to brighten as the popup is removed. But with the wait, that occurs between steps 2 and 3, it doesn't brighten before transitioning.

Makes no sense, but it works I guess