1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-21 17:27:24 +08:00

Merge pull request #26591 from peppy/offset-awareness

Show offset explanation tooltip on settings offset adjust slider bar
This commit is contained in:
Bartłomiej Dach 2024-01-22 14:59:31 +01:00 committed by GitHub
commit 95435ecd13
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 12 additions and 5 deletions

View File

@ -10,9 +10,9 @@ namespace osu.Game.Localisation
private const string prefix = @"osu.Game.Resources.Localisation.BeatmapOffsetControl";
/// <summary>
/// "Beatmap offset"
/// "Audio offset (this beatmap)"
/// </summary>
public static LocalisableString BeatmapOffset => new TranslatableString(getKey(@"beatmap_offset"), @"Beatmap offset");
public static LocalisableString AudioOffsetThisBeatmap => new TranslatableString(getKey(@"beatmap_offset"), @"Audio offset (this beatmap)");
/// <summary>
/// "Previous play:"

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

@ -86,7 +86,7 @@ namespace osu.Game.Screens.Play.PlayerSettings
new OffsetSliderBar
{
KeyboardStep = 5,
LabelText = BeatmapOffsetControlStrings.BeatmapOffset,
LabelText = BeatmapOffsetControlStrings.AudioOffsetThisBeatmap,
Current = Current,
},
referenceScoreContainer = new FillFlowContainer
@ -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();