-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Remove requirement of base
calls to ensure user skin container layouts are retrieved
#29564
Merged
Merged
Changes from 1 commit
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
4175652
Rename `SkinComponentsContainer` to `SkinnableContainer`
peppy f37cab0
Rename `SkinComponentsContainerLookup` to `GlobalSkinnableContainerLo…
peppy 36b4013
Rename `GameplaySkinComponentLookup` -> `SkinComponentLookup`
peppy 9a21174
Move `GlobalSkinnableContainers` to global scope
peppy b57b816
Rename `Target` lookup to `Component`
peppy 1435fe2
Remove requirement of `base` calls to ensure user skin container layo…
peppy 46d55d5
Remove remaining early `base` lookup calls which were missed
peppy 48cfd77
`Component` -> `Lookup`
peppy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. | ||
// See the LICENCE file in the repository root for full licence text. | ||
|
||
namespace osu.Game.Skinning | ||
{ | ||
/// <summary> | ||
/// A lookup class which is only for internal use, and explicitly to get a user-level configuration. | ||
/// </summary> | ||
internal class UserSkinComponentLookup : ISkinComponentLookup | ||
{ | ||
public readonly ISkinComponentLookup Component; | ||
|
||
public UserSkinComponentLookup(ISkinComponentLookup component) | ||
{ | ||
Component = component; | ||
} | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
And here I guess I have my answer to the previous thing I guess, or maybe not?
The problem I have here is that
UserSkinComponentLookup
is going to wrap anISkinComponentLookup
, which can be aGlobalSkinnableContainerLookup
, which again confuses me because I delineate the notion of components and containers of components as two notions that will not cross. If that is the case, then I'd argue the following renames should also happen:ISkinComponentLookup
->ISkinLookup
UserSkinComponentLookup
->UserSkinLookup
because they encapsulate both lookups of individual components as well as containers of components.
If I am not correct in assuming that containers of components and components are separate notions, then I guess disregard all I said and you can probably merge this.
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 think I agree with this in principle, just to remove N+1 keywords. However....
I don't agree with this one because it sounds like "look up this thing from the user's skin specifically", like "ignore any argon/whatever base skin". Original naming I think is best for this one.
Also,
UserSkinComponentLookup
may not be just containers in the future. It depends on the path this takes but it may be something passed through to aISkin.GetConfiguration(UserSkinComponentLookup)
to configureSkinnableDrawable
s (but not override them).THAT SAID, I will stress that this is up in the air, so it's just my own ramblings at this point.
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.
Suggestions thrown around for that second one:
UserConfiguredSkinLookup
JsonSkinLookup
. I'd be alright with that, they don't have to be 1-to-1.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.
If
UserSkinComponentLookup
is going to wrap anISkinComponentLookup
then I'm not sure it's an option to dropComponent
from only one. It's essentially a decorator pattern, so it should be transformative in nature, and not add any new qualifiers or whatever - otherwise something is just straight up not shaped right.Probably fine to leave as is, I'm not hugely fussed at this stage.
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.
FWIW I also proposed dropping "Component" from everywhere, including
GetDrawableComponent
, but smoogi didn't agree with this so I dropped it for now.We can probably leave it everywhere for now and reconsider later.
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.
Rather than disagreeing, I want things to be consistent above all. It's a big part of the reason why we got into this mess in the first place (
SkinComponentsContainer
<>SkinnableDrawable
) and the core of my arguments this year.If we can't agree that keeping naming consistent based on what things are rather than what their end product is, then I don't think we can comfortably move forward, which is why I pushed back against
GlobalSkinnableContainerLookup
.Especially during a refactoring stage when everything's new, I think it's best to keep things consistent so we don't step over our feet, and hopefully the next time we look at this code we won't have to piece together what, if any, special functionality is awarded to certain types that justifies their distinct naming.
Over time, when people get used to the structure of things, it will matter not whether a
*ComponentLookup
type returns a container or a drawable; but only that it represents a lookup type that's defined somewhere in a transformer. There's many paths this could go down in the future, but I'll leave that for a separate time to not derail this.That is all to say, I'm not tied to "Component", but it is the keyword that has remained consistent and this PR is just moving the rest back in line with it. I'm not against dropping it unless it causes confusion somwhere - saying certain words like "ISkinLookup" or "OsuSkinLookup" or "OsuSkinLookups" (I guess? the enum name) out loud makes it quite appealing.
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.
Adding my two cents here, dropping the term "Component" in these lookup classes makes me kinda anxious because it gives a more generalised name for the type than what it's actually supposed to be used for. As in, we can have
ISkinLookup
, but that only will look up drawables/containers, it does not look up textures/samples/config/etc.We even have
ManiaSkinConfigurationLookup
existing right now, and having that next to what would beManiaSkinLookup
does not sound good to me at all.