1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-06 09:03:01 +08:00

Merge pull request #30579 from peppy/fix-rank-display-song-select

Fix top rank display not showing up on beatmaps with many difficulties
This commit is contained in:
Bartłomiej Dach 2024-11-12 12:26:26 +01:00 committed by GitHub
commit c25215d2cf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 36 additions and 10 deletions

View File

@ -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" />

View File

@ -222,12 +222,6 @@ namespace osu.Game.Screens.Select
InternalChild = new Container
{
RelativeSizeAxes = Axes.Both,
Padding = new MarginPadding
{
// Avoid clash between scrollbar and osu! logo.
Top = 10,
Bottom = 100,
},
Children = new Drawable[]
{
setPool,
@ -1266,6 +1260,38 @@ namespace osu.Game.Screens.Select
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)

View File

@ -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" />
@ -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" />