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
Populate HandleInput #1242
Populate HandleInput #1242
Conversation
It looks like I can't add reviewers, but I still should summon @default0 somehow. |
private readonly ConcurrentDictionary<Type, bool> cachedValues = new ConcurrentDictionary<Type, bool>(); | ||
|
||
private readonly string[] inputMethods = { | ||
"OnHover", |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code to actually do the checking looks solid enough. I just kind of disagree that it has to be a publicly exposed instantiable class that is used via DI, instead of an internal static helper that is maybe even a nested class inside Drawable (though, I don't particularly care if it is or isn't).
Also notable that I only looked at the code and did not do any testing, but want to expressly mention that someone should put in the time to check all components where the override was removed to ensure that they retained their old behaviour.
|
||
namespace osu.Framework.Caching | ||
{ | ||
public class HandleInputCache |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
osu.Framework/Graphics/Drawable.cs
Outdated
@@ -1830,10 +1836,31 @@ protected virtual void OnFocusLost(InputState state) | |||
/// is propagated up the scene graph to the next eligible Drawable.</returns> | |||
protected virtual bool OnMouseMove(InputState state) => false; | |||
|
|||
private HandleInputCache handleInputCache; | |||
|
|||
public string[] InputMethods => new[] |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
I like this because it takes out the manual overhead of remembering to add |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this.
Let's adjust the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
docs plz
Rather than doing one dictionary lookup for every drawable every frame.
@peppy plz approve. |
resolves #1235