Skip to content

Commit

Permalink
Add setting to configure team seed display
Browse files Browse the repository at this point in the history
  • Loading branch information
frenzibyte committed Oct 28, 2023
1 parent 28e331d commit e2788a2
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
2 changes: 2 additions & 0 deletions osu.Game.Tournament/Models/LadderInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,7 @@ public class LadderInfo
public Bindable<bool> AutoProgressScreens = new BindableBool(true);

public Bindable<bool> SplitMapPoolByMods = new BindableBool(true);

public Bindable<bool> DisplayTeamSeeds = new BindableBool();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// See the LICENCE file in the repository root for full licence text.

using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Game.Tournament.Components;
Expand All @@ -16,6 +17,8 @@ public partial class MatchHeader : Container
private TeamScoreDisplay teamDisplay2 = null!;
private DrawableTournamentHeaderLogo logo = null!;

public readonly BindableBool DisplaySeeds = new BindableBool();

private bool showScores = true;

public bool ShowScores
Expand Down Expand Up @@ -88,11 +91,13 @@ private void load()
{
Anchor = Anchor.TopLeft,
Origin = Anchor.TopLeft,
DisplaySeed = { BindTarget = DisplaySeeds },
},
teamDisplay2 = new TeamScoreDisplay(TeamColour.Blue)
{
Anchor = Anchor.TopRight,
Origin = Anchor.TopRight,
DisplaySeed = { BindTarget = DisplaySeeds },
},
};
}
Expand Down
12 changes: 9 additions & 3 deletions osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public partial class GameplayScreen : BeatmapInfoScreen
private Drawable chroma = null!;

[BackgroundDependencyLoader]
private void load(LadderInfo ladder, MatchIPCInfo ipc)
private void load(MatchIPCInfo ipc)
{
this.ipc = ipc;

Expand Down Expand Up @@ -118,12 +118,18 @@ private void load(LadderInfo ladder, MatchIPCInfo ipc)
LabelText = "Players per team",
Current = LadderInfo.PlayersPerTeam,
KeyboardStep = 1,
}
},
new SettingsCheckbox
{
LabelText = "Display team seeds",
Current = LadderInfo.DisplayTeamSeeds,
},
}
}
});

ladder.ChromaKeyWidth.BindValueChanged(width => chroma.Width = width.NewValue, true);
LadderInfo.ChromaKeyWidth.BindValueChanged(width => chroma.Width = width.NewValue, true);
LadderInfo.DisplayTeamSeeds.BindValueChanged(v => header.DisplaySeeds.Value = v.NewValue, true);

warmup.BindValueChanged(w =>
{
Expand Down

0 comments on commit e2788a2

Please sign in to comment.