Skip to content

Commit

Permalink
Added warning
Browse files Browse the repository at this point in the history
  • Loading branch information
necocat0918 committed Feb 3, 2025
1 parent 4739f93 commit f4e67fa
Show file tree
Hide file tree
Showing 2 changed files with 28 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 <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();
}
}
}

3 changes: 2 additions & 1 deletion osu.Game/Screens/Edit/Editor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using DiffPlex.Model;
using JetBrains.Annotations;
using osu.Framework;
using osu.Framework.Allocation;
Expand Down Expand Up @@ -450,7 +451,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 f4e67fa

Please # to comment.