1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-14 05:47:20 +08:00

Merge pull request #31780 from necocat0918/pr

Added warning before bookmark reset
This commit is contained in:
Dean Herbert 2025-02-05 16:02:44 +09:00 committed by GitHub
commit 8c5b19d4f8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 27 additions and 1 deletions

View File

@ -0,0 +1,26 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.Allocation;
using osu.Game.Overlays.Dialog;
namespace osu.Game.Screens.Edit
{
public partial class BookmarkResetDialog : DeletionDialog
{
private readonly EditorBeatmap editor;
public BookmarkResetDialog(EditorBeatmap editorBeatmap)
{
editor = editorBeatmap;
BodyText = "All Bookmarks";
}
[BackgroundDependencyLoader]
private void load()
{
DangerousAction = () => editor.Bookmarks.Clear();
}
}
}

View File

@ -462,7 +462,7 @@ namespace osu.Game.Screens.Edit
{
Hotkey = new Hotkey(GlobalAction.EditorSeekToNextBookmark)
},
new EditorMenuItem(EditorStrings.ResetBookmarks, MenuItemType.Destructive, () => editorBeatmap.Bookmarks.Clear())
new EditorMenuItem(EditorStrings.ResetBookmarks, MenuItemType.Destructive, () => dialogOverlay?.Push(new BookmarkResetDialog(editorBeatmap)))
}
}
}