Show tooltip on global offset adjust slider bar

This commit is contained in:
Dean Herbert 2024-01-17 17:57:49 +09:00
parent 123e36a999
commit cc7be137bc
No known key found for this signature in database
2 changed files with 9 additions and 2 deletions

View File

@ -12,12 +12,14 @@ using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Graphics.UserInterface;
using osu.Framework.Localisation;
using osu.Game.Configuration;
using osu.Game.Graphics;
using osu.Game.Graphics.Containers;
using osu.Game.Graphics.UserInterface;
using osu.Game.Graphics.UserInterfaceV2;
using osu.Game.Localisation;
using osu.Game.Screens.Play.PlayerSettings;
using osuTK;
namespace osu.Game.Overlays.Settings.Sections.Audio
@ -67,7 +69,7 @@ namespace osu.Game.Overlays.Settings.Sections.Audio
Direction = FillDirection.Vertical,
Children = new Drawable[]
{
new TimeSlider
new OffsetSliderBar
{
RelativeSizeAxes = Axes.X,
Current = { BindTarget = Current },
@ -157,6 +159,11 @@ namespace osu.Game.Overlays.Settings.Sections.Audio
: $@"Based on the last {averageHitErrorHistory.Count} play(s), the suggested offset is {SuggestedOffset.Value:N0} ms.";
applySuggestion.Enabled.Value = SuggestedOffset.Value != null;
}
private partial class OffsetSliderBar : RoundedSliderBar<double>
{
public override LocalisableString TooltipText => BeatmapOffsetControl.GetOffsetExplanatoryText(Current.Value);
}
}
}
}

View File

@ -307,7 +307,7 @@ namespace osu.Game.Screens.Play.PlayerSettings
}
}
public partial class OffsetSliderBar : PlayerSliderBar<double>
private partial class OffsetSliderBar : PlayerSliderBar<double>
{
protected override Drawable CreateControl() => new CustomSliderBar();