Skip to content

Commit

Permalink
Merge pull request #30579 from peppy/fix-rank-display-song-select
Browse files Browse the repository at this point in the history
Fix top rank display not showing up on beatmaps with many difficulties
  • Loading branch information
bdach authored Nov 12, 2024
2 parents 678d14a + 8c5785f commit c25215d
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 10 deletions.
2 changes: 1 addition & 1 deletion osu.Desktop/osu.Desktop.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<ItemGroup Label="Package References">
<PackageReference Include="System.IO.Packaging" Version="8.0.1" />
<PackageReference Include="DiscordRichPresence" Version="1.2.1.24" />
<PackageReference Include="Velopack" Version="0.0.630-g9c52e40" />
<PackageReference Include="Velopack" Version="0.0.869" />
</ItemGroup>
<ItemGroup Label="Resources">
<EmbeddedResource Include="lazer.ico" />
Expand Down
38 changes: 32 additions & 6 deletions osu.Game/Screens/Select/BeatmapCarousel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -222,12 +222,6 @@ public BeatmapCarousel(FilterCriteria initialCriteria)
InternalChild = new Container
{
RelativeSizeAxes = Axes.Both,
Padding = new MarginPadding
{
// Avoid clash between scrollbar and osu! logo.
Top = 10,
Bottom = 100,
},
Children = new Drawable[]
{
setPool,
Expand Down Expand Up @@ -1266,6 +1260,38 @@ protected override bool OnDragStart(DragStartEvent e)

return base.OnDragStart(e);
}

protected override ScrollbarContainer CreateScrollbar(Direction direction)
{
return new PaddedScrollbar();
}

protected partial class PaddedScrollbar : OsuScrollbar
{
public PaddedScrollbar()
: base(Direction.Vertical)
{
}
}

private const float top_padding = 10;
private const float bottom_padding = 70;

protected override float ToScrollbarPosition(float scrollPosition)
{
if (Precision.AlmostEquals(0, ScrollableExtent))
return 0;

return top_padding + (ScrollbarMovementExtent - (top_padding + bottom_padding)) * (scrollPosition / ScrollableExtent);
}

protected override float FromScrollbarPosition(float scrollbarPosition)
{
if (Precision.AlmostEquals(0, ScrollbarMovementExtent))
return 0;

return ScrollableExtent * ((scrollbarPosition - top_padding) / (ScrollbarMovementExtent - (top_padding + bottom_padding)));
}
}

protected override void Dispose(bool isDisposing)
Expand Down
6 changes: 3 additions & 3 deletions osu.Game/osu.Game.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<ItemGroup Label="Package References">
<PackageReference Include="AutoMapper" Version="13.0.1" />
<PackageReference Include="DiffPlex" Version="1.7.2" />
<PackageReference Include="HtmlAgilityPack" Version="1.11.67" />
<PackageReference Include="HtmlAgilityPack" Version="1.11.70" />
<PackageReference Include="Humanizer" Version="2.14.1" />
<PackageReference Include="MessagePack" Version="2.5.187" />
<PackageReference Include="Microsoft.AspNetCore.SignalR.Client" Version="8.0.10" />
Expand All @@ -35,9 +35,9 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Realm" Version="11.5.0" />
<PackageReference Include="ppy.osu.Framework" Version="2024.1025.0" />
<PackageReference Include="ppy.osu.Framework" Version="2024.1111.0" />
<PackageReference Include="ppy.osu.Game.Resources" Version="2024.1106.0" />
<PackageReference Include="Sentry" Version="4.12.1" />
<PackageReference Include="Sentry" Version="4.13.0" />
<!-- Held back due to 0.34.0 failing AOT compilation on ZstdSharp.dll dependency. -->
<PackageReference Include="SharpCompress" Version="0.38.0" />
<PackageReference Include="NUnit" Version="3.14.0" />
Expand Down

0 comments on commit c25215d

Please sign in to comment.