-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1153 from andy840119/implement-clear-notes-section
Implement clear notes section in the edit note mode.
- Loading branch information
Showing
12 changed files
with
181 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
osu.Game.Rulesets.Karaoke/Edit/Lyrics/Extends/Notes/NoteClearSection.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// Copyright (c) andy840119 <[email protected]>. Licensed under the GPL Licence. | ||
// See the LICENCE file in the repository root for full licence text. | ||
|
||
using System.Collections.Generic; | ||
using osu.Framework.Allocation; | ||
using osu.Framework.Graphics; | ||
using osu.Game.Rulesets.Karaoke.Edit.ChangeHandlers.Notes; | ||
using osu.Game.Rulesets.Karaoke.Edit.Components.Containers; | ||
using osu.Game.Rulesets.Karaoke.Edit.Lyrics.Extends.Components; | ||
using osu.Game.Rulesets.Karaoke.Edit.Lyrics.States; | ||
using osu.Game.Rulesets.Karaoke.Objects; | ||
|
||
namespace osu.Game.Rulesets.Karaoke.Edit.Lyrics.Extends.Notes | ||
{ | ||
public class NoteClearSection : Section | ||
{ | ||
protected sealed override string Title => "Clear"; | ||
|
||
[BackgroundDependencyLoader] | ||
private void load(ILyricSelectionState lyricSelectionState, INotesChangeHandler notesChangeHandler) | ||
{ | ||
Children = new Drawable[] | ||
{ | ||
new AutoGenerateButton | ||
{ | ||
StartSelecting = () => new Dictionary<Lyric, string>() | ||
}, | ||
}; | ||
|
||
lyricSelectionState.Action = e => | ||
{ | ||
if (e != LyricEditorSelectingAction.Apply) | ||
return; | ||
|
||
notesChangeHandler.Clear(); | ||
}; | ||
} | ||
|
||
private class AutoGenerateButton : SelectLyricButton | ||
{ | ||
protected override string StandardText => "Clear"; | ||
|
||
protected override string SelectingText => "Cancel clear"; | ||
} | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
osu.Game.Rulesets.Karaoke/Edit/Lyrics/Extends/Notes/NoteEditModeSpecialAction.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// Copyright (c) andy840119 <[email protected]>. Licensed under the GPL Licence. | ||
// See the LICENCE file in the repository root for full licence text. | ||
|
||
namespace osu.Game.Rulesets.Karaoke.Edit.Lyrics.Extends.Notes | ||
{ | ||
public enum NoteEditModeSpecialAction | ||
{ | ||
AutoGenerate, | ||
|
||
SyncTime, | ||
|
||
Clear, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
osu.Game.Rulesets.Karaoke/Edit/Lyrics/Extends/Notes/SwitchSpecialActionSection.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// Copyright (c) andy840119 <[email protected]>. Licensed under the GPL Licence. | ||
// See the LICENCE file in the repository root for full licence text. | ||
|
||
using osu.Framework.Allocation; | ||
using osu.Game.Graphics.UserInterfaceV2; | ||
using osu.Game.Rulesets.Karaoke.Edit.Components.Containers; | ||
using osu.Game.Rulesets.Karaoke.Edit.Lyrics.States.Modes; | ||
|
||
namespace osu.Game.Rulesets.Karaoke.Edit.Lyrics.Extends.Notes | ||
{ | ||
public class SwitchSpecialActionSection : Section | ||
{ | ||
protected sealed override string Title => "Clear"; | ||
|
||
[BackgroundDependencyLoader] | ||
private void load(IEditNoteModeState editNoteModeState) | ||
{ | ||
Children = new[] | ||
{ | ||
new LabelledEnumDropdown<NoteEditModeSpecialAction> | ||
{ | ||
Label = "Switch special actions", | ||
Description = "Auto-generate, edit or clear the notes.", | ||
Current = editNoteModeState.BindableSpecialAction, | ||
} | ||
}; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
osu.Game.Rulesets.Karaoke/Edit/Lyrics/States/Modes/IEditNoteModeState.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,16 @@ | ||
// Copyright (c) andy840119 <[email protected]>. Licensed under the GPL Licence. | ||
// See the LICENCE file in the repository root for full licence text. | ||
|
||
using osu.Framework.Bindables; | ||
using osu.Game.Rulesets.Karaoke.Edit.Lyrics.Extends.Notes; | ||
using osu.Game.Rulesets.Karaoke.Objects; | ||
|
||
namespace osu.Game.Rulesets.Karaoke.Edit.Lyrics.States.Modes | ||
{ | ||
public interface IEditNoteModeState : IHasEditModeState<NoteEditMode>, IHasBlueprintSelection<Note> | ||
{ | ||
Bindable<NoteEditModeSpecialAction> BindableSpecialAction { get; } | ||
|
||
Bindable<NoteEditPropertyMode> NoteEditPropertyMode { get; } | ||
} | ||
} |