-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Make BeatmapSetOverlay accept nulls everywhere #2416
Conversation
Can you split this up into multiple PRs or even just multiple commits next time? This is super difficult to go through since so many files are touched. |
How would you split it up? It'd just become a commit per class or class group, at which point it's the same as just reviewing a file at a time. The changes I made are basically the same in each case. Once you start reviewing you'll understand. |
Reviewing one class or class group at a time would make this so much simpler. The avatar change is grouped into all of this, changes to how things are displayed in SuccessRate are grouped into all of this, changes to display and interaction of things like Beatmap in ScoresContainer are grouped into all of this. None of these components have been tested individually, so there's a lot of cases I have to go through to validate the code visually. |
This is one of the reasons I want individual tests per component. Right now the whole overlay is one testable component so that's how I felt it correct to apply updates. |
Cool, sounds like something you should've done then. |
Can do if you'd prefer, though it's a large time investment and the changes made here are pretty straight-forward (just moving logic to a separate method). |
@@ -31,15 +32,25 @@ public BeatmapMetrics Metrics | |||
|
|||
const int rating_range = 10; | |||
|
|||
var ratings = Metrics.Ratings.Skip(1).Take(rating_range); // adjust for API returning weird empty data at 0. | |||
if (metrics == null) |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
@@ -125,6 +120,15 @@ protected override void Update() | |||
|
|||
private void updatePreviewTrack(bool playing) | |||
{ | |||
if (playing && BeatmapSet == null) |
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.
clickableArea.Action = () => profile?.ShowUser(avatar.User); | ||
clickableArea.Action = () => | ||
{ | ||
if (avatar.User != null) profile?.ShowUser(avatar.User); |
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.
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.
@@ -47,9 +47,7 @@ public TestCaseBeatmapScoresContainer() | |||
AddStep("scores pack 1", () => scoresContainer.Scores = scores); | |||
AddStep("scores pack 2", () => scoresContainer.Scores = anotherScores); | |||
AddStep("only top score", () => scoresContainer.Scores = new[] { topScore }); | |||
AddStep("remove scores", scoresContainer.CleanAllScores); | |||
AddStep("turn on loading", () => scoresContainer.IsLoading = true); | |||
AddStep("turn off loading", () => scoresContainer.IsLoading = false); |
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.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
|
||
private readonly ScrollContainer scroll; | ||
|
||
private BeatmapSetInfo beatmapSet; | ||
|
||
public BeatmapSetInfo BeatmapSet |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
◕‿◕ sure why not |
At very least I think this is a step in the right direction. |
A step forward in usability of
BeatmapSetOverlay
. The default state now matches what you are returned to when displaying anull
BeatmapInfo
.Helps with making #2350 tidy.
BeatmapSetOverlay
hierarchy now acceptsnull
in its settable property.updateInfo
, which is also called from BDL to provide a default state.