Skip to content

Commit

Permalink
Merge pull request #31780 from necocat0918/pr
Browse files Browse the repository at this point in the history
Added warning before bookmark reset
  • Loading branch information
peppy authored Feb 5, 2025
2 parents 20c4bad + 13fa49d commit 8c5b19d
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
26 changes: 26 additions & 0 deletions osu.Game/Screens/Edit/BookmarkResetDialog.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// Copyright (c) ppy Pty Ltd <[email protected]>. 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();
}
}
}

2 changes: 1 addition & 1 deletion osu.Game/Screens/Edit/Editor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ private void load(OsuConfigManager config)
{
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)))
}
}
}
Expand Down

0 comments on commit 8c5b19d

Please sign in to comment.