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

Implement new design of the key counter #22640

Closed
wants to merge 11 commits into from

Conversation

ItsShamed
Copy link
Contributor

This is just the component in itself for now. I tried to integrate it in the player, but I ended up regressing other things instead. For now, I think it's better to keep things somewhat simple and leave the integration for another PR.

osu.Game.Tests_Tpe6qj95jz.mp4

To implement different different sources of input for KeyCounter, it
is now possible to create a Trigger class (to inherit) instead of
inheriting KeyCounter. This eases the creation of more input sources
(like for tests) while allowing to implement different UI variants.

That way, if another variant of the key counter needs to implemented
(for whathever reason), this can be done by only inheriting KeyCounter
and changing how things are arranged visually.
This allows for different layouts of display. Idk, maybe someone would
want to mix both variants? (don't do this please). This commit is mostly
prep for further changes.
This caused the Keyboard inputs to register twice, which is not what we
want.
Makes it better to understand their purpose
This reverts commit 7bce3ed.

Things regressed on reference leaks  when trying to integrate the new counter.
I think it's better to just leave the implementation as is fwiw and
integrate it in a follow up PR.
I added comments instead to clarify that the values come from the Figma
design.
@mk56-spn
Copy link
Contributor

mk56-spn commented Feb 14, 2023

I really dont think this should've been done before the conversion of the keycounter into a skinnable drawable. I had a prototype working version of this month's back ( nowhere near as clean but that's beside the point ) which I remember asking about in the discord and being told that it would likely be better to do that first. My concern is that that already difficult refactor that multiple people have failed at doing will only be made harder by the addition of this component being done before it.

https://discord.com/channels/188630481301012481/188630652340404224/1019248279512432650 relevant discussion

@ItsShamed
Copy link
Contributor Author

ItsShamed commented Feb 14, 2023

Oh, my very bad. I wasn't aware of there was already a discussion on this. I don't think it will be hard to convert this to a ISkinnableDrawable anyway, it would even make things easier to integrate things to the Player imo (integrating it through HUDOverlay was pure pain tbh).

Moreover, since this is just the implementation without any intention of integrating it yet, I don't think this is much of a concern right now.

@mk56-spn
Copy link
Contributor

Oh, my very bad. I wasn't aware of there was already a discussion on this. I don't think it will be hard to convert this to a ISkinnableDrawable anyway, it would even make things easier to integrate things to the Player imo (integrating it through HUDOverlay was pure pain tbh).

Moreover, since this is just the implementation without any intention of integrating it yet, I don't think this is much of a concern right now.

i hope it ends up being easier, just voicing my concerns, and its understandable that you werent aware, it was only mentioned in passing on a long buried discord convo, but yeah thats all i wanted to add.

@ItsShamed
Copy link
Contributor Author

I think for the time being, it's okay to keep that hidden until we find a way to make it customizable.

@peppy
Copy link
Member

peppy commented Feb 15, 2023

Converting to a skinnable component should definitely be one of the next steps, as above.

@peppy peppy self-requested a review February 15, 2023 05:24
Comment on lines +23 to +24
// Make things look bigger without using Scale
private const float scale_factor = 1.5f;
Copy link
Member

Choose a reason for hiding this comment

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

Can you explain this a bit? Is it to match figma metrics to game?

Copy link
Contributor Author

@ItsShamed ItsShamed Feb 15, 2023

Choose a reason for hiding this comment

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

Basically the Figma values were too small visually, and since I want to keep the Figma values for clarity, I thought that it's best to just scale out the values to make them bigger.

@peppy
Copy link
Member

peppy commented Feb 15, 2023

I feel like you could probably split this PR up into two pieces: the part which is abstracting out a portion of the original implementation, then a second PR which implements the new design. It's going to be a bit hard to review both pieces at once as a lot of movement is going on here.

@ItsShamed
Copy link
Contributor Author

splitted the PR, not much of a difference tho
see #22654 and #22655

@ItsShamed ItsShamed closed this Feb 15, 2023
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.

3 participants