mirror of
https://github.com/osukey/osukey.git
synced 2025-08-05 23:53:51 +09:00
Merge branch 'master' into playlist-item-add-owner
This commit is contained in:
@ -136,7 +136,7 @@ namespace osu.Game.Online.API.Requests.Responses
|
||||
IBeatmapMetadataInfo IBeatmapSetInfo.Metadata => metadata;
|
||||
|
||||
DateTimeOffset IBeatmapSetInfo.DateAdded => throw new NotImplementedException();
|
||||
IEnumerable<INamedFileUsage> IBeatmapSetInfo.Files => throw new NotImplementedException();
|
||||
IEnumerable<INamedFileUsage> IHasNamedFiles.Files => throw new NotImplementedException();
|
||||
double IBeatmapSetInfo.MaxStarDifficulty => throw new NotImplementedException();
|
||||
double IBeatmapSetInfo.MaxLength => throw new NotImplementedException();
|
||||
double IBeatmapSetInfo.MaxBPM => BPM;
|
||||
|
@ -8,6 +8,7 @@ using JetBrains.Annotations;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Database;
|
||||
using osu.Game.Rulesets;
|
||||
using osu.Game.Rulesets.Mods;
|
||||
using osu.Game.Scoring;
|
||||
@ -147,6 +148,7 @@ namespace osu.Game.Online.API.Requests.Responses
|
||||
}
|
||||
|
||||
public IRulesetInfo Ruleset => new RulesetInfo { OnlineID = RulesetID };
|
||||
IEnumerable<INamedFileUsage> IHasNamedFiles.Files => throw new NotImplementedException();
|
||||
|
||||
IBeatmapInfo IScoreInfo.Beatmap => Beatmap;
|
||||
}
|
||||
|
@ -15,6 +15,9 @@ namespace osu.Game.Online
|
||||
[Resolved(CanBeNull = true)]
|
||||
protected BeatmapManager? Manager { get; private set; }
|
||||
|
||||
[Resolved(CanBeNull = true)]
|
||||
protected BeatmapModelDownloader? Downloader { get; private set; }
|
||||
|
||||
private ArchiveDownloadRequest<IBeatmapSetInfo>? attachedRequest;
|
||||
|
||||
public BeatmapDownloadTracker(IBeatmapSetInfo trackedItem)
|
||||
@ -25,7 +28,7 @@ namespace osu.Game.Online
|
||||
[BackgroundDependencyLoader(true)]
|
||||
private void load()
|
||||
{
|
||||
if (Manager == null)
|
||||
if (Manager == null || Downloader == null)
|
||||
return;
|
||||
|
||||
// Used to interact with manager classes that don't support interface types. Will eventually be replaced.
|
||||
@ -34,10 +37,10 @@ namespace osu.Game.Online
|
||||
if (Manager.IsAvailableLocally(beatmapSetInfo))
|
||||
UpdateState(DownloadState.LocallyAvailable);
|
||||
else
|
||||
attachDownload(Manager.GetExistingDownload(beatmapSetInfo));
|
||||
attachDownload(Downloader.GetExistingDownload(beatmapSetInfo));
|
||||
|
||||
Manager.DownloadBegan += downloadBegan;
|
||||
Manager.DownloadFailed += downloadFailed;
|
||||
Downloader.DownloadBegan += downloadBegan;
|
||||
Downloader.DownloadFailed += downloadFailed;
|
||||
Manager.ItemUpdated += itemUpdated;
|
||||
Manager.ItemRemoved += itemRemoved;
|
||||
}
|
||||
@ -115,10 +118,14 @@ namespace osu.Game.Online
|
||||
base.Dispose(isDisposing);
|
||||
attachDownload(null);
|
||||
|
||||
if (Downloader != null)
|
||||
{
|
||||
Downloader.DownloadBegan -= downloadBegan;
|
||||
Downloader.DownloadFailed -= downloadFailed;
|
||||
}
|
||||
|
||||
if (Manager != null)
|
||||
{
|
||||
Manager.DownloadBegan -= downloadBegan;
|
||||
Manager.DownloadFailed -= downloadFailed;
|
||||
Manager.ItemUpdated -= itemUpdated;
|
||||
Manager.ItemRemoved -= itemRemoved;
|
||||
}
|
||||
|
@ -14,6 +14,8 @@ using osu.Framework.Graphics.Sprites;
|
||||
using osu.Framework.Graphics.UserInterface;
|
||||
using osu.Framework.Input.Events;
|
||||
using osu.Framework.Localisation;
|
||||
using osu.Framework.Platform;
|
||||
using osu.Game.Database;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.Containers;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
@ -66,6 +68,9 @@ namespace osu.Game.Online.Leaderboards
|
||||
[Resolved]
|
||||
private ScoreManager scoreManager { get; set; }
|
||||
|
||||
[Resolved]
|
||||
private Storage storage { get; set; }
|
||||
|
||||
public LeaderboardScore(ScoreInfo score, int? rank, bool allowHighlight = true)
|
||||
{
|
||||
Score = score;
|
||||
@ -394,8 +399,8 @@ namespace osu.Game.Online.Leaderboards
|
||||
if (Score.Mods.Length > 0 && modsContainer.Any(s => s.IsHovered) && songSelect != null)
|
||||
items.Add(new OsuMenuItem("Use these mods", MenuItemType.Highlighted, () => songSelect.Mods.Value = Score.Mods));
|
||||
|
||||
if (Score.Files?.Count > 0)
|
||||
items.Add(new OsuMenuItem("Export", MenuItemType.Standard, () => scoreManager.Export(Score)));
|
||||
if (Score.Files.Count > 0)
|
||||
items.Add(new OsuMenuItem("Export", MenuItemType.Standard, () => new LegacyScoreExporter(storage).Export(Score)));
|
||||
|
||||
if (Score.ID != 0)
|
||||
items.Add(new OsuMenuItem("Delete", MenuItemType.Destructive, () => dialogOverlay?.Push(new LocalScoreDeleteDialog(Score))));
|
||||
|
@ -15,6 +15,9 @@ namespace osu.Game.Online
|
||||
[Resolved(CanBeNull = true)]
|
||||
protected ScoreManager? Manager { get; private set; }
|
||||
|
||||
[Resolved(CanBeNull = true)]
|
||||
protected ScoreModelDownloader? Downloader { get; private set; }
|
||||
|
||||
private ArchiveDownloadRequest<IScoreInfo>? attachedRequest;
|
||||
|
||||
public ScoreDownloadTracker(ScoreInfo trackedItem)
|
||||
@ -25,7 +28,7 @@ namespace osu.Game.Online
|
||||
[BackgroundDependencyLoader(true)]
|
||||
private void load()
|
||||
{
|
||||
if (Manager == null)
|
||||
if (Manager == null || Downloader == null)
|
||||
return;
|
||||
|
||||
// Used to interact with manager classes that don't support interface types. Will eventually be replaced.
|
||||
@ -38,10 +41,10 @@ namespace osu.Game.Online
|
||||
if (Manager.IsAvailableLocally(scoreInfo))
|
||||
UpdateState(DownloadState.LocallyAvailable);
|
||||
else
|
||||
attachDownload(Manager.GetExistingDownload(scoreInfo));
|
||||
attachDownload(Downloader.GetExistingDownload(scoreInfo));
|
||||
|
||||
Manager.DownloadBegan += downloadBegan;
|
||||
Manager.DownloadFailed += downloadFailed;
|
||||
Downloader.DownloadBegan += downloadBegan;
|
||||
Downloader.DownloadFailed += downloadFailed;
|
||||
Manager.ItemUpdated += itemUpdated;
|
||||
Manager.ItemRemoved += itemRemoved;
|
||||
}
|
||||
@ -119,10 +122,14 @@ namespace osu.Game.Online
|
||||
base.Dispose(isDisposing);
|
||||
attachDownload(null);
|
||||
|
||||
if (Downloader != null)
|
||||
{
|
||||
Downloader.DownloadBegan -= downloadBegan;
|
||||
Downloader.DownloadFailed -= downloadFailed;
|
||||
}
|
||||
|
||||
if (Manager != null)
|
||||
{
|
||||
Manager.DownloadBegan -= downloadBegan;
|
||||
Manager.DownloadFailed -= downloadFailed;
|
||||
Manager.ItemUpdated -= itemUpdated;
|
||||
Manager.ItemRemoved -= itemRemoved;
|
||||
}
|
||||
|
Reference in New Issue
Block a user