mirror of
https://github.com/ppy/osu.git
synced 2025-01-28 04:02:57 +08:00
Allow using SizeSlider
on different value types
This commit is contained in:
parent
f7edf25d4c
commit
7654584e40
@ -17,7 +17,7 @@ namespace osu.Game.Tests.Visual.UserInterface
|
||||
private TestExpandingContainer container;
|
||||
private SettingsToolboxGroup toolboxGroup;
|
||||
|
||||
private ExpandableSlider<float, SizeSlider> slider1;
|
||||
private ExpandableSlider<float, SizeSlider<float>> slider1;
|
||||
private ExpandableSlider<double> slider2;
|
||||
|
||||
[SetUp]
|
||||
@ -34,7 +34,7 @@ namespace osu.Game.Tests.Visual.UserInterface
|
||||
Width = 1,
|
||||
Children = new Drawable[]
|
||||
{
|
||||
slider1 = new ExpandableSlider<float, SizeSlider>
|
||||
slider1 = new ExpandableSlider<float, SizeSlider<float>>
|
||||
{
|
||||
Current = new BindableFloat
|
||||
{
|
||||
|
@ -19,7 +19,7 @@ namespace osu.Game.Overlays.Settings.Sections.Gameplay
|
||||
{
|
||||
Children = new Drawable[]
|
||||
{
|
||||
new SettingsSlider<float, SizeSlider>
|
||||
new SettingsSlider<float, SizeSlider<float>>
|
||||
{
|
||||
LabelText = SkinSettingsStrings.GameplayCursorSize,
|
||||
Current = config.GetBindable<float>(OsuSetting.GameplayCursorSize),
|
||||
|
@ -1,6 +1,7 @@
|
||||
// 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 System;
|
||||
using osu.Framework.Localisation;
|
||||
using osu.Game.Graphics.UserInterface;
|
||||
|
||||
@ -9,8 +10,9 @@ namespace osu.Game.Overlays.Settings.Sections
|
||||
/// <summary>
|
||||
/// A slider intended to show a "size" multiplier number, where 1x is 1.0.
|
||||
/// </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,
|
||||
Current = config.GetBindable<bool>(OsuSetting.CursorRotation)
|
||||
},
|
||||
new SettingsSlider<float, SizeSlider>
|
||||
new SettingsSlider<float, SizeSlider<float>>
|
||||
{
|
||||
LabelText = UserInterfaceStrings.MenuCursorSize,
|
||||
Current = config.GetBindable<float>(OsuSetting.MenuCursorSize),
|
||||
|
Loading…
Reference in New Issue
Block a user