1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-21 21:32:55 +08:00

Fix warmup state, automate more

This commit is contained in:
Dean Herbert 2018-11-11 09:22:57 +09:00
parent 2683b161d5
commit e3576572a3

View File

@ -1,7 +1,6 @@
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>. // Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using Microsoft.Diagnostics.Runtime.Interop;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Configuration; using osu.Framework.Configuration;
using osu.Framework.Graphics; using osu.Framework.Graphics;
@ -33,17 +32,12 @@ namespace osu.Game.Tournament.Screens.Gameplay
AddRange(new Drawable[] AddRange(new Drawable[]
{ {
new MatchHeader(), new MatchHeader(),
// new CustomChatOverlay
// {
// Anchor = Anchor.BottomCentre,
// Origin = Anchor.BottomCentre,
// Size = new Vector2(0.4f, 1)
// },
new Box new Box
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Height = 720 / 1080f, Height = 720 / 1080f,
Colour = new Color4(0, 255, 0, 255), Colour = new Color4(0, 255, 0, 255),
Y = 16,
Anchor = Anchor.Centre, Anchor = Anchor.Centre,
Origin= Anchor.Centre, Origin= Anchor.Centre,
}, },
@ -53,7 +47,6 @@ namespace osu.Game.Tournament.Screens.Gameplay
{ {
warmupButton = new TriangleButton warmupButton = new TriangleButton
{ {
Colour = Color4.Gray,
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
Text = "Toggle warmup", Text = "Toggle warmup",
Action = () => warmup.Toggle() Action = () => warmup.Toggle()
@ -65,9 +58,10 @@ namespace osu.Game.Tournament.Screens.Gameplay
State.BindValueChanged(stateChanged); State.BindValueChanged(stateChanged);
State.BindTo(ipc.State); State.BindTo(ipc.State);
currentMatch.BindValueChanged(m => warmup.Value = m.Team1Score + m.Team2Score == 0);
currentMatch.BindTo(ladder.CurrentMatch); currentMatch.BindTo(ladder.CurrentMatch);
warmup.BindValueChanged(w => warmupButton.Colour = !w ? Color4.White : Color4.Gray, true); warmup.BindValueChanged(w => warmupButton.Alpha = !w ? 0.5f : 1, true);
} }
private ScheduledDelegate scheduledBarContract; private ScheduledDelegate scheduledBarContract;