From da5504557242c19b02535f5a145ec514bcfc2a45 Mon Sep 17 00:00:00 2001 From: andy840119 Date: Sun, 24 Mar 2024 22:09:38 +0800 Subject: [PATCH 1/4] Expose the property for able to change translation language. --- .../Objects/Drawables/DrawableLyric.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/osu.Game.Rulesets.Karaoke/Objects/Drawables/DrawableLyric.cs b/osu.Game.Rulesets.Karaoke/Objects/Drawables/DrawableLyric.cs index 0405e1837..12de1a820 100644 --- a/osu.Game.Rulesets.Karaoke/Objects/Drawables/DrawableLyric.cs +++ b/osu.Game.Rulesets.Karaoke/Objects/Drawables/DrawableLyric.cs @@ -117,6 +117,16 @@ public void ChangeDisplayProperty(LyricDisplayProperty lyricDisplayProperty) lyricPieces.ForEach(x => x.DisplayProperty = lyricDisplayProperty); } + public void ChangePreferTranslationLanguage(CultureInfo? language) + { + if (language != null && translateTextBindable.TryGetValue(language, out string? translate)) + translateText.Text = translate; + else + { + translateText.Text = string.Empty; + } + } + protected override void OnApply() { base.OnApply(); From 5983a935620e07f04d421ac24d5f1ba48a3fd8bd Mon Sep 17 00:00:00 2001 From: andy840119 Date: Sun, 24 Mar 2024 22:11:11 +0800 Subject: [PATCH 2/4] Implement the mod for able to change the translation language by mod. --- .../Mods/TestSceneKaraokeModTranslation.cs | 20 ++++++++++ osu.Game.Rulesets.Karaoke/KaraokeRuleset.cs | 1 + .../Mods/KaraokeModTranslation.cs | 39 +++++++++++++++++++ 3 files changed, 60 insertions(+) create mode 100644 osu.Game.Rulesets.Karaoke.Tests/Mods/TestSceneKaraokeModTranslation.cs create mode 100644 osu.Game.Rulesets.Karaoke/Mods/KaraokeModTranslation.cs diff --git a/osu.Game.Rulesets.Karaoke.Tests/Mods/TestSceneKaraokeModTranslation.cs b/osu.Game.Rulesets.Karaoke.Tests/Mods/TestSceneKaraokeModTranslation.cs new file mode 100644 index 000000000..fe8c4579b --- /dev/null +++ b/osu.Game.Rulesets.Karaoke.Tests/Mods/TestSceneKaraokeModTranslation.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. + +using NUnit.Framework; +using osu.Game.Rulesets.Karaoke.Mods; +using osu.Game.Rulesets.Karaoke.Tests.Beatmaps; + +namespace osu.Game.Rulesets.Karaoke.Tests.Mods; + +public partial class TestSceneKaraokeModTranslation : KaraokeModTestScene +{ + [Test] + public void TestAllPanelExist() => CreateModTest(new ModTestData + { + Mod = new KaraokeModTranslation(), + Autoplay = false, + Beatmap = new TestKaraokeBeatmap(new RulesetInfo()), + PassCondition = () => true, + }); +} diff --git a/osu.Game.Rulesets.Karaoke/KaraokeRuleset.cs b/osu.Game.Rulesets.Karaoke/KaraokeRuleset.cs index b1581b233..94d81b8b7 100644 --- a/osu.Game.Rulesets.Karaoke/KaraokeRuleset.cs +++ b/osu.Game.Rulesets.Karaoke/KaraokeRuleset.cs @@ -144,6 +144,7 @@ public override IEnumerable GetModsFor(ModType type) => { new KaraokeModNoFail(), new KaraokeModLyricConfiguration(), + new KaraokeModTranslation(), }, ModType.DifficultyIncrease => new Mod[] { diff --git a/osu.Game.Rulesets.Karaoke/Mods/KaraokeModTranslation.cs b/osu.Game.Rulesets.Karaoke/Mods/KaraokeModTranslation.cs new file mode 100644 index 000000000..f3caec1a6 --- /dev/null +++ b/osu.Game.Rulesets.Karaoke/Mods/KaraokeModTranslation.cs @@ -0,0 +1,39 @@ +// Copyright (c) andy840119 . Licensed under the GPL Licence. +// See the LICENCE file in the repository root for full licence text. + +using System.Globalization; +using osu.Framework.Allocation; +using osu.Framework.Localisation; +using osu.Game.Rulesets.Karaoke.Configuration; +using osu.Game.Rulesets.Karaoke.Objects.Drawables; +using osu.Game.Rulesets.Mods; +using osu.Game.Rulesets.Objects.Drawables; + +namespace osu.Game.Rulesets.Karaoke.Mods; + +public class KaraokeModTranslation : Mod, IApplicableToDrawableHitObject +{ + public override string Name => "Translation"; + + public override LocalisableString Description => "Display prefer translation by ruleset configuration."; + + public override double ScoreMultiplier => 1.0f; + + public override string Acronym => "LT"; + + public void ApplyToDrawableHitObject(DrawableHitObject drawable) + { + if (drawable is not DrawableLyric drawableLyric) + return; + + var preferLanguage = getPreferLanguage(drawableLyric.Dependencies); + drawableLyric.ChangePreferTranslationLanguage(preferLanguage); + return; + + static CultureInfo? getPreferLanguage(IReadOnlyDependencyContainer dependencyContainer) + { + var config = dependencyContainer.Get(); + return config.Get(KaraokeRulesetSetting.PreferLanguage); + } + } +} From d8d29af8f92dae8a6d0ebdbe09da2031d3bb3701 Mon Sep 17 00:00:00 2001 From: andy840119 Date: Sun, 24 Mar 2024 22:23:35 +0800 Subject: [PATCH 3/4] Remove old adjust configuration from the config. --- .../Skinning/TestSceneLyric.cs | 1 - .../KaraokeRulesetConfigManager.cs | 3 - .../Configuration/KaraokeSessionStatics.cs | 16 ----- .../Edit/DrawableKaraokeEditorRuleset.cs | 12 ---- .../KaraokeSettingsSubsectionStrings.cs | 10 --- .../Objects/Drawables/DrawableLyric.cs | 17 +---- .../Sections/Gameplay/TranslateSettings.cs | 6 -- .../Screens/Skin/Style/NoteStylePreview.cs | 2 +- .../UI/HUD/GeneralSettingOverlay.cs | 14 +--- .../UI/KaraokeSettingsSubsection.cs | 7 -- .../UI/PlayerSettings/TranslateSettings.cs | 67 ------------------- 11 files changed, 3 insertions(+), 152 deletions(-) delete mode 100644 osu.Game.Rulesets.Karaoke/UI/PlayerSettings/TranslateSettings.cs diff --git a/osu.Game.Rulesets.Karaoke.Tests/Skinning/TestSceneLyric.cs b/osu.Game.Rulesets.Karaoke.Tests/Skinning/TestSceneLyric.cs index e6a968acd..a0990a813 100644 --- a/osu.Game.Rulesets.Karaoke.Tests/Skinning/TestSceneLyric.cs +++ b/osu.Game.Rulesets.Karaoke.Tests/Skinning/TestSceneLyric.cs @@ -33,7 +33,6 @@ public TestSceneLyric() private void load() { var config = Dependencies.Get(); - config.SetValue(KaraokeRulesetSetting.UseTranslate, true); config.SetValue(KaraokeRulesetSetting.PreferLanguage, cultureInfo); } diff --git a/osu.Game.Rulesets.Karaoke/Configuration/KaraokeRulesetConfigManager.cs b/osu.Game.Rulesets.Karaoke/Configuration/KaraokeRulesetConfigManager.cs index 0a1b50e09..a41c01084 100644 --- a/osu.Game.Rulesets.Karaoke/Configuration/KaraokeRulesetConfigManager.cs +++ b/osu.Game.Rulesets.Karaoke/Configuration/KaraokeRulesetConfigManager.cs @@ -34,7 +34,6 @@ protected override void InitialiseDefaults() SetDefault(KaraokeRulesetSetting.LyricAlpha, 1, 0.2, 1, 0.01); // Translate - SetDefault(KaraokeRulesetSetting.UseTranslate, true); SetDefault(KaraokeRulesetSetting.PreferLanguage, new CultureInfo("en-US")); // Pitch @@ -112,7 +111,6 @@ protected BindableFontUsage SetDefault(KaraokeRulesetSetting setting, FontUsage new TrackedSetting(KaraokeRulesetSetting.ScrollTime, v => new SettingDescription(v, "Scroll Time", $"{v}ms")), new TrackedSetting(KaraokeRulesetSetting.DisplayNoteRubyText, b => new SettingDescription(b, "Toggle display", b ? "Show" : "Hide")), new TrackedSetting(KaraokeRulesetSetting.ShowCursor, b => new SettingDescription(b, "Cursor display", b ? "Show" : "Hide")), - new TrackedSetting(KaraokeRulesetSetting.UseTranslate, b => new SettingDescription(b, "Display translate", b ? "Show" : "Hide")), new TrackedSetting(KaraokeRulesetSetting.PreferLanguage, c => new SettingDescription(c, "Translate language", CultureInfoUtils.GetLanguageDisplayText(c))), new TrackedSetting(KaraokeRulesetSetting.MicrophoneDevice, d => new SettingDescription(d, "Change to the new microphone device", d)), }; @@ -129,7 +127,6 @@ public enum KaraokeRulesetSetting LyricAlpha, // Translate - UseTranslate, PreferLanguage, // Pitch diff --git a/osu.Game.Rulesets.Karaoke/Configuration/KaraokeSessionStatics.cs b/osu.Game.Rulesets.Karaoke/Configuration/KaraokeSessionStatics.cs index edd0ce8e5..dc4a9780a 100644 --- a/osu.Game.Rulesets.Karaoke/Configuration/KaraokeSessionStatics.cs +++ b/osu.Game.Rulesets.Karaoke/Configuration/KaraokeSessionStatics.cs @@ -2,12 +2,8 @@ // See the LICENCE file in the repository root for full licence text. using System; -using System.Collections.Generic; -using System.Globalization; -using System.Linq; using osu.Game.Beatmaps; using osu.Game.Configuration; -using osu.Game.Rulesets.Karaoke.Beatmaps; using osu.Game.Rulesets.Karaoke.Objects; using osu.Game.Rulesets.Karaoke.UI.Components; @@ -21,14 +17,6 @@ public KaraokeSessionStatics(KaraokeRulesetConfigManager config, IBeatmap? beatm { rulesetConfigManager = config; - // Translate - bool useTranslate = getValue(KaraokeRulesetSetting.UseTranslate); - var preferLanguage = getValue(KaraokeRulesetSetting.PreferLanguage); - var availableTranslate = beatmap?.AvailableTranslates(); - var selectedLanguage = availableTranslate?.FirstOrDefault(t => EqualityComparer.Default.Equals(t, preferLanguage)) ?? availableTranslate?.FirstOrDefault(); - SetDefault(KaraokeRulesetSession.UseTranslate, useTranslate); - SetDefault(KaraokeRulesetSession.PreferLanguage, selectedLanguage); - // Pitch bool overridePitch = getValue(KaraokeRulesetSetting.OverridePitchAtGameplay); int pitchValue = getValue(KaraokeRulesetSetting.Pitch); @@ -59,10 +47,6 @@ public KaraokeSessionStatics(KaraokeRulesetConfigManager config, IBeatmap? beatm public enum KaraokeRulesetSession { - // Translate - UseTranslate, - PreferLanguage, - // Pitch Pitch, VocalPitch, diff --git a/osu.Game.Rulesets.Karaoke/Edit/DrawableKaraokeEditorRuleset.cs b/osu.Game.Rulesets.Karaoke/Edit/DrawableKaraokeEditorRuleset.cs index 7b5da6899..9f0b75d09 100644 --- a/osu.Game.Rulesets.Karaoke/Edit/DrawableKaraokeEditorRuleset.cs +++ b/osu.Game.Rulesets.Karaoke/Edit/DrawableKaraokeEditorRuleset.cs @@ -2,10 +2,7 @@ // See the LICENCE file in the repository root for full licence text. using System.Collections.Generic; -using osu.Framework.Allocation; -using osu.Framework.Bindables; using osu.Game.Beatmaps; -using osu.Game.Rulesets.Karaoke.Configuration; using osu.Game.Rulesets.Karaoke.UI; using osu.Game.Rulesets.Mods; using osu.Game.Rulesets.UI; @@ -15,8 +12,6 @@ namespace osu.Game.Rulesets.Karaoke.Edit; public partial class DrawableKaraokeEditorRuleset : DrawableKaraokeRuleset { - private readonly Bindable bindableDisplayTranslateToggle = new(); - public new IScrollingInfo ScrollingInfo => base.ScrollingInfo; protected override bool DisplayNotePlayfield => true; @@ -24,17 +19,10 @@ public partial class DrawableKaraokeEditorRuleset : DrawableKaraokeRuleset public DrawableKaraokeEditorRuleset(Ruleset ruleset, IBeatmap beatmap, IReadOnlyList? mods) : base(ruleset, beatmap, mods) { - bindableDisplayTranslateToggle.BindValueChanged(x => { Session.SetValue(KaraokeRulesetSession.UseTranslate, x.NewValue); }); } protected override Playfield CreatePlayfield() => new KaraokeEditorPlayfield(); - [BackgroundDependencyLoader] - private void load(KaraokeRulesetEditConfigManager editConfigManager) - { - editConfigManager.BindWith(KaraokeRulesetEditSetting.DisplayTranslate, bindableDisplayTranslateToggle); - } - // todo: use default adjustment container because DrawableEditorRulesetWrapper will create it but contains no KaraokeRulesetConfigManager public override PlayfieldAdjustmentContainer CreatePlayfieldAdjustmentContainer() => new(); } diff --git a/osu.Game.Rulesets.Karaoke/Localisation/KaraokeSettingsSubsectionStrings.cs b/osu.Game.Rulesets.Karaoke/Localisation/KaraokeSettingsSubsectionStrings.cs index 89529cf0a..5d3cb67ac 100644 --- a/osu.Game.Rulesets.Karaoke/Localisation/KaraokeSettingsSubsectionStrings.cs +++ b/osu.Game.Rulesets.Karaoke/Localisation/KaraokeSettingsSubsectionStrings.cs @@ -38,16 +38,6 @@ public static class KaraokeSettingsSubsectionStrings public static LocalisableString ShowCursorWhilePlayingTooltip => new TranslatableString(getKey(@"show_cursor_while_playing_tooltip"), @"Will not showing the cursor while gameplay if not select this option."); - /// - /// "Translate" - /// - public static LocalisableString Translate => new TranslatableString(getKey(@"translate"), @"Translate"); - - /// - /// "Show the translation under the lyric if contains in the beatmap." - /// - public static LocalisableString TranslateTooltip => new TranslatableString(getKey(@"translate_tooltip"), @"Show the translation under the lyric if contains in the beatmap."); - /// /// "Prefer language" /// diff --git a/osu.Game.Rulesets.Karaoke/Objects/Drawables/DrawableLyric.cs b/osu.Game.Rulesets.Karaoke/Objects/Drawables/DrawableLyric.cs index 12de1a820..19c214d21 100644 --- a/osu.Game.Rulesets.Karaoke/Objects/Drawables/DrawableLyric.cs +++ b/osu.Game.Rulesets.Karaoke/Objects/Drawables/DrawableLyric.cs @@ -24,8 +24,6 @@ public partial class DrawableLyric : DrawableKaraokeHitObject private Container lyricPieces = null!; private OsuSpriteText translateText = null!; - private KaraokeRulesetConfigManager? config { get; set; } - private readonly BindableBool useTranslateBindable = new(); private readonly Bindable preferLanguageBindable = new(); @@ -55,7 +53,7 @@ public DrawableLyric(Lyric? hitObject) } [BackgroundDependencyLoader(true)] - private void load(KaraokeSessionStatics? session) + private void load(KaraokeRulesetConfigManager? config) { AutoSizeAxes = Axes.Both; @@ -69,19 +67,6 @@ private void load(KaraokeSessionStatics? session) Origin = Anchor.TopLeft, }); - if (session != null) - { - // gameplay. - session.BindWith(KaraokeRulesetSession.UseTranslate, useTranslateBindable); - session.BindWith(KaraokeRulesetSession.PreferLanguage, preferLanguageBindable); - } - else if (config != null) - { - // preview lyric effect. - config.BindWith(KaraokeRulesetSetting.UseTranslate, useTranslateBindable); - config.BindWith(KaraokeRulesetSetting.PreferLanguage, preferLanguageBindable); - } - useTranslateBindable.BindValueChanged(_ => applyTranslate(), true); preferLanguageBindable.BindValueChanged(_ => applyTranslate(), true); diff --git a/osu.Game.Rulesets.Karaoke/Screens/Settings/Sections/Gameplay/TranslateSettings.cs b/osu.Game.Rulesets.Karaoke/Screens/Settings/Sections/Gameplay/TranslateSettings.cs index e55f31265..a795993e8 100644 --- a/osu.Game.Rulesets.Karaoke/Screens/Settings/Sections/Gameplay/TranslateSettings.cs +++ b/osu.Game.Rulesets.Karaoke/Screens/Settings/Sections/Gameplay/TranslateSettings.cs @@ -5,7 +5,6 @@ using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Localisation; -using osu.Game.Overlays.Settings; using osu.Game.Rulesets.Karaoke.Configuration; using osu.Game.Rulesets.Karaoke.Screens.Settings.Previews; using osu.Game.Rulesets.Karaoke.Screens.Settings.Previews.Gameplay; @@ -23,11 +22,6 @@ private void load() { Children = new Drawable[] { - new SettingsCheckbox - { - LabelText = "Translate", - Current = Config.GetBindable(KaraokeRulesetSetting.UseTranslate), - }, new SettingsLanguage { LabelText = "Prefer language", diff --git a/osu.Game.Rulesets.Karaoke/Screens/Skin/Style/NoteStylePreview.cs b/osu.Game.Rulesets.Karaoke/Screens/Skin/Style/NoteStylePreview.cs index 6778361b2..94563941b 100644 --- a/osu.Game.Rulesets.Karaoke/Screens/Skin/Style/NoteStylePreview.cs +++ b/osu.Game.Rulesets.Karaoke/Screens/Skin/Style/NoteStylePreview.cs @@ -37,7 +37,7 @@ protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnl } [BackgroundDependencyLoader] - private void load(OverlayColourProvider colourProvider, StyleManager manager) + private void load(OverlayColourProvider colourProvider) { Masking = true; CornerRadius = 15; diff --git a/osu.Game.Rulesets.Karaoke/UI/HUD/GeneralSettingOverlay.cs b/osu.Game.Rulesets.Karaoke/UI/HUD/GeneralSettingOverlay.cs index 49c677b76..7bcecec3e 100644 --- a/osu.Game.Rulesets.Karaoke/UI/HUD/GeneralSettingOverlay.cs +++ b/osu.Game.Rulesets.Karaoke/UI/HUD/GeneralSettingOverlay.cs @@ -118,20 +118,8 @@ public virtual void OnReleased(KeyBindingReleaseEvent e) } [BackgroundDependencyLoader] - private void load(IBindable beatmap, KaraokeSessionStatics session) + private void load(KaraokeSessionStatics session) { - // Add translate group if this beatmap has translate - if (beatmap.Value.Beatmap.AnyTranslate()) - { - Add(new TranslateSettings - { - Expanded = - { - Value = false, - }, - }); - } - session.BindWith(KaraokeRulesetSession.Pitch, bindablePitch); session.BindWith(KaraokeRulesetSession.VocalPitch, bindableVocalPitch); session.BindWith(KaraokeRulesetSession.ScoringPitch, bindableScoringPitch); diff --git a/osu.Game.Rulesets.Karaoke/UI/KaraokeSettingsSubsection.cs b/osu.Game.Rulesets.Karaoke/UI/KaraokeSettingsSubsection.cs index 221e29d7d..34c1dd234 100644 --- a/osu.Game.Rulesets.Karaoke/UI/KaraokeSettingsSubsection.cs +++ b/osu.Game.Rulesets.Karaoke/UI/KaraokeSettingsSubsection.cs @@ -58,13 +58,6 @@ private void load(IPerformFromScreenRunner performer) TooltipText = KaraokeSettingsSubsectionStrings.ShowCursorWhilePlayingTooltip, Current = config.GetBindable(KaraokeRulesetSetting.ShowCursor), }, - // Translate - new SettingsCheckbox - { - LabelText = KaraokeSettingsSubsectionStrings.Translate, - TooltipText = KaraokeSettingsSubsectionStrings.TranslateTooltip, - Current = config.GetBindable(KaraokeRulesetSetting.UseTranslate), - }, // Device new SettingsMicrophoneDeviceDropdown { diff --git a/osu.Game.Rulesets.Karaoke/UI/PlayerSettings/TranslateSettings.cs b/osu.Game.Rulesets.Karaoke/UI/PlayerSettings/TranslateSettings.cs deleted file mode 100644 index a77f4e57a..000000000 --- a/osu.Game.Rulesets.Karaoke/UI/PlayerSettings/TranslateSettings.cs +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) andy840119 . Licensed under the GPL Licence. -// See the LICENCE file in the repository root for full licence text. - -using System.Globalization; -using osu.Framework.Allocation; -using osu.Framework.Bindables; -using osu.Framework.Graphics; -using osu.Game.Beatmaps; -using osu.Game.Graphics.Sprites; -using osu.Game.Graphics.UserInterface; -using osu.Game.Rulesets.Karaoke.Beatmaps; -using osu.Game.Rulesets.Karaoke.Configuration; -using osu.Game.Screens.Play.PlayerSettings; - -namespace osu.Game.Rulesets.Karaoke.UI.PlayerSettings; - -public partial class TranslateSettings : PlayerSettingsGroup -{ - private readonly PlayerCheckbox translateCheckBox; - private readonly OsuSpriteText translateText; - private readonly OsuDropdown translateDropDown; - - public TranslateSettings() - : base("Translate") - { - Children = new Drawable[] - { - translateCheckBox = new PlayerCheckbox - { - LabelText = "Translate", - }, - translateText = new OsuSpriteText - { - Text = "Translate language", - }, - translateDropDown = new OsuDropdown - { - RelativeSizeAxes = Axes.X, - }, - }; - } - - [BackgroundDependencyLoader] - private void load(IBindable beatmap, KaraokeSessionStatics session) - { - translateDropDown.Items = beatmap.Value.Beatmap.AvailableTranslates(); - - // Translate - translateCheckBox.Current = session.GetBindable(KaraokeRulesetSession.UseTranslate); - translateDropDown.Current = session.GetBindable(KaraokeRulesetSession.PreferLanguage); - - // hidden dropdown if not translate - translateCheckBox.Current.BindValueChanged(value => - { - if (value.NewValue) - { - translateText.Show(); - translateDropDown.Show(); - } - else - { - translateText.Hide(); - translateDropDown.Hide(); - } - }, true); - } -} From 3ad5a8ca6a52cf24da1ba431c0c8685773046934 Mon Sep 17 00:00:00 2001 From: andy840119 Date: Sun, 24 Mar 2024 22:25:22 +0800 Subject: [PATCH 4/4] Remove the configuration in the editor because: 1. it's not that useful. 2. Should see the lyric config effect by mod. --- .../KaraokeRulesetEditConfigManager.cs | 10 ------- .../Menus/LyricDisplayPreviewMenuItem.cs | 26 ------------------- .../Edit/KaraokeHitObjectComposer.cs | 5 +--- 3 files changed, 1 insertion(+), 40 deletions(-) delete mode 100644 osu.Game.Rulesets.Karaoke/Edit/Components/Menus/LyricDisplayPreviewMenuItem.cs diff --git a/osu.Game.Rulesets.Karaoke/Configuration/KaraokeRulesetEditConfigManager.cs b/osu.Game.Rulesets.Karaoke/Configuration/KaraokeRulesetEditConfigManager.cs index 724092546..52cd72102 100644 --- a/osu.Game.Rulesets.Karaoke/Configuration/KaraokeRulesetEditConfigManager.cs +++ b/osu.Game.Rulesets.Karaoke/Configuration/KaraokeRulesetEditConfigManager.cs @@ -2,23 +2,13 @@ // See the LICENCE file in the repository root for full licence text. using osu.Game.Configuration; -using osu.Game.Rulesets.Karaoke.Graphics.Sprites; namespace osu.Game.Rulesets.Karaoke.Configuration; public class KaraokeRulesetEditConfigManager : InMemoryConfigManager { - protected override void InitialiseDefaults() - { - base.InitialiseDefaults(); - - // Lyric display. - SetDefault(KaraokeRulesetEditSetting.DisplayTranslate, true); - } } public enum KaraokeRulesetEditSetting { - // Lyric display type - DisplayTranslate, } diff --git a/osu.Game.Rulesets.Karaoke/Edit/Components/Menus/LyricDisplayPreviewMenuItem.cs b/osu.Game.Rulesets.Karaoke/Edit/Components/Menus/LyricDisplayPreviewMenuItem.cs deleted file mode 100644 index c9a7418ba..000000000 --- a/osu.Game.Rulesets.Karaoke/Edit/Components/Menus/LyricDisplayPreviewMenuItem.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) andy840119 . Licensed under the GPL Licence. -// See the LICENCE file in the repository root for full licence text. - -using osu.Framework.Bindables; -using osu.Framework.Graphics.UserInterface; -using osu.Game.Rulesets.Karaoke.Configuration; -using osu.Game.Rulesets.Karaoke.Graphics.UserInterface; - -namespace osu.Game.Rulesets.Karaoke.Edit.Components.Menus; - -public class LyricDisplayPreviewMenuItem : MenuItem -{ - private readonly Bindable bindableDisplayTranslateToggle = new(); - - public LyricDisplayPreviewMenuItem(KaraokeRulesetEditConfigManager config, string text) - : base(text) - { - // Note: cannot use config.GetBindable directly the menu item. - config.BindWith(KaraokeRulesetEditSetting.DisplayTranslate, bindableDisplayTranslateToggle); - - Items = new MenuItem[] - { - new BindableBoolMenuItem("Display translate", bindableDisplayTranslateToggle), - }; - } -} diff --git a/osu.Game.Rulesets.Karaoke/Edit/KaraokeHitObjectComposer.cs b/osu.Game.Rulesets.Karaoke/Edit/KaraokeHitObjectComposer.cs index 9fa983a31..806d587f4 100644 --- a/osu.Game.Rulesets.Karaoke/Edit/KaraokeHitObjectComposer.cs +++ b/osu.Game.Rulesets.Karaoke/Edit/KaraokeHitObjectComposer.cs @@ -151,10 +151,7 @@ protected void CreateMenuBar() { new("Config") { - Items = new MenuItem[] - { - new LyricDisplayPreviewMenuItem(editConfigManager, "Lyric display preview"), - }, + Items = Array.Empty(), }, new("Tools") {