mirror of https://github.com/ppy/osu
Automatically select new match in ladder editor after adding
This commit is contained in:
parent
dd32b771cf
commit
e46385ee6a
|
@ -78,8 +78,12 @@ public MenuItem[] ContextMenuItems
|
|||
{
|
||||
new OsuMenuItem("Create new match", MenuItemType.Highlighted, () =>
|
||||
{
|
||||
var pos = MatchesContainer.ToLocalSpace(GetContainingInputManager().CurrentState.Mouse.Position);
|
||||
LadderInfo.Matches.Add(new TournamentMatch { Position = { Value = new Point((int)pos.X, (int)pos.Y) } });
|
||||
Vector2 pos = MatchesContainer.ToLocalSpace(GetContainingInputManager().CurrentState.Mouse.Position);
|
||||
TournamentMatch newMatch = new TournamentMatch { Position = { Value = new Point((int)pos.X, (int)pos.Y) } };
|
||||
|
||||
LadderInfo.Matches.Add(newMatch);
|
||||
|
||||
editorInfo.Selected.Value = newMatch;
|
||||
}),
|
||||
new OsuMenuItem("Reset teams", MenuItemType.Destructive, () =>
|
||||
{
|
||||
|
|
|
@ -250,10 +250,7 @@ protected override void LoadComplete()
|
|||
if (editorInfo != null)
|
||||
{
|
||||
globalSelection = editorInfo.Selected.GetBoundCopy();
|
||||
globalSelection.BindValueChanged(s =>
|
||||
{
|
||||
if (s.NewValue != Match) Selected = false;
|
||||
});
|
||||
globalSelection.BindValueChanged(s => Selected = s.NewValue == Match, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue