1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 15:07:44 +08:00

Add localisation support for MouseSettings

This commit is contained in:
Dean Herbert 2021-07-15 13:07:35 +09:00
parent d58534dce6
commit 3f3adfe297
2 changed files with 50 additions and 10 deletions

View File

@ -14,6 +14,46 @@ namespace osu.Game.Localisation
/// </summary>
public static LocalisableString Mouse => new TranslatableString(getKey(@"mouse"), @"Mouse");
/// <summary>
/// "Not applicable in full screen mode"
/// </summary>
public static LocalisableString NotApplicableFullscreen => new TranslatableString(getKey(@"not_applicable_full_screen"), @"Not applicable in full screen mode");
/// <summary>
/// "High precision mouse"
/// </summary>
public static LocalisableString HighPrecisionMouse => new TranslatableString(getKey(@"high_precision_mouse"), @"High precision mouse");
/// <summary>
/// "Attempts to bypass any operation system mouse acceleration. On windows, this is equivalent to what used to be known as &quot;Raw Input&quot;."
/// </summary>
public static LocalisableString HighPrecisionMouseTooltip => new TranslatableString(getKey(@"high_precision_mouse_tooltip"), @"Attempts to bypass any operation system mouse acceleration. On windows, this is equivalent to what used to be known as ""Raw Input"".");
/// <summary>
/// "Confine mouse cursor to window"
/// </summary>
public static LocalisableString ConfineMouseMode => new TranslatableString(getKey(@"confine_mouse_mode"), @"Confine mouse cursor to window");
/// <summary>
/// "Disable mouse wheel during gameplay"
/// </summary>
public static LocalisableString DisableMouseWheel => new TranslatableString(getKey(@"disable_mouse_wheel"), @"Disable mouse wheel during gameplay");
/// <summary>
/// "Disable mouse buttons during gameplay"
/// </summary>
public static LocalisableString DisableMouseButtons => new TranslatableString(getKey(@"disable_mouse_buttons"), @"Disable mouse buttons during gameplay");
/// <summary>
/// "Enable high precision mouse to adjust sensitivity"
/// </summary>
public static LocalisableString EnableHighPrecisionForSensitivityAdjust => new TranslatableString(getKey(@"enable_high_precision_for_sensitivity_adjust"), @"Enable high precision mouse to adjust sensitivity");
/// <summary>
/// "Cursor sensitivity"
/// </summary>
public static LocalisableString CursorSensitivity => new TranslatableString(getKey(@"cursor_sensitivity"), @"Cursor sensitivity");
private static string getKey(string key) => $@"{prefix}:{key}";
}
}
}

View File

@ -47,29 +47,29 @@ namespace osu.Game.Overlays.Settings.Sections.Input
{
new SettingsCheckbox
{
LabelText = "High precision mouse",
TooltipText = "Attempts to bypass any operation system mouse acceleration. On windows, this is equivalent to what used to be known as \"Raw Input\".",
LabelText = MouseSettingsStrings.HighPrecisionMouse,
TooltipText = MouseSettingsStrings.HighPrecisionMouseTooltip,
Current = relativeMode,
Keywords = new[] { "raw", "input", "relative", "cursor" }
Keywords = new[] { @"raw", @"input", @"relative", @"cursor" }
},
new SensitivitySetting
{
LabelText = "Cursor sensitivity",
LabelText = MouseSettingsStrings.CursorSensitivity,
Current = localSensitivity
},
confineMouseModeSetting = new SettingsEnumDropdown<OsuConfineMouseMode>
{
LabelText = "Confine mouse cursor to window",
LabelText = MouseSettingsStrings.ConfineMouseMode,
Current = osuConfig.GetBindable<OsuConfineMouseMode>(OsuSetting.ConfineMouseMode)
},
new SettingsCheckbox
{
LabelText = "Disable mouse wheel during gameplay",
LabelText = MouseSettingsStrings.DisableMouseWheel,
Current = osuConfig.GetBindable<bool>(OsuSetting.MouseDisableWheel)
},
new SettingsCheckbox
{
LabelText = "Disable mouse buttons during gameplay",
LabelText = MouseSettingsStrings.DisableMouseButtons,
Current = osuConfig.GetBindable<bool>(OsuSetting.MouseDisableButtons)
},
};
@ -99,7 +99,7 @@ namespace osu.Game.Overlays.Settings.Sections.Input
if (isFullscreen)
{
confineMouseModeSetting.Current.Disabled = true;
confineMouseModeSetting.TooltipText = "Not applicable in full screen mode";
confineMouseModeSetting.TooltipText = MouseSettingsStrings.NotApplicableFullscreen;
}
else
{
@ -120,7 +120,7 @@ namespace osu.Game.Overlays.Settings.Sections.Input
private class SensitivitySlider : OsuSliderBar<double>
{
public override LocalisableString TooltipText => Current.Disabled ? "enable high precision mouse to adjust sensitivity" : $"{base.TooltipText}x";
public override LocalisableString TooltipText => Current.Disabled ? MouseSettingsStrings.EnableHighPrecisionForSensitivityAdjust : $"{base.TooltipText}x";
}
}
}