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