Add SkinSettingsStrings

This commit is contained in:
kj415j45 2021-08-12 11:40:22 +08:00
parent 31ffaf15d4
commit 61502e977a
No known key found for this signature in database
GPG Key ID: 54226D868052F383
2 changed files with 63 additions and 8 deletions

View File

@ -0,0 +1,54 @@
// 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.Localisation;
namespace osu.Game.Localisation
{
public static class SkinSettingsStrings
{
private const string prefix = @"osu.Game.Resources.Localisation.SkinSettings";
/// <summary>
/// "Skin"
/// </summary>
public static LocalisableString SkinSectionHeader => new TranslatableString(getKey(@"skin_section_header"), @"Skin");
/// <summary>
/// "Skin layout editor"
/// </summary>
public static LocalisableString SkinLayoutEditor => new TranslatableString(getKey(@"skin_layout_editor"), @"Skin layout editor");
/// <summary>
/// "Gameplay cursor size"
/// </summary>
public static LocalisableString CursorSize => new TranslatableString(getKey(@"cursor_size"), @"Gameplay cursor size");
/// <summary>
/// "Adjust gameplay cursor size based on current beatmap"
/// </summary>
public static LocalisableString AutoCursorSize => new TranslatableString(getKey(@"auto_cursor_size"), @"Adjust gameplay cursor size based on current beatmap");
/// <summary>
/// "Beatmap skins"
/// </summary>
public static LocalisableString BeatmapSkins => new TranslatableString(getKey(@"beatmap_skins"), @"Beatmap skins");
/// <summary>
/// "Beatmap colours"
/// </summary>
public static LocalisableString BeatmapColours => new TranslatableString(getKey(@"beatmap_colours"), @"Beatmap colours");
/// <summary>
/// "Beatmap hitsounds"
/// </summary>
public static LocalisableString BeatmapHitsounds => new TranslatableString(getKey(@"beatmap_hitsounds"), @"Beatmap hitsounds");
/// <summary>
/// "Export selected skin"
/// </summary>
public static LocalisableString ExportSkinButton => new TranslatableString(getKey(@"export_skin_button"), @"Export selected skin");
private static string getKey(string key) => $"{prefix}:{key}";
}
}

View File

@ -13,6 +13,7 @@
using osu.Framework.Logging;
using osu.Game.Configuration;
using osu.Game.Graphics.UserInterface;
using osu.Game.Localisation;
using osu.Game.Skinning;
using osu.Game.Skinning.Editor;
using osuTK;
@ -23,7 +24,7 @@ public class SkinSection : SettingsSection
{
private SkinSettingsDropdown skinDropdown;
public override string Header => "Skin";
public override LocalisableString Header => SkinSettingsStrings.SkinSectionHeader;
public override Drawable CreateIcon() => new SpriteIcon
{
@ -69,34 +70,34 @@ private void load(OsuConfigManager config, [CanBeNull] SkinEditorOverlay skinEdi
skinDropdown = new SkinSettingsDropdown(),
new SettingsButton
{
Text = "Skin layout editor",
Text = SkinSettingsStrings.SkinLayoutEditor,
Action = () => skinEditor?.Toggle(),
},
new ExportSkinButton(),
new SettingsSlider<float, SizeSlider>
{
LabelText = "Gameplay cursor size",
LabelText = SkinSettingsStrings.CursorSize,
Current = config.GetBindable<float>(OsuSetting.GameplayCursorSize),
KeyboardStep = 0.01f
},
new SettingsCheckbox
{
LabelText = "Adjust gameplay cursor size based on current beatmap",
LabelText = SkinSettingsStrings.AutoCursorSize,
Current = config.GetBindable<bool>(OsuSetting.AutoCursorSize)
},
new SettingsCheckbox
{
LabelText = "Beatmap skins",
LabelText = SkinSettingsStrings.BeatmapSkins,
Current = config.GetBindable<bool>(OsuSetting.BeatmapSkins)
},
new SettingsCheckbox
{
LabelText = "Beatmap colours",
LabelText = SkinSettingsStrings.BeatmapColours,
Current = config.GetBindable<bool>(OsuSetting.BeatmapColours)
},
new SettingsCheckbox
{
LabelText = "Beatmap hitsounds",
LabelText = SkinSettingsStrings.BeatmapHitsounds,
Current = config.GetBindable<bool>(OsuSetting.BeatmapHitsounds)
},
};
@ -200,7 +201,7 @@ private class ExportSkinButton : SettingsButton
[BackgroundDependencyLoader]
private void load()
{
Text = "Export selected skin";
Text = SkinSettingsStrings.ExportSkinButton;
Action = export;
currentSkin = skins.CurrentSkin.GetBoundCopy();