mirror of
https://github.com/ppy/osu.git
synced 2025-01-12 13:15:08 +08:00
Localise tracked setting toasts
This commit is contained in:
parent
cce4a41c5d
commit
545cfc7bf1
@ -6,10 +6,12 @@ using System.Diagnostics;
|
||||
using osu.Framework.Configuration;
|
||||
using osu.Framework.Configuration.Tracking;
|
||||
using osu.Framework.Extensions;
|
||||
using osu.Framework.Extensions.LocalisationExtensions;
|
||||
using osu.Framework.Platform;
|
||||
using osu.Framework.Testing;
|
||||
using osu.Game.Input;
|
||||
using osu.Game.Input.Bindings;
|
||||
using osu.Game.Localisation;
|
||||
using osu.Game.Overlays;
|
||||
using osu.Game.Rulesets.Scoring;
|
||||
using osu.Game.Screens.Select;
|
||||
@ -185,13 +187,13 @@ namespace osu.Game.Configuration
|
||||
|
||||
return new TrackedSettings
|
||||
{
|
||||
new TrackedSetting<bool>(OsuSetting.MouseDisableButtons, v => new SettingDescription(!v, "gameplay mouse buttons", v ? "disabled" : "enabled", LookupKeyBindings(GlobalAction.ToggleGameplayMouseButtons))),
|
||||
new TrackedSetting<HUDVisibilityMode>(OsuSetting.HUDVisibilityMode, m => new SettingDescription(m, "HUD Visibility", m.GetDescription(), $"cycle: {LookupKeyBindings(GlobalAction.ToggleInGameInterface)} quick view: {LookupKeyBindings(GlobalAction.HoldForHUD)}")),
|
||||
new TrackedSetting<ScalingMode>(OsuSetting.Scaling, m => new SettingDescription(m, "scaling", m.GetDescription())),
|
||||
new TrackedSetting<bool>(OsuSetting.MouseDisableButtons, v => new SettingDescription(!v, GlobalActionKeyBindingStrings.ToggleGameplayMouseButtons, v ? CommonStrings.Disabled.ToLower() : CommonStrings.Enabled.ToLower(), LookupKeyBindings(GlobalAction.ToggleGameplayMouseButtons))),
|
||||
new TrackedSetting<HUDVisibilityMode>(OsuSetting.HUDVisibilityMode, m => new SettingDescription(m, GameplaySettingsStrings.HUDVisibilityMode, m.GetLocalisableDescription(), $"{GlobalActionKeyBindingStrings.ToggleInGameInterface}: {LookupKeyBindings(GlobalAction.ToggleInGameInterface)} {GlobalActionKeyBindingStrings.HoldForHUD}: {LookupKeyBindings(GlobalAction.HoldForHUD)}")),
|
||||
new TrackedSetting<ScalingMode>(OsuSetting.Scaling, m => new SettingDescription(m, GraphicsSettingsStrings.ScreenScaling, m.GetLocalisableDescription())),
|
||||
new TrackedSetting<int>(OsuSetting.Skin, m =>
|
||||
{
|
||||
string skinName = LookupSkinName(m) ?? string.Empty;
|
||||
return new SettingDescription(skinName, "skin", skinName, $"random: {LookupKeyBindings(GlobalAction.RandomSkin)}");
|
||||
return new SettingDescription(skinName, SkinSettingsStrings.SkinSectionHeader, skinName, $"{GlobalActionKeyBindingStrings.RandomSkin}: {LookupKeyBindings(GlobalAction.RandomSkin)}");
|
||||
})
|
||||
};
|
||||
}
|
||||
|
@ -1,9 +1,11 @@
|
||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using osu.Framework.Extensions.LocalisationExtensions;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osu.Framework.Localisation;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
using osuTK;
|
||||
@ -23,7 +25,7 @@ namespace osu.Game.Overlays.OSD
|
||||
|
||||
protected readonly OsuSpriteText ShortcutText;
|
||||
|
||||
protected Toast(string description, string value, string shortcut)
|
||||
protected Toast(LocalisableString description, LocalisableString value, LocalisableString shortcut)
|
||||
{
|
||||
Anchor = Anchor.Centre;
|
||||
Origin = Anchor.Centre;
|
||||
@ -60,7 +62,7 @@ namespace osu.Game.Overlays.OSD
|
||||
Spacing = new Vector2(1, 0),
|
||||
Anchor = Anchor.TopCentre,
|
||||
Origin = Anchor.TopCentre,
|
||||
Text = description.ToUpperInvariant()
|
||||
Text = description.ToUpper()
|
||||
},
|
||||
ValueText = new OsuSpriteText
|
||||
{
|
||||
@ -79,7 +81,7 @@ namespace osu.Game.Overlays.OSD
|
||||
Alpha = 0.3f,
|
||||
Margin = new MarginPadding { Bottom = 15 },
|
||||
Font = OsuFont.GetFont(size: 12, weight: FontWeight.Bold),
|
||||
Text = string.IsNullOrEmpty(shortcut) ? "NO KEY BOUND" : shortcut.ToUpperInvariant()
|
||||
Text = string.IsNullOrEmpty(shortcut.ToString()) ? (LocalisableString)"NO KEY BOUND" : shortcut.ToUpper()
|
||||
},
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user