-
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 #2261 from andy840119/refactor-the-editable-lyric-…
…in-lyric-editor Refactor the EditableLyric in the lyric editor.
- Loading branch information
Showing
21 changed files
with
230 additions
and
179 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
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
34 changes: 34 additions & 0 deletions
34
...raoke/Screens/Edit/Beatmaps/Lyrics/Content/Components/Lyrics/Carets/DrawableRangeCaret.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,34 @@ | ||
// Copyright (c) andy840119 <[email protected]>. Licensed under the GPL Licence. | ||
// See the LICENCE file in the repository root for full licence text. | ||
|
||
using System; | ||
using osu.Game.Rulesets.Karaoke.Screens.Edit.Beatmaps.Lyrics.CaretPosition; | ||
using osu.Game.Rulesets.Karaoke.Screens.Edit.Beatmaps.Lyrics.States; | ||
|
||
namespace osu.Game.Rulesets.Karaoke.Screens.Edit.Beatmaps.Lyrics.Content.Components.Lyrics.Carets; | ||
|
||
public abstract partial class DrawableRangeCaret<TCaretPosition> : DrawableCaret, ICanAcceptRangeIndex | ||
where TCaretPosition : struct, IIndexCaretPosition | ||
{ | ||
protected DrawableRangeCaret(DrawableCaretState state) | ||
: base(state) | ||
{ | ||
} | ||
|
||
public sealed override void ApplyCaretPosition(ICaretPosition caret) | ||
{ | ||
if (caret is not TCaretPosition tCaret) | ||
throw new InvalidCastException(); | ||
|
||
ApplyCaretPosition(tCaret); | ||
} | ||
|
||
public void ApplyRangeCaretPosition(RangeCaretPosition rangeCaretPosition) | ||
{ | ||
ApplyRangeCaretPosition(rangeCaretPosition.GetRangeCaretPositionWithType<TCaretPosition>()); | ||
} | ||
|
||
protected abstract void ApplyCaretPosition(TCaretPosition caret); | ||
|
||
protected abstract void ApplyRangeCaretPosition(RangeCaretPosition<TCaretPosition> caret); | ||
} |
Oops, something went wrong.