From cca938bbe78dcb6277697908eadffe588fdd1a6a Mon Sep 17 00:00:00 2001 From: andy840119 Date: Sat, 19 Feb 2022 13:45:32 +0800 Subject: [PATCH 1/3] fix the typo --- .../Rows/Extends/RecordingTimeTags/RecordingTimeTagPart.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/osu.Game.Rulesets.Karaoke/Edit/Lyrics/Rows/Extends/RecordingTimeTags/RecordingTimeTagPart.cs b/osu.Game.Rulesets.Karaoke/Edit/Lyrics/Rows/Extends/RecordingTimeTags/RecordingTimeTagPart.cs index 792613f8e..33995109b 100644 --- a/osu.Game.Rulesets.Karaoke/Edit/Lyrics/Rows/Extends/RecordingTimeTags/RecordingTimeTagPart.cs +++ b/osu.Game.Rulesets.Karaoke/Edit/Lyrics/Rows/Extends/RecordingTimeTags/RecordingTimeTagPart.cs @@ -120,7 +120,7 @@ private class RecordingTimeTagVisualization : CompositeDrawable, IHasCustomToolt [Resolved] private ILyricTimeTagsChangeHandler lyricTimeTagsChangeHandler { get; set; } - private readonly Bindable bindableTIme; + private readonly Bindable bindableTime; private readonly RightTriangle timeTagTriangle; @@ -138,7 +138,7 @@ public RecordingTimeTagVisualization(Lyric lyric, TimeTag timeTag) RelativePositionAxes = Axes.X; Size = new Vector2(RecordingTimeTagEditor.TIMELINE_HEIGHT); - bindableTIme = timeTag.TimeBindable.GetBoundCopy(); + bindableTime = timeTag.TimeBindable.GetBoundCopy(); InternalChildren = new Drawable[] { timeTagTriangle = new RightTriangle @@ -163,7 +163,7 @@ private void load(OsuColour colours, RecordingTimeTagEditor timeline) { timeTagTriangle.Colour = colours.GetTimeTagColour(timeTag); - bindableTIme.BindValueChanged(e => + bindableTime.BindValueChanged(e => { bool hasValue = e.NewValue.HasValue; Alpha = hasValue ? 1 : 0; From b5dfe671e6e2f5871869e7f88c9b94b6443608d6 Mon Sep 17 00:00:00 2001 From: andy840119 Date: Sat, 19 Feb 2022 15:06:19 +0800 Subject: [PATCH 2/3] add tickle effect in the adjust time-tag mode. --- .../TimeTagEditorHitObjectBlueprint.cs | 25 ++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/osu.Game.Rulesets.Karaoke/Edit/Lyrics/Rows/Extends/TimeTags/TimeTagEditorHitObjectBlueprint.cs b/osu.Game.Rulesets.Karaoke/Edit/Lyrics/Rows/Extends/TimeTags/TimeTagEditorHitObjectBlueprint.cs index 4aa5e2e13..bd74b5523 100644 --- a/osu.Game.Rulesets.Karaoke/Edit/Lyrics/Rows/Extends/TimeTags/TimeTagEditorHitObjectBlueprint.cs +++ b/osu.Game.Rulesets.Karaoke/Edit/Lyrics/Rows/Extends/TimeTags/TimeTagEditorHitObjectBlueprint.cs @@ -18,7 +18,9 @@ using osu.Game.Rulesets.Karaoke.Graphics.Shapes; using osu.Game.Rulesets.Karaoke.Objects; using osu.Game.Rulesets.Karaoke.Utils; +using osu.Game.Screens.Edit; using osuTK; +using osuTK.Graphics; namespace osu.Game.Rulesets.Karaoke.Edit.Lyrics.Rows.Extends.TimeTags { @@ -81,11 +83,14 @@ public TimeTagEditorHitObjectBlueprint(TimeTag item) } [BackgroundDependencyLoader] - private void load(TimeTagEditor timeline, OsuColour colours) + private void load(EditorClock clock, TimeTagEditor timeline, OsuColour colours) { // todo : should be able to let user able to select show from ruby or main text. timeTagText.Text = LyricUtils.GetTimeTagDisplayRubyText(timeline.HitObject, Item); + + timeTagPiece.Clock = clock; timeTagPiece.Colour = colours.BlueLight; + timeTagWithNoTimePiece.Colour = colours.Red; startTime.BindValueChanged(_ => { @@ -105,10 +110,22 @@ private void load(TimeTagEditor timeline, OsuColour colours) break; } + // should wait until all time-tag time has been modified. Schedule(() => { - // should wait until all time-tag time has been modified. - X = (float)timeline.GetPreviewTime(Item); + double previewTime = timeline.GetPreviewTime(Item); + + // adjust position. + X = (float)previewTime; + + // make tickle effect. + timeTagPiece.ClearTransforms(); + + using (timeTagPiece.BeginAbsoluteSequence(previewTime)) + { + timeTagPiece.Colour = colours.BlueLight; + timeTagPiece.FlashColour(colours.PurpleDark, 750, Easing.OutQuint); + } }); }, true); } @@ -180,6 +197,8 @@ public TimeTagPiece(TimeTag timeTag) throw new ArgumentOutOfRangeException(nameof(timeTag.Index.State)); } } + + public override bool RemoveCompletedTransforms => false; } public class TimeTagWithNoTimePiece : CompositeDrawable From 94460efefafea804d97d9266b568646f3cf19536 Mon Sep 17 00:00:00 2001 From: andy840119 Date: Sat, 19 Feb 2022 15:37:34 +0800 Subject: [PATCH 3/3] add tickle effect in the adjust time-tag mode. --- .../RecordingTimeTags/RecordingTimeTagPart.cs | 33 ++++++++++++++++--- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/osu.Game.Rulesets.Karaoke/Edit/Lyrics/Rows/Extends/RecordingTimeTags/RecordingTimeTagPart.cs b/osu.Game.Rulesets.Karaoke/Edit/Lyrics/Rows/Extends/RecordingTimeTags/RecordingTimeTagPart.cs index 33995109b..84daa2ac5 100644 --- a/osu.Game.Rulesets.Karaoke/Edit/Lyrics/Rows/Extends/RecordingTimeTags/RecordingTimeTagPart.cs +++ b/osu.Game.Rulesets.Karaoke/Edit/Lyrics/Rows/Extends/RecordingTimeTags/RecordingTimeTagPart.cs @@ -22,6 +22,7 @@ using osu.Game.Screens.Edit; using osu.Game.Screens.Edit.Components.Timelines.Summary.Parts; using osuTK; +using osuTK.Graphics; namespace osu.Game.Rulesets.Karaoke.Edit.Lyrics.Rows.Extends.RecordingTimeTags { @@ -122,7 +123,7 @@ private class RecordingTimeTagVisualization : CompositeDrawable, IHasCustomToolt private readonly Bindable bindableTime; - private readonly RightTriangle timeTagTriangle; + private readonly TimeTagPiece timeTagPiece; private readonly Lyric lyric; private readonly TimeTag timeTag; @@ -141,7 +142,7 @@ public RecordingTimeTagVisualization(Lyric lyric, TimeTag timeTag) bindableTime = timeTag.TimeBindable.GetBoundCopy(); InternalChildren = new Drawable[] { - timeTagTriangle = new RightTriangle + timeTagPiece = new TimeTagPiece { Name = "Time tag triangle", Anchor = Anchor.Centre, @@ -159,9 +160,10 @@ public RecordingTimeTagVisualization(Lyric lyric, TimeTag timeTag) } [BackgroundDependencyLoader] - private void load(OsuColour colours, RecordingTimeTagEditor timeline) + private void load(EditorClock clock, OsuColour colours, RecordingTimeTagEditor timeline) { - timeTagTriangle.Colour = colours.GetTimeTagColour(timeTag); + timeTagPiece.Clock = clock; + timeTagPiece.Colour = colours.GetTimeTagColour(timeTag); bindableTime.BindValueChanged(e => { @@ -171,7 +173,23 @@ private void load(OsuColour colours, RecordingTimeTagEditor timeline) if (!hasValue) return; - X = (float)timeline.GetPreviewTime(timeTag); + // should wait until all time-tag time has been modified. + Schedule(() => + { + double previewTime = timeline.GetPreviewTime(timeTag); + + // adjust position. + X = (float)previewTime; + + // make tickle effect. + timeTagPiece.ClearTransforms(); + + using (timeTagPiece.BeginAbsoluteSequence(previewTime)) + { + timeTagPiece.Colour = colours.GetTimeTagColour(timeTag); + timeTagPiece.FlashColour(colours.RedDark, 750, Easing.OutQuint); + } + }); }, true); } @@ -200,5 +218,10 @@ protected override bool OnClick(ClickEvent e) }) }; } + + private class TimeTagPiece : RightTriangle + { + public override bool RemoveCompletedTransforms => false; + } } }