1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-06 06:17:23 +08:00

Beatmap Editor Save Toast

This commit is contained in:
LukynkaCZE 2022-07-19 21:38:23 +02:00
parent 87afa7317b
commit a00da279b7
2 changed files with 27 additions and 1 deletions

View File

@ -34,6 +34,17 @@ namespace osu.Game.Localisation
/// </summary>
public static LocalisableString RestartTrack => new TranslatableString(getKey(@"restart_track"), @"Restart track");
/// <summary>
/// "Beatmap Editor"
/// </summary>r
public static LocalisableString BeatmapEditor => new TranslatableString(getKey(@"beatmap_editor"), @"Beatmap Editor");
/// <summary>
/// "Beatmap Saved"
/// </summary>
public static LocalisableString EditorSaveBeatmap => new TranslatableString(getKey(@"beatmap_editor_save"), @"Beatmap Saved");
private static string getKey(string key) => $@"{prefix}:{key}";
}
}

View File

@ -18,6 +18,7 @@ using osu.Framework.Graphics.UserInterface;
using osu.Framework.Input;
using osu.Framework.Input.Bindings;
using osu.Framework.Input.Events;
using osu.Framework.Localisation;
using osu.Framework.Logging;
using osu.Framework.Platform;
using osu.Framework.Screens;
@ -31,10 +32,11 @@ using osu.Game.Database;
using osu.Game.Graphics.Cursor;
using osu.Game.Graphics.UserInterface;
using osu.Game.Input.Bindings;
using osu.Game.Localisation;
using osu.Game.Online.API;
using osu.Game.Overlays;
using osu.Game.Overlays.Notifications;
using osu.Game.Resources.Localisation.Web;
using osu.Game.Overlays.OSD;
using osu.Game.Rulesets;
using osu.Game.Rulesets.Edit;
using osu.Game.Rulesets.Objects;
@ -50,6 +52,7 @@ using osu.Game.Screens.Play;
using osu.Game.Users;
using osuTK.Graphics;
using osuTK.Input;
using CommonStrings = osu.Game.Resources.Localisation.Web.CommonStrings;
namespace osu.Game.Screens.Edit
{
@ -169,6 +172,9 @@ namespace osu.Game.Screens.Edit
[Cached]
private readonly OverlayColourProvider colourProvider = new OverlayColourProvider(OverlayColourScheme.Aquamarine);
[Resolved(canBeNull: true)]
private OnScreenDisplay onScreenDisplay { get; set; }
public Editor(EditorLoader loader = null)
{
this.loader = loader;
@ -405,6 +411,7 @@ namespace osu.Game.Screens.Edit
// no longer new after first user-triggered save.
isNewBeatmap = false;
updateLastSavedHash();
onScreenDisplay?.Display(new BeatmapEditorToast(ToastStrings.EditorSaveBeatmap, editorBeatmap.BeatmapInfo.GetDisplayTitle()));
return true;
}
@ -934,5 +941,13 @@ namespace osu.Game.Screens.Edit
ControlPointInfo IBeatSyncProvider.ControlPoints => editorBeatmap.ControlPointInfo;
IClock IBeatSyncProvider.Clock => clock;
ChannelAmplitudes? IBeatSyncProvider.Amplitudes => Beatmap.Value.TrackLoaded ? Beatmap.Value.Track.CurrentAmplitudes : null;
private class BeatmapEditorToast : Toast
{
public BeatmapEditorToast(LocalisableString value, string beatmapDisplayName)
: base(ToastStrings.BeatmapEditor, value, beatmapDisplayName) { }
}
}
}