1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-21 23:59:16 +08:00

Apply suggestions from code review

Co-authored-by: Bartłomiej Dach <dach.bartlomiej@gmail.com>
This commit is contained in:
kj415j45 2021-08-14 21:52:09 +08:00
parent e26ccf786e
commit f87f86e671
No known key found for this signature in database
GPG Key ID: 54226D868052F383
10 changed files with 14 additions and 9 deletions

View File

@ -42,7 +42,7 @@ namespace osu.Game.Localisation
/// <summary> /// <summary>
/// "Show difficulty graph on progress bar" /// "Show difficulty graph on progress bar"
/// </summary> /// </summary>
public static LocalisableString ShowProgressGraph => new TranslatableString(getKey(@"show_progress_graph"), @"Show difficulty graph on progress bar"); public static LocalisableString ShowDifficultyGraph => new TranslatableString(getKey(@"show_progress_graph"), @"Show difficulty graph on progress bar");
/// <summary> /// <summary>
/// "Show health display even when you can't fail" /// "Show health display even when you can't fail"

View File

@ -32,7 +32,7 @@ namespace osu.Game.Localisation
/// <summary> /// <summary>
/// "Integrations" /// "Integrations"
/// </summary> /// </summary>
public static LocalisableString IntegrationHeader => new TranslatableString(getKey(@"integration_header"), @"Integrations"); public static LocalisableString IntegrationsHeader => new TranslatableString(getKey(@"integrations_header"), @"Integrations");
/// <summary> /// <summary>
/// "Discord Rich Presence" /// "Discord Rich Presence"

View File

@ -37,7 +37,7 @@ namespace osu.Game.Localisation
/// <summary> /// <summary>
/// "Hold-to-confirm activation time" /// "Hold-to-confirm activation time"
/// </summary> /// </summary>
public static LocalisableString HoldActivationDelay => new TranslatableString(getKey(@"hold_activation_delay"), @"Hold-to-confirm activation time"); public static LocalisableString HoldToConfirmActivationTime => new TranslatableString(getKey(@"hold_to_confirm_activation_time"), @"Hold-to-confirm activation time");
/// <summary> /// <summary>
/// "Main Menu" /// "Main Menu"

View File

@ -46,7 +46,7 @@ namespace osu.Game.Overlays.Settings.Sections.Gameplay
}, },
new SettingsCheckbox new SettingsCheckbox
{ {
LabelText = GameplaySettingsStrings.ShowProgressGraph, LabelText = GameplaySettingsStrings.ShowDifficultyGraph,
Current = config.GetBindable<bool>(OsuSetting.ShowProgressGraph) Current = config.GetBindable<bool>(OsuSetting.ShowProgressGraph)
}, },
new SettingsCheckbox new SettingsCheckbox

View File

@ -146,7 +146,7 @@ namespace osu.Game.Overlays.Settings.Sections.Graphics
{ {
updateResolutionDropdown(); updateResolutionDropdown();
windowModeDropdown.WarningText = mode.NewValue != WindowMode.Fullscreen ? GraphicsSettingsStrings.NotFullscreenNote : string.Empty; windowModeDropdown.WarningText = mode.NewValue != WindowMode.Fullscreen ? GraphicsSettingsStrings.NotFullscreenNote : default;
}, true); }, true);
windowModes.BindCollectionChanged((sender, args) => windowModes.BindCollectionChanged((sender, args) =>

View File

@ -48,7 +48,7 @@ namespace osu.Game.Overlays.Settings.Sections.Graphics
frameLimiterDropdown.Current.BindValueChanged(limit => frameLimiterDropdown.Current.BindValueChanged(limit =>
{ {
frameLimiterDropdown.WarningText = limit.NewValue == FrameSync.Unlimited ? GraphicsSettingsStrings.UnlimitedFramesNote : string.Empty; frameLimiterDropdown.WarningText = limit.NewValue == FrameSync.Unlimited ? GraphicsSettingsStrings.UnlimitedFramesNote : default;
}, true); }, true);
} }
} }

View File

@ -11,7 +11,7 @@ namespace osu.Game.Overlays.Settings.Sections.Online
{ {
public class IntegrationSettings : SettingsSubsection public class IntegrationSettings : SettingsSubsection
{ {
protected override LocalisableString Header => OnlineSettingsStrings.IntegrationHeader; protected override LocalisableString Header => OnlineSettingsStrings.IntegrationsHeader;
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(OsuConfigManager config) private void load(OsuConfigManager config)

View File

@ -37,7 +37,7 @@ namespace osu.Game.Overlays.Settings.Sections.UserInterface
}, },
new SettingsSlider<float, TimeSlider> new SettingsSlider<float, TimeSlider>
{ {
LabelText = UserInterfaceStrings.HoldActivationDelay, LabelText = UserInterfaceStrings.HoldToConfirmActivationTime,
Current = config.GetBindable<float>(OsuSetting.UIHoldActivationDelay), Current = config.GetBindable<float>(OsuSetting.UIHoldActivationDelay),
KeyboardStep = 50 KeyboardStep = 50
}, },

View File

@ -61,7 +61,7 @@ namespace osu.Game.Overlays.Settings.Sections.UserInterface
user.BindValueChanged(u => user.BindValueChanged(u =>
{ {
backgroundSourceDropdown.WarningText = u.NewValue?.IsSupporter != true ? UserInterfaceStrings.NotSupporterNote : string.Empty; backgroundSourceDropdown.WarningText = u.NewValue?.IsSupporter != true ? UserInterfaceStrings.NotSupporterNote : default;
}, true); }, true);
} }
} }

View File

@ -24,6 +24,11 @@ namespace osu.Game.Overlays.Settings
protected abstract LocalisableString Header { get; } protected abstract LocalisableString Header { get; }
public IEnumerable<IFilterable> FilterableChildren => Children.OfType<IFilterable>(); public IEnumerable<IFilterable> FilterableChildren => Children.OfType<IFilterable>();
// FilterTerms should contains both original string and localised string for user to search.
// Since LocalisableString is unable to get original string at this time (2021-08-14),
// only call .ToString() to use localised one.
// TODO: Update here when FilterTerms accept LocalisableString.
public virtual IEnumerable<string> FilterTerms => new[] { Header.ToString() }; public virtual IEnumerable<string> FilterTerms => new[] { Header.ToString() };
public bool MatchingFilter public bool MatchingFilter