diff --git a/osu.Game.Rulesets.Karaoke/Screens/Edit/AutoGenerateSubsection.cs b/osu.Game.Rulesets.Karaoke/Screens/Edit/AutoGenerateSubsection.cs index 89e2b77b2..db86bfe0b 100644 --- a/osu.Game.Rulesets.Karaoke/Screens/Edit/AutoGenerateSubsection.cs +++ b/osu.Game.Rulesets.Karaoke/Screens/Edit/AutoGenerateSubsection.cs @@ -70,17 +70,17 @@ private void load() x.RelativeSizeAxes = Axes.X; x.AutoSizeAxes = Axes.Y; x.Padding = new MarginPadding { Horizontal = horizontal_padding }; - x.Description = CreateInvalidLyricDescriptionFormat(); + x.Description = CreateInvalidDescriptionFormat(); }) }; }); } - protected abstract OsuButton CreateGenerateButton(); + protected abstract EditorSectionButton CreateGenerateButton(); protected virtual DescriptionTextFlowContainer CreateDescriptionTextFlowContainer() => new(); - protected abstract DescriptionFormat CreateInvalidLyricDescriptionFormat(); + protected abstract DescriptionFormat CreateInvalidDescriptionFormat(); protected abstract ConfigButton CreateConfigButton(); diff --git a/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Configs/Generator/Lyrics/ReferenceLyric/ReferenceLyricDetectorConfigDialog.cs b/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Configs/Generator/Lyrics/ReferenceLyric/ReferenceLyricDetectorConfigDialog.cs index e3f522479..dfa8cb80f 100644 --- a/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Configs/Generator/Lyrics/ReferenceLyric/ReferenceLyricDetectorConfigDialog.cs +++ b/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Configs/Generator/Lyrics/ReferenceLyric/ReferenceLyricDetectorConfigDialog.cs @@ -12,7 +12,7 @@ namespace osu.Game.Rulesets.Karaoke.Screens.Edit.Beatmaps.Configs.Generator.Lyri { public partial class ReferenceLyricGeneratorConfigDialog : GeneratorConfigDialog { - protected override KaraokeRulesetEditGeneratorSetting Config => KaraokeRulesetEditGeneratorSetting.NoteGeneratorConfig; + protected override KaraokeRulesetEditGeneratorSetting Config => KaraokeRulesetEditGeneratorSetting.ReferenceLyricDetectorConfig; protected override OverlayColourScheme OverlayColourScheme => OverlayColourScheme.Green; diff --git a/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Lyrics/Settings/Language/LanguageAutoGenerateSubsection.cs b/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Lyrics/Settings/Language/LanguageAutoGenerateSubsection.cs index 97b60308c..8439e931f 100644 --- a/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Lyrics/Settings/Language/LanguageAutoGenerateSubsection.cs +++ b/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Lyrics/Settings/Language/LanguageAutoGenerateSubsection.cs @@ -21,7 +21,7 @@ public LanguageAutoGenerateSubsection() { } - protected override DescriptionFormat CreateInvalidLyricDescriptionFormat() + protected override DescriptionFormat CreateInvalidDescriptionFormat() => new() { Text = $"Seems some lyric has no texts, go to [{DescriptionFormat.LINK_KEY_ACTION}]({typing_mode}) to fill the text.", diff --git a/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Lyrics/Settings/LyricEditorAutoGenerateSubsection.cs b/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Lyrics/Settings/LyricEditorAutoGenerateSubsection.cs index ff7f00944..e76dd1b2c 100644 --- a/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Lyrics/Settings/LyricEditorAutoGenerateSubsection.cs +++ b/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Lyrics/Settings/LyricEditorAutoGenerateSubsection.cs @@ -5,7 +5,6 @@ using System.Diagnostics.CodeAnalysis; using osu.Framework.Allocation; using osu.Framework.Localisation; -using osu.Game.Graphics.UserInterface; using osu.Game.Rulesets.Karaoke.Edit.ChangeHandlers.Lyrics; using osu.Game.Rulesets.Karaoke.Objects; using osu.Game.Rulesets.Karaoke.Screens.Edit.Beatmaps.Lyrics.Settings.Components.Markdown; @@ -22,7 +21,7 @@ protected LyricEditorAutoGenerateSubsection(LyricAutoGenerateProperty autoGenera this.autoGenerateProperty = autoGenerateProperty; } - protected override OsuButton CreateGenerateButton() + protected override EditorSectionButton CreateGenerateButton() => new AutoGenerateButton(autoGenerateProperty); protected sealed override DescriptionTextFlowContainer CreateDescriptionTextFlowContainer() diff --git a/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Lyrics/Settings/Notes/NoteAutoGenerateSubsection.cs b/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Lyrics/Settings/Notes/NoteAutoGenerateSubsection.cs index 3dfb606df..a6e8b5a60 100644 --- a/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Lyrics/Settings/Notes/NoteAutoGenerateSubsection.cs +++ b/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Lyrics/Settings/Notes/NoteAutoGenerateSubsection.cs @@ -29,7 +29,7 @@ public NoteAutoGenerateSubsection() { } - protected override DescriptionFormat CreateInvalidLyricDescriptionFormat() + protected override DescriptionFormat CreateInvalidDescriptionFormat() => new() { Text = $"Seems some lyric contains invalid time-tag, go to [{DescriptionFormat.LINK_KEY_ACTION}]({create_time_tag_mode}) to fix those issue.", diff --git a/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Lyrics/Settings/Reference/ReferenceLyricAutoGenerateSection.cs b/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Lyrics/Settings/Reference/ReferenceLyricAutoGenerateSection.cs index ba9cf567b..abb92f328 100644 --- a/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Lyrics/Settings/Reference/ReferenceLyricAutoGenerateSection.cs +++ b/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Lyrics/Settings/Reference/ReferenceLyricAutoGenerateSection.cs @@ -20,7 +20,7 @@ public ReferenceLyricAutoGenerateSubsection() { } - protected override DescriptionFormat CreateInvalidLyricDescriptionFormat() + protected override DescriptionFormat CreateInvalidDescriptionFormat() => new() { Text = "Seems every lyrics in the songs are unique. But don't worry, reference lyric can still link by hands." diff --git a/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Lyrics/Settings/RubyRomaji/Components/CreateNewTextTagButton.cs b/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Lyrics/Settings/RubyRomaji/Components/CreateNewTextTagButton.cs index 83a8ffdcd..cc94cb721 100644 --- a/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Lyrics/Settings/RubyRomaji/Components/CreateNewTextTagButton.cs +++ b/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Lyrics/Settings/RubyRomaji/Components/CreateNewTextTagButton.cs @@ -11,7 +11,6 @@ using osu.Framework.Graphics.Cursor; using osu.Framework.Graphics.UserInterface; using osu.Framework.Localisation; -using osu.Game.Graphics.UserInterface; using osu.Game.Graphics.UserInterfaceV2; using osu.Game.Rulesets.Karaoke.Objects; using osu.Game.Rulesets.Karaoke.Objects.Types; @@ -21,7 +20,7 @@ namespace osu.Game.Rulesets.Karaoke.Screens.Edit.Beatmaps.Lyrics.Settings.RubyRomaji.Components { - public partial class CreateNewTextTagButton : OsuButton, IHasPopover where TTextTag : class, ITextTag, new() + public partial class CreateNewTextTagButton : EditorSectionButton, IHasPopover where TTextTag : class, ITextTag, new() { public new Action Action; @@ -34,8 +33,6 @@ namespace osu.Game.Rulesets.Karaoke.Screens.Edit.Beatmaps.Lyrics.Settings.RubyRo public CreateNewTextTagButton() { - RelativeSizeAxes = Axes.X; - Content.CornerRadius = 15; base.Action = this.ShowPopover; } @@ -151,13 +148,8 @@ private void submit() }); } - private partial class AddButton : OsuButton + private partial class AddButton : EditorSectionButton { - public AddButton() - { - RelativeSizeAxes = Axes.X; - Content.CornerRadius = 15; - } } } } diff --git a/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Lyrics/Settings/RubyRomaji/TextTagAutoGenerateSection.cs b/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Lyrics/Settings/RubyRomaji/TextTagAutoGenerateSection.cs index c7c1ca8cf..d80164365 100644 --- a/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Lyrics/Settings/RubyRomaji/TextTagAutoGenerateSection.cs +++ b/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Lyrics/Settings/RubyRomaji/TextTagAutoGenerateSection.cs @@ -19,7 +19,7 @@ protected TextTagAutoGenerateSubsection(LyricAutoGenerateProperty autoGeneratePr { } - protected override DescriptionFormat CreateInvalidLyricDescriptionFormat() + protected override DescriptionFormat CreateInvalidDescriptionFormat() => new() { Text = $"Seems some lyric missing language, go to [{DescriptionFormat.LINK_KEY_ACTION}]({language_mode}) to fill the language.", diff --git a/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Lyrics/Settings/SelectLyricButton.cs b/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Lyrics/Settings/SelectLyricButton.cs index fdce1287d..b536ac582 100644 --- a/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Lyrics/Settings/SelectLyricButton.cs +++ b/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Lyrics/Settings/SelectLyricButton.cs @@ -7,16 +7,14 @@ using System.Collections.Generic; using osu.Framework.Allocation; using osu.Framework.Bindables; -using osu.Framework.Graphics; using osu.Framework.Localisation; using osu.Game.Graphics; -using osu.Game.Graphics.UserInterface; using osu.Game.Rulesets.Karaoke.Objects; using osu.Game.Rulesets.Karaoke.Screens.Edit.Beatmaps.Lyrics.States; namespace osu.Game.Rulesets.Karaoke.Screens.Edit.Beatmaps.Lyrics.Settings { - public abstract partial class SelectLyricButton : OsuButton + public abstract partial class SelectLyricButton : EditorSectionButton { private IBindable selecting; @@ -36,12 +34,6 @@ protected virtual void Cancel() { } [Resolved] private ILyricSelectionState lyricSelectionState { get; set; } - protected SelectLyricButton() - { - RelativeSizeAxes = Axes.X; - Content.CornerRadius = 15; - } - [BackgroundDependencyLoader] private void load(OsuColour colours) { diff --git a/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Lyrics/Settings/TimeTags/TimeTagAutoGenerateSection.cs b/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Lyrics/Settings/TimeTags/TimeTagAutoGenerateSection.cs index 64919e74c..6f8435d60 100644 --- a/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Lyrics/Settings/TimeTags/TimeTagAutoGenerateSection.cs +++ b/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Lyrics/Settings/TimeTags/TimeTagAutoGenerateSection.cs @@ -27,7 +27,7 @@ public TimeTageAutoGenerateSubsection() { } - protected override DescriptionFormat CreateInvalidLyricDescriptionFormat() + protected override DescriptionFormat CreateInvalidDescriptionFormat() => new() { Text = $"Seems some lyric missing language, go to [{DescriptionFormat.LINK_KEY_ACTION}]({language_mode}) to fill the language.", diff --git a/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Lyrics/Settings/TimeTags/TimeTagCreateConfigSubsection.cs b/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Lyrics/Settings/TimeTags/TimeTagCreateConfigSubsection.cs index f1eb98b22..8e012b25d 100644 --- a/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Lyrics/Settings/TimeTags/TimeTagCreateConfigSubsection.cs +++ b/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Lyrics/Settings/TimeTags/TimeTagCreateConfigSubsection.cs @@ -14,7 +14,6 @@ using osu.Framework.Graphics.UserInterface; using osu.Framework.Localisation; using osu.Game.Graphics; -using osu.Game.Graphics.UserInterface; using osu.Game.Rulesets.Karaoke.Screens.Edit.Beatmaps.Lyrics.Settings.Components.Markdown; using osu.Game.Rulesets.Karaoke.Screens.Edit.Beatmaps.Lyrics.States; using osu.Game.Rulesets.Karaoke.Screens.Edit.Components.Markdown; @@ -179,15 +178,13 @@ private DescriptionFormat getDescription(CreateTimeTagEditMode mode) => _ => throw new InvalidOperationException(nameof(mode)) }; - private partial class EditModeButton : OsuButton + private partial class EditModeButton : EditorSectionButton { public CreateTimeTagEditMode Mode { get; } public EditModeButton(CreateTimeTagEditMode mode) { Mode = mode; - RelativeSizeAxes = Axes.X; - Content.CornerRadius = 15; } } } diff --git a/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Pages/PageScreen.cs b/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Pages/PageScreen.cs index b21977365..d388f852f 100644 --- a/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Pages/PageScreen.cs +++ b/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Pages/PageScreen.cs @@ -12,6 +12,7 @@ using osu.Game.Rulesets.Karaoke.Beatmaps.Metadatas; using osu.Game.Rulesets.Karaoke.Edit.ChangeHandlers.Beatmaps; using osu.Game.Rulesets.Karaoke.Edit.Utils; +using osu.Game.Rulesets.Karaoke.Screens.Edit.Beatmaps.Pages.Settings; using osu.Game.Screens.Edit; namespace osu.Game.Rulesets.Karaoke.Screens.Edit.Beatmaps.Pages; diff --git a/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Pages/PageEditorEditModeSection.cs b/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Pages/Settings/PageEditorEditModeSection.cs similarity index 97% rename from osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Pages/PageEditorEditModeSection.cs rename to osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Pages/Settings/PageEditorEditModeSection.cs index d4c552ad6..72591228a 100644 --- a/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Pages/PageEditorEditModeSection.cs +++ b/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Pages/Settings/PageEditorEditModeSection.cs @@ -10,7 +10,7 @@ using osu.Game.Rulesets.Karaoke.Screens.Edit.Components.Markdown; using osuTK.Graphics; -namespace osu.Game.Rulesets.Karaoke.Screens.Edit.Beatmaps.Pages; +namespace osu.Game.Rulesets.Karaoke.Screens.Edit.Beatmaps.Pages.Settings; public partial class PageEditorEditModeSection : EditModeSection { diff --git a/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Pages/PageEditorIssueSection.cs b/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Pages/Settings/PageEditorIssueSection.cs similarity index 98% rename from osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Pages/PageEditorIssueSection.cs rename to osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Pages/Settings/PageEditorIssueSection.cs index 072d9a189..c04f8cd53 100644 --- a/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Pages/PageEditorIssueSection.cs +++ b/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Pages/Settings/PageEditorIssueSection.cs @@ -13,7 +13,7 @@ using osu.Game.Rulesets.Karaoke.Screens.Edit.Components.Issues; using osuTK; -namespace osu.Game.Rulesets.Karaoke.Screens.Edit.Beatmaps.Pages; +namespace osu.Game.Rulesets.Karaoke.Screens.Edit.Beatmaps.Pages.Settings; public partial class PageEditorIssueSection : IssueSection { diff --git a/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Pages/PageSettings.cs b/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Pages/Settings/PageSettings.cs similarity index 94% rename from osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Pages/PageSettings.cs rename to osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Pages/Settings/PageSettings.cs index deadd89ca..bbde5f742 100644 --- a/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Pages/PageSettings.cs +++ b/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Pages/Settings/PageSettings.cs @@ -8,7 +8,7 @@ using osu.Framework.Graphics; using osu.Game.Overlays; -namespace osu.Game.Rulesets.Karaoke.Screens.Edit.Beatmaps.Pages; +namespace osu.Game.Rulesets.Karaoke.Screens.Edit.Beatmaps.Pages.Settings; public partial class PageSettings : EditorSettings { diff --git a/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Pages/PagesSection.cs b/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Pages/Settings/PagesSection.cs similarity index 95% rename from osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Pages/PagesSection.cs rename to osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Pages/Settings/PagesSection.cs index bc6f889bb..9b9e738ab 100644 --- a/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Pages/PagesSection.cs +++ b/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Pages/Settings/PagesSection.cs @@ -14,14 +14,13 @@ using osu.Game.Extensions; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; -using osu.Game.Graphics.UserInterface; using osu.Game.Rulesets.Karaoke.Beatmaps.Metadatas; using osu.Game.Rulesets.Karaoke.Edit.ChangeHandlers.Beatmaps; using osu.Game.Rulesets.Karaoke.Screens.Edit.Beatmaps.Components.UserInterface; using osu.Game.Screens.Edit; using osuTK; -namespace osu.Game.Rulesets.Karaoke.Screens.Edit.Beatmaps.Pages; +namespace osu.Game.Rulesets.Karaoke.Screens.Edit.Beatmaps.Pages.Settings; public partial class PagesSection : EditorSection { @@ -158,7 +157,7 @@ private void load(OsuColour colour, IPageStateProvider pageStateProvider) } } - private partial class CreateNewPageButton : OsuButton + private partial class CreateNewPageButton : EditorSectionButton { [Resolved, AllowNull] private IBeatmapPagesChangeHandler beatmapPagesChangeHandler { get; set; } @@ -168,8 +167,6 @@ private partial class CreateNewPageButton : OsuButton public CreateNewPageButton() { - RelativeSizeAxes = Axes.X; - Content.CornerRadius = 15; Text = "Create new page"; Action = () => { diff --git a/osu.Game.Rulesets.Karaoke/Screens/Edit/EditModeSection.cs b/osu.Game.Rulesets.Karaoke/Screens/Edit/EditModeSection.cs index 1c01391b5..757e65a99 100644 --- a/osu.Game.Rulesets.Karaoke/Screens/Edit/EditModeSection.cs +++ b/osu.Game.Rulesets.Karaoke/Screens/Edit/EditModeSection.cs @@ -14,7 +14,6 @@ using osu.Framework.Localisation; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; -using osu.Game.Graphics.UserInterface; using osu.Game.Overlays; using osu.Game.Overlays.Toolbar; using osu.Game.Rulesets.Edit.Checks.Components; @@ -119,7 +118,7 @@ internal virtual void UpdateEditMode(TEditMode mode) protected abstract DescriptionFormat GetSelectionDescription(TEditMode mode); - protected partial class Selection : OsuButton + protected partial class Selection : EditorSectionButton { public new Action Action; @@ -127,9 +126,6 @@ protected partial class Selection : OsuButton public Selection() { - RelativeSizeAxes = Axes.X; - Content.CornerRadius = 15; - base.Action = () => Action?.Invoke(Mode); } } diff --git a/osu.Game.Rulesets.Karaoke/Screens/Edit/EditorSectionButton.cs b/osu.Game.Rulesets.Karaoke/Screens/Edit/EditorSectionButton.cs new file mode 100644 index 000000000..268298e38 --- /dev/null +++ b/osu.Game.Rulesets.Karaoke/Screens/Edit/EditorSectionButton.cs @@ -0,0 +1,16 @@ +// Copyright (c) andy840119 . Licensed under the GPL Licence. +// See the LICENCE file in the repository root for full licence text. + +using osu.Framework.Graphics; +using osu.Game.Graphics.UserInterface; + +namespace osu.Game.Rulesets.Karaoke.Screens.Edit; + +public abstract partial class EditorSectionButton : OsuButton +{ + protected EditorSectionButton() + { + RelativeSizeAxes = Axes.X; + Content.CornerRadius = 15; + } +}