mirror of
https://github.com/ppy/osu.git
synced 2025-02-22 02:03:20 +08:00
Merge pull request #20564 from peppy/fix-gameplay-leaderboard-overlap
Adjust leaderboard score panels sizing based on accuracy/combo width
This commit is contained in:
commit
52dfca48b9
@ -52,7 +52,7 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="ppy.osu.Game.Resources" Version="2022.831.0" />
|
<PackageReference Include="ppy.osu.Game.Resources" Version="2022.831.0" />
|
||||||
<PackageReference Include="ppy.osu.Framework.Android" Version="2022.928.0" />
|
<PackageReference Include="ppy.osu.Framework.Android" Version="2022.1005.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup Label="Transitive Dependencies">
|
<ItemGroup Label="Transitive Dependencies">
|
||||||
<!-- Realm needs to be directly referenced in all Xamarin projects, as it will not pull in its transitive dependencies otherwise. -->
|
<!-- Realm needs to be directly referenced in all Xamarin projects, as it will not pull in its transitive dependencies otherwise. -->
|
||||||
|
@ -137,12 +137,13 @@ namespace osu.Desktop
|
|||||||
{
|
{
|
||||||
base.SetHost(host);
|
base.SetHost(host);
|
||||||
|
|
||||||
var iconStream = Assembly.GetExecutingAssembly().GetManifestResourceStream(GetType(), "lazer.ico");
|
|
||||||
|
|
||||||
var desktopWindow = (SDL2DesktopWindow)host.Window;
|
var desktopWindow = (SDL2DesktopWindow)host.Window;
|
||||||
|
|
||||||
|
var iconStream = Assembly.GetExecutingAssembly().GetManifestResourceStream(GetType(), "lazer.ico");
|
||||||
|
if (iconStream != null)
|
||||||
|
desktopWindow.SetIconFromStream(iconStream);
|
||||||
|
|
||||||
desktopWindow.CursorState |= CursorState.Hidden;
|
desktopWindow.CursorState |= CursorState.Hidden;
|
||||||
desktopWindow.SetIconFromStream(iconStream);
|
|
||||||
desktopWindow.Title = Name;
|
desktopWindow.Title = Name;
|
||||||
desktopWindow.DragDrop += f => fileDrop(new[] { f });
|
desktopWindow.DragDrop += f => fileDrop(new[] { f });
|
||||||
}
|
}
|
||||||
|
@ -66,7 +66,8 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
{
|
{
|
||||||
AddSliderStep("score", 0, 1000000, 500000, v => scoreProcessor.TotalScore.Value = v);
|
AddSliderStep("score", 0, 1000000, 500000, v => scoreProcessor.TotalScore.Value = v);
|
||||||
AddSliderStep("accuracy", 0f, 1f, 0.5f, v => scoreProcessor.Accuracy.Value = v);
|
AddSliderStep("accuracy", 0f, 1f, 0.5f, v => scoreProcessor.Accuracy.Value = v);
|
||||||
AddSliderStep("combo", 0, 1000, 0, v => scoreProcessor.HighestCombo.Value = v);
|
AddSliderStep("combo", 0, 10000, 0, v => scoreProcessor.HighestCombo.Value = v);
|
||||||
|
AddStep("toggle expanded", () => leaderboard.Expanded.Value = !leaderboard.Expanded.Value);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
#nullable disable
|
#nullable disable
|
||||||
|
|
||||||
|
using System;
|
||||||
using JetBrains.Annotations;
|
using JetBrains.Annotations;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
@ -39,8 +40,6 @@ namespace osu.Game.Screens.Play.HUD
|
|||||||
|
|
||||||
private const float rank_text_width = 35f;
|
private const float rank_text_width = 35f;
|
||||||
|
|
||||||
private const float score_components_width = 85f;
|
|
||||||
|
|
||||||
private const float avatar_size = 25f;
|
private const float avatar_size = 25f;
|
||||||
|
|
||||||
private const double panel_transition_duration = 500;
|
private const double panel_transition_duration = 500;
|
||||||
@ -161,7 +160,7 @@ namespace osu.Game.Screens.Play.HUD
|
|||||||
{
|
{
|
||||||
new Dimension(GridSizeMode.Absolute, rank_text_width),
|
new Dimension(GridSizeMode.Absolute, rank_text_width),
|
||||||
new Dimension(),
|
new Dimension(),
|
||||||
new Dimension(GridSizeMode.AutoSize, maxSize: score_components_width),
|
new Dimension(GridSizeMode.AutoSize),
|
||||||
},
|
},
|
||||||
Content = new[]
|
Content = new[]
|
||||||
{
|
{
|
||||||
@ -286,8 +285,19 @@ namespace osu.Game.Screens.Play.HUD
|
|||||||
LoadComponentAsync(new DrawableAvatar(User), avatarContainer.Add);
|
LoadComponentAsync(new DrawableAvatar(User), avatarContainer.Add);
|
||||||
|
|
||||||
TotalScore.BindValueChanged(v => scoreText.Text = v.NewValue.ToString("N0"), true);
|
TotalScore.BindValueChanged(v => scoreText.Text = v.NewValue.ToString("N0"), true);
|
||||||
Accuracy.BindValueChanged(v => accuracyText.Text = v.NewValue.FormatAccuracy(), true);
|
|
||||||
Combo.BindValueChanged(v => comboText.Text = $"{v.NewValue}x", true);
|
Accuracy.BindValueChanged(v =>
|
||||||
|
{
|
||||||
|
accuracyText.Text = v.NewValue.FormatAccuracy();
|
||||||
|
updateDetailsWidth();
|
||||||
|
}, true);
|
||||||
|
|
||||||
|
Combo.BindValueChanged(v =>
|
||||||
|
{
|
||||||
|
comboText.Text = $"{v.NewValue}x";
|
||||||
|
updateDetailsWidth();
|
||||||
|
}, true);
|
||||||
|
|
||||||
HasQuit.BindValueChanged(_ => updateState());
|
HasQuit.BindValueChanged(_ => updateState());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -303,13 +313,10 @@ namespace osu.Game.Screens.Play.HUD
|
|||||||
|
|
||||||
private void changeExpandedState(ValueChangedEvent<bool> expanded)
|
private void changeExpandedState(ValueChangedEvent<bool> expanded)
|
||||||
{
|
{
|
||||||
scoreComponents.ClearTransforms();
|
|
||||||
|
|
||||||
if (expanded.NewValue)
|
if (expanded.NewValue)
|
||||||
{
|
{
|
||||||
gridContainer.ResizeWidthTo(regular_width, panel_transition_duration, Easing.OutQuint);
|
gridContainer.ResizeWidthTo(regular_width, panel_transition_duration, Easing.OutQuint);
|
||||||
|
|
||||||
scoreComponents.ResizeWidthTo(score_components_width, panel_transition_duration, Easing.OutQuint);
|
|
||||||
scoreComponents.FadeIn(panel_transition_duration, Easing.OutQuint);
|
scoreComponents.FadeIn(panel_transition_duration, Easing.OutQuint);
|
||||||
|
|
||||||
usernameText.FadeIn(panel_transition_duration, Easing.OutQuint);
|
usernameText.FadeIn(panel_transition_duration, Easing.OutQuint);
|
||||||
@ -318,11 +325,29 @@ namespace osu.Game.Screens.Play.HUD
|
|||||||
{
|
{
|
||||||
gridContainer.ResizeWidthTo(compact_width, panel_transition_duration, Easing.OutQuint);
|
gridContainer.ResizeWidthTo(compact_width, panel_transition_duration, Easing.OutQuint);
|
||||||
|
|
||||||
scoreComponents.ResizeWidthTo(0, panel_transition_duration, Easing.OutQuint);
|
|
||||||
scoreComponents.FadeOut(text_transition_duration, Easing.OutQuint);
|
scoreComponents.FadeOut(text_transition_duration, Easing.OutQuint);
|
||||||
|
|
||||||
usernameText.FadeOut(text_transition_duration, Easing.OutQuint);
|
usernameText.FadeOut(text_transition_duration, Easing.OutQuint);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
updateDetailsWidth();
|
||||||
|
}
|
||||||
|
|
||||||
|
private float? scoreComponentsTargetWidth;
|
||||||
|
|
||||||
|
private void updateDetailsWidth()
|
||||||
|
{
|
||||||
|
const float score_components_min_width = 88f;
|
||||||
|
|
||||||
|
float newWidth = Expanded.Value
|
||||||
|
? Math.Max(score_components_min_width, comboText.DrawWidth + accuracyText.DrawWidth + 25)
|
||||||
|
: 0;
|
||||||
|
|
||||||
|
if (scoreComponentsTargetWidth == newWidth)
|
||||||
|
return;
|
||||||
|
|
||||||
|
scoreComponentsTargetWidth = newWidth;
|
||||||
|
scoreComponents.ResizeWidthTo(newWidth, panel_transition_duration, Easing.OutQuint);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateState()
|
private void updateState()
|
||||||
|
@ -35,7 +35,7 @@
|
|||||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Realm" Version="10.15.1" />
|
<PackageReference Include="Realm" Version="10.15.1" />
|
||||||
<PackageReference Include="ppy.osu.Framework" Version="2022.928.0" />
|
<PackageReference Include="ppy.osu.Framework" Version="2022.1005.0" />
|
||||||
<PackageReference Include="ppy.osu.Game.Resources" Version="2022.831.0" />
|
<PackageReference Include="ppy.osu.Game.Resources" Version="2022.831.0" />
|
||||||
<PackageReference Include="Sentry" Version="3.20.1" />
|
<PackageReference Include="Sentry" Version="3.20.1" />
|
||||||
<PackageReference Include="SharpCompress" Version="0.32.2" />
|
<PackageReference Include="SharpCompress" Version="0.32.2" />
|
||||||
|
@ -61,7 +61,7 @@
|
|||||||
<Reference Include="System.Net.Http" />
|
<Reference Include="System.Net.Http" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup Label="Package References">
|
<ItemGroup Label="Package References">
|
||||||
<PackageReference Include="ppy.osu.Framework.iOS" Version="2022.928.0" />
|
<PackageReference Include="ppy.osu.Framework.iOS" Version="2022.1005.0" />
|
||||||
<PackageReference Include="ppy.osu.Game.Resources" Version="2022.831.0" />
|
<PackageReference Include="ppy.osu.Game.Resources" Version="2022.831.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<!-- See https://github.com/dotnet/runtime/issues/35988 (can be removed after Xamarin uses net6.0) -->
|
<!-- See https://github.com/dotnet/runtime/issues/35988 (can be removed after Xamarin uses net6.0) -->
|
||||||
@ -82,7 +82,7 @@
|
|||||||
<PackageReference Include="DiffPlex" Version="1.7.1" />
|
<PackageReference Include="DiffPlex" Version="1.7.1" />
|
||||||
<PackageReference Include="Humanizer" Version="2.14.1" />
|
<PackageReference Include="Humanizer" Version="2.14.1" />
|
||||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
|
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
|
||||||
<PackageReference Include="ppy.osu.Framework" Version="2022.928.0" />
|
<PackageReference Include="ppy.osu.Framework" Version="2022.1005.0" />
|
||||||
<PackageReference Include="SharpCompress" Version="0.32.1" />
|
<PackageReference Include="SharpCompress" Version="0.32.1" />
|
||||||
<PackageReference Include="NUnit" Version="3.13.3" />
|
<PackageReference Include="NUnit" Version="3.13.3" />
|
||||||
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
|
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
|
||||||
|
Loading…
Reference in New Issue
Block a user