Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions osu.Game/Localisation/SongSelectStrings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,11 @@ public static class SongSelectStrings
/// </summary>
public static LocalisableString WatchReplay => new TranslatableString(getKey(@"watch_replay"), @"Watch replay");

/// <summary>
/// "Download replay"
/// </summary>
public static LocalisableString DownloadReplay => new TranslatableString(getKey(@"download_replay"), @"Download replay");
Comment on lines +117 to +120

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

UsersStrings.ShowExtraTopRanksDownloadReplay.ToSentence() can be used instead


/// <summary>
/// "For all difficulties"
/// </summary>
Expand Down
6 changes: 6 additions & 0 deletions osu.Game/Screens/Select/BeatmapLeaderboardScore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@
[Resolved]
private IAPIProvider api { get; set; } = null!;

[Resolved]
private ScoreModelDownloader scoreDownloader { get; set; }
Comment thread
yorunoken marked this conversation as resolved.
Outdated

private const float expanded_right_content_width = 200;
private const float grade_width = 35;
private const float username_min_width = 120;
Expand Down Expand Up @@ -128,7 +131,7 @@
return inputRectangle.Contains(ToLocalSpace(screenSpacePos));
}

public BeatmapLeaderboardScore(ScoreInfo score, bool sheared = true)

Check failure on line 134 in osu.Game/Screens/Select/BeatmapLeaderboardScore.cs

View workflow job for this annotation

GitHub Actions / Test (Windows, windows-latest, MultiThreaded)

Non-nullable property 'scoreDownloader' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.

Check failure on line 134 in osu.Game/Screens/Select/BeatmapLeaderboardScore.cs

View workflow job for this annotation

GitHub Actions / Test (Windows, windows-latest, MultiThreaded)

Non-nullable property 'scoreDownloader' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.

Check failure on line 134 in osu.Game/Screens/Select/BeatmapLeaderboardScore.cs

View workflow job for this annotation

GitHub Actions / Test (Linux, ubuntu-latest, MultiThreaded)

Non-nullable property 'scoreDownloader' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.

Check failure on line 134 in osu.Game/Screens/Select/BeatmapLeaderboardScore.cs

View workflow job for this annotation

GitHub Actions / Test (Linux, ubuntu-latest, MultiThreaded)

Non-nullable property 'scoreDownloader' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.

Check failure on line 134 in osu.Game/Screens/Select/BeatmapLeaderboardScore.cs

View workflow job for this annotation

GitHub Actions / Test (Linux, ubuntu-latest, SingleThread)

Non-nullable property 'scoreDownloader' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.

Check failure on line 134 in osu.Game/Screens/Select/BeatmapLeaderboardScore.cs

View workflow job for this annotation

GitHub Actions / Test (Linux, ubuntu-latest, SingleThread)

Non-nullable property 'scoreDownloader' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.

Check warning on line 134 in osu.Game/Screens/Select/BeatmapLeaderboardScore.cs

View workflow job for this annotation

GitHub Actions / Build only (iOS)

Non-nullable property 'scoreDownloader' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.

Check warning on line 134 in osu.Game/Screens/Select/BeatmapLeaderboardScore.cs

View workflow job for this annotation

GitHub Actions / Build only (iOS)

Non-nullable property 'scoreDownloader' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.

Check failure on line 134 in osu.Game/Screens/Select/BeatmapLeaderboardScore.cs

View workflow job for this annotation

GitHub Actions / Test (Windows, windows-latest, SingleThread)

Non-nullable property 'scoreDownloader' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.

Check failure on line 134 in osu.Game/Screens/Select/BeatmapLeaderboardScore.cs

View workflow job for this annotation

GitHub Actions / Test (Windows, windows-latest, SingleThread)

Non-nullable property 'scoreDownloader' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.

Check warning on line 134 in osu.Game/Screens/Select/BeatmapLeaderboardScore.cs

View workflow job for this annotation

GitHub Actions / Build only (Android)

Non-nullable property 'scoreDownloader' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.

Check warning on line 134 in osu.Game/Screens/Select/BeatmapLeaderboardScore.cs

View workflow job for this annotation

GitHub Actions / Build only (Android)

Non-nullable property 'scoreDownloader' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.

Check failure on line 134 in osu.Game/Screens/Select/BeatmapLeaderboardScore.cs

View workflow job for this annotation

GitHub Actions / Code Quality

Non-nullable property 'scoreDownloader' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.

Check failure on line 134 in osu.Game/Screens/Select/BeatmapLeaderboardScore.cs

View workflow job for this annotation

GitHub Actions / Code Quality

Non-nullable property 'scoreDownloader' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.
{
Score = score;

Expand Down Expand Up @@ -626,6 +629,9 @@
if (Score.OnlineID > 0)
items.Add(new OsuMenuItem(CommonStrings.CopyLink, MenuItemType.Standard, () => game?.CopyToClipboard($@"{api.Endpoints.WebsiteUrl}/scores/{Score.OnlineID}")));

if (Score.HasOnlineReplay && Score.Files.Count == 0)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This menu item continues to show if the user already has the given replay downloaded, meaning they can keep re-downloading it forever and not be able to tell that it's already downloaded.

Unsure how it should be handled UX-wise. Probably best choice user-wise would be disabling the menu item and changing its text to something like "Replay already downloaded" or similar. Not sure.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

maybe it could go through "Replay downloading" -> "Replay downloaded"?
could also be replaced by "watch replay" as well.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

could also be replaced by "watch replay" as well.

This could work too, sure.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think I'd rather hide it if it's already downloaded? In such cases, the "watch replay" context item will be there in its palce.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

the watch replay button doesn't show up in leaderboard even if the replay is available locally, I'll be adding it shortly

items.Add(new OsuMenuItem(SongSelectStrings.DownloadReplay, MenuItemType.Standard, () => scoreDownloader.Download(Score)));

if (Score.Files.Count <= 0) return items.ToArray();

if (items.Count > 0)
Expand Down
Loading