Merge remote-tracking branch 'upstream/master' into custom-ipc-location

This commit is contained in:
Shivam
2020-05-17 12:44:12 +02:00
169 changed files with 56 additions and 1487 deletions

View File

@ -25,7 +25,11 @@ namespace osu.Game.Tournament.Screens.Editors
protected override BindableList<SeedingResult> Storage => team.SeedingResults;
public SeedingEditorScreen(TournamentTeam team)
[Resolved(canBeNull: true)]
private TournamentSceneManager sceneManager { get; set; }
public SeedingEditorScreen(TournamentTeam team, TournamentScreen parentScreen)
: base(parentScreen)
{
this.team = team;
}

View File

@ -38,7 +38,7 @@ namespace osu.Game.Tournament.Screens.Editors
});
}
protected override TeamRow CreateDrawable(TournamentTeam model) => new TeamRow(model);
protected override TeamRow CreateDrawable(TournamentTeam model) => new TeamRow(model, this);
private void addAllCountries()
{
@ -63,7 +63,7 @@ namespace osu.Game.Tournament.Screens.Editors
[Resolved]
private LadderInfo ladderInfo { get; set; }
public TeamRow(TournamentTeam team)
public TeamRow(TournamentTeam team, TournamentScreen parent)
{
Model = team;
@ -154,7 +154,7 @@ namespace osu.Game.Tournament.Screens.Editors
Text = "Edit seeding results",
Action = () =>
{
sceneManager?.SetScreen(new SeedingEditorScreen(team));
sceneManager?.SetScreen(new SeedingEditorScreen(team, parent));
}
},
}

View File

@ -9,6 +9,7 @@ using osu.Framework.Extensions.IEnumerableExtensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Game.Graphics.UserInterface;
using osu.Game.Graphics;
using osu.Game.Graphics.Containers;
using osu.Game.Overlays.Settings;
@ -25,8 +26,19 @@ namespace osu.Game.Tournament.Screens.Editors
private FillFlowContainer<TDrawable> flow;
[Resolved(canBeNull: true)]
private TournamentSceneManager sceneManager { get; set; }
protected ControlPanel ControlPanel;
private readonly TournamentScreen parentScreen;
private BackButton backButton;
protected TournamentEditorScreen(TournamentScreen parentScreen = null)
{
this.parentScreen = parentScreen;
}
[BackgroundDependencyLoader]
private void load()
{
@ -47,7 +59,7 @@ namespace osu.Game.Tournament.Screens.Editors
Direction = FillDirection.Vertical,
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Spacing = new Vector2(20)
Spacing = new Vector2(20),
},
},
ControlPanel = new ControlPanel
@ -70,6 +82,19 @@ namespace osu.Game.Tournament.Screens.Editors
}
});
if (parentScreen != null)
{
AddInternal(backButton = new BackButton
{
Anchor = Anchor.BottomLeft,
Origin = Anchor.BottomLeft,
State = { Value = Visibility.Visible },
Action = () => sceneManager?.SetScreen(parentScreen.GetType())
});
flow.Padding = new MarginPadding { Bottom = backButton.Height * 2 };
}
Storage.CollectionChanged += (_, args) =>
{
switch (args.Action)