From a1eda54feebd59c864400a9bffab226e3af472ff Mon Sep 17 00:00:00 2001 From: andy840119 Date: Thu, 15 Aug 2024 23:33:27 +0800 Subject: [PATCH 1/5] Add missing comma. --- .../Edit/Beatmaps/Lyrics/Content/Compose/EditLyricDetailRow.cs | 2 +- osu.Game.Rulesets.Karaoke/Screens/Edit/EditorTable.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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/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 }, }); } From 423d486a41b013735e3796f36467aa9f1a81b7a9 Mon Sep 17 00:00:00 2001 From: andy840119 Date: Thu, 15 Aug 2024 23:33:37 +0800 Subject: [PATCH 2/5] Remove unused using. --- osu.Game.Rulesets.Karaoke/Integration/Formats/LrcParserUtils.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); } From 4872f11da9d8207401f3a86a74cd1356bc2c41f8 Mon Sep 17 00:00:00 2001 From: andy840119 Date: Thu, 15 Aug 2024 23:46:50 +0800 Subject: [PATCH 3/5] Adjust the panel: 1. poanel should not block the editor. 2. adjust the panel style. --- .../Beatmaps/Lyrics/Content/Compose/Panel.cs | 63 ++++++++----------- .../Content/Compose/Panels/InvalidPanel.cs | 1 + .../Content/Compose/Panels/PropertyPanel.cs | 1 + 3 files changed, 29 insertions(+), 36 deletions(-) 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() From 45931338c625ea182993e23012e8a92f17c03677 Mon Sep 17 00:00:00 2001 From: andy840119 Date: Thu, 15 Aug 2024 23:35:02 +0800 Subject: [PATCH 4/5] There's no need to change the editor size after open the panels. --- .../Lyrics/Content/Compose/LyricComposer.cs | 40 +------------------ 1 file changed, 1 insertion(+), 39 deletions(-) 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 From 194486e77e11474bfaabc07b7fec0447bdff531d Mon Sep 17 00:00:00 2001 From: andy840119 Date: Thu, 15 Aug 2024 23:55:19 +0800 Subject: [PATCH 5/5] Adjust the padding size. --- .../Edit/Beatmaps/Lyrics/Content/Compose/LyricEditor.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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, };