mirror of
https://github.com/ppy/osu.git
synced 2024-12-15 01:52:55 +08:00
Add bindable flow for expanded leaderboard state
This commit is contained in:
parent
a6d163619a
commit
ee9e6fff40
@ -85,6 +85,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
|||||||
public void TestScoreUpdates()
|
public void TestScoreUpdates()
|
||||||
{
|
{
|
||||||
AddRepeatStep("update state", () => streamingClient.RandomlyUpdateState(), 100);
|
AddRepeatStep("update state", () => streamingClient.RandomlyUpdateState(), 100);
|
||||||
|
AddToggleStep("switch compact mode", expanded => leaderboard.Expanded.Value = expanded);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using JetBrains.Annotations;
|
using JetBrains.Annotations;
|
||||||
|
using osu.Framework.Bindables;
|
||||||
using osu.Framework.Caching;
|
using osu.Framework.Caching;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
@ -16,6 +17,8 @@ namespace osu.Game.Screens.Play.HUD
|
|||||||
{
|
{
|
||||||
private readonly Cached sorting = new Cached();
|
private readonly Cached sorting = new Cached();
|
||||||
|
|
||||||
|
public Bindable<bool> Expanded = new Bindable<bool>();
|
||||||
|
|
||||||
public GameplayLeaderboard()
|
public GameplayLeaderboard()
|
||||||
{
|
{
|
||||||
Width = GameplayLeaderboardScore.EXTENDED_WIDTH + GameplayLeaderboardScore.SHEAR_WIDTH;
|
Width = GameplayLeaderboardScore.EXTENDED_WIDTH + GameplayLeaderboardScore.SHEAR_WIDTH;
|
||||||
@ -49,6 +52,7 @@ namespace osu.Game.Screens.Play.HUD
|
|||||||
{
|
{
|
||||||
Anchor = Anchor.TopRight,
|
Anchor = Anchor.TopRight,
|
||||||
Origin = Anchor.TopRight,
|
Origin = Anchor.TopRight,
|
||||||
|
Expanded = { BindTarget = Expanded },
|
||||||
};
|
};
|
||||||
|
|
||||||
base.Add(drawable);
|
base.Add(drawable);
|
||||||
|
@ -30,6 +30,8 @@ namespace osu.Game.Screens.Play.HUD
|
|||||||
|
|
||||||
private const float panel_shear = 0.15f;
|
private const float panel_shear = 0.15f;
|
||||||
|
|
||||||
|
public Bindable<bool> Expanded = new Bindable<bool>();
|
||||||
|
|
||||||
private OsuSpriteText positionText, scoreText, accuracyText, comboText, usernameText;
|
private OsuSpriteText positionText, scoreText, accuracyText, comboText, usernameText;
|
||||||
|
|
||||||
public BindableDouble TotalScore { get; } = new BindableDouble();
|
public BindableDouble TotalScore { get; } = new BindableDouble();
|
||||||
|
Loading…
Reference in New Issue
Block a user