Skip to content

Commit

Permalink
Clean-up code.
Browse files Browse the repository at this point in the history
  • Loading branch information
andy840119 committed Dec 13, 2020
1 parent 806390d commit 5ecc442
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ public class DrawableLyricEditListItem : OsuRearrangeableListItem<Lyric>

private Box background;
private Box dragAlert;


public DrawableLyricEditListItem(Lyric item)
: base(item)
Expand Down
2 changes: 1 addition & 1 deletion osu.Game.Rulesets.Karaoke/Edit/Lyrics/Infos/InfoControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class InfoControl : Container
{
private const int max_height = 120;

private Box headerBackground;
private readonly Box headerBackground;

public Lyric Lyric { get; }

Expand Down
1 change: 1 addition & 0 deletions osu.Game.Rulesets.Karaoke/Edit/Lyrics/LyricEditorScreen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ public class LyricEditorScreen : EditorScreenWithTimeline, ICanAcceptFiles

[Cached]
protected readonly TimeTagManager TranslateManager;

[Cached]
protected readonly LyricManager LyricManager;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ public int GetHoverIndex(float position)
if (GetPercentageWidth(i, i + 1, 0.5f) > position)
return i;
}

return text.Length;
}
}
Expand Down
23 changes: 12 additions & 11 deletions osu.Game.Rulesets.Karaoke/Edit/Lyrics/Lyrics/LyricControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ private void load(IFrameBasedClock framedClock, TimeTagManager timeTagManager)
drawableLyric.Clock = framedClock;
timeTagManager?.BindableCursorPosition.BindValueChanged(e =>
{
UpdateTimeTagCursoe(e.NewValue);
UpdateTimeTagCursor(e.NewValue);
}, true);
lyricManager?.BindableSplitLyric.BindValueChanged(e =>
{
Expand All @@ -118,19 +118,20 @@ private void load(IFrameBasedClock framedClock, TimeTagManager timeTagManager)
});
}

protected void UpdateTimeTagCursoe(TimeTag cursor)
protected void UpdateTimeTagCursor(TimeTag cursor)
{
timeTagCursorContainer.Clear();
if (drawableLyric.TimeTagsBindable.Value.Contains(cursor))

if (!drawableLyric.TimeTagsBindable.Value.Contains(cursor))
return;

var spacing = timeTagIndexPosition(cursor.Index) + extraSpacing(cursor);
timeTagCursorContainer.Add(new DrawableTimeTagCursor(cursor)
{
var spacing = timeTagIndexPosition(cursor.Index) + extraSpacing(cursor);
timeTagCursorContainer.Add(new DrawableTimeTagCursor(cursor)
{
Anchor = Anchor.BottomLeft,
Origin = Anchor.BottomLeft,
X = spacing
});
}
Anchor = Anchor.BottomLeft,
Origin = Anchor.BottomLeft,
X = spacing
});
}

protected void UpdateTimeTags()
Expand Down

0 comments on commit 5ecc442

Please sign in to comment.