mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 16:29:58 +09:00
Allow using SizeSlider
on different value types
This commit is contained in:
@ -17,7 +17,7 @@ namespace osu.Game.Tests.Visual.UserInterface
|
|||||||
private TestExpandingContainer container;
|
private TestExpandingContainer container;
|
||||||
private SettingsToolboxGroup toolboxGroup;
|
private SettingsToolboxGroup toolboxGroup;
|
||||||
|
|
||||||
private ExpandableSlider<float, SizeSlider> slider1;
|
private ExpandableSlider<float, SizeSlider<float>> slider1;
|
||||||
private ExpandableSlider<double> slider2;
|
private ExpandableSlider<double> slider2;
|
||||||
|
|
||||||
[SetUp]
|
[SetUp]
|
||||||
@ -34,7 +34,7 @@ namespace osu.Game.Tests.Visual.UserInterface
|
|||||||
Width = 1,
|
Width = 1,
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
slider1 = new ExpandableSlider<float, SizeSlider>
|
slider1 = new ExpandableSlider<float, SizeSlider<float>>
|
||||||
{
|
{
|
||||||
Current = new BindableFloat
|
Current = new BindableFloat
|
||||||
{
|
{
|
||||||
|
@ -19,7 +19,7 @@ namespace osu.Game.Overlays.Settings.Sections.Gameplay
|
|||||||
{
|
{
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
new SettingsSlider<float, SizeSlider>
|
new SettingsSlider<float, SizeSlider<float>>
|
||||||
{
|
{
|
||||||
LabelText = SkinSettingsStrings.GameplayCursorSize,
|
LabelText = SkinSettingsStrings.GameplayCursorSize,
|
||||||
Current = config.GetBindable<float>(OsuSetting.GameplayCursorSize),
|
Current = config.GetBindable<float>(OsuSetting.GameplayCursorSize),
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// 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.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
|
using System;
|
||||||
using osu.Framework.Localisation;
|
using osu.Framework.Localisation;
|
||||||
using osu.Game.Graphics.UserInterface;
|
using osu.Game.Graphics.UserInterface;
|
||||||
|
|
||||||
@ -9,8 +10,9 @@ namespace osu.Game.Overlays.Settings.Sections
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A slider intended to show a "size" multiplier number, where 1x is 1.0.
|
/// A slider intended to show a "size" multiplier number, where 1x is 1.0.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal class SizeSlider : OsuSliderBar<float>
|
internal class SizeSlider<T> : OsuSliderBar<T>
|
||||||
|
where T : struct, IEquatable<T>, IComparable<T>, IConvertible, IFormattable
|
||||||
{
|
{
|
||||||
public override LocalisableString TooltipText => Current.Value.ToString(@"0.##x");
|
public override LocalisableString TooltipText => Current.Value.ToString(@"0.##x", null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,7 @@ namespace osu.Game.Overlays.Settings.Sections.UserInterface
|
|||||||
LabelText = UserInterfaceStrings.CursorRotation,
|
LabelText = UserInterfaceStrings.CursorRotation,
|
||||||
Current = config.GetBindable<bool>(OsuSetting.CursorRotation)
|
Current = config.GetBindable<bool>(OsuSetting.CursorRotation)
|
||||||
},
|
},
|
||||||
new SettingsSlider<float, SizeSlider>
|
new SettingsSlider<float, SizeSlider<float>>
|
||||||
{
|
{
|
||||||
LabelText = UserInterfaceStrings.MenuCursorSize,
|
LabelText = UserInterfaceStrings.MenuCursorSize,
|
||||||
Current = config.GetBindable<float>(OsuSetting.MenuCursorSize),
|
Current = config.GetBindable<float>(OsuSetting.MenuCursorSize),
|
||||||
|
Reference in New Issue
Block a user