diff --git a/osu.Game.Rulesets.Karaoke/Edit/ImportLyric/AssignLanguage/AssignLanguageSubScreen.cs b/osu.Game.Rulesets.Karaoke/Edit/ImportLyric/AssignLanguage/AssignLanguageSubScreen.cs index 8b5ce3522..7197d355b 100644 --- a/osu.Game.Rulesets.Karaoke/Edit/ImportLyric/AssignLanguage/AssignLanguageSubScreen.cs +++ b/osu.Game.Rulesets.Karaoke/Edit/ImportLyric/AssignLanguage/AssignLanguageSubScreen.cs @@ -44,7 +44,7 @@ protected override Drawable CreateContent() => new LyricEditor { RelativeSizeAxes = Axes.Both, - Mode = Mode.EditMode, + Mode = Mode.ViewMode, LyricFastEditMode = LyricFastEditMode.Language, }; diff --git a/osu.Game.Rulesets.Karaoke/Edit/ImportLyric/DragFile/DragFileSubScreen.cs b/osu.Game.Rulesets.Karaoke/Edit/ImportLyric/DragFile/DragFileSubScreen.cs index 9fd56cbb6..f6d620bd7 100644 --- a/osu.Game.Rulesets.Karaoke/Edit/ImportLyric/DragFile/DragFileSubScreen.cs +++ b/osu.Game.Rulesets.Karaoke/Edit/ImportLyric/DragFile/DragFileSubScreen.cs @@ -103,7 +103,7 @@ public void ImportLyricFile(FileInfo fileInfo) public override void Complete() { - ScreenStack.Push(ImportLyricStep.AssignLanguage); + ScreenStack.Push(ImportLyricStep.EditLyric); } private PopupDialog createFileNotFoundDialog() diff --git a/osu.Game.Rulesets.Karaoke/Edit/ImportLyric/EditLyric/EditLyricSubScreen.cs b/osu.Game.Rulesets.Karaoke/Edit/ImportLyric/EditLyric/EditLyricSubScreen.cs new file mode 100644 index 000000000..bdcab00ea --- /dev/null +++ b/osu.Game.Rulesets.Karaoke/Edit/ImportLyric/EditLyric/EditLyricSubScreen.cs @@ -0,0 +1,91 @@ +// Copyright (c) andy840119 . Licensed under the GPL Licence. +// See the LICENCE file in the repository root for full licence text. + +using osu.Framework.Allocation; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Sprites; +using osu.Framework.Timing; +using osu.Game.Rulesets.Karaoke.Edit.Lyrics; + +namespace osu.Game.Rulesets.Karaoke.Edit.ImportLyric.EditLyric +{ + public class EditLyricSubScreen : ImportLyricSubScreenWithTopNavigation + { + public override string Title => "Edit lyric"; + + public override string ShortTitle => "Edit"; + + public override ImportLyricStep Step => ImportLyricStep.EditLyric; + + public override IconUsage Icon => FontAwesome.Solid.Globe; + + [Cached] + protected readonly LyricManager LyricManager; + + public EditLyricSubScreen() + { + AddInternal(LyricManager = new LyricManager()); + } + + protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnlyDependencyContainer parent) + { + var dependencies = new DependencyContainer(base.CreateChildDependencies(parent)); + var clock = new DecoupleableInterpolatingFramedClock { IsCoupled = false }; + dependencies.CacheAs(clock); + dependencies.CacheAs(clock); + + return dependencies; + } + + protected override TopNavigation CreateNavigation() + => new EditLyricNavigation(this); + + protected override Drawable CreateContent() + => new LyricEditor + { + RelativeSizeAxes = Axes.Both, + Mode = Mode.EditMode, + LyricFastEditMode = LyricFastEditMode.None, + }; + + protected override void LoadComplete() + { + base.LoadComplete(); + Navigation.State = NavigationState.Initial; + } + + public override void Complete() + { + ScreenStack.Push(ImportLyricStep.AssignLanguage); + } + + public class EditLyricNavigation : TopNavigation + { + public EditLyricNavigation(EditLyricSubScreen screen) + : base(screen) + { + } + + protected override void UpdateState(NavigationState value) + { + base.UpdateState(value); + + switch (value) + { + case NavigationState.Initial: + NavigationText = "Check and edit lyric if needed."; + break; + + case NavigationState.Working: + case NavigationState.Done: + NavigationText = "Cool!"; + break; + + case NavigationState.Error: + NavigationText = "Oops, seems cause some error in here."; + break; + } + } + } + } +} diff --git a/osu.Game.Rulesets.Karaoke/Edit/ImportLyric/ImportLyricStep.cs b/osu.Game.Rulesets.Karaoke/Edit/ImportLyric/ImportLyricStep.cs index 5b65c8309..14c2da9f7 100644 --- a/osu.Game.Rulesets.Karaoke/Edit/ImportLyric/ImportLyricStep.cs +++ b/osu.Game.Rulesets.Karaoke/Edit/ImportLyric/ImportLyricStep.cs @@ -7,6 +7,8 @@ public enum ImportLyricStep { ImportLyric, + EditLyric, + AssignLanguage, GenerateRuby, diff --git a/osu.Game.Rulesets.Karaoke/Edit/ImportLyric/ImportLyricSubScreenStack.cs b/osu.Game.Rulesets.Karaoke/Edit/ImportLyric/ImportLyricSubScreenStack.cs index 6046ef79f..e4deeecbf 100644 --- a/osu.Game.Rulesets.Karaoke/Edit/ImportLyric/ImportLyricSubScreenStack.cs +++ b/osu.Game.Rulesets.Karaoke/Edit/ImportLyric/ImportLyricSubScreenStack.cs @@ -3,6 +3,7 @@ using osu.Game.Rulesets.Karaoke.Edit.ImportLyric.AssignLanguage; using osu.Game.Rulesets.Karaoke.Edit.ImportLyric.DragFile; +using osu.Game.Rulesets.Karaoke.Edit.ImportLyric.EditLyric; using osu.Game.Rulesets.Karaoke.Edit.ImportLyric.GenerateRuby; using osu.Game.Rulesets.Karaoke.Edit.ImportLyric.GenerateTimeTag; using osu.Game.Rulesets.Karaoke.Edit.ImportLyric.Success; @@ -32,6 +33,10 @@ public void Push(ImportLyricStep step) Push(new DragFileSubScreen()); return; + case ImportLyricStep.EditLyric: + Push(new EditLyricSubScreen()); + return; + case ImportLyricStep.AssignLanguage: Push(new AssignLanguageSubScreen()); return;