From eba0a8395addb4fb3d6e4b9fe9c4a29bd47bb08b Mon Sep 17 00:00:00 2001 From: andy840119 Date: Sat, 19 Dec 2020 21:41:27 +0900 Subject: [PATCH] Post clean-up. --- .../AssignLanguage/AssignLanguageSubScreen.cs | 13 ++++++------- .../ImportLyric/EditLyric/EditLyricSubScreen.cs | 3 ++- .../GenerateRuby/GenerateRubySubScreen.cs | 12 ++++++------ .../GenerateTimeTag/GenerateTimeTagSubScreen.cs | 16 ++++++++-------- .../ImportLyricSubScreenWithTopNavigation.cs | 3 ++- .../Edit/Lyrics/Lyrics/LyricControl.cs | 1 - 6 files changed, 24 insertions(+), 24 deletions(-) diff --git a/osu.Game.Rulesets.Karaoke/Edit/ImportLyric/AssignLanguage/AssignLanguageSubScreen.cs b/osu.Game.Rulesets.Karaoke/Edit/ImportLyric/AssignLanguage/AssignLanguageSubScreen.cs index 0f52bd5a3..4560f172e 100644 --- a/osu.Game.Rulesets.Karaoke/Edit/ImportLyric/AssignLanguage/AssignLanguageSubScreen.cs +++ b/osu.Game.Rulesets.Karaoke/Edit/ImportLyric/AssignLanguage/AssignLanguageSubScreen.cs @@ -3,7 +3,6 @@ using osu.Framework.Allocation; using osu.Framework.Graphics; -using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Sprites; using osu.Game.Rulesets.Karaoke.Edit.Lyrics; @@ -53,11 +52,11 @@ internal void AskForAutoAssignLanguage() { DialogOverlay.Push(new UseLanguageDetectorPopupDialog(ok => { - if (ok) - { - LyricManager.AutoDetectLyricLanguage(); - Navigation.State = NavigationState.Done; - } + if (!ok) + return; + + LyricManager.AutoDetectLyricLanguage(); + Navigation.State = NavigationState.Done; })); } @@ -101,7 +100,7 @@ private class AssignLanguageTextFlowContainer : NavigationTextContainer { public AssignLanguageTextFlowContainer(AssignLanguageSubScreen screen) { - AddLinkFactory(auto_assign_language, "language detector", () => screen.AskForAutoAssignLanguage()); + AddLinkFactory(auto_assign_language, "language detector", screen.AskForAutoAssignLanguage); } } } diff --git a/osu.Game.Rulesets.Karaoke/Edit/ImportLyric/EditLyric/EditLyricSubScreen.cs b/osu.Game.Rulesets.Karaoke/Edit/ImportLyric/EditLyric/EditLyricSubScreen.cs index 6a2d0c964..d1bf34e53 100644 --- a/osu.Game.Rulesets.Karaoke/Edit/ImportLyric/EditLyric/EditLyricSubScreen.cs +++ b/osu.Game.Rulesets.Karaoke/Edit/ImportLyric/EditLyric/EditLyricSubScreen.cs @@ -3,7 +3,6 @@ using osu.Framework.Allocation; using osu.Framework.Graphics; -using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Sprites; using osu.Game.Rulesets.Karaoke.Edit.Lyrics; @@ -80,6 +79,7 @@ protected override void UpdateState(NavigationState value) case NavigationState.Working: case NavigationState.Done: var mode = Screen.LyricEditor.Mode; + switch (mode) { case Mode.EditMode: @@ -87,6 +87,7 @@ protected override void UpdateState(NavigationState value) break; // todo : edit mode. } + break; case NavigationState.Error: diff --git a/osu.Game.Rulesets.Karaoke/Edit/ImportLyric/GenerateRuby/GenerateRubySubScreen.cs b/osu.Game.Rulesets.Karaoke/Edit/ImportLyric/GenerateRuby/GenerateRubySubScreen.cs index cdc5ba76c..795ee5e3f 100644 --- a/osu.Game.Rulesets.Karaoke/Edit/ImportLyric/GenerateRuby/GenerateRubySubScreen.cs +++ b/osu.Game.Rulesets.Karaoke/Edit/ImportLyric/GenerateRuby/GenerateRubySubScreen.cs @@ -51,11 +51,11 @@ internal void AskForAutoGenerateRuby() { DialogOverlay.Push(new UseAutoGenerateRubyPopupDialog(ok => { - if (ok) - { - RubyRomajiManager.AutoGenerateRubyTags(); - Navigation.State = NavigationState.Done; - } + if (!ok) + return; + + RubyRomajiManager.AutoGenerateRubyTags(); + Navigation.State = NavigationState.Done; })); } @@ -99,7 +99,7 @@ private class GenerateRubyTextFlowContainer : NavigationTextContainer { public GenerateRubyTextFlowContainer(GenerateRubySubScreen screen) { - AddLinkFactory(auto_generate_ruby, "auto generate ruby", () => screen.AskForAutoGenerateRuby()); + AddLinkFactory(auto_generate_ruby, "auto generate ruby", screen.AskForAutoGenerateRuby); } } } diff --git a/osu.Game.Rulesets.Karaoke/Edit/ImportLyric/GenerateTimeTag/GenerateTimeTagSubScreen.cs b/osu.Game.Rulesets.Karaoke/Edit/ImportLyric/GenerateTimeTag/GenerateTimeTagSubScreen.cs index fe1ad7f7a..b201357f0 100644 --- a/osu.Game.Rulesets.Karaoke/Edit/ImportLyric/GenerateTimeTag/GenerateTimeTagSubScreen.cs +++ b/osu.Game.Rulesets.Karaoke/Edit/ImportLyric/GenerateTimeTag/GenerateTimeTagSubScreen.cs @@ -52,11 +52,11 @@ internal void AskForAutoGenerateTimeTag() { DialogOverlay.Push(new UseAutoGenerateTimeTagPopupDialog(ok => { - if (ok) - { - timeTagManager.AutoGenerateTimeTags(); - Navigation.State = NavigationState.Done; - } + if (!ok) + return; + + timeTagManager.AutoGenerateTimeTags(); + Navigation.State = NavigationState.Done; })); } @@ -79,12 +79,12 @@ protected override void UpdateState(NavigationState value) switch (value) { case NavigationState.Initial: - NavigationText = $"Press [{auto_generate_time_tag}] to autu-generate time tag. It's very easy."; + NavigationText = $"Press [{auto_generate_time_tag}] to auto-generate time tag. It's very easy."; break; case NavigationState.Working: case NavigationState.Done: - NavigationText = $"Cool, you can reset yout time-tag by pressing [{auto_generate_time_tag}]"; + NavigationText = $"Cool, you can reset your time-tag by pressing [{auto_generate_time_tag}]"; break; case NavigationState.Error: @@ -100,7 +100,7 @@ private class GenerateTimeTagTextFlowContainer : NavigationTextContainer { public GenerateTimeTagTextFlowContainer(GenerateTimeTagSubScreen screen) { - AddLinkFactory(auto_generate_time_tag, "auto generate time tag", () => screen.AskForAutoGenerateTimeTag()); + AddLinkFactory(auto_generate_time_tag, "auto generate time tag", screen.AskForAutoGenerateTimeTag); } } } diff --git a/osu.Game.Rulesets.Karaoke/Edit/ImportLyric/ImportLyricSubScreenWithTopNavigation.cs b/osu.Game.Rulesets.Karaoke/Edit/ImportLyric/ImportLyricSubScreenWithTopNavigation.cs index c56a83589..0cff5d753 100644 --- a/osu.Game.Rulesets.Karaoke/Edit/ImportLyric/ImportLyricSubScreenWithTopNavigation.cs +++ b/osu.Game.Rulesets.Karaoke/Edit/ImportLyric/ImportLyricSubScreenWithTopNavigation.cs @@ -81,7 +81,8 @@ protected TopNavigation(ImportLyricSubScreen screen) { RelativeSizeAxes = Axes.Both, }, - text = CreateTextContainer().With(t => { + text = CreateTextContainer().With(t => + { t.Anchor = Anchor.CentreLeft; t.Origin = Anchor.CentreLeft; t.RelativeSizeAxes = Axes.X; diff --git a/osu.Game.Rulesets.Karaoke/Edit/Lyrics/Lyrics/LyricControl.cs b/osu.Game.Rulesets.Karaoke/Edit/Lyrics/Lyrics/LyricControl.cs index bb9bdfa88..f00593272 100644 --- a/osu.Game.Rulesets.Karaoke/Edit/Lyrics/Lyrics/LyricControl.cs +++ b/osu.Game.Rulesets.Karaoke/Edit/Lyrics/Lyrics/LyricControl.cs @@ -12,7 +12,6 @@ using osu.Game.Rulesets.Karaoke.Edit.Lyrics.Lyrics.Components; using osu.Game.Rulesets.Karaoke.Objects; using osu.Game.Rulesets.Karaoke.Utils; -using osuTK.Input; namespace osu.Game.Rulesets.Karaoke.Edit.Lyrics.Lyrics {