From 7c94f245be5bb9beeb01f15dcc7432886dd7faab Mon Sep 17 00:00:00 2001 From: andy840119 Date: Fri, 13 Sep 2024 23:07:16 +0800 Subject: [PATCH] Rename the change handler. --- ...lerTest.cs => BeatmapTranslationsChangeHandlerTest.cs} | 2 +- ...angeHandler.cs => BeatmapTranslationsChangeHandler.cs} | 2 +- ...ngeHandler.cs => IBeatmapTranslationsChangeHandler.cs} | 2 +- .../Translations/Components/CreateNewTranslationButton.cs | 6 +++--- .../Translations/Components/RemoveTranslationButton.cs | 8 ++++---- .../Edit/Beatmaps/Translations/TranslationEditSection.cs | 4 ++-- .../Edit/Beatmaps/Translations/TranslationScreen.cs | 6 +++--- 7 files changed, 15 insertions(+), 15 deletions(-) rename osu.Game.Rulesets.Karaoke.Tests/Editor/ChangeHandlers/Beatmaps/{BeatmapLanguagesChangeHandlerTest.cs => BeatmapTranslationsChangeHandlerTest.cs} (96%) rename osu.Game.Rulesets.Karaoke/Edit/ChangeHandlers/Beatmaps/{BeatmapLanguagesChangeHandler.cs => BeatmapTranslationsChangeHandler.cs} (88%) rename osu.Game.Rulesets.Karaoke/Edit/ChangeHandlers/Beatmaps/{IBeatmapLanguagesChangeHandler.cs => IBeatmapTranslationsChangeHandler.cs} (90%) diff --git a/osu.Game.Rulesets.Karaoke.Tests/Editor/ChangeHandlers/Beatmaps/BeatmapLanguagesChangeHandlerTest.cs b/osu.Game.Rulesets.Karaoke.Tests/Editor/ChangeHandlers/Beatmaps/BeatmapTranslationsChangeHandlerTest.cs similarity index 96% rename from osu.Game.Rulesets.Karaoke.Tests/Editor/ChangeHandlers/Beatmaps/BeatmapLanguagesChangeHandlerTest.cs rename to osu.Game.Rulesets.Karaoke.Tests/Editor/ChangeHandlers/Beatmaps/BeatmapTranslationsChangeHandlerTest.cs index e8f49d21e..c2a6f9a53 100644 --- a/osu.Game.Rulesets.Karaoke.Tests/Editor/ChangeHandlers/Beatmaps/BeatmapLanguagesChangeHandlerTest.cs +++ b/osu.Game.Rulesets.Karaoke.Tests/Editor/ChangeHandlers/Beatmaps/BeatmapTranslationsChangeHandlerTest.cs @@ -11,7 +11,7 @@ namespace osu.Game.Rulesets.Karaoke.Tests.Editor.ChangeHandlers.Beatmaps; -public partial class BeatmapLanguagesChangeHandlerTest : BaseChangeHandlerTest +public partial class BeatmapTranslationsChangeHandlerTest : BaseChangeHandlerTest { [Test] public void TestAdd() diff --git a/osu.Game.Rulesets.Karaoke/Edit/ChangeHandlers/Beatmaps/BeatmapLanguagesChangeHandler.cs b/osu.Game.Rulesets.Karaoke/Edit/ChangeHandlers/Beatmaps/BeatmapTranslationsChangeHandler.cs similarity index 88% rename from osu.Game.Rulesets.Karaoke/Edit/ChangeHandlers/Beatmaps/BeatmapLanguagesChangeHandler.cs rename to osu.Game.Rulesets.Karaoke/Edit/ChangeHandlers/Beatmaps/BeatmapTranslationsChangeHandler.cs index 692c7927a..ac547717b 100644 --- a/osu.Game.Rulesets.Karaoke/Edit/ChangeHandlers/Beatmaps/BeatmapLanguagesChangeHandler.cs +++ b/osu.Game.Rulesets.Karaoke/Edit/ChangeHandlers/Beatmaps/BeatmapTranslationsChangeHandler.cs @@ -9,7 +9,7 @@ namespace osu.Game.Rulesets.Karaoke.Edit.ChangeHandlers.Beatmaps; -public partial class BeatmapLanguagesChangeHandler : BeatmapListPropertyChangeHandler, IBeatmapLanguagesChangeHandler +public partial class BeatmapTranslationsChangeHandler : BeatmapListPropertyChangeHandler, IBeatmapTranslationsChangeHandler { public IBindableList Languages => Items; diff --git a/osu.Game.Rulesets.Karaoke/Edit/ChangeHandlers/Beatmaps/IBeatmapLanguagesChangeHandler.cs b/osu.Game.Rulesets.Karaoke/Edit/ChangeHandlers/Beatmaps/IBeatmapTranslationsChangeHandler.cs similarity index 90% rename from osu.Game.Rulesets.Karaoke/Edit/ChangeHandlers/Beatmaps/IBeatmapLanguagesChangeHandler.cs rename to osu.Game.Rulesets.Karaoke/Edit/ChangeHandlers/Beatmaps/IBeatmapTranslationsChangeHandler.cs index a20f47095..c9b68019f 100644 --- a/osu.Game.Rulesets.Karaoke/Edit/ChangeHandlers/Beatmaps/IBeatmapLanguagesChangeHandler.cs +++ b/osu.Game.Rulesets.Karaoke/Edit/ChangeHandlers/Beatmaps/IBeatmapTranslationsChangeHandler.cs @@ -6,7 +6,7 @@ namespace osu.Game.Rulesets.Karaoke.Edit.ChangeHandlers.Beatmaps; -public interface IBeatmapLanguagesChangeHandler +public interface IBeatmapTranslationsChangeHandler { IBindableList Languages { get; } diff --git a/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Translations/Components/CreateNewTranslationButton.cs b/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Translations/Components/CreateNewTranslationButton.cs index 204217967..fa66e57c9 100644 --- a/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Translations/Components/CreateNewTranslationButton.cs +++ b/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Translations/Components/CreateNewTranslationButton.cs @@ -18,7 +18,7 @@ namespace osu.Game.Rulesets.Karaoke.Screens.Edit.Beatmaps.Translations.Component public partial class CreateNewTranslationButton : IconButton, IHasPopover { [Resolved] - private IBeatmapLanguagesChangeHandler beatmapLanguagesChangeHandler { get; set; } = null!; + private IBeatmapTranslationsChangeHandler beatmapTranslationsChangeHandler { get; set; } = null!; private readonly Bindable currentLanguage = new(); @@ -33,9 +33,9 @@ public CreateNewTranslationButton() if (newLanguage == null) return; - if (!beatmapLanguagesChangeHandler.Languages.Contains(newLanguage)) + if (!beatmapTranslationsChangeHandler.Languages.Contains(newLanguage)) { - beatmapLanguagesChangeHandler.Add(newLanguage); + beatmapTranslationsChangeHandler.Add(newLanguage); } // after selected the language, should always hide the popover. diff --git a/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Translations/Components/RemoveTranslationButton.cs b/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Translations/Components/RemoveTranslationButton.cs index 2cd1277e2..97720d88a 100644 --- a/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Translations/Components/RemoveTranslationButton.cs +++ b/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Translations/Components/RemoveTranslationButton.cs @@ -14,7 +14,7 @@ namespace osu.Game.Rulesets.Karaoke.Screens.Edit.Beatmaps.Translations.Component public partial class RemoveTranslationButton : IconButton { [Resolved] - private IBeatmapLanguagesChangeHandler beatmapLanguagesChangeHandler { get; set; } = null!; + private IBeatmapTranslationsChangeHandler beatmapTranslationsChangeHandler { get; set; } = null!; [Resolved] private IDialogOverlay dialogOverlay { get; set; } = null!; @@ -27,17 +27,17 @@ public RemoveTranslationButton() Icon = FontAwesome.Solid.Trash; Action = () => { - if (beatmapLanguagesChangeHandler.IsLanguageContainsTranslation(currentLanguage.Value)) + if (beatmapTranslationsChangeHandler.IsLanguageContainsTranslation(currentLanguage.Value)) { dialogOverlay.Push(new DeleteLanguagePopupDialog(currentLanguage.Value, isOk => { if (isOk) - beatmapLanguagesChangeHandler.Remove(currentLanguage.Value); + beatmapTranslationsChangeHandler.Remove(currentLanguage.Value); })); } else { - beatmapLanguagesChangeHandler.Remove(currentLanguage.Value); + beatmapTranslationsChangeHandler.Remove(currentLanguage.Value); } }; } diff --git a/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Translations/TranslationEditSection.cs b/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Translations/TranslationEditSection.cs index 1990738a1..86ca23cf2 100644 --- a/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Translations/TranslationEditSection.cs +++ b/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Translations/TranslationEditSection.cs @@ -35,7 +35,7 @@ public partial class TranslationEditSection : Container, ITranslationInfoProvide private readonly Bindable currentLanguage = new(); [Resolved] - private IBeatmapLanguagesChangeHandler beatmapLanguagesChangeHandler { get; set; } = null!; + private IBeatmapTranslationsChangeHandler beatmapTranslationsChangeHandler { get; set; } = null!; private readonly IBindableList bindableLyrics = new BindableList(); @@ -190,7 +190,7 @@ public TranslationEditSection() [BackgroundDependencyLoader] private void load(ILyricsProvider lyricsProvider, OverlayColourProvider colourProvider) { - languageDropdown.ItemSource = beatmapLanguagesChangeHandler.Languages; + languageDropdown.ItemSource = beatmapTranslationsChangeHandler.Languages; bindableLyrics.BindTo(lyricsProvider.BindableLyrics); diff --git a/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Translations/TranslationScreen.cs b/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Translations/TranslationScreen.cs index ab6e2e2a9..b23a3b862 100644 --- a/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Translations/TranslationScreen.cs +++ b/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Translations/TranslationScreen.cs @@ -14,8 +14,8 @@ namespace osu.Game.Rulesets.Karaoke.Screens.Edit.Beatmaps.Translations; public partial class TranslationScreen : BeatmapEditorRoundedScreen { - [Cached(typeof(IBeatmapLanguagesChangeHandler))] - private readonly BeatmapLanguagesChangeHandler beatmapLanguagesChangeHandler; + [Cached(typeof(IBeatmapTranslationsChangeHandler))] + private readonly BeatmapTranslationsChangeHandler beatmapTranslationsChangeHandler; [Cached(typeof(ILyricTranslationChangeHandler))] private readonly LyricTranslationChangeHandler lyricTranslationChangeHandler; @@ -23,7 +23,7 @@ public partial class TranslationScreen : BeatmapEditorRoundedScreen public TranslationScreen() : base(KaraokeBeatmapEditorScreenMode.Translation) { - AddInternal(beatmapLanguagesChangeHandler = new BeatmapLanguagesChangeHandler()); + AddInternal(beatmapTranslationsChangeHandler = new BeatmapTranslationsChangeHandler()); AddInternal(lyricTranslationChangeHandler = new LyricTranslationChangeHandler()); }