diff --git a/osu.Game.Rulesets.Karaoke/Edit/Lyrics/Extends/Reference/ReferenceExtend.cs b/osu.Game.Rulesets.Karaoke/Edit/Lyrics/Extends/Reference/ReferenceExtend.cs new file mode 100644 index 000000000..a1419ae48 --- /dev/null +++ b/osu.Game.Rulesets.Karaoke/Edit/Lyrics/Extends/Reference/ReferenceExtend.cs @@ -0,0 +1,20 @@ +// Copyright (c) andy840119 . Licensed under the GPL Licence. +// See the LICENCE file in the repository root for full licence text. + +namespace osu.Game.Rulesets.Karaoke.Edit.Lyrics.Extends.Reference +{ + public class ReferenceExtend : EditExtend + { + public override ExtendDirection Direction => ExtendDirection.Right; + + public override float ExtendWidth => 300; + + public ReferenceExtend() + { + Children = new[] + { + new ReferenceLyricAutoGenerateSection(), + }; + } + } +} diff --git a/osu.Game.Rulesets.Karaoke/Edit/Lyrics/Extends/Reference/ReferenceLyricAutoGenerateSection.cs b/osu.Game.Rulesets.Karaoke/Edit/Lyrics/Extends/Reference/ReferenceLyricAutoGenerateSection.cs new file mode 100644 index 000000000..2044095c5 --- /dev/null +++ b/osu.Game.Rulesets.Karaoke/Edit/Lyrics/Extends/Reference/ReferenceLyricAutoGenerateSection.cs @@ -0,0 +1,55 @@ +// Copyright (c) andy840119 . Licensed under the GPL Licence. +// See the LICENCE file in the repository root for full licence text. + +using osu.Framework.Graphics.UserInterface; +using osu.Framework.Localisation; +using osu.Game.Rulesets.Karaoke.Edit.Components.Containers; +using osu.Game.Rulesets.Karaoke.Edit.Configs.Generator.ReferenceLyric; +using osu.Game.Rulesets.Karaoke.Edit.Lyrics.Extends.Components; + +namespace osu.Game.Rulesets.Karaoke.Edit.Lyrics.Extends.Reference +{ + public class ReferenceLyricAutoGenerateSection : Section + { + protected override LocalisableString Title => "Auto generate"; + + public ReferenceLyricAutoGenerateSection() + { + Children = new[] + { + new ReferenceLyricAutoGenerateSubsection() + }; + } + + private class ReferenceLyricAutoGenerateSubsection : AutoGenerateSubsection + { + public ReferenceLyricAutoGenerateSubsection() + : base(LyricAutoGenerateProperty.DetectReferenceLyric) + { + } + + protected override InvalidLyricAlertTextContainer CreateInvalidLyricAlertTextContainer() + => new InvalidLyricLanguageAlertTextContainer(); + + protected override ConfigButton CreateConfigButton() + => new ReferenceLyricAutoGenerateConfigButton(); + + protected class InvalidLyricLanguageAlertTextContainer : InvalidLyricAlertTextContainer + { + private const string language_mode = "LANGUAGE_MODE"; + + public InvalidLyricLanguageAlertTextContainer() + { + SwitchToEditorMode(language_mode, "edit language mode", LyricEditorMode.Language); + Text = $"Seems some lyric missing language, go to [{language_mode}] to fill the language."; + } + } + + protected class ReferenceLyricAutoGenerateConfigButton : ConfigButton + { + public override Popover GetPopover() + => new ReferenceLyricDetectorConfigPopover(); + } + } + } +} diff --git a/osu.Game.Rulesets.Karaoke/Edit/Lyrics/LyricEditor.cs b/osu.Game.Rulesets.Karaoke/Edit/Lyrics/LyricEditor.cs index 38012409b..4a0dd0b0c 100644 --- a/osu.Game.Rulesets.Karaoke/Edit/Lyrics/LyricEditor.cs +++ b/osu.Game.Rulesets.Karaoke/Edit/Lyrics/LyricEditor.cs @@ -18,6 +18,7 @@ using osu.Game.Rulesets.Karaoke.Edit.Lyrics.Extends; using osu.Game.Rulesets.Karaoke.Edit.Lyrics.Extends.Languages; using osu.Game.Rulesets.Karaoke.Edit.Lyrics.Extends.Notes; +using osu.Game.Rulesets.Karaoke.Edit.Lyrics.Extends.Reference; using osu.Game.Rulesets.Karaoke.Edit.Lyrics.Extends.RubyRomaji; using osu.Game.Rulesets.Karaoke.Edit.Lyrics.Extends.Singers; using osu.Game.Rulesets.Karaoke.Edit.Lyrics.Extends.Texting; @@ -230,6 +231,7 @@ EditExtend getExtendArea() => Mode switch { LyricEditorMode.Texting => new TextingExtend(), + LyricEditorMode.Reference => new ReferenceExtend(), LyricEditorMode.Language => new LanguageExtend(), LyricEditorMode.EditRuby => new RubyTagExtend(), LyricEditorMode.EditRomaji => new RomajiTagExtend(),