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

Overlays: Implement individual element pulse #9943

Merged
merged 2 commits into from Mar 11, 2021
Merged

Conversation

Megamouse
Copy link
Contributor

@Megamouse Megamouse commented Mar 10, 2021

Currently, the pulse in the native UI is continuous and provides a rather bad user experience.
Sometimes it's hard to see that you selected a different element if the pulse glow is currently at 0.

This PR improves this behaviour by immediately highlighting the current element after a user interaction.

Technically this is achieved by resetting the sinus curve, using an individual offset for each element.
The offset is calculated with the current time and a hardcoded speed modifier.
The sinus reset values are kinda half assed and it would probably be easier to understand if we use cos.
Since the time is taken twice (once when setting the offset and once when drawing the elements) it won't be 100% accurate, but this should not be noticeable by any human being.

This affects the

  • OSK keys
  • OSK cursor/caret
  • Save dialog entries

@JohnHolmesII
Copy link
Contributor

Might I recommend just using the math symbol sin. As an english speaker, and the rest of the code being english, I was very confused about the talk of nose cavities, and only realized what was going on because you mentioned cos in this post :).

Copy link
Contributor

@kd-11 kd-11 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a bit overdesigned but this is my fault for making the pulse mechanism part of 'core' rendering out of desperation. If I ever find some time to restructure I'll likely make this a proper animation class instead. It only needs a timer from 0 on each instance and a change from sin to cos to make it super easy to reset to max brightness. But since this works, and I'm in the middle of other stuff, this is good enough.

@Megamouse Megamouse merged commit 40f3adc into RPCS3:master Mar 11, 2021
@Megamouse
Copy link
Contributor Author

@JohnHolmesII lets just say it's artistic freedom

@Megamouse Megamouse deleted the glowww branch March 12, 2021 18:15
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.

None yet

3 participants