mirror of
https://github.com/ppy/osu.git
synced 2025-01-28 02:43:19 +08:00
Centralise implementation of slider bars which display millisecond time values
This commit is contained in:
parent
7854a0a913
commit
33862fc0db
@ -45,10 +45,5 @@ namespace osu.Game.Rulesets.Mania
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
private class TimeSlider : OsuSliderBar<double>
|
|
||||||
{
|
|
||||||
protected override LocalisableString GetTooltipText(double value) => $"{value:N0} ms";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
15
osu.Game/Graphics/UserInterface/TimeSlider.cs
Normal file
15
osu.Game/Graphics/UserInterface/TimeSlider.cs
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
// 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.Graphics.UserInterface
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// A slider bar which displays a millisecond time value.
|
||||||
|
/// </summary>
|
||||||
|
public class TimeSlider : OsuSliderBar<double>
|
||||||
|
{
|
||||||
|
protected override LocalisableString GetTooltipText(double value) => $"{value:N0} ms";
|
||||||
|
}
|
||||||
|
}
|
@ -23,7 +23,7 @@ namespace osu.Game.Overlays.Settings.Sections.Audio
|
|||||||
{
|
{
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
new SettingsSlider<double, OffsetSlider>
|
new SettingsSlider<double, TimeSlider>
|
||||||
{
|
{
|
||||||
LabelText = AudioSettingsStrings.AudioOffset,
|
LabelText = AudioSettingsStrings.AudioOffset,
|
||||||
Current = config.GetBindable<double>(OsuSetting.AudioOffset),
|
Current = config.GetBindable<double>(OsuSetting.AudioOffset),
|
||||||
@ -35,10 +35,5 @@ namespace osu.Game.Overlays.Settings.Sections.Audio
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
private class OffsetSlider : OsuSliderBar<double>
|
|
||||||
{
|
|
||||||
protected override LocalisableString GetTooltipText(double value) => value.ToString(@"0ms");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -43,10 +43,5 @@ namespace osu.Game.Overlays.Settings.Sections.UserInterface
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
private class TimeSlider : OsuSliderBar<double>
|
|
||||||
{
|
|
||||||
protected override LocalisableString GetTooltipText(double value) => $"{value:N0} ms";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user