diff --git a/osu.Game.Rulesets.Karaoke/Integration/Formats/LrcParserUtils.cs b/osu.Game.Rulesets.Karaoke/Integration/Formats/LrcParserUtils.cs index 704e8fd4f..bc514b1d8 100644 --- a/osu.Game.Rulesets.Karaoke/Integration/Formats/LrcParserUtils.cs +++ b/osu.Game.Rulesets.Karaoke/Integration/Formats/LrcParserUtils.cs @@ -102,7 +102,7 @@ static TimeTag convertTimeTag(KeyValuePair time static TextIndex convertTextIndex(LrcParser.Model.TextIndex textIndex) { int index = textIndex.Index; - var state = textIndex.State == IndexState.Start ? Framework.Graphics.Sprites.TextIndex.IndexState.Start : Framework.Graphics.Sprites.TextIndex.IndexState.End; + var state = textIndex.State == IndexState.Start ? TextIndex.IndexState.Start : TextIndex.IndexState.End; return new TextIndex(index, state); } diff --git a/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Lyrics/Content/Compose/EditLyricDetailRow.cs b/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Lyrics/Content/Compose/EditLyricDetailRow.cs index fde045263..30bf28674 100644 --- a/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Lyrics/Content/Compose/EditLyricDetailRow.cs +++ b/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Lyrics/Content/Compose/EditLyricDetailRow.cs @@ -42,7 +42,7 @@ protected override Drawable CreateContent(Lyric lyric) new LyricLayer(lyric), new InteractLyricLayer(lyric), new TimeTagLayer(lyric), - } + }, }; } } diff --git a/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Lyrics/Content/Compose/LyricComposer.cs b/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Lyrics/Content/Compose/LyricComposer.cs index f019ac584..098e2618d 100644 --- a/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Lyrics/Content/Compose/LyricComposer.cs +++ b/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Lyrics/Content/Compose/LyricComposer.cs @@ -146,7 +146,7 @@ public LyricComposer() closeOtherPanelsInTheSameDirection(type); } - togglePanel(type, show); + panelInstance[type].State.Value = show ? Visibility.Visible : Visibility.Hidden; }, true); } } @@ -191,13 +191,6 @@ static Panel getInstance(PanelType panelType) => }; } - private void togglePanel(PanelType panel, bool show) - { - panelInstance[panel].State.Value = show ? Visibility.Visible : Visibility.Hidden; - - calculateLyricEditorSize(); - } - private void calculatePanelPosition() { float radio = DrawWidth / DrawHeight; @@ -234,7 +227,6 @@ private void assignPanelPosition(PanelLayout panelLayout) } closeOtherPanelsInTheSameDirection(PanelType.Property); - calculateLyricEditorSize(); } private void closeOtherPanelsInTheSameDirection(PanelType exceptPanel) @@ -248,36 +240,6 @@ private void closeOtherPanelsInTheSameDirection(PanelType exceptPanel) } } - private void calculateLyricEditorSize() - { - var padding = new MarginPadding(); - - foreach (var (position, panelTypes) in panelDirections) - { - var instances = panelTypes.Select(panelType => panelInstance[panelType]).ToArray(); - float maxWidth = instances.Any() ? instances.Max(getWidth) : 0; - - switch (position) - { - case PanelDirection.Left: - padding.Left = maxWidth; - break; - - case PanelDirection.Right: - padding.Right = maxWidth; - break; - - default: - throw new ArgumentOutOfRangeException(nameof(position), position, null); - } - } - - mainEditorArea.Padding = padding; - - static float getWidth(Panel panel) - => panel.State.Value == Visibility.Visible ? panel.Width : 0; - } - #endregion #region Bottom editor diff --git a/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Lyrics/Content/Compose/LyricEditor.cs b/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Lyrics/Content/Compose/LyricEditor.cs index f32df6bf3..bbaa6fd6b 100644 --- a/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Lyrics/Content/Compose/LyricEditor.cs +++ b/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Lyrics/Content/Compose/LyricEditor.cs @@ -28,7 +28,11 @@ public LyricEditor() InternalChild = skinProvidingContainer = new SkinProvidingContainer(skin = new LyricEditorSkin(null)) { - Margin = new MarginPadding { Left = 30 }, + Padding = new MarginPadding + { + Vertical = 64, + Horizontal = 120, + }, RelativeSizeAxes = Axes.Both, }; diff --git a/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Lyrics/Content/Compose/Panel.cs b/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Lyrics/Content/Compose/Panel.cs index 399767b7a..79a197281 100644 --- a/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Lyrics/Content/Compose/Panel.cs +++ b/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Lyrics/Content/Compose/Panel.cs @@ -26,30 +26,38 @@ public abstract partial class Panel : FocusedOverlayContainer protected virtual string PopOutSampleName => "UI/overlay-pop-out"; private readonly IBindable bindableMode = new Bindable(); - private readonly Box background; private readonly FillFlowContainer fillFlowContainer; + protected override bool BlockPositionalInput => false; + protected Panel() { - RelativeSizeAxes = Axes.Y; + Padding = new MarginPadding(10); - InternalChildren = new Drawable[] + InternalChild = new Container { - background = new Box - { - Name = "Background", - RelativeSizeAxes = Axes.Both, - }, - new OsuScrollContainer + Masking = true, + CornerRadius = 10, + RelativeSizeAxes = Axes.Both, + Children = new Drawable[] { - RelativeSizeAxes = Axes.Both, - Child = fillFlowContainer = new FillFlowContainer + background = new Box + { + Name = "Background", + RelativeSizeAxes = Axes.Both, + Alpha = 0.6f, + }, + new OsuScrollContainer { - RelativeSizeAxes = Axes.X, - AutoSizeAxes = Axes.Y, - Direction = FillDirection.Vertical, - Spacing = new Vector2(10), + RelativeSizeAxes = Axes.Both, + Child = fillFlowContainer = new FillFlowContainer + { + RelativeSizeAxes = Axes.X, + AutoSizeAxes = Axes.Y, + Direction = FillDirection.Vertical, + Spacing = new Vector2(10), + }, }, }, }; @@ -85,23 +93,18 @@ public PanelDirection Direction switch (direction) { case PanelDirection.Left: - Anchor = Anchor.CentreLeft; - Origin = Anchor.CentreLeft; + Anchor = Anchor.TopLeft; + Origin = Anchor.TopLeft; break; case PanelDirection.Right: - Anchor = Anchor.CentreRight; - Origin = Anchor.CentreRight; + Anchor = Anchor.TopRight; + Origin = Anchor.TopRight; break; default: throw new ArgumentOutOfRangeException(nameof(direction)); } - - if (State.Value == Visibility.Hidden) - { - X = getHideXPosition(); - } } } @@ -109,8 +112,6 @@ protected override void PopIn() { samplePopIn?.Play(); - // todo: adjust the effect. - this.MoveToX(0, transition_length, Easing.OutQuint); this.FadeTo(1, transition_length, Easing.OutQuint); // should load the content after opened. @@ -121,20 +122,10 @@ protected override void PopOut() { samplePopOut?.Play(); - float width = getHideXPosition(); - this.MoveToX(width, transition_length, Easing.OutQuint); this.FadeTo(0, transition_length, Easing.OutQuint).OnComplete(_ => { // should clear the content if close. fillFlowContainer.Clear(); }); } - - private float getHideXPosition() => - direction switch - { - PanelDirection.Left => -DrawWidth, - PanelDirection.Right => DrawWidth, - _ => throw new ArgumentOutOfRangeException(), - }; } diff --git a/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Lyrics/Content/Compose/Panels/InvalidPanel.cs b/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Lyrics/Content/Compose/Panels/InvalidPanel.cs index 3a1ef5a34..4553c1c25 100644 --- a/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Lyrics/Content/Compose/Panels/InvalidPanel.cs +++ b/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Lyrics/Content/Compose/Panels/InvalidPanel.cs @@ -11,6 +11,7 @@ public partial class InvalidPanel : Panel public InvalidPanel() { Width = 200; + Height = 300; } protected override IReadOnlyList CreateSections() => diff --git a/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Lyrics/Content/Compose/Panels/PropertyPanel.cs b/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Lyrics/Content/Compose/Panels/PropertyPanel.cs index 319472126..c86af9733 100644 --- a/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Lyrics/Content/Compose/Panels/PropertyPanel.cs +++ b/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Lyrics/Content/Compose/Panels/PropertyPanel.cs @@ -12,6 +12,7 @@ public partial class PropertyPanel : Panel public PropertyPanel() { Width = 200; + RelativeSizeAxes = Axes.Y; } protected override IReadOnlyList CreateSections() diff --git a/osu.Game.Rulesets.Karaoke/Screens/Edit/EditorTable.cs b/osu.Game.Rulesets.Karaoke/Screens/Edit/EditorTable.cs index 28643e787..ca797cdca 100644 --- a/osu.Game.Rulesets.Karaoke/Screens/Edit/EditorTable.cs +++ b/osu.Game.Rulesets.Karaoke/Screens/Edit/EditorTable.cs @@ -47,7 +47,7 @@ protected EditorTable() RelativeSizeAxes = Axes.Both, Depth = 1f, Padding = new MarginPadding { Horizontal = -horizontal_inset }, - Margin = new MarginPadding { Top = ROW_HEIGHT } + Margin = new MarginPadding { Top = ROW_HEIGHT }, }); }