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
Only show components in skin editor which are usable on the current screen #17279
Merged
smoogipoo
merged 11 commits into
ppy:master
from
peppy:skin-editor-borrowed-dependencies
Mar 18, 2022
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
b07ca87
Merge branch 'skin-editor-toolbox-ui' into skin-editor-borrowed-depen…
peppy cc356bc
Show components available for current screen only (using actual live …
peppy e577152
Merge branch 'master' into skin-editor-borrowed-dependencies
bdach ac739c9
Change `PerformancePointsCounter` resolution requirements to be required
peppy fd71aa4
Change `SongProgress` resolution requirements to be required
peppy 1d83b36
Merge branch 'master' into skin-editor-borrowed-dependencies
peppy e252f1a
Add explanation about try-catch logic in `SkinComponentToolbox`
peppy 4650c19
Make `SongProgress.DrawableRuleset` nullable to allow test scene to work
peppy ef29de9
Add one more missing dependency required by `SongProgress`
peppy a8bb696
Cache gameplay clock in more places to fix song progress related tests
bdach 50d64e1
Merge branch 'master' into skin-editor-borrowed-dependencies
bdach File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
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
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
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.
So if I understand this correctly, this add is what actually holds the invariant that only usable components are shown on their corresponding screens, and it works because the synchronous add causes a synchronous load which fails after dependencies are not found in the borrowing container, and therefore the element is finally not added.
I guess it works but I feel some reservations towards that - it feels a bit too magic if I'm honest and needs to be properly xmldoc'd / signposted. Like right now
SongProgress
are visible when skin editing song select because they have nullable dependencies. The try-catch is also doing a lot of magic - any old other failure that isn't a DI failure will also make the component disappear. I'd be more fine with catching a DI-specific exception and logging any other unexpected one.Dunno, probably going to wait for @smoogipoo's thoughts on 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.
Maybe it's okay for now? Definitely needs documentation though.
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 also agree with this bit for better safety,
DependencyNotRegisteredException
should be enough to indicate a DI failure.