Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
18 changes: 18 additions & 0 deletions osu.Game/Beatmaps/BeatmapImporter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
using System.Threading.Tasks;
using osu.Framework.Extensions;
using osu.Framework.Extensions.IEnumerableExtensions;
using osu.Framework.Localisation;
using osu.Framework.Logging;
using osu.Framework.Platform;
using osu.Game.Beatmaps.Formats;
Expand All @@ -18,6 +19,7 @@
using osu.Game.Extensions;
using osu.Game.IO;
using osu.Game.IO.Archives;
using osu.Game.Localisation;
using osu.Game.Overlays.Notifications;
using osu.Game.Rulesets;
using osu.Game.Rulesets.Objects.Types;
Expand Down Expand Up @@ -455,5 +457,21 @@ private List<BeatmapInfo> createBeatmapDifficulties(BeatmapSetInfo beatmapSet, R

return beatmaps;
}

protected override LocalisableString ImportAbortedText => NotificationsStrings.ImportBeatmapsAborted;

protected override LocalisableString ImportStartingText => NotificationsStrings.ImportBeatmapsStarting;

protected override LocalisableString ImportRunningText(int processedCount, int totalCount) => NotificationsStrings.ImportBeatmapsRunning(processedCount, totalCount);

protected override LocalisableString ImportCompletedText(int totalCount) => NotificationsStrings.ImportBeatmapsCompleted(totalCount);

protected override LocalisableString ImportIncompletedText(int processedCount, int totalCount) => NotificationsStrings.ImportBeatmapsIncompleted(processedCount, totalCount);

protected override LocalisableString ImportFailedText => NotificationsStrings.ImportBeatmapsFailed;

protected override LocalisableString ImportPausedText => NotificationsStrings.ImportBeatmapsPaused;

protected override LocalisableString ImportResumingText => NotificationsStrings.ImportBeatmapsResuming;
}
}
31 changes: 22 additions & 9 deletions osu.Game/Beatmaps/BeatmapManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,14 @@
using osu.Framework.Audio.Track;
using osu.Framework.Extensions;
using osu.Framework.IO.Stores;
using osu.Framework.Localisation;
using osu.Framework.Platform;
using osu.Game.Beatmaps.ControlPoints;
using osu.Game.Beatmaps.Formats;
using osu.Game.Database;
using osu.Game.Extensions;
using osu.Game.IO.Archives;
using osu.Game.Localisation;
using osu.Game.Models;
using osu.Game.Online.API;
using osu.Game.Online.API.Requests.Responses;
Expand Down Expand Up @@ -372,7 +374,6 @@ public void DeleteAllVideos()

public void ResetAllOffsets()
{
const string reset_complete_message = "All offsets have been reset!";
Realm.Write(r =>
{
var items = r.All<BeatmapInfo>();
Expand All @@ -383,7 +384,7 @@ public void ResetAllOffsets()
beatmap.UserSettings.Offset = 0;
}

PostNotification?.Invoke(new ProgressCompletionNotification { Text = reset_complete_message });
PostNotification?.Invoke(new ProgressCompletionNotification { Text = NotificationsStrings.RestoreBeatmapOffsetsCompleted });
});
}

Expand Down Expand Up @@ -435,20 +436,18 @@ public void DeleteDifficultyImmediately(BeatmapInfo beatmapInfo)
/// </summary>
public void DeleteVideos(List<BeatmapSetInfo> items, bool silent = false)
{
const string no_videos_message = "No videos found to delete!";

if (items.Count == 0)
{
if (!silent)
PostNotification?.Invoke(new ProgressCompletionNotification { Text = no_videos_message });
PostNotification?.Invoke(new ProgressCompletionNotification { Text = NotificationsStrings.DeleteBeatmapVideosAborted });
return;
}

var notification = new ProgressNotification
{
Progress = 0,
Text = $"Preparing to delete all {HumanisedModelName} videos...",
CompletionText = no_videos_message,
Text = NotificationsStrings.DeleteBeatmapVideosStarting,
CompletionText = NotificationsStrings.DeleteBeatmapVideosAborted,
State = ProgressNotificationState.Active,
};

Expand All @@ -470,10 +469,10 @@ public void DeleteVideos(List<BeatmapSetInfo> items, bool silent = false)
{
DeleteFile(b, video);
deleted++;
notification.CompletionText = $"Deleted {deleted} {HumanisedModelName} video(s)!";
notification.CompletionText = NotificationsStrings.DeleteBeatmapVideosCompleted(deleted);
}

notification.Text = $"Deleting videos from {HumanisedModelName}s ({deleted} deleted)";
notification.Text = NotificationsStrings.DeleteBeatmapVideosRunning(deleted);

notification.Progress = (float)++i / items.Count;
}
Expand Down Expand Up @@ -682,6 +681,20 @@ public Action<IEnumerable<Live<BeatmapSetInfo>>>? PresentImport
#endregion

public override string HumanisedModelName => "beatmap";

protected override LocalisableString DeleteModelsAbortedText => NotificationsStrings.DeleteBeatmapsAborted;

protected override LocalisableString DeleteModelsStartingText => NotificationsStrings.DeleteBeatmapsStarting;

protected override LocalisableString DeleteModelsRunningText(int processedCount, int totalCount) => NotificationsStrings.DeleteBeatmapsRunning(processedCount, totalCount);

protected override LocalisableString DeleteModelsCompletedText => NotificationsStrings.DeleteBeatmapsCompleted;

protected override LocalisableString RestoreModelsAbortedText => NotificationsStrings.RestoreBeatmapsAborted;

protected override LocalisableString RestoreModelsRunningText(int processedCount, int totalCount) => NotificationsStrings.RestoreBeatmapsRunning(processedCount, totalCount);

protected override LocalisableString RestoreModelsCompletedText => NotificationsStrings.RestoreBeatmapsCompleted;
}

/// <summary>
Expand Down
Loading
Loading