mirror of
https://github.com/ppy/osu.git
synced 2025-01-13 02:32:55 +08:00
Actually add match score display to gameplay screen
This commit is contained in:
parent
26286177d3
commit
9f519d7002
@ -35,6 +35,7 @@ namespace osu.Game.Tournament.Screens.Gameplay.Components
|
|||||||
public MatchScoreDisplay()
|
public MatchScoreDisplay()
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.X;
|
RelativeSizeAxes = Axes.X;
|
||||||
|
AutoSizeAxes = Axes.Y;
|
||||||
|
|
||||||
InternalChildren = new Drawable[]
|
InternalChildren = new Drawable[]
|
||||||
{
|
{
|
||||||
@ -102,12 +103,12 @@ namespace osu.Game.Tournament.Screens.Gameplay.Components
|
|||||||
var diff = Math.Max(score1.Value, score2.Value) - Math.Min(score1.Value, score2.Value);
|
var diff = Math.Max(score1.Value, score2.Value) - Math.Min(score1.Value, score2.Value);
|
||||||
|
|
||||||
losingBar.ResizeWidthTo(0, 400, Easing.OutQuint);
|
losingBar.ResizeWidthTo(0, 400, Easing.OutQuint);
|
||||||
winningBar.ResizeWidthTo((float)Math.Pow(diff / 1000000f, 0.5), 400, Easing.OutQuint);
|
winningBar.ResizeWidthTo((float)Math.Pow(diff / 1000000f, 0.5) / 2, 400, Easing.OutQuint);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void UpdateAfterChildren()
|
protected override void Update()
|
||||||
{
|
{
|
||||||
base.UpdateAfterChildren();
|
base.Update();
|
||||||
|
|
||||||
score1Text.X = -Math.Max(5 + score1Text.DrawWidth / 2, score1Bar.DrawWidth);
|
score1Text.X = -Math.Max(5 + score1Text.DrawWidth / 2, score1Bar.DrawWidth);
|
||||||
score2Text.X = Math.Max(5 + score2Text.DrawWidth / 2, score2Bar.DrawWidth);
|
score2Text.X = Math.Max(5 + score2Text.DrawWidth / 2, score2Bar.DrawWidth);
|
||||||
|
@ -92,6 +92,12 @@ namespace osu.Game.Tournament.Screens.Gameplay
|
|||||||
Anchor = Anchor.BottomCentre,
|
Anchor = Anchor.BottomCentre,
|
||||||
Origin = Anchor.BottomCentre,
|
Origin = Anchor.BottomCentre,
|
||||||
},
|
},
|
||||||
|
scoreDisplay = new MatchScoreDisplay
|
||||||
|
{
|
||||||
|
Y = -65,
|
||||||
|
Anchor = Anchor.BottomCentre,
|
||||||
|
Origin = Anchor.BottomCentre,
|
||||||
|
},
|
||||||
new ControlPanel
|
new ControlPanel
|
||||||
{
|
{
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
@ -123,6 +129,7 @@ namespace osu.Game.Tournament.Screens.Gameplay
|
|||||||
|
|
||||||
private ScheduledDelegate scheduledBarContract;
|
private ScheduledDelegate scheduledBarContract;
|
||||||
private MatchChatDisplay chat;
|
private MatchChatDisplay chat;
|
||||||
|
private MatchScoreDisplay scoreDisplay;
|
||||||
|
|
||||||
private void stateChanged(TourneyState state)
|
private void stateChanged(TourneyState state)
|
||||||
{
|
{
|
||||||
@ -142,13 +149,17 @@ namespace osu.Game.Tournament.Screens.Gameplay
|
|||||||
{
|
{
|
||||||
chat.FadeOut(200);
|
chat.FadeOut(200);
|
||||||
chat.MoveToY(100, 500, Easing.In);
|
chat.MoveToY(100, 500, Easing.In);
|
||||||
using (SongBar.BeginDelayedSequence(300, true))
|
using (BeginDelayedSequence(300, true))
|
||||||
|
{
|
||||||
|
scoreDisplay.FadeIn(100);
|
||||||
SongBar.Expanded = true;
|
SongBar.Expanded = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void contract()
|
void contract()
|
||||||
{
|
{
|
||||||
SongBar.Expanded = false;
|
SongBar.Expanded = false;
|
||||||
|
scoreDisplay.FadeOut(100);
|
||||||
using (chat.BeginDelayedSequence(500))
|
using (chat.BeginDelayedSequence(500))
|
||||||
{
|
{
|
||||||
chat.FadeIn(300);
|
chat.FadeIn(300);
|
||||||
|
Loading…
Reference in New Issue
Block a user