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:
commit
8c5b19d4f8
26
osu.Game/Screens/Edit/BookmarkResetDialog.cs
Normal file
26
osu.Game/Screens/Edit/BookmarkResetDialog.cs
Normal 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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)))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user