2018-01-05 11:21:19 +00:00
|
|
|
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
2017-02-07 04:59:30 +00:00
|
|
|
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
2016-12-14 19:59:23 +00:00
|
|
|
|
|
2017-05-16 13:49:38 +00:00
|
|
|
|
using System;
|
2017-10-23 05:36:08 +00:00
|
|
|
|
using osu.Framework.Allocation;
|
2016-11-30 14:08:11 +00:00
|
|
|
|
using osu.Framework.Graphics;
|
2017-02-04 08:50:58 +00:00
|
|
|
|
using osu.Game.Graphics.UserInterface;
|
2016-11-30 14:08:11 +00:00
|
|
|
|
|
2017-05-15 01:55:29 +00:00
|
|
|
|
namespace osu.Game.Overlays.Settings
|
2016-12-07 20:39:21 +00:00
|
|
|
|
{
|
2017-05-15 01:55:29 +00:00
|
|
|
|
public class SettingsSlider<T> : SettingsSlider<T, OsuSliderBar<T>>
|
2018-01-10 06:41:13 +00:00
|
|
|
|
where T : struct, IEquatable<T>, IComparable, IConvertible
|
2016-12-07 20:39:21 +00:00
|
|
|
|
{
|
2017-04-21 11:59:04 +00:00
|
|
|
|
}
|
|
|
|
|
|
2017-05-15 01:55:29 +00:00
|
|
|
|
public class SettingsSlider<T, U> : SettingsItem<T>
|
2018-01-10 06:41:13 +00:00
|
|
|
|
where T : struct, IEquatable<T>, IComparable, IConvertible
|
2018-01-05 05:37:32 +00:00
|
|
|
|
where U : OsuSliderBar<T>, new()
|
2017-04-21 11:59:04 +00:00
|
|
|
|
{
|
2017-07-13 06:02:45 +00:00
|
|
|
|
protected override Drawable CreateControl() => new U
|
2016-12-07 20:39:21 +00:00
|
|
|
|
{
|
2017-05-04 14:07:24 +00:00
|
|
|
|
Margin = new MarginPadding { Top = 5, Bottom = 5 },
|
|
|
|
|
RelativeSizeAxes = Axes.X
|
|
|
|
|
};
|
2017-10-23 05:36:08 +00:00
|
|
|
|
|
|
|
|
|
public float KeyboardStep;
|
|
|
|
|
|
|
|
|
|
[BackgroundDependencyLoader]
|
|
|
|
|
private void load()
|
|
|
|
|
{
|
|
|
|
|
var slider = Control as U;
|
|
|
|
|
if (slider != null)
|
|
|
|
|
slider.KeyboardStep = KeyboardStep;
|
|
|
|
|
}
|
2016-12-07 20:39:21 +00:00
|
|
|
|
}
|
2016-12-09 13:18:58 +00:00
|
|
|
|
}
|