From 8586506fbf58ac5e1517b616f976d012cb66d201 Mon Sep 17 00:00:00 2001 From: andy840119 Date: Fri, 13 Sep 2024 22:57:34 +0800 Subject: [PATCH 1/2] Change the button naming. --- ...eateNewLanguageButton.cs => CreateNewTranslationButton.cs} | 4 ++-- .../{RemoveLanguageButton.cs => RemoveTranslationButton.cs} | 4 ++-- .../Edit/Beatmaps/Translations/TranslationEditSection.cs | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) rename osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Translations/Components/{CreateNewLanguageButton.cs => CreateNewTranslationButton.cs} (93%) rename osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Translations/Components/{RemoveLanguageButton.cs => RemoveTranslationButton.cs} (93%) diff --git a/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Translations/Components/CreateNewLanguageButton.cs b/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Translations/Components/CreateNewTranslationButton.cs similarity index 93% rename from osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Translations/Components/CreateNewLanguageButton.cs rename to osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Translations/Components/CreateNewTranslationButton.cs index c9042342e..204217967 100644 --- a/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Translations/Components/CreateNewLanguageButton.cs +++ b/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Translations/Components/CreateNewTranslationButton.cs @@ -15,14 +15,14 @@ namespace osu.Game.Rulesets.Karaoke.Screens.Edit.Beatmaps.Translations.Components; -public partial class CreateNewLanguageButton : IconButton, IHasPopover +public partial class CreateNewTranslationButton : IconButton, IHasPopover { [Resolved] private IBeatmapLanguagesChangeHandler beatmapLanguagesChangeHandler { get; set; } = null!; private readonly Bindable currentLanguage = new(); - public CreateNewLanguageButton() + public CreateNewTranslationButton() { Icon = FontAwesome.Solid.Plus; Action = this.ShowPopover; diff --git a/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Translations/Components/RemoveLanguageButton.cs b/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Translations/Components/RemoveTranslationButton.cs similarity index 93% rename from osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Translations/Components/RemoveLanguageButton.cs rename to osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Translations/Components/RemoveTranslationButton.cs index 9efc98e0b..2cd1277e2 100644 --- a/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Translations/Components/RemoveLanguageButton.cs +++ b/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Translations/Components/RemoveTranslationButton.cs @@ -11,7 +11,7 @@ namespace osu.Game.Rulesets.Karaoke.Screens.Edit.Beatmaps.Translations.Components; -public partial class RemoveLanguageButton : IconButton +public partial class RemoveTranslationButton : IconButton { [Resolved] private IBeatmapLanguagesChangeHandler beatmapLanguagesChangeHandler { get; set; } = null!; @@ -22,7 +22,7 @@ public partial class RemoveLanguageButton : IconButton [Resolved] private IBindable currentLanguage { get; set; } = null!; - public RemoveLanguageButton() + public RemoveTranslationButton() { Icon = FontAwesome.Solid.Trash; Action = () => 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 2c25d126a..1990738a1 100644 --- a/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Translations/TranslationEditSection.cs +++ b/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Translations/TranslationEditSection.cs @@ -102,12 +102,12 @@ public TranslationEditSection() RelativeSizeAxes = Axes.X, }, Empty(), - new CreateNewLanguageButton + new CreateNewTranslationButton { Y = 5, }, Empty(), - new RemoveLanguageButton + new RemoveTranslationButton { Y = 5, }, From 7c94f245be5bb9beeb01f15dcc7432886dd7faab Mon Sep 17 00:00:00 2001 From: andy840119 Date: Fri, 13 Sep 2024 23:07:16 +0800 Subject: [PATCH 2/2] 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()); }