Add localisation support for remaining input settings sections

This commit is contained in:
Dean Herbert
2021-07-16 23:03:44 +09:00
parent b3d89254a9
commit 7df7137c88
6 changed files with 122 additions and 17 deletions

View File

@ -11,6 +11,7 @@ using osu.Framework.Platform;
using osu.Framework.Threading;
using osu.Game.Graphics.Sprites;
using osuTK;
using osu.Game.Localisation;
namespace osu.Game.Overlays.Settings.Sections.Input
{
@ -53,7 +54,7 @@ namespace osu.Game.Overlays.Settings.Sections.Input
private OsuSpriteText noTabletMessage;
protected override LocalisableString Header => "Tablet";
protected override LocalisableString Header => TabletSettingsStrings.Tablet;
public TabletSettings(ITabletHandler tabletHandler)
{
@ -67,14 +68,14 @@ namespace osu.Game.Overlays.Settings.Sections.Input
{
new SettingsCheckbox
{
LabelText = "Enabled",
LabelText = CommonStrings.Enabled,
Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre,
Current = tabletHandler.Enabled
},
noTabletMessage = new OsuSpriteText
{
Text = "No tablet detected!",
Text = TabletSettingsStrings.NoTabletDetected,
Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre,
Padding = new MarginPadding { Horizontal = SettingsPanel.CONTENT_MARGINS }
@ -95,7 +96,7 @@ namespace osu.Game.Overlays.Settings.Sections.Input
},
new DangerousSettingsButton
{
Text = "Reset to full area",
Text = TabletSettingsStrings.ResetToFullArea,
Action = () =>
{
aspectLock.Value = false;
@ -106,7 +107,7 @@ namespace osu.Game.Overlays.Settings.Sections.Input
},
new SettingsButton
{
Text = "Conform to current game aspect ratio",
Text = TabletSettingsStrings.ConformToCurrentGameAspectRatio,
Action = () =>
{
forceAspectRatio((float)host.Window.ClientSize.Width / host.Window.ClientSize.Height);
@ -115,43 +116,43 @@ namespace osu.Game.Overlays.Settings.Sections.Input
new SettingsSlider<float>
{
TransferValueOnCommit = true,
LabelText = "X Offset",
LabelText = TabletSettingsStrings.XOffset,
Current = offsetX
},
new SettingsSlider<float>
{
TransferValueOnCommit = true,
LabelText = "Y Offset",
LabelText = TabletSettingsStrings.YOffset,
Current = offsetY
},
new SettingsSlider<float>
{
TransferValueOnCommit = true,
LabelText = "Rotation",
LabelText = TabletSettingsStrings.Rotation,
Current = rotation
},
new RotationPresetButtons(tabletHandler),
new SettingsSlider<float>
{
TransferValueOnCommit = true,
LabelText = "Aspect Ratio",
LabelText = TabletSettingsStrings.AspectRatio,
Current = aspectRatio
},
new SettingsCheckbox
{
LabelText = "Lock aspect ratio",
LabelText = TabletSettingsStrings.LockAspectRatio,
Current = aspectLock
},
new SettingsSlider<float>
{
TransferValueOnCommit = true,
LabelText = "Width",
LabelText = CommonStrings.Width,
Current = sizeX
},
new SettingsSlider<float>
{
TransferValueOnCommit = true,
LabelText = "Height",
LabelText = CommonStrings.Height,
Current = sizeY
},
}