From fa7bd482d2d90df9a1b916a4634e324281b5eb2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Wed, 15 Oct 2025 10:04:00 +0200 Subject: [PATCH] Show sample suffix on timeline pieces --- .../Compose/Components/Timeline/SamplePointPiece.cs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/osu.Game/Screens/Edit/Compose/Components/Timeline/SamplePointPiece.cs b/osu.Game/Screens/Edit/Compose/Components/Timeline/SamplePointPiece.cs index cdd2f52dab..eaf9069431 100644 --- a/osu.Game/Screens/Edit/Compose/Components/Timeline/SamplePointPiece.cs +++ b/osu.Game/Screens/Edit/Compose/Components/Timeline/SamplePointPiece.cs @@ -127,7 +127,7 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline private void updateText() { - Label.Text = $"{abbreviateBank(GetBankValue(GetSamples()))} {GetVolumeValue(GetSamples())}"; + Label.Text = $"{abbreviateBank(GetBankValue(GetSamples()))}{GetSuffix(GetSamples())} {GetVolumeValue(GetSamples())}"; if (!contracted.Value) LabelContainer.ResizeWidthTo(Label.Width, 200, Easing.OutQuint); @@ -149,6 +149,17 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline return samples.FirstOrDefault(o => o.Name == HitSampleInfo.HIT_NORMAL)?.Bank; } + public static string GetSuffix(IEnumerable samples) + { + var suffixes = samples.Select(o => o.Suffix).Distinct().ToList(); + + // having multiple values should never happen, but just for safety... + if (suffixes.Count != 1 || suffixes.Single() is not string commonSuffix) + return string.Empty; + + return $@":{commonSuffix}"; + } + public static string? GetAdditionBankValue(IEnumerable samples) { var firstAddition = samples.FirstOrDefault(o => o.Name != HitSampleInfo.HIT_NORMAL);