mirror of
https://github.com/osukey/osukey.git
synced 2025-08-05 07:33:55 +09:00
Hide score displays during warmup
This commit is contained in:
@ -15,6 +15,18 @@ namespace osu.Game.Tournament.Screens.Gameplay.Components
|
||||
{
|
||||
public class MatchHeader : Container
|
||||
{
|
||||
private TeamScoreDisplay teamDisplay1;
|
||||
private TeamScoreDisplay teamDisplay2;
|
||||
|
||||
public bool ShowScores
|
||||
{
|
||||
set
|
||||
{
|
||||
teamDisplay1.ShowScore = value;
|
||||
teamDisplay2.ShowScore = value;
|
||||
}
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load()
|
||||
{
|
||||
@ -43,13 +55,12 @@ namespace osu.Game.Tournament.Screens.Gameplay.Components
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
new TeamScoreDisplay(TeamColour.Red)
|
||||
teamDisplay1 = new TeamScoreDisplay(TeamColour.Red)
|
||||
{
|
||||
Anchor = Anchor.TopLeft,
|
||||
Origin = Anchor.TopLeft,
|
||||
},
|
||||
new TeamScoreDisplay(TeamColour.Blue)
|
||||
teamDisplay2 = new TeamScoreDisplay(TeamColour.Blue)
|
||||
{
|
||||
Anchor = Anchor.TopRight,
|
||||
Origin = Anchor.TopRight,
|
||||
@ -66,6 +77,10 @@ namespace osu.Game.Tournament.Screens.Gameplay.Components
|
||||
private readonly Bindable<TournamentTeam> currentTeam = new Bindable<TournamentTeam>();
|
||||
private readonly Bindable<int?> currentTeamScore = new Bindable<int?>();
|
||||
|
||||
private TeamDisplay teamDisplay;
|
||||
|
||||
public bool ShowScore { set => teamDisplay.ShowScore = value; }
|
||||
|
||||
public TeamScoreDisplay(TeamColour teamColour)
|
||||
{
|
||||
this.teamColour = teamColour;
|
||||
@ -116,7 +131,7 @@ namespace osu.Game.Tournament.Screens.Gameplay.Components
|
||||
{
|
||||
InternalChildren = new Drawable[]
|
||||
{
|
||||
new TeamDisplay(team, teamColour, currentTeamScore, currentMatch.Value.PointsToWin),
|
||||
teamDisplay = new TeamDisplay(team, teamColour, currentTeamScore, currentMatch.Value.PointsToWin),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@ -12,6 +12,10 @@ namespace osu.Game.Tournament.Screens.Gameplay.Components
|
||||
{
|
||||
public class TeamDisplay : DrawableTournamentTeam
|
||||
{
|
||||
private readonly TeamScore score;
|
||||
|
||||
public bool ShowScore { set => score.FadeTo(value ? 1 : 0, 200); }
|
||||
|
||||
public TeamDisplay(TournamentTeam team, TeamColour colour, Bindable<int?> currentTeamScore, int pointsToWin)
|
||||
: base(team)
|
||||
{
|
||||
@ -63,7 +67,7 @@ namespace osu.Game.Tournament.Screens.Gameplay.Components
|
||||
Origin = anchor,
|
||||
Anchor = anchor,
|
||||
},
|
||||
new TeamScore(currentTeamScore, colour, pointsToWin)
|
||||
score = new TeamScore(currentTeamScore, colour, pointsToWin)
|
||||
{
|
||||
Origin = anchor,
|
||||
Anchor = anchor,
|
||||
|
Reference in New Issue
Block a user