From 51dcfeee9249ad68500fa97940e3d5edbb46aa71 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 25 Aug 2018 21:40:40 +0900 Subject: [PATCH 001/317] Move existing tournament resources to new project --- osu.Game.Tournament.Tests/.vscode/launch.json | 31 ++++++++++++ osu.Game.Tournament.Tests/.vscode/tasks.json | 47 +++++++++++++++++++ .../TestCaseDrawings.cs | 31 ++++++------ .../osu.Game.Tournament.Tests.csproj | 16 +++++++ .../Properties/AssemblyInfo.cs | 11 +++++ .../Components/DrawingsConfigManager.cs | 2 +- .../Drawings/Components}/DrawingsTeam.cs | 20 +++++--- .../Screens/Drawings/Components}/Group.cs | 13 +++-- .../Drawings/Components}/GroupContainer.cs | 5 +- .../Screens/Drawings/Components}/ITeamList.cs | 4 +- .../Components}/ScrollingTeamContainer.cs | 23 ++++----- .../Components}/StorageBackedTeamList.cs | 20 +++----- .../Components/VisualiserContainer.cs | 6 +-- .../Screens/Drawings/DrawingsScreen.cs | 20 ++++---- .../osu.Game.Tournament.csproj | 13 +++++ osu.Game/Screens/Menu/MainMenu.cs | 15 ------ osu.Game/Tests/Visual/OsuTestCase.cs | 2 +- osu.sln | 12 +++++ 18 files changed, 202 insertions(+), 89 deletions(-) create mode 100644 osu.Game.Tournament.Tests/.vscode/launch.json create mode 100644 osu.Game.Tournament.Tests/.vscode/tasks.json rename {osu.Game.Tests/Visual => osu.Game.Tournament.Tests}/TestCaseDrawings.cs (76%) create mode 100644 osu.Game.Tournament.Tests/osu.Game.Tournament.Tests.csproj create mode 100644 osu.Game.Tournament/Properties/AssemblyInfo.cs rename {osu.Game/Screens/Tournament => osu.Game.Tournament/Screens/Drawings}/Components/DrawingsConfigManager.cs (92%) rename {osu.Game/Screens/Tournament/Teams => osu.Game.Tournament/Screens/Drawings/Components}/DrawingsTeam.cs (65%) rename {osu.Game/Screens/Tournament => osu.Game.Tournament/Screens/Drawings/Components}/Group.cs (95%) rename {osu.Game/Screens/Tournament => osu.Game.Tournament/Screens/Drawings/Components}/GroupContainer.cs (95%) rename {osu.Game/Screens/Tournament/Teams => osu.Game.Tournament/Screens/Drawings/Components}/ITeamList.cs (68%) rename {osu.Game/Screens/Tournament => osu.Game.Tournament/Screens/Drawings/Components}/ScrollingTeamContainer.cs (94%) rename {osu.Game/Screens/Tournament/Teams => osu.Game.Tournament/Screens/Drawings/Components}/StorageBackedTeamList.cs (73%) rename {osu.Game/Screens/Tournament => osu.Game.Tournament/Screens/Drawings}/Components/VisualiserContainer.cs (98%) rename osu.Game/Screens/Tournament/Drawings.cs => osu.Game.Tournament/Screens/Drawings/DrawingsScreen.cs (96%) create mode 100644 osu.Game.Tournament/osu.Game.Tournament.csproj diff --git a/osu.Game.Tournament.Tests/.vscode/launch.json b/osu.Game.Tournament.Tests/.vscode/launch.json new file mode 100644 index 0000000000..0204158347 --- /dev/null +++ b/osu.Game.Tournament.Tests/.vscode/launch.json @@ -0,0 +1,31 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "name": "VisualTests (Debug)", + "type": "coreclr", + "request": "launch", + "program": "dotnet", + "args": [ + "${workspaceRoot}/bin/Debug/netcoreapp2.1/osu.Game.Tournament.Tests.dll" + ], + "cwd": "${workspaceRoot}", + "preLaunchTask": "Build (Debug)", + "env": {}, + "console": "internalConsole" + }, + { + "name": "VisualTests (Release)", + "type": "coreclr", + "request": "launch", + "program": "dotnet", + "args": [ + "${workspaceRoot}/bin/Release/netcoreapp2.1/osu.Game.Tournament.Tests.dll" + ], + "cwd": "${workspaceRoot}", + "preLaunchTask": "Build (Release)", + "env": {}, + "console": "internalConsole" + } + ] +} \ No newline at end of file diff --git a/osu.Game.Tournament.Tests/.vscode/tasks.json b/osu.Game.Tournament.Tests/.vscode/tasks.json new file mode 100644 index 0000000000..37f2f32874 --- /dev/null +++ b/osu.Game.Tournament.Tests/.vscode/tasks.json @@ -0,0 +1,47 @@ +{ + // See https://go.microsoft.com/fwlink/?LinkId=733558 + // for the documentation about the tasks.json format + "version": "2.0.0", + "tasks": [ + { + "label": "Build (Debug)", + "type": "shell", + "command": "dotnet", + "args": [ + "build", + "--no-restore", + "osu.Game.Tournament.Tests.csproj", + "/p:GenerateFullPaths=true", + "/m", + "/verbosity:m" + ], + "group": "build", + "problemMatcher": "$msCompile" + }, + { + "label": "Build (Release)", + "type": "shell", + "command": "dotnet", + "args": [ + "build", + "--no-restore", + "osu.Game.Tournament.Tests.csproj", + "/p:Configuration=Release", + "/p:GenerateFullPaths=true", + "/m", + "/verbosity:m" + ], + "group": "build", + "problemMatcher": "$msCompile" + }, + { + "label": "Restore", + "type": "shell", + "command": "dotnet", + "args": [ + "restore" + ], + "problemMatcher": [] + } + ] +} \ No newline at end of file diff --git a/osu.Game.Tests/Visual/TestCaseDrawings.cs b/osu.Game.Tournament.Tests/TestCaseDrawings.cs similarity index 76% rename from osu.Game.Tests/Visual/TestCaseDrawings.cs rename to osu.Game.Tournament.Tests/TestCaseDrawings.cs index a6a3ef6747..029668df73 100644 --- a/osu.Game.Tests/Visual/TestCaseDrawings.cs +++ b/osu.Game.Tournament.Tests/TestCaseDrawings.cs @@ -2,18 +2,17 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; -using System.ComponentModel; -using osu.Game.Screens.Tournament; -using osu.Game.Screens.Tournament.Teams; +using osu.Game.Tests.Visual; +using osu.Game.Tournament.Screens.Drawings; +using osu.Game.Tournament.Screens.Drawings.Components; -namespace osu.Game.Tests.Visual +namespace osu.Game.Tournament.Tests { - [Description("for tournament use")] public class TestCaseDrawings : OsuTestCase { public TestCaseDrawings() { - Add(new Drawings + Add(new DrawingsScreen { TeamList = new TestTeamList(), }); @@ -21,57 +20,57 @@ namespace osu.Game.Tests.Visual private class TestTeamList : ITeamList { - public IEnumerable Teams { get; } = new[] + public IEnumerable Teams { get; } = new[] { - new DrawingsTeam + new TournamentTeam { FlagName = "GB", FullName = "United Kingdom", Acronym = "UK" }, - new DrawingsTeam + new TournamentTeam { FlagName = "FR", FullName = "France", Acronym = "FRA" }, - new DrawingsTeam + new TournamentTeam { FlagName = "CN", FullName = "China", Acronym = "CHN" }, - new DrawingsTeam + new TournamentTeam { FlagName = "AU", FullName = "Australia", Acronym = "AUS" }, - new DrawingsTeam + new TournamentTeam { FlagName = "JP", FullName = "Japan", Acronym = "JPN" }, - new DrawingsTeam + new TournamentTeam { FlagName = "RO", FullName = "Romania", Acronym = "ROM" }, - new DrawingsTeam + new TournamentTeam { FlagName = "IT", FullName = "Italy", Acronym = "PIZZA" }, - new DrawingsTeam + new TournamentTeam { FlagName = "VE", FullName = "Venezuela", Acronym = "VNZ" }, - new DrawingsTeam + new TournamentTeam { FlagName = "US", FullName = "United States of America", diff --git a/osu.Game.Tournament.Tests/osu.Game.Tournament.Tests.csproj b/osu.Game.Tournament.Tests/osu.Game.Tournament.Tests.csproj new file mode 100644 index 0000000000..2b67016f7a --- /dev/null +++ b/osu.Game.Tournament.Tests/osu.Game.Tournament.Tests.csproj @@ -0,0 +1,16 @@ + + + + + + + + + + WinExe + netcoreapp2.1 + + + + + \ No newline at end of file diff --git a/osu.Game.Tournament/Properties/AssemblyInfo.cs b/osu.Game.Tournament/Properties/AssemblyInfo.cs new file mode 100644 index 0000000000..4955391097 --- /dev/null +++ b/osu.Game.Tournament/Properties/AssemblyInfo.cs @@ -0,0 +1,11 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System.Runtime.CompilerServices; + +// We publish our internal attributes to other sub-projects of the framework. +// Note, that we omit visual tests as they are meant to test the framework +// behavior "in the wild". + +[assembly: InternalsVisibleTo("osu.Game.Tournament.Tests")] +[assembly: InternalsVisibleTo("osu.Game.Tournament.Tests.Dynamic")] diff --git a/osu.Game/Screens/Tournament/Components/DrawingsConfigManager.cs b/osu.Game.Tournament/Screens/Drawings/Components/DrawingsConfigManager.cs similarity index 92% rename from osu.Game/Screens/Tournament/Components/DrawingsConfigManager.cs rename to osu.Game.Tournament/Screens/Drawings/Components/DrawingsConfigManager.cs index 49fb39c6da..ac3dbf8a11 100644 --- a/osu.Game/Screens/Tournament/Components/DrawingsConfigManager.cs +++ b/osu.Game.Tournament/Screens/Drawings/Components/DrawingsConfigManager.cs @@ -4,7 +4,7 @@ using osu.Framework.Configuration; using osu.Framework.Platform; -namespace osu.Game.Screens.Tournament.Components +namespace osu.Game.Tournament.Screens.Drawings.Components { public class DrawingsConfigManager : IniConfigManager { diff --git a/osu.Game/Screens/Tournament/Teams/DrawingsTeam.cs b/osu.Game.Tournament/Screens/Drawings/Components/DrawingsTeam.cs similarity index 65% rename from osu.Game/Screens/Tournament/Teams/DrawingsTeam.cs rename to osu.Game.Tournament/Screens/Drawings/Components/DrawingsTeam.cs index 0926ed2748..7e182d1b62 100644 --- a/osu.Game/Screens/Tournament/Teams/DrawingsTeam.cs +++ b/osu.Game.Tournament/Screens/Drawings/Components/DrawingsTeam.cs @@ -1,23 +1,29 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -namespace osu.Game.Screens.Tournament.Teams +namespace osu.Game.Tournament.Screens.Drawings.Components { - public class DrawingsTeam + public class TournamentTeam { /// /// The name of this team. /// public string FullName; - /// - /// Short acronym which appears in the group boxes post-selection. - /// - public string Acronym; - /// /// Name of the file containing the flag. /// public string FlagName; + + private string acronym; + + /// + /// Short acronym which appears in the group boxes post-selection. + /// + public string Acronym + { + get { return acronym ?? FullName.Substring(0, 3); } + set { acronym = value; } + } } } diff --git a/osu.Game/Screens/Tournament/Group.cs b/osu.Game.Tournament/Screens/Drawings/Components/Group.cs similarity index 95% rename from osu.Game/Screens/Tournament/Group.cs rename to osu.Game.Tournament/Screens/Drawings/Components/Group.cs index 6845d8fc48..01f13857fc 100644 --- a/osu.Game/Screens/Tournament/Group.cs +++ b/osu.Game.Tournament/Screens/Drawings/Components/Group.cs @@ -7,15 +7,14 @@ using System.Text; using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Textures; using osu.Game.Graphics.Sprites; using OpenTK; using OpenTK.Graphics; -using osu.Game.Screens.Tournament.Teams; -using osu.Framework.Graphics.Shapes; -namespace osu.Game.Screens.Tournament +namespace osu.Game.Tournament.Screens.Drawings.Components { public class Group : Container { @@ -73,7 +72,7 @@ namespace osu.Game.Screens.Tournament }; } - public void AddTeam(DrawingsTeam team) + public void AddTeam(TournamentTeam team) { GroupTeam gt = new GroupTeam(team); @@ -91,7 +90,7 @@ namespace osu.Game.Screens.Tournament return allTeams.Any(t => t.Team.FullName == fullName); } - public bool RemoveTeam(DrawingsTeam team) + public bool RemoveTeam(TournamentTeam team) { allTeams.RemoveAll(gt => gt.Team == team); @@ -122,12 +121,12 @@ namespace osu.Game.Screens.Tournament private class GroupTeam : Container { - public readonly DrawingsTeam Team; + public readonly TournamentTeam Team; private readonly FillFlowContainer innerContainer; private readonly Sprite flagSprite; - public GroupTeam(DrawingsTeam team) + public GroupTeam(TournamentTeam team) { Team = team; diff --git a/osu.Game/Screens/Tournament/GroupContainer.cs b/osu.Game.Tournament/Screens/Drawings/Components/GroupContainer.cs similarity index 95% rename from osu.Game/Screens/Tournament/GroupContainer.cs rename to osu.Game.Tournament/Screens/Drawings/Components/GroupContainer.cs index c717a7401f..2914d28a00 100644 --- a/osu.Game/Screens/Tournament/GroupContainer.cs +++ b/osu.Game.Tournament/Screens/Drawings/Components/GroupContainer.cs @@ -8,9 +8,8 @@ using System.Text; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using OpenTK; -using osu.Game.Screens.Tournament.Teams; -namespace osu.Game.Screens.Tournament +namespace osu.Game.Tournament.Screens.Drawings.Components { public class GroupContainer : Container { @@ -64,7 +63,7 @@ namespace osu.Game.Screens.Tournament } } - public void AddTeam(DrawingsTeam team) + public void AddTeam(TournamentTeam team) { if (groups[currentGroup].TeamsCount == maxTeams) return; diff --git a/osu.Game/Screens/Tournament/Teams/ITeamList.cs b/osu.Game.Tournament/Screens/Drawings/Components/ITeamList.cs similarity index 68% rename from osu.Game/Screens/Tournament/Teams/ITeamList.cs rename to osu.Game.Tournament/Screens/Drawings/Components/ITeamList.cs index 728c702173..37b321c85b 100644 --- a/osu.Game/Screens/Tournament/Teams/ITeamList.cs +++ b/osu.Game.Tournament/Screens/Drawings/Components/ITeamList.cs @@ -3,10 +3,10 @@ using System.Collections.Generic; -namespace osu.Game.Screens.Tournament.Teams +namespace osu.Game.Tournament.Screens.Drawings.Components { public interface ITeamList { - IEnumerable Teams { get; } + IEnumerable Teams { get; } } } diff --git a/osu.Game/Screens/Tournament/ScrollingTeamContainer.cs b/osu.Game.Tournament/Screens/Drawings/Components/ScrollingTeamContainer.cs similarity index 94% rename from osu.Game/Screens/Tournament/ScrollingTeamContainer.cs rename to osu.Game.Tournament/Screens/Drawings/Components/ScrollingTeamContainer.cs index d1c7e0fced..ec2e8afcb6 100644 --- a/osu.Game/Screens/Tournament/ScrollingTeamContainer.cs +++ b/osu.Game.Tournament/Screens/Drawings/Components/ScrollingTeamContainer.cs @@ -13,18 +13,17 @@ using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Textures; using osu.Framework.Threading; -using osu.Game.Screens.Tournament.Teams; using OpenTK; using OpenTK.Graphics; -namespace osu.Game.Screens.Tournament +namespace osu.Game.Tournament.Screens.Drawings.Components { public class ScrollingTeamContainer : Container { public event Action OnScrollStarted; - public event Action OnSelected; + public event Action OnSelected; - private readonly List availableTeams = new List(); + private readonly List availableTeams = new List(); private readonly Container tracker; @@ -84,6 +83,7 @@ namespace osu.Game.Screens.Tournament } private ScrollState _scrollState; + private ScrollState scrollState { get { return _scrollState; } @@ -166,7 +166,7 @@ namespace osu.Game.Screens.Tournament } } - public void AddTeam(DrawingsTeam team) + public void AddTeam(TournamentTeam team) { if (availableTeams.Contains(team)) return; @@ -177,12 +177,12 @@ namespace osu.Game.Screens.Tournament scrollState = ScrollState.Idle; } - public void AddTeams(IEnumerable teams) + public void AddTeams(IEnumerable teams) { if (teams == null) return; - foreach (DrawingsTeam t in teams) + foreach (TournamentTeam t in teams) AddTeam(t); } @@ -193,7 +193,7 @@ namespace osu.Game.Screens.Tournament scrollState = ScrollState.Idle; } - public void RemoveTeam(DrawingsTeam team) + public void RemoveTeam(TournamentTeam team) { availableTeams.Remove(team); @@ -278,7 +278,7 @@ namespace osu.Game.Screens.Tournament private void addFlags() { - foreach (DrawingsTeam t in availableTeams) + foreach (TournamentTeam t in availableTeams) { Add(new ScrollingTeam(t) { @@ -320,12 +320,13 @@ namespace osu.Game.Screens.Tournament public const float WIDTH = 58; public const float HEIGHT = 41; - public DrawingsTeam Team; + public TournamentTeam Team; private readonly Sprite flagSprite; private readonly Box outline; private bool selected; + public bool Selected { get { return selected; } @@ -341,7 +342,7 @@ namespace osu.Game.Screens.Tournament } } - public ScrollingTeam(DrawingsTeam team) + public ScrollingTeam(TournamentTeam team) { Team = team; diff --git a/osu.Game/Screens/Tournament/Teams/StorageBackedTeamList.cs b/osu.Game.Tournament/Screens/Drawings/Components/StorageBackedTeamList.cs similarity index 73% rename from osu.Game/Screens/Tournament/Teams/StorageBackedTeamList.cs rename to osu.Game.Tournament/Screens/Drawings/Components/StorageBackedTeamList.cs index bb112c7e2d..296a23339e 100644 --- a/osu.Game/Screens/Tournament/Teams/StorageBackedTeamList.cs +++ b/osu.Game.Tournament/Screens/Drawings/Components/StorageBackedTeamList.cs @@ -7,7 +7,7 @@ using System.IO; using osu.Framework.Logging; using osu.Framework.Platform; -namespace osu.Game.Screens.Tournament.Teams +namespace osu.Game.Tournament.Screens.Drawings.Components { public class StorageBackedTeamList : ITeamList { @@ -20,11 +20,11 @@ namespace osu.Game.Screens.Tournament.Teams this.storage = storage; } - public IEnumerable Teams + public IEnumerable Teams { get { - var teams = new List(); + var teams = new List(); try { @@ -47,17 +47,11 @@ namespace osu.Game.Screens.Tournament.Teams continue; } - string flagName = split[0].Trim(); - string teamName = split[1].Trim(); - - string acronym = split.Length >= 3 ? split[2].Trim() : teamName; - acronym = acronym.Substring(0, Math.Min(3, acronym.Length)); - - teams.Add(new DrawingsTeam + teams.Add(new TournamentTeam { - FlagName = flagName, - FullName = teamName, - Acronym = acronym + FlagName = split[0].Trim(), + FullName = split[1].Trim(), + Acronym = split.Length >= 3 ? split[2].Trim() : null }); } } diff --git a/osu.Game/Screens/Tournament/Components/VisualiserContainer.cs b/osu.Game.Tournament/Screens/Drawings/Components/VisualiserContainer.cs similarity index 98% rename from osu.Game/Screens/Tournament/Components/VisualiserContainer.cs rename to osu.Game.Tournament/Screens/Drawings/Components/VisualiserContainer.cs index 1453d4e78f..6581dbd328 100644 --- a/osu.Game/Screens/Tournament/Components/VisualiserContainer.cs +++ b/osu.Game.Tournament/Screens/Drawings/Components/VisualiserContainer.cs @@ -1,16 +1,16 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using System.Collections.Generic; +using System.Linq; using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Textures; using osu.Framework.MathUtils; -using System.Collections.Generic; -using System.Linq; -namespace osu.Game.Screens.Tournament.Components +namespace osu.Game.Tournament.Screens.Drawings.Components { public class VisualiserContainer : Container { diff --git a/osu.Game/Screens/Tournament/Drawings.cs b/osu.Game.Tournament/Screens/Drawings/DrawingsScreen.cs similarity index 96% rename from osu.Game/Screens/Tournament/Drawings.cs rename to osu.Game.Tournament/Screens/Drawings/DrawingsScreen.cs index 4e2109afd0..e3853dca6f 100644 --- a/osu.Game/Screens/Tournament/Drawings.cs +++ b/osu.Game.Tournament/Screens/Drawings/DrawingsScreen.cs @@ -9,23 +9,23 @@ using System.Threading.Tasks; using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Textures; +using osu.Framework.IO.Stores; using osu.Framework.Logging; using osu.Framework.Platform; using osu.Game.Graphics.Sprites; using osu.Game.Graphics.UserInterface; +using osu.Game.Screens; using osu.Game.Screens.Backgrounds; -using osu.Game.Screens.Tournament.Components; -using osu.Game.Screens.Tournament.Teams; +using osu.Game.Tournament.Screens.Drawings.Components; using OpenTK; using OpenTK.Graphics; -using osu.Framework.IO.Stores; -using osu.Framework.Graphics.Shapes; -namespace osu.Game.Screens.Tournament +namespace osu.Game.Tournament.Screens.Drawings { - public class Drawings : OsuScreen + public class DrawingsScreen : OsuScreen { private const string results_filename = "drawings_results.txt"; @@ -37,7 +37,7 @@ namespace osu.Game.Screens.Tournament private GroupContainer groupsContainer; private OsuSpriteText fullTeamNameText; - private readonly List allTeams = new List(); + private readonly List allTeams = new List(); private DrawingsConfigManager drawingsConfig; @@ -253,7 +253,7 @@ namespace osu.Game.Screens.Tournament reset(true); } - private void onTeamSelected(DrawingsTeam team) + private void onTeamSelected(TournamentTeam team) { groupsContainer.AddTeam(team); @@ -290,7 +290,7 @@ namespace osu.Game.Screens.Tournament teamsContainer.ClearTeams(); allTeams.Clear(); - foreach (DrawingsTeam t in TeamList.Teams) + foreach (TournamentTeam t in TeamList.Teams) { if (groupsContainer.ContainsTeam(t.FullName)) continue; @@ -327,7 +327,7 @@ namespace osu.Game.Screens.Tournament continue; // ReSharper disable once AccessToModifiedClosure - DrawingsTeam teamToAdd = allTeams.FirstOrDefault(t => t.FullName == line); + TournamentTeam teamToAdd = allTeams.FirstOrDefault(t => t.FullName == line); if (teamToAdd == null) continue; diff --git a/osu.Game.Tournament/osu.Game.Tournament.csproj b/osu.Game.Tournament/osu.Game.Tournament.csproj new file mode 100644 index 0000000000..8adff80820 --- /dev/null +++ b/osu.Game.Tournament/osu.Game.Tournament.csproj @@ -0,0 +1,13 @@ + + + + netstandard2.0 + Library + AnyCPU + true + tools for tournaments. + + + + + \ No newline at end of file diff --git a/osu.Game/Screens/Menu/MainMenu.cs b/osu.Game/Screens/Menu/MainMenu.cs index 2dd6e1d7e1..042fa4a07b 100644 --- a/osu.Game/Screens/Menu/MainMenu.cs +++ b/osu.Game/Screens/Menu/MainMenu.cs @@ -3,11 +3,8 @@ using OpenTK; using OpenTK.Graphics; -using OpenTK.Input; using osu.Framework.Allocation; using osu.Framework.Graphics; -using osu.Framework.Input.EventArgs; -using osu.Framework.Input.States; using osu.Framework.Screens; using osu.Game.Beatmaps; using osu.Game.Graphics; @@ -18,7 +15,6 @@ using osu.Game.Screens.Direct; using osu.Game.Screens.Edit; using osu.Game.Screens.Multi; using osu.Game.Screens.Select; -using osu.Game.Screens.Tournament; namespace osu.Game.Screens.Menu { @@ -199,16 +195,5 @@ namespace osu.Game.Screens.Menu Content.FadeOut(3000); return base.OnExiting(next); } - - protected override bool OnKeyDown(InputState state, KeyDownEventArgs args) - { - if (!args.Repeat && state.Keyboard.ControlPressed && state.Keyboard.ShiftPressed && args.Key == Key.D) - { - Push(new Drawings()); - return true; - } - - return base.OnKeyDown(state, args); - } } } diff --git a/osu.Game/Tests/Visual/OsuTestCase.cs b/osu.Game/Tests/Visual/OsuTestCase.cs index 67a13bd850..dccf852000 100644 --- a/osu.Game/Tests/Visual/OsuTestCase.cs +++ b/osu.Game/Tests/Visual/OsuTestCase.cs @@ -48,7 +48,7 @@ namespace osu.Game.Tests.Visual { beatmap.SetAudioManager(audioManager); - Ruleset.Value = rulesets.AvailableRulesets.First(); + Ruleset.Value = rulesets.AvailableRulesets.FirstOrDefault(); } protected override void Dispose(bool isDisposing) diff --git a/osu.sln b/osu.sln index bf1b6d60e1..f6ed7a5c42 100644 --- a/osu.sln +++ b/osu.sln @@ -27,6 +27,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "osu.Game.Rulesets.Taiko.Tes EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "osu.Game.Rulesets.Osu.Tests", "osu.Game.Rulesets.Osu.Tests\osu.Game.Rulesets.Osu.Tests.csproj", "{6A2D5D58-0261-4A75-BE84-2BE8B076B7C2}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "osu.Game.Tournament", "osu.Game.Tournament\osu.Game.Tournament.csproj", "{5672CA4D-1B37-425B-A118-A8DA26E78938}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "osu.Game.Tournament.Tests", "osu.Game.Tournament.Tests\osu.Game.Tournament.Tests.csproj", "{5789E78D-38F9-4072-AB7B-978F34B2C17F}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -81,6 +85,14 @@ Global {6A2D5D58-0261-4A75-BE84-2BE8B076B7C2}.Debug|Any CPU.Build.0 = Debug|Any CPU {6A2D5D58-0261-4A75-BE84-2BE8B076B7C2}.Release|Any CPU.ActiveCfg = Release|Any CPU {6A2D5D58-0261-4A75-BE84-2BE8B076B7C2}.Release|Any CPU.Build.0 = Release|Any CPU + {5672CA4D-1B37-425B-A118-A8DA26E78938}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5672CA4D-1B37-425B-A118-A8DA26E78938}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5672CA4D-1B37-425B-A118-A8DA26E78938}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5672CA4D-1B37-425B-A118-A8DA26E78938}.Release|Any CPU.Build.0 = Release|Any CPU + {5789E78D-38F9-4072-AB7B-978F34B2C17F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5789E78D-38F9-4072-AB7B-978F34B2C17F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5789E78D-38F9-4072-AB7B-978F34B2C17F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5789E78D-38F9-4072-AB7B-978F34B2C17F}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE From 40b01ec35a4337bae9c9f662759ab69287179ff4 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 26 Aug 2018 01:14:18 +0900 Subject: [PATCH 002/317] Add basic match pairing component for ladder display --- .../TestCaseMatchPairings.cs | 61 +++++++++ .../Ladder/Components/DrawableMatchPairing.cs | 45 ++++++ .../Ladder/Components/DrawableMatchTeam.cs | 129 ++++++++++++++++++ .../Components/DrawableTournamentTeam.cs | 45 ++++++ .../Screens/Ladder/Components/MatchPairing.cs | 31 +++++ 5 files changed, 311 insertions(+) create mode 100644 osu.Game.Tournament.Tests/TestCaseMatchPairings.cs create mode 100644 osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs create mode 100644 osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs create mode 100644 osu.Game.Tournament/Screens/Ladder/Components/DrawableTournamentTeam.cs create mode 100644 osu.Game.Tournament/Screens/Ladder/Components/MatchPairing.cs diff --git a/osu.Game.Tournament.Tests/TestCaseMatchPairings.cs b/osu.Game.Tournament.Tests/TestCaseMatchPairings.cs new file mode 100644 index 0000000000..77cf3c97f1 --- /dev/null +++ b/osu.Game.Tournament.Tests/TestCaseMatchPairings.cs @@ -0,0 +1,61 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System; +using System.Collections.Generic; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Game.Tests.Visual; +using osu.Game.Tournament.Screens.Drawings.Components; +using osu.Game.Tournament.Screens.Ladder.Components; + +namespace osu.Game.Tournament.Tests +{ + public class TestCaseMatchPairings : OsuTestCase + { + public override IReadOnlyList RequiredTypes => new[] + { + typeof(MatchPairing), + typeof(DrawableMatchPairing), + typeof(DrawableMatchTeam), + typeof(DrawableTournamentTeam), + }; + + public TestCaseMatchPairings() + { + var pairing1 = new MatchPairing( + new TournamentTeam { FlagName = "AU", FullName = "Australia", }, + new TournamentTeam { FlagName = "JP", FullName = "Japan", Acronym = "JPN" }) + { + Team1Score = { Value = 8 }, + Team2Score = { Value = 6 }, + }; + + var pairing2 = new MatchPairing( + new TournamentTeam + { + FlagName = "RO", + FullName = "Romania", + } + ); + + Child = new FillFlowContainer + { + Children = new Drawable[] + { + new DrawableMatchPairing(pairing1), + new DrawableMatchPairing(pairing2), + new DrawableMatchPairing(new MatchPairing()) + } + }; + + AddStep("mark complete", () => pairing1.Completed.Value = true); + AddRepeatStep("change scores", () => pairing1.Team2Score.Value++, 5); + AddStep("mark complete", () => pairing1.Completed.Value = true); + + AddStep("add new team", () => pairing2.Team2.Value = + new TournamentTeam { FlagName = "PT", FullName = "Portugal" } + ); + } + } +} diff --git a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs new file mode 100644 index 0000000000..281208cdcf --- /dev/null +++ b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs @@ -0,0 +1,45 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; + +namespace osu.Game.Tournament.Screens.Ladder.Components +{ + public class DrawableMatchPairing : CompositeDrawable + { + private readonly MatchPairing pairing; + private readonly FillFlowContainer flow; + + public DrawableMatchPairing(MatchPairing pairing) + { + this.pairing = pairing; + + AutoSizeAxes = Axes.Both; + + Margin = new MarginPadding(5); + + InternalChild = flow = new FillFlowContainer + { + AutoSizeAxes = Axes.Both, + Direction = FillDirection.Vertical, + }; + + pairing.Team1.BindValueChanged(_ => updateTeams()); + pairing.Team2.BindValueChanged(_ => updateTeams()); + + updateTeams(); + } + + private void updateTeams() + { + // todo: teams may need to be bindable for transitions at a later point. + + flow.Children = new[] + { + new DrawableMatchTeam(pairing.Team1, pairing), + new DrawableMatchTeam(pairing.Team2, pairing) + }; + } + } +} diff --git a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs new file mode 100644 index 0000000000..9d8ea00e31 --- /dev/null +++ b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs @@ -0,0 +1,129 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System; +using osu.Framework.Allocation; +using osu.Framework.Configuration; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Shapes; +using osu.Game.Graphics; +using osu.Game.Graphics.Sprites; +using osu.Game.Tournament.Screens.Drawings.Components; +using OpenTK; +using OpenTK.Graphics; + +namespace osu.Game.Tournament.Screens.Ladder.Components +{ + public class DrawableMatchTeam : DrawableTournamentTeam + { + private OsuSpriteText scoreText; + private Box background; + + private readonly Bindable score = new Bindable(); + private readonly BindableBool completed = new BindableBool(); + + private Color4 colourWinner; + private Color4 colourNormal; + + private readonly Func isWinner; + + public DrawableMatchTeam(TournamentTeam team, MatchPairing pairing) + : base(team) + { + Size = new Vector2(150, 40); + + Masking = true; + CornerRadius = 5; + + Flag.Scale = new Vector2(0.9f); + Flag.Anchor = Flag.Origin = Anchor.CentreLeft; + + AcronymText.Anchor = AcronymText.Origin = Anchor.CentreLeft; + AcronymText.Padding = new MarginPadding { Left = 50 }; + AcronymText.TextSize = 24; + + if (pairing != null) + { + completed.BindTo(pairing.Completed); + + if (team == pairing.Team1.Value) + { + score.BindTo(pairing.Team1Score); + isWinner = () => pairing.Team1Score.Value > pairing.Team2Score.Value; + } + else + { + score.BindTo(pairing.Team2Score); + isWinner = () => pairing.Team2Score.Value > pairing.Team1Score.Value; + } + } + } + + [BackgroundDependencyLoader] + private void load(OsuColour colours) + { + colourWinner = colours.BlueDarker; + colourNormal = OsuColour.Gray(0.2f); + + InternalChildren = new Drawable[] + { + background = new Box + { + RelativeSizeAxes = Axes.Both, + }, + new Container + { + Padding = new MarginPadding(5), + RelativeSizeAxes = Axes.Both, + Children = new Drawable[] + { + AcronymText, + Flag, + new Container + { + Masking = true, + CornerRadius = 5, + Width = 0.3f, + Anchor = Anchor.CentreRight, + Origin = Anchor.CentreRight, + RelativeSizeAxes = Axes.Both, + Children = new Drawable[] + { + new Box + { + Colour = OsuColour.Gray(0.1f), + Alpha = 0.8f, + RelativeSizeAxes = Axes.Both, + }, + scoreText = new OsuSpriteText + { + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + TextSize = 20, + } + } + } + } + } + }; + + completed.BindValueChanged(_ => updateWinStyle()); + + score.BindValueChanged(val => + { + scoreText.Text = val?.ToString() ?? string.Empty; + updateWinStyle(); + }, true); + } + + private void updateWinStyle() + { + bool winner = completed && isWinner?.Invoke() == true; + + background.FadeColour(winner ? colourWinner : colourNormal, winner ? 500 : 0, Easing.OutQuint); + + scoreText.Font = AcronymText.Font = winner ? "Exo2.0-Bold" : "Exo2.0-Regular"; + } + } +} diff --git a/osu.Game.Tournament/Screens/Ladder/Components/DrawableTournamentTeam.cs b/osu.Game.Tournament/Screens/Ladder/Components/DrawableTournamentTeam.cs new file mode 100644 index 0000000000..dc5e2c9007 --- /dev/null +++ b/osu.Game.Tournament/Screens/Ladder/Components/DrawableTournamentTeam.cs @@ -0,0 +1,45 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework.Allocation; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Sprites; +using osu.Framework.Graphics.Textures; +using osu.Game.Graphics.Sprites; +using osu.Game.Tournament.Screens.Drawings.Components; + +namespace osu.Game.Tournament.Screens.Ladder.Components +{ + public abstract class DrawableTournamentTeam : CompositeDrawable + { + public readonly TournamentTeam Team; + + protected readonly Sprite Flag; + protected readonly OsuSpriteText AcronymText; + + protected DrawableTournamentTeam(TournamentTeam team) + { + Team = team; + + Flag = new Sprite + { + RelativeSizeAxes = Axes.Both, + FillMode = FillMode.Fit + }; + + AcronymText = new OsuSpriteText + { + Text = team?.Acronym.ToUpperInvariant() ?? string.Empty, + Font = @"Exo2.0-Regular" + }; + } + + [BackgroundDependencyLoader] + private void load(TextureStore textures) + { + if (Team != null) + Flag.Texture = textures.Get($@"Flags/{Team.FlagName}"); + } + } +} diff --git a/osu.Game.Tournament/Screens/Ladder/Components/MatchPairing.cs b/osu.Game.Tournament/Screens/Ladder/Components/MatchPairing.cs new file mode 100644 index 0000000000..b8d8b77d74 --- /dev/null +++ b/osu.Game.Tournament/Screens/Ladder/Components/MatchPairing.cs @@ -0,0 +1,31 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework.Configuration; +using osu.Game.Tournament.Screens.Drawings.Components; + +namespace osu.Game.Tournament.Screens.Ladder.Components +{ + /// + /// A collection of two teams competing in a head-to-head match. + /// + public class MatchPairing + { + public Bindable Team1 = new Bindable(); + public Bindable Team1Score = new Bindable(); + + public Bindable Team2 = new Bindable(); + public Bindable Team2Score = new Bindable(); + + public Bindable Completed = new Bindable(); + + public MatchPairing(TournamentTeam team1 = null, TournamentTeam team2 = null) + { + Team1.Value = team1; + Team2.Value = team2; + + Team1Score.ValueChanged += _ => Completed.Value = false; + Team2Score.ValueChanged += _ => Completed.Value = false; + } + } +} From 3d3a7f714dc338b2d5ccf0a2eb55b563d5bb8fed Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 26 Aug 2018 01:24:19 +0900 Subject: [PATCH 003/317] Move and use shared components --- osu.Game.Tournament.Tests/TestCaseDrawings.cs | 1 + .../TestCaseMatchPairings.cs | 2 +- .../Components/DrawableTournamentTeam.cs | 3 +- .../TournamentTeam.cs} | 2 +- .../Screens/Drawings/Components/Group.cs | 49 ++++++------------- .../Drawings/Components/GroupContainer.cs | 1 + .../Screens/Drawings/Components/ITeamList.cs | 1 + .../Components/ScrollingTeamContainer.cs | 32 ++++-------- .../Components/StorageBackedTeamList.cs | 1 + .../Screens/Drawings/DrawingsScreen.cs | 1 + .../Ladder/Components/DrawableMatchTeam.cs | 2 +- .../Screens/Ladder/Components/MatchPairing.cs | 2 +- 12 files changed, 35 insertions(+), 62 deletions(-) rename osu.Game.Tournament/{Screens/Ladder => }/Components/DrawableTournamentTeam.cs (91%) rename osu.Game.Tournament/{Screens/Drawings/Components/DrawingsTeam.cs => Components/TournamentTeam.cs} (92%) diff --git a/osu.Game.Tournament.Tests/TestCaseDrawings.cs b/osu.Game.Tournament.Tests/TestCaseDrawings.cs index 029668df73..511724e51a 100644 --- a/osu.Game.Tournament.Tests/TestCaseDrawings.cs +++ b/osu.Game.Tournament.Tests/TestCaseDrawings.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using osu.Game.Tests.Visual; +using osu.Game.Tournament.Components; using osu.Game.Tournament.Screens.Drawings; using osu.Game.Tournament.Screens.Drawings.Components; diff --git a/osu.Game.Tournament.Tests/TestCaseMatchPairings.cs b/osu.Game.Tournament.Tests/TestCaseMatchPairings.cs index 77cf3c97f1..d5835896a4 100644 --- a/osu.Game.Tournament.Tests/TestCaseMatchPairings.cs +++ b/osu.Game.Tournament.Tests/TestCaseMatchPairings.cs @@ -6,7 +6,7 @@ using System.Collections.Generic; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Game.Tests.Visual; -using osu.Game.Tournament.Screens.Drawings.Components; +using osu.Game.Tournament.Components; using osu.Game.Tournament.Screens.Ladder.Components; namespace osu.Game.Tournament.Tests diff --git a/osu.Game.Tournament/Screens/Ladder/Components/DrawableTournamentTeam.cs b/osu.Game.Tournament/Components/DrawableTournamentTeam.cs similarity index 91% rename from osu.Game.Tournament/Screens/Ladder/Components/DrawableTournamentTeam.cs rename to osu.Game.Tournament/Components/DrawableTournamentTeam.cs index dc5e2c9007..ec60d24c2c 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/DrawableTournamentTeam.cs +++ b/osu.Game.Tournament/Components/DrawableTournamentTeam.cs @@ -7,9 +7,8 @@ using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Textures; using osu.Game.Graphics.Sprites; -using osu.Game.Tournament.Screens.Drawings.Components; -namespace osu.Game.Tournament.Screens.Ladder.Components +namespace osu.Game.Tournament.Components { public abstract class DrawableTournamentTeam : CompositeDrawable { diff --git a/osu.Game.Tournament/Screens/Drawings/Components/DrawingsTeam.cs b/osu.Game.Tournament/Components/TournamentTeam.cs similarity index 92% rename from osu.Game.Tournament/Screens/Drawings/Components/DrawingsTeam.cs rename to osu.Game.Tournament/Components/TournamentTeam.cs index 7e182d1b62..03d787af76 100644 --- a/osu.Game.Tournament/Screens/Drawings/Components/DrawingsTeam.cs +++ b/osu.Game.Tournament/Components/TournamentTeam.cs @@ -1,7 +1,7 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -namespace osu.Game.Tournament.Screens.Drawings.Components +namespace osu.Game.Tournament.Components { public class TournamentTeam { diff --git a/osu.Game.Tournament/Screens/Drawings/Components/Group.cs b/osu.Game.Tournament/Screens/Drawings/Components/Group.cs index 01f13857fc..1600a19be8 100644 --- a/osu.Game.Tournament/Screens/Drawings/Components/Group.cs +++ b/osu.Game.Tournament/Screens/Drawings/Components/Group.cs @@ -4,13 +4,11 @@ using System.Collections.Generic; using System.Linq; using System.Text; -using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; -using osu.Framework.Graphics.Sprites; -using osu.Framework.Graphics.Textures; using osu.Game.Graphics.Sprites; +using osu.Game.Tournament.Components; using OpenTK; using OpenTK.Graphics; @@ -119,21 +117,26 @@ namespace osu.Game.Tournament.Screens.Drawings.Components return sb.ToString(); } - private class GroupTeam : Container + private class GroupTeam : DrawableTournamentTeam { - public readonly TournamentTeam Team; - private readonly FillFlowContainer innerContainer; - private readonly Sprite flagSprite; - public GroupTeam(TournamentTeam team) + public GroupTeam(TournamentTeam team) : base(team) { - Team = team; - Width = 36; AutoSizeAxes = Axes.Y; - Children = new Drawable[] + + Flag.Anchor = Anchor.TopCentre; + Flag.Origin = Anchor.TopCentre; + + AcronymText.Anchor = Anchor.TopCentre; + AcronymText.Origin = Anchor.TopCentre; + AcronymText.Text = team.Acronym.ToUpperInvariant(); + AcronymText.TextSize = 10f; + AcronymText.Font = @"Exo2.0-Bold"; + + InternalChildren = new Drawable[] { innerContainer = new FillFlowContainer { @@ -148,22 +151,8 @@ namespace osu.Game.Tournament.Screens.Drawings.Components Children = new Drawable[] { - flagSprite = new Sprite - { - RelativeSizeAxes = Axes.Both, - Anchor = Anchor.TopCentre, - Origin = Anchor.TopCentre, - FillMode = FillMode.Fit - }, - new OsuSpriteText - { - Anchor = Anchor.TopCentre, - Origin = Anchor.TopCentre, - - Text = team.Acronym.ToUpperInvariant(), - TextSize = 10f, - Font = @"Exo2.0-Bold" - } + Flag, + AcronymText } } }; @@ -175,12 +164,6 @@ namespace osu.Game.Tournament.Screens.Drawings.Components innerContainer.ScaleTo(1.5f); innerContainer.ScaleTo(1f, 200); } - - [BackgroundDependencyLoader] - private void load(TextureStore textures) - { - flagSprite.Texture = textures.Get($@"Flags/{Team.FlagName}"); - } } } } diff --git a/osu.Game.Tournament/Screens/Drawings/Components/GroupContainer.cs b/osu.Game.Tournament/Screens/Drawings/Components/GroupContainer.cs index 2914d28a00..236d19a3ad 100644 --- a/osu.Game.Tournament/Screens/Drawings/Components/GroupContainer.cs +++ b/osu.Game.Tournament/Screens/Drawings/Components/GroupContainer.cs @@ -7,6 +7,7 @@ using System.Linq; using System.Text; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; +using osu.Game.Tournament.Components; using OpenTK; namespace osu.Game.Tournament.Screens.Drawings.Components diff --git a/osu.Game.Tournament/Screens/Drawings/Components/ITeamList.cs b/osu.Game.Tournament/Screens/Drawings/Components/ITeamList.cs index 37b321c85b..614507dc80 100644 --- a/osu.Game.Tournament/Screens/Drawings/Components/ITeamList.cs +++ b/osu.Game.Tournament/Screens/Drawings/Components/ITeamList.cs @@ -2,6 +2,7 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; +using osu.Game.Tournament.Components; namespace osu.Game.Tournament.Screens.Drawings.Components { diff --git a/osu.Game.Tournament/Screens/Drawings/Components/ScrollingTeamContainer.cs b/osu.Game.Tournament/Screens/Drawings/Components/ScrollingTeamContainer.cs index ec2e8afcb6..816a3ef958 100644 --- a/osu.Game.Tournament/Screens/Drawings/Components/ScrollingTeamContainer.cs +++ b/osu.Game.Tournament/Screens/Drawings/Components/ScrollingTeamContainer.cs @@ -5,14 +5,12 @@ using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; -using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Colour; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; -using osu.Framework.Graphics.Sprites; -using osu.Framework.Graphics.Textures; using osu.Framework.Threading; +using osu.Game.Tournament.Components; using OpenTK; using OpenTK.Graphics; @@ -315,14 +313,11 @@ namespace osu.Game.Tournament.Screens.Drawings.Components Scrolling } - public class ScrollingTeam : Container + public class ScrollingTeam : DrawableTournamentTeam { public const float WIDTH = 58; public const float HEIGHT = 41; - public TournamentTeam Team; - - private readonly Sprite flagSprite; private readonly Box outline; private bool selected; @@ -343,9 +338,8 @@ namespace osu.Game.Tournament.Screens.Drawings.Components } public ScrollingTeam(TournamentTeam team) + : base(team) { - Team = team; - Anchor = Anchor.CentreLeft; Origin = Anchor.CentreLeft; @@ -355,28 +349,20 @@ namespace osu.Game.Tournament.Screens.Drawings.Components Alpha = 0; - Children = new Drawable[] + Flag.Anchor = Anchor.Centre; + Flag.Origin = Anchor.Centre; + Flag.Scale = new Vector2(0.9f); + + InternalChildren = new Drawable[] { outline = new Box { RelativeSizeAxes = Axes.Both, Alpha = 0 }, - flagSprite = new Sprite - { - Anchor = Anchor.Centre, - Origin = Anchor.Centre, - - Size = new Vector2(WIDTH, HEIGHT) - new Vector2(8) - } + Flag }; } - - [BackgroundDependencyLoader] - private void load(TextureStore textures) - { - flagSprite.Texture = textures.Get($@"Flags/{Team.FlagName}"); - } } } } diff --git a/osu.Game.Tournament/Screens/Drawings/Components/StorageBackedTeamList.cs b/osu.Game.Tournament/Screens/Drawings/Components/StorageBackedTeamList.cs index 296a23339e..44ee9d64ca 100644 --- a/osu.Game.Tournament/Screens/Drawings/Components/StorageBackedTeamList.cs +++ b/osu.Game.Tournament/Screens/Drawings/Components/StorageBackedTeamList.cs @@ -6,6 +6,7 @@ using System.Collections.Generic; using System.IO; using osu.Framework.Logging; using osu.Framework.Platform; +using osu.Game.Tournament.Components; namespace osu.Game.Tournament.Screens.Drawings.Components { diff --git a/osu.Game.Tournament/Screens/Drawings/DrawingsScreen.cs b/osu.Game.Tournament/Screens/Drawings/DrawingsScreen.cs index e3853dca6f..8e6738d8d6 100644 --- a/osu.Game.Tournament/Screens/Drawings/DrawingsScreen.cs +++ b/osu.Game.Tournament/Screens/Drawings/DrawingsScreen.cs @@ -19,6 +19,7 @@ using osu.Game.Graphics.Sprites; using osu.Game.Graphics.UserInterface; using osu.Game.Screens; using osu.Game.Screens.Backgrounds; +using osu.Game.Tournament.Components; using osu.Game.Tournament.Screens.Drawings.Components; using OpenTK; using OpenTK.Graphics; diff --git a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs index 9d8ea00e31..1a190b4cc7 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs @@ -9,7 +9,7 @@ using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; -using osu.Game.Tournament.Screens.Drawings.Components; +using osu.Game.Tournament.Components; using OpenTK; using OpenTK.Graphics; diff --git a/osu.Game.Tournament/Screens/Ladder/Components/MatchPairing.cs b/osu.Game.Tournament/Screens/Ladder/Components/MatchPairing.cs index b8d8b77d74..26beb5c598 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/MatchPairing.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/MatchPairing.cs @@ -2,7 +2,7 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Configuration; -using osu.Game.Tournament.Screens.Drawings.Components; +using osu.Game.Tournament.Components; namespace osu.Game.Tournament.Screens.Ladder.Components { From 9fbbede027f76880e4649631f189a5c08eb03d8c Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 26 Aug 2018 01:30:33 +0900 Subject: [PATCH 004/317] Fix spacing --- .../Screens/Ladder/Components/DrawableMatchPairing.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs index 281208cdcf..dd98e92ca3 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs @@ -3,6 +3,7 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; +using OpenTK; namespace osu.Game.Tournament.Screens.Ladder.Components { @@ -23,6 +24,7 @@ namespace osu.Game.Tournament.Screens.Ladder.Components { AutoSizeAxes = Axes.Both, Direction = FillDirection.Vertical, + Spacing = new Vector2(2) }; pairing.Team1.BindValueChanged(_ => updateTeams()); From bfc5ccd6d0a39cd3c0ea4898b7c23fa9962fd24c Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 26 Aug 2018 18:37:46 +0900 Subject: [PATCH 005/317] Add winners and progressions --- .../TestCaseMatchPairings.cs | 47 ++++++- .../Ladder/Components/DrawableMatchPairing.cs | 117 ++++++++++++++++-- .../Screens/Ladder/Components/MatchPairing.cs | 8 ++ 3 files changed, 158 insertions(+), 14 deletions(-) diff --git a/osu.Game.Tournament.Tests/TestCaseMatchPairings.cs b/osu.Game.Tournament.Tests/TestCaseMatchPairings.cs index d5835896a4..a1ab2c7a48 100644 --- a/osu.Game.Tournament.Tests/TestCaseMatchPairings.cs +++ b/osu.Game.Tournament.Tests/TestCaseMatchPairings.cs @@ -23,6 +23,9 @@ namespace osu.Game.Tournament.Tests public TestCaseMatchPairings() { + FillFlowContainer level1; + FillFlowContainer level2; + var pairing1 = new MatchPairing( new TournamentTeam { FlagName = "AU", FullName = "Australia", }, new TournamentTeam { FlagName = "JP", FullName = "Japan", Acronym = "JPN" }) @@ -41,21 +44,53 @@ namespace osu.Game.Tournament.Tests Child = new FillFlowContainer { + AutoSizeAxes = Axes.Both, + Direction = FillDirection.Horizontal, Children = new Drawable[] { - new DrawableMatchPairing(pairing1), - new DrawableMatchPairing(pairing2), - new DrawableMatchPairing(new MatchPairing()) + level1 = new FillFlowContainer + { + AutoSizeAxes = Axes.Both, + Direction = FillDirection.Vertical, + Children = new[] + { + new DrawableMatchPairing(pairing1), + new DrawableMatchPairing(pairing2), + new DrawableMatchPairing(new MatchPairing()), + } + }, + level2 = new FillFlowContainer + { + AutoSizeAxes = Axes.Both, + Direction = FillDirection.Vertical, + Margin = new MarginPadding(20), + Children = new[] + { + new DrawableMatchPairing(new MatchPairing()), + new DrawableMatchPairing(new MatchPairing()) + } + } } }; + level1.Children[0].Progression = level2.Children[0]; + level1.Children[1].Progression = level2.Children[0]; + AddStep("mark complete", () => pairing1.Completed.Value = true); AddRepeatStep("change scores", () => pairing1.Team2Score.Value++, 5); AddStep("mark complete", () => pairing1.Completed.Value = true); + AddStep("add new team", () => pairing2.Team2.Value = new TournamentTeam { FlagName = "PT", FullName = "Portugal" }); + AddStep("Add progression", () => level1.Children[2].Progression = level2.Children[1]); - AddStep("add new team", () => pairing2.Team2.Value = - new TournamentTeam { FlagName = "PT", FullName = "Portugal" } - ); + AddStep("start match", () => pairing2.ResetScores()); + + AddRepeatStep("change scores", () => pairing2.Team1Score.Value++, 5); + AddStep("mark complete", () => pairing2.Completed.Value = true); + + AddStep("start submatch", () => level2.Children[0].Pairing.ResetScores()); + + AddRepeatStep("change scores", () => level2.Children[0].Pairing.Team1Score.Value++, 5); + AddStep("mark complete", () => level2.Children[0].Pairing.Completed.Value = true); } } } diff --git a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs index dd98e92ca3..461199327e 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs @@ -1,47 +1,148 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using System.Collections.Generic; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Lines; +using osu.Framework.MathUtils; using OpenTK; namespace osu.Game.Tournament.Screens.Ladder.Components { public class DrawableMatchPairing : CompositeDrawable { - private readonly MatchPairing pairing; + public readonly MatchPairing Pairing; private readonly FillFlowContainer flow; + private DrawableMatchPairing progression; + + private readonly Path path; + + public DrawableMatchPairing Progression + { + get => progression; + set + { + if (progression == value) return; + progression = value; + + if (LoadState == LoadState.Loaded) + updateProgression(); + + path.FadeInFromZero(200); + } + } + + private Vector2 progressionStart; + private Vector2 progressionEnd; + + private const float line_width = 2; + + private void updateProgression() + { + if (progression == null) + { + path.Positions = new List(); + return; + } + + Vector2 getCenteredVector(Vector2 top, Vector2 bottom) => new Vector2(top.X, top.Y + (bottom.Y - top.Y) / 2); + + const float padding = 5; + + var start = getCenteredVector(ScreenSpaceDrawQuad.TopRight, ScreenSpaceDrawQuad.BottomRight); + var end = getCenteredVector(progression.ScreenSpaceDrawQuad.TopLeft, progression.ScreenSpaceDrawQuad.BottomLeft); + + bool progressionAbove = progression.ScreenSpaceDrawQuad.TopLeft.Y < ScreenSpaceDrawQuad.TopLeft.Y; + + if (!Precision.AlmostEquals(progressionStart, start) || !Precision.AlmostEquals(progressionEnd, end)) + { + progressionStart = start; + progressionEnd = end; + + path.Origin = progressionAbove ? Anchor.BottomLeft : Anchor.TopLeft; + path.Y = progressionAbove ? line_width : -line_width; + + Vector2 startPosition = path.ToLocalSpace(start) + new Vector2(padding, 0); + Vector2 endPosition = path.ToLocalSpace(end) + new Vector2(-padding, 0); + Vector2 intermediate1 = startPosition + new Vector2(padding, 0); + Vector2 intermediate2 = new Vector2(intermediate1.X, endPosition.Y); + + path.Positions = new List + { + startPosition, + intermediate1, + intermediate2, + endPosition + }; + } + + var destinationForWinner = progressionAbove ? progression.Pairing.Team2 : progression.Pairing.Team1; + + destinationForWinner.Value = Pairing.Winner; + } + public DrawableMatchPairing(MatchPairing pairing) { - this.pairing = pairing; + Pairing = pairing; AutoSizeAxes = Axes.Both; Margin = new MarginPadding(5); - InternalChild = flow = new FillFlowContainer + InternalChildren = new Drawable[] { - AutoSizeAxes = Axes.Both, - Direction = FillDirection.Vertical, - Spacing = new Vector2(2) + flow = new FillFlowContainer + { + AutoSizeAxes = Axes.Both, + Direction = FillDirection.Vertical, + Spacing = new Vector2(2) + }, + path = new Path + { + Alpha = 0, + BypassAutoSizeAxes = Axes.Both, + Anchor = Anchor.CentreRight, + PathWidth = line_width, + }, }; pairing.Team1.BindValueChanged(_ => updateTeams()); pairing.Team2.BindValueChanged(_ => updateTeams()); + pairing.Completed.BindValueChanged(_ => updateProgression()); + updateTeams(); } + protected override void LoadComplete() + { + base.LoadComplete(); + updateTeams(); + } + + protected override void UpdateAfterAutoSize() + { + // required because the lines rely on flow being completed by other elements. + base.UpdateAfterAutoSize(); + updateProgression(); + } + private void updateTeams() { + if (LoadState != LoadState.Loaded) + return; + // todo: teams may need to be bindable for transitions at a later point. flow.Children = new[] { - new DrawableMatchTeam(pairing.Team1, pairing), - new DrawableMatchTeam(pairing.Team2, pairing) + new DrawableMatchTeam(Pairing.Team1, Pairing), + new DrawableMatchTeam(Pairing.Team2, Pairing) }; + + updateProgression(); } } } diff --git a/osu.Game.Tournament/Screens/Ladder/Components/MatchPairing.cs b/osu.Game.Tournament/Screens/Ladder/Components/MatchPairing.cs index 26beb5c598..b19b551a04 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/MatchPairing.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/MatchPairing.cs @@ -27,5 +27,13 @@ namespace osu.Game.Tournament.Screens.Ladder.Components Team1Score.ValueChanged += _ => Completed.Value = false; Team2Score.ValueChanged += _ => Completed.Value = false; } + + public TournamentTeam Winner => !Completed.Value ? null : (Team1Score.Value > Team2Score.Value ? Team1.Value : Team2.Value); + + public void ResetScores() + { + Team1Score.Value = 0; + Team2Score.Value = 0; + } } } From 041d8263961e746fedf1058227aa1a22c52e348b Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 26 Aug 2018 18:41:21 +0900 Subject: [PATCH 006/317] Simplify winner lookup --- .../Screens/Ladder/Components/DrawableMatchTeam.cs | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs index 1a190b4cc7..1f2447ef06 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs @@ -45,18 +45,10 @@ namespace osu.Game.Tournament.Screens.Ladder.Components if (pairing != null) { - completed.BindTo(pairing.Completed); + isWinner = () => pairing.Winner == Team; - if (team == pairing.Team1.Value) - { - score.BindTo(pairing.Team1Score); - isWinner = () => pairing.Team1Score.Value > pairing.Team2Score.Value; - } - else - { - score.BindTo(pairing.Team2Score); - isWinner = () => pairing.Team2Score.Value > pairing.Team1Score.Value; - } + completed.BindTo(pairing.Completed); + score.BindTo(team == pairing.Team1.Value ? pairing.Team1Score : pairing.Team2Score); } } From e4ea802c7bf00a5265a821689a9859f9861bc1d0 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 26 Aug 2018 19:11:46 +0900 Subject: [PATCH 007/317] Add user interaction and stricter change validation rules --- .../TestCaseMatchPairings.cs | 23 ++--- .../Ladder/Components/DrawableMatchPairing.cs | 86 ++++++++++++------- .../Ladder/Components/DrawableMatchTeam.cs | 32 ++++++- .../Screens/Ladder/Components/MatchPairing.cs | 20 ++++- .../Ladder/Components/TournamentConditions.cs | 13 +++ 5 files changed, 129 insertions(+), 45 deletions(-) create mode 100644 osu.Game.Tournament/Screens/Ladder/Components/TournamentConditions.cs diff --git a/osu.Game.Tournament.Tests/TestCaseMatchPairings.cs b/osu.Game.Tournament.Tests/TestCaseMatchPairings.cs index a1ab2c7a48..553e48a822 100644 --- a/osu.Game.Tournament.Tests/TestCaseMatchPairings.cs +++ b/osu.Game.Tournament.Tests/TestCaseMatchPairings.cs @@ -3,6 +3,8 @@ using System; using System.Collections.Generic; +using osu.Framework.Allocation; +using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Game.Tests.Visual; @@ -21,6 +23,9 @@ namespace osu.Game.Tournament.Tests typeof(DrawableTournamentTeam), }; + [Cached] + private Bindable conditions = new Bindable(new TournamentConditions { BestOf = 9 }); + public TestCaseMatchPairings() { FillFlowContainer level1; @@ -30,8 +35,8 @@ namespace osu.Game.Tournament.Tests new TournamentTeam { FlagName = "AU", FullName = "Australia", }, new TournamentTeam { FlagName = "JP", FullName = "Japan", Acronym = "JPN" }) { - Team1Score = { Value = 8 }, - Team2Score = { Value = 6 }, + Team1Score = { Value = 4 }, + Team2Score = { Value = 1 }, }; var pairing2 = new MatchPairing( @@ -76,21 +81,19 @@ namespace osu.Game.Tournament.Tests level1.Children[0].Progression = level2.Children[0]; level1.Children[1].Progression = level2.Children[0]; - AddStep("mark complete", () => pairing1.Completed.Value = true); - AddRepeatStep("change scores", () => pairing1.Team2Score.Value++, 5); - AddStep("mark complete", () => pairing1.Completed.Value = true); + AddRepeatStep("change scores", () => pairing1.Team2Score.Value++, 4); AddStep("add new team", () => pairing2.Team2.Value = new TournamentTeam { FlagName = "PT", FullName = "Portugal" }); AddStep("Add progression", () => level1.Children[2].Progression = level2.Children[1]); - AddStep("start match", () => pairing2.ResetScores()); + AddStep("start match", () => pairing2.StartMatch()); - AddRepeatStep("change scores", () => pairing2.Team1Score.Value++, 5); - AddStep("mark complete", () => pairing2.Completed.Value = true); + AddRepeatStep("change scores", () => pairing2.Team1Score.Value++, 10); - AddStep("start submatch", () => level2.Children[0].Pairing.ResetScores()); + AddStep("start submatch", () => level2.Children[0].Pairing.StartMatch()); AddRepeatStep("change scores", () => level2.Children[0].Pairing.Team1Score.Value++, 5); - AddStep("mark complete", () => level2.Children[0].Pairing.Completed.Value = true); + + AddRepeatStep("change scores", () => level2.Children[0].Pairing.Team2Score.Value++, 4); } } } diff --git a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs index 461199327e..7be302be73 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs @@ -2,6 +2,8 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; +using osu.Framework.Allocation; +using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Lines; @@ -14,9 +16,10 @@ namespace osu.Game.Tournament.Screens.Ladder.Components { public readonly MatchPairing Pairing; private readonly FillFlowContainer flow; - private DrawableMatchPairing progression; + private readonly Bindable conditions = new Bindable(); + private readonly Path path; public DrawableMatchPairing Progression @@ -39,6 +42,51 @@ namespace osu.Game.Tournament.Screens.Ladder.Components private const float line_width = 2; + public DrawableMatchPairing(MatchPairing pairing) + { + Pairing = pairing; + + AutoSizeAxes = Axes.Both; + + Margin = new MarginPadding(5); + + InternalChildren = new Drawable[] + { + flow = new FillFlowContainer + { + AutoSizeAxes = Axes.Both, + Direction = FillDirection.Vertical, + Spacing = new Vector2(2) + }, + path = new Path + { + Alpha = 0, + BypassAutoSizeAxes = Axes.Both, + Anchor = Anchor.CentreRight, + PathWidth = line_width, + }, + }; + + pairing.Team1.BindValueChanged(_ => updateTeams()); + pairing.Team2.BindValueChanged(_ => updateTeams()); + + pairing.Team1Score.BindValueChanged(_ => updateWinConditions()); + pairing.Team2Score.BindValueChanged(_ => updateWinConditions()); + + pairing.Completed.BindValueChanged(_ => updateProgression()); + + updateTeams(); + } + + [BackgroundDependencyLoader(true)] + private void load(Bindable conditions) + { + this.conditions.BindValueChanged(_ => updateWinConditions()); + + if (conditions != null) + this.conditions.BindTo(conditions); + } + private void updateProgression() { if (progression == null) @@ -83,37 +131,11 @@ namespace osu.Game.Tournament.Screens.Ladder.Components destinationForWinner.Value = Pairing.Winner; } - public DrawableMatchPairing(MatchPairing pairing) + private void updateWinConditions() { - Pairing = pairing; + if (conditions.Value == null) return; - AutoSizeAxes = Axes.Both; - - Margin = new MarginPadding(5); - - InternalChildren = new Drawable[] - { - flow = new FillFlowContainer - { - AutoSizeAxes = Axes.Both, - Direction = FillDirection.Vertical, - Spacing = new Vector2(2) - }, - path = new Path - { - Alpha = 0, - BypassAutoSizeAxes = Axes.Both, - Anchor = Anchor.CentreRight, - PathWidth = line_width, - }, - }; - - pairing.Team1.BindValueChanged(_ => updateTeams()); - pairing.Team2.BindValueChanged(_ => updateTeams()); - - pairing.Completed.BindValueChanged(_ => updateProgression()); - - updateTeams(); + Pairing.Completed.Value = Pairing.Team1Score.Value + Pairing.Team2Score.Value >= conditions.Value.BestOf; } protected override void LoadComplete() @@ -136,6 +158,9 @@ namespace osu.Game.Tournament.Screens.Ladder.Components // todo: teams may need to be bindable for transitions at a later point. + if (Pairing.Team1.Value == null || Pairing.Team2.Value == null) + Pairing.CancelMatchStart(); + flow.Children = new[] { new DrawableMatchTeam(Pairing.Team1, Pairing), @@ -143,6 +168,7 @@ namespace osu.Game.Tournament.Screens.Ladder.Components }; updateProgression(); + updateWinConditions(); } } } diff --git a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs index 1f2447ef06..06b400976c 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs @@ -7,16 +7,20 @@ using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; +using osu.Framework.Input.EventArgs; +using osu.Framework.Input.States; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; using osu.Game.Tournament.Components; using OpenTK; using OpenTK.Graphics; +using OpenTK.Input; namespace osu.Game.Tournament.Screens.Ladder.Components { public class DrawableMatchTeam : DrawableTournamentTeam { + private readonly MatchPairing pairing; private OsuSpriteText scoreText; private Box background; @@ -31,6 +35,7 @@ namespace osu.Game.Tournament.Screens.Ladder.Components public DrawableMatchTeam(TournamentTeam team, MatchPairing pairing) : base(team) { + this.pairing = pairing; Size = new Vector2(150, 40); Masking = true; @@ -48,7 +53,8 @@ namespace osu.Game.Tournament.Screens.Ladder.Components isWinner = () => pairing.Winner == Team; completed.BindTo(pairing.Completed); - score.BindTo(team == pairing.Team1.Value ? pairing.Team1Score : pairing.Team2Score); + if (team != null) + score.BindTo(team == pairing.Team1.Value ? pairing.Team1Score : pairing.Team2Score); } } @@ -109,6 +115,30 @@ namespace osu.Game.Tournament.Screens.Ladder.Components }, true); } + protected override bool OnMouseDown(InputState state, MouseDownEventArgs args) + { + if (Team == null) return true; + + if (args.Button == MouseButton.Left) + { + if (score.Value == null) + { + pairing.StartMatch(); + } + else if (!pairing.Completed) + score.Value++; + } + else + { + if (score.Value > 0) + score.Value--; + else + pairing.CancelMatchStart(); + } + + return true; + } + private void updateWinStyle() { bool winner = completed && isWinner?.Invoke() == true; diff --git a/osu.Game.Tournament/Screens/Ladder/Components/MatchPairing.cs b/osu.Game.Tournament/Screens/Ladder/Components/MatchPairing.cs index b19b551a04..b615330cc2 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/MatchPairing.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/MatchPairing.cs @@ -23,15 +23,27 @@ namespace osu.Game.Tournament.Screens.Ladder.Components { Team1.Value = team1; Team2.Value = team2; - - Team1Score.ValueChanged += _ => Completed.Value = false; - Team2Score.ValueChanged += _ => Completed.Value = false; } public TournamentTeam Winner => !Completed.Value ? null : (Team1Score.Value > Team2Score.Value ? Team1.Value : Team2.Value); - public void ResetScores() + /// + /// Remove scores from the match, in case of a false click or false start. + /// + public void CancelMatchStart() { + Team1Score.Value = null; + Team2Score.Value = null; + } + + /// + /// Initialise this match with zeroed scores. Will be a noop if either team is not present. + /// + public void StartMatch() + { + if (Team1.Value == null || Team2.Value == null) + return; + Team1Score.Value = 0; Team2Score.Value = 0; } diff --git a/osu.Game.Tournament/Screens/Ladder/Components/TournamentConditions.cs b/osu.Game.Tournament/Screens/Ladder/Components/TournamentConditions.cs new file mode 100644 index 0000000000..fd0e8cea87 --- /dev/null +++ b/osu.Game.Tournament/Screens/Ladder/Components/TournamentConditions.cs @@ -0,0 +1,13 @@ +namespace osu.Game.Tournament.Screens.Ladder.Components +{ + /// + /// Conditions governing a tournament. + /// + public class TournamentConditions + { + /// + /// How many matches before a winner is decided. + /// + public int BestOf; + } +} From 6e6b6b285ae8fce66c9da2154337f53a410515d1 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 27 Aug 2018 17:08:00 +0900 Subject: [PATCH 008/317] Don't require every-frame update --- .../Screens/Ladder/Components/DrawableMatchPairing.cs | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs index 7be302be73..8191df6680 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs @@ -144,13 +144,6 @@ namespace osu.Game.Tournament.Screens.Ladder.Components updateTeams(); } - protected override void UpdateAfterAutoSize() - { - // required because the lines rely on flow being completed by other elements. - base.UpdateAfterAutoSize(); - updateProgression(); - } - private void updateTeams() { if (LoadState != LoadState.Loaded) @@ -167,7 +160,7 @@ namespace osu.Game.Tournament.Screens.Ladder.Components new DrawableMatchTeam(Pairing.Team2, Pairing) }; - updateProgression(); + SchedulerAfterChildren.Add(() => Scheduler.Add(updateProgression)); updateWinConditions(); } } From e6baf418fba4bd216ef1801383066f66d2c4cf34 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 4 Sep 2018 01:34:17 +0900 Subject: [PATCH 009/317] Add tournament tests rider configuration --- .../runConfigurations/TournamentTests.xml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .idea/.idea.osu/.idea/runConfigurations/TournamentTests.xml diff --git a/.idea/.idea.osu/.idea/runConfigurations/TournamentTests.xml b/.idea/.idea.osu/.idea/runConfigurations/TournamentTests.xml new file mode 100644 index 0000000000..5b425e8582 --- /dev/null +++ b/.idea/.idea.osu/.idea/runConfigurations/TournamentTests.xml @@ -0,0 +1,18 @@ + + + + \ No newline at end of file From 234b04dfc567629da9056ee6925882afd066126d Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 10 Sep 2018 04:51:38 +0900 Subject: [PATCH 010/317] Add basic ladder manager and state retention --- .../TestCaseLadderManager.cs | 34 +++++++++++++ .../TestCaseMatchPairings.cs | 13 ++--- osu.Game.Tournament.Tests/teams.json | 1 + .../Components/TournamentTeam.cs | 13 ++++- .../Components/StorageBackedTeamList.cs | 1 - .../Ladder/Components/DrawableMatchPairing.cs | 33 +++++++++++- .../Ladder/Components/DrawableMatchTeam.cs | 47 ++++++++++++++--- .../Screens/Ladder/Components/LadderInfo.cs | 9 ++++ .../Ladder/Components/LadderManager.cs | 51 +++++++++++++++++++ .../Screens/Ladder/Components/MatchPairing.cs | 21 ++++++-- 10 files changed, 199 insertions(+), 24 deletions(-) create mode 100644 osu.Game.Tournament.Tests/TestCaseLadderManager.cs create mode 100644 osu.Game.Tournament.Tests/teams.json create mode 100644 osu.Game.Tournament/Screens/Ladder/Components/LadderInfo.cs create mode 100644 osu.Game.Tournament/Screens/Ladder/Components/LadderManager.cs diff --git a/osu.Game.Tournament.Tests/TestCaseLadderManager.cs b/osu.Game.Tournament.Tests/TestCaseLadderManager.cs new file mode 100644 index 0000000000..dc4633aa17 --- /dev/null +++ b/osu.Game.Tournament.Tests/TestCaseLadderManager.cs @@ -0,0 +1,34 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System.Collections.Generic; +using System.IO; +using Newtonsoft.Json; +using osu.Framework.Allocation; +using osu.Game.Tests.Visual; +using osu.Game.Tournament.Components; +using osu.Game.Tournament.Screens.Ladder.Components; + +namespace osu.Game.Tournament.Tests +{ + public class TestCaseLadderManager : OsuTestCase + { + [Cached] + private readonly LadderManager manager; + + public TestCaseLadderManager() + { + var teams = JsonConvert.DeserializeObject>(File.ReadAllText(@"teams.json")); + var ladder = JsonConvert.DeserializeObject(File.ReadAllText(@"bracket.json")) ?? new LadderInfo(); + + Child = manager = new LadderManager(ladder, teams); + } + + protected override void Dispose(bool isDisposing) + { + base.Dispose(isDisposing); + + File.WriteAllText(@"bracket.json", JsonConvert.SerializeObject(manager.Info)); + } + } +} diff --git a/osu.Game.Tournament.Tests/TestCaseMatchPairings.cs b/osu.Game.Tournament.Tests/TestCaseMatchPairings.cs index 553e48a822..bd6b085b0f 100644 --- a/osu.Game.Tournament.Tests/TestCaseMatchPairings.cs +++ b/osu.Game.Tournament.Tests/TestCaseMatchPairings.cs @@ -28,8 +28,8 @@ namespace osu.Game.Tournament.Tests public TestCaseMatchPairings() { - FillFlowContainer level1; - FillFlowContainer level2; + Container level1; + Container level2; var pairing1 = new MatchPairing( new TournamentTeam { FlagName = "AU", FullName = "Australia", }, @@ -47,16 +47,14 @@ namespace osu.Game.Tournament.Tests } ); - Child = new FillFlowContainer + Child = new Container { AutoSizeAxes = Axes.Both, - Direction = FillDirection.Horizontal, Children = new Drawable[] { - level1 = new FillFlowContainer + level1 = new Container { AutoSizeAxes = Axes.Both, - Direction = FillDirection.Vertical, Children = new[] { new DrawableMatchPairing(pairing1), @@ -64,10 +62,9 @@ namespace osu.Game.Tournament.Tests new DrawableMatchPairing(new MatchPairing()), } }, - level2 = new FillFlowContainer + level2 = new Container { AutoSizeAxes = Axes.Both, - Direction = FillDirection.Vertical, Margin = new MarginPadding(20), Children = new[] { diff --git a/osu.Game.Tournament.Tests/teams.json b/osu.Game.Tournament.Tests/teams.json new file mode 100644 index 0000000000..7df0040469 --- /dev/null +++ b/osu.Game.Tournament.Tests/teams.json @@ -0,0 +1 @@ +[{"Players":[{"id":3632846,"username":"lxLucasxl"},{"id":7110363,"username":"BubShish"},{"id":5748843,"username":"Fisk-"},{"id":4585260,"username":"A b y s s"},{"id":9513273,"username":"VorticalEx"},{"id":7341471,"username":"Bossplays_02"}],"Name":"Argentina","Acronym":"ARG"},{"Players":[{"id":2956184,"username":"Lusty Platypus"},{"id":2145124,"username":"Spartan-"},{"id":4018184,"username":"Rek"},{"id":4247722,"username":"PotassiumF"},{"id":9527845,"username":"AngeLItchysick"},{"id":8832989,"username":"[Crz]Yukikaze-"}],"Name":"Australia","Acronym":"AUS"},{"Players":[{"id":9530019,"username":"Lothus"},{"id":2288363,"username":"SillyFangirl"},{"id":4917435,"username":"FelipeLink"},{"id":5691061,"username":"andreymc"},{"id":4794096,"username":"Shedin"},{"id":3224958,"username":"Lazarento"}],"Name":"Brazil","Acronym":"BRA"},{"Players":[{"id":2747704,"username":"Dawt"},{"id":7025841,"username":"CommandoBlack"},{"id":5390121,"username":"Piggy"},{"id":2198070,"username":"beary605"},{"id":2777647,"username":"Freeflow"},{"id":9675053,"username":"Kiyora"}],"Name":"Canada","Acronym":"CAN"},{"Players":[{"id":5281416,"username":"WalterToro"},{"id":2225008,"username":"Skalim"},{"id":469808,"username":"Sophti"},{"id":4686036,"username":"sebaex"},{"id":4116072,"username":"Arkener"},{"id":4531184,"username":"Raizenn"}],"Name":"Chile","Acronym":"CHL"},{"Players":[{"id":89545,"username":"ZhangFan"},{"id":7215250,"username":"[Crz]Mix0130"},{"id":7961511,"username":"[Crz]Hina"},{"id":7082178,"username":"[Crz]Satori"},{"id":6659363,"username":"Wilben_Chan"},{"id":5270332,"username":"[Crz]Lucifer"}],"Name":"China","Acronym":"CHN"},{"Players":[{"id":2883132,"username":"Jole"},{"id":5001658,"username":"FreakyHands"},{"id":4402263,"username":"mart732c"},{"id":6751666,"username":"tailsdk"},{"id":5352616,"username":"Kainura"},{"id":8969233,"username":"zyglrox"}],"Name":"Denmark","Acronym":"DNK"},{"Players":[{"id":8132964,"username":"Camopoltergeist"},{"id":4789005,"username":"princesswell"},{"id":9663200,"username":"--Vanilla--"},{"id":1982941,"username":"matti644"},{"id":8370443,"username":"Your Daughter"},{"id":8105584,"username":"Twist-X"}],"Name":"Finland","Acronym":"FIN"},{"Players":[{"id":1594604,"username":"Azubeur"},{"id":2284328,"username":"Elementaires"},{"id":3897919,"username":"AntoAa"},{"id":4056690,"username":"Todestrieb"},{"id":7190228,"username":"Cunu"},{"id":3909293,"username":"DemonWaves"}],"Name":"France","Acronym":"FRA"},{"Players":[{"id":4516252,"username":"Malox"},{"id":3357640,"username":"ElectroYan"},{"id":5587671,"username":"-Dom-"},{"id":9764403,"username":"tyro901"},{"id":7009106,"username":"Nediz"},{"id":6232245,"username":"LastExceed"}],"Name":"Germany","Acronym":"GER"},{"Players":[{"id":5417362,"username":"Mooncha"},{"id":2121137,"username":"ng051106"},{"id":4544555,"username":"Opean"},{"id":643394,"username":"Snow Note"}],"Name":"['Hong Kong']","Acronym":"HKG"},{"Players":[{"id":5767941,"username":"RemFangirl"},{"id":4557440,"username":"reyss"},{"id":5492871,"username":"LovelySerenade"},{"id":6045757,"username":"Nixeria-sama"},{"id":5114499,"username":"lombit"},{"id":3497139,"username":"LordBoker-"}],"Name":"Indonesia","Acronym":"IDN"},{"Players":[{"id":3461860,"username":"Yomiel"},{"id":5245132,"username":"BadIsTheNewGod"},{"id":3244389,"username":"Mura7797"},{"id":8889323,"username":"extramen"},{"id":8485394,"username":"Cribob"},{"id":6380163,"username":"CribobFanBoy"}],"Name":"Italy","Acronym":"ITA"},{"Players":[{"id":1824775,"username":"inteliser"},{"id":7540718,"username":"tinpura"},{"id":1847698,"username":"PiraTom"},{"id":10011429,"username":"[ misa ]"},{"id":8679066,"username":"mach_jp"},{"id":10242062,"username":"AMDuskia1996"}],"Name":"Japan","Acronym":"JPN"},{"Players":[{"id":3946113,"username":"idqoos123"},{"id":10543278,"username":"hh27v5Fangirl"},{"id":8566617,"username":"capchon"},{"id":5315736,"username":"my2tic"}],"Name":"Macau","Acronym":"MAC"},{"Players":[{"id":7727987,"username":"Neokje"},{"id":8287005,"username":"[MY]xRay"},{"id":9627666,"username":"Minisora"},{"id":6237337,"username":"watarakisah"},{"id":6363947,"username":"Kiritolow"},{"id":4477497,"username":"cheewee10"}],"Name":"Malaysia","Acronym":"MYS"},{"Players":[{"id":1098581,"username":"mrdawn2"},{"id":9369363,"username":"TheSnooperPS"},{"id":6964358,"username":"Redenor"},{"id":9630674,"username":"Freek"},{"id":2827823,"username":"Boots"},{"id":5183940,"username":"2fast4you98"}],"Name":"Netherlands","Acronym":"NLD"},{"Players":[{"id":86188,"username":"Staiain"},{"id":7676585,"username":"Bizarrely_F4st"},{"id":3494742,"username":"KarlF"},{"id":3750387,"username":"Falniir"},{"id":9000473,"username":"Jesen"},{"id":2764122,"username":"Hjeg"}],"Name":"Norway","Acronym":"NOR"},{"Players":[{"id":914472,"username":"akuma123"},{"id":6114633,"username":"DaZeRo5"},{"id":11885200,"username":"DaKub"},{"id":10218427,"username":"Ovento17"}],"Name":"Peru","Acronym":"PER"},{"Players":[{"id":2039089,"username":"arcwinolivirus"},{"id":4469895,"username":"SurfChu85"},{"id":2471512,"username":"JztCallMeRon"},{"id":9770359,"username":"Toyohime-"},{"id":2722489,"username":"Cielo Day"},{"id":3770641,"username":"Ainyan"}],"Name":"Philippines","Acronym":"PHL"},{"Players":[{"id":743282,"username":"Tidek"},{"id":1654221,"username":"Hudonom"},{"id":6382502,"username":"Kroly-"},{"id":6905790,"username":"Arkitev"},{"id":2235750,"username":"_underjoy"},{"id":3353343,"username":"[-Agonys-]"}],"Name":"Poland","Acronym":"POL"},{"Players":[{"id":9074986,"username":"AngeloLagusa"},{"id":5145890,"username":"Jormungand"},{"id":9847747,"username":"MAZAFUKER1337"},{"id":8035172,"username":"fegasaren"},{"id":7767168,"username":"claer"}],"Name":"['Russian Federation']","Acronym":"RUS"},{"Players":[{"id":7199159,"username":"ByeForNow"},{"id":876528,"username":"Tamaneko"},{"id":8612061,"username":"Polytetral"},{"id":7462804,"username":"Lindyes"},{"id":4574597,"username":"OrienST8"},{"id":9362562,"username":"LuigiClaren"}],"Name":"Singapore","Acronym":"SGP"},{"Players":[{"id":6699923,"username":"SuddenDeath"},{"id":7014697,"username":"Estonians"},{"id":8474029,"username":"wonder5193"},{"id":8283444,"username":"[ Special ]"},{"id":903155,"username":"Nausicaa"},{"id":7945868,"username":"SnowScent"}],"Name":"['South Korea']","Acronym":"KOR"},{"Players":[{"id":3154852,"username":"aitor98"},{"id":8141215,"username":"David5_"},{"id":7935867,"username":"miguel-580"},{"id":6809566,"username":"itsdarious555"},{"id":8497100,"username":"GreenSoul"}],"Name":"Spain","Acronym":"ESP"},{"Players":[{"id":1612580,"username":"Vent"},{"id":6872025,"username":"Couil"},{"id":2229274,"username":"Xytox"},{"id":4899311,"username":"Stug"},{"id":5045509,"username":"YoShiZoRi"},{"id":3918056,"username":"Craty"}],"Name":"Sweden","Acronym":"SWE"},{"Players":[{"id":4952941,"username":"Gamer97"},{"id":8642966,"username":"Adyrem"},{"id":8372292,"username":"doere_"},{"id":9593126,"username":"Monogai"},{"id":3974114,"username":"Haprapra"},{"id":2573716,"username":"Akayro"}],"Name":"Switzerland","Acronym":"CHE"},{"Players":[{"id":766374,"username":"LostCool"},{"id":2838908,"username":"4ksrub"},{"id":6535376,"username":"SharpKunG1412"},{"id":2772110,"username":"BossMadWolf"},{"id":8521723,"username":"MyZterioN-"},{"id":6456531,"username":"-[DaNieL_TH]-"}],"Name":"Thailand","Acronym":"THA"},{"Players":[{"id":2656856,"username":"Sakaki"},{"id":6193819,"username":"SaKuRaLaN"},{"id":1990582,"username":"mspstommy"},{"id":8819232,"username":"Tamamo Desu"},{"id":11531528,"username":"Red MewFew"},{"id":1967808,"username":"luckygino"}],"Name":"Taiwan","Acronym":"TWN"},{"Players":[{"id":3359035,"username":"Amascite"},{"id":4168230,"username":"PikachuNick"},{"id":3617889,"username":"itsjakey"},{"id":3799946,"username":"xSnaggles"},{"id":6814203,"username":"Civilization"},{"id":6701945,"username":"Domblade"}],"Name":"['United Kingdom']","Acronym":"GBR"},{"Players":[{"id":7616811,"username":"TheToaphster"},{"id":2141612,"username":"stupud man"},{"id":7687954,"username":"Neuro-"},{"id":3251373,"username":"-Electro-"},{"id":5610085,"username":"EtienneXC"},{"id":2594280,"username":"Chrubble"}],"Name":"['United States']","Acronym":"USA"},{"Players":[{"id":2243452,"username":"Nakatoru"},{"id":8065567,"username":"Aezlack"},{"id":8301758,"username":"Edvo"},{"id":2140739,"username":"[_Chichinya_]"},{"id":8198818,"username":"[_Gearfrik_]"},{"id":1489811,"username":"_Yisus_"}],"Name":"Venezuela","Acronym":"VEN"}] \ No newline at end of file diff --git a/osu.Game.Tournament/Components/TournamentTeam.cs b/osu.Game.Tournament/Components/TournamentTeam.cs index 03d787af76..14e874e9ef 100644 --- a/osu.Game.Tournament/Components/TournamentTeam.cs +++ b/osu.Game.Tournament/Components/TournamentTeam.cs @@ -1,6 +1,9 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using System.Collections.Generic; +using osu.Game.Users; + namespace osu.Game.Tournament.Components { public class TournamentTeam @@ -10,10 +13,16 @@ namespace osu.Game.Tournament.Components /// public string FullName; + private string flagName; + /// /// Name of the file containing the flag. /// - public string FlagName; + public string FlagName + { + get { return flagName ?? Acronym.Substring(0, 2); } + set { flagName = value; } + } private string acronym; @@ -25,5 +34,7 @@ namespace osu.Game.Tournament.Components get { return acronym ?? FullName.Substring(0, 3); } set { acronym = value; } } + + public List Players { get; set; } } } diff --git a/osu.Game.Tournament/Screens/Drawings/Components/StorageBackedTeamList.cs b/osu.Game.Tournament/Screens/Drawings/Components/StorageBackedTeamList.cs index 44ee9d64ca..625f05edac 100644 --- a/osu.Game.Tournament/Screens/Drawings/Components/StorageBackedTeamList.cs +++ b/osu.Game.Tournament/Screens/Drawings/Components/StorageBackedTeamList.cs @@ -50,7 +50,6 @@ namespace osu.Game.Tournament.Screens.Drawings.Components teams.Add(new TournamentTeam { - FlagName = split[0].Trim(), FullName = split[1].Trim(), Acronym = split.Length >= 3 ? split[2].Trim() : null }); diff --git a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs index 8191df6680..62d38a2ee6 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs @@ -7,8 +7,12 @@ using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Lines; +using osu.Framework.Input.EventArgs; +using osu.Framework.Input.States; using osu.Framework.MathUtils; using OpenTK; +using OpenTK.Input; +using SixLabors.Primitives; namespace osu.Game.Tournament.Screens.Ladder.Components { @@ -46,6 +50,8 @@ namespace osu.Game.Tournament.Screens.Ladder.Components { Pairing = pairing; + Position = new Vector2(pairing.Position.X, pairing.Position.Y); + AutoSizeAxes = Axes.Both; Margin = new MarginPadding(5); @@ -103,15 +109,19 @@ namespace osu.Game.Tournament.Screens.Ladder.Components var end = getCenteredVector(progression.ScreenSpaceDrawQuad.TopLeft, progression.ScreenSpaceDrawQuad.BottomLeft); bool progressionAbove = progression.ScreenSpaceDrawQuad.TopLeft.Y < ScreenSpaceDrawQuad.TopLeft.Y; + bool progressionToRight = progression.ScreenSpaceDrawQuad.TopLeft.X > ScreenSpaceDrawQuad.TopLeft.X; if (!Precision.AlmostEquals(progressionStart, start) || !Precision.AlmostEquals(progressionEnd, end)) { progressionStart = start; progressionEnd = end; - path.Origin = progressionAbove ? Anchor.BottomLeft : Anchor.TopLeft; + path.Origin = progressionAbove ? Anchor.y2 : Anchor.y0; path.Y = progressionAbove ? line_width : -line_width; + path.Origin |= progressionToRight ? Anchor.x0 : Anchor.x2; + //path.X = progressionToRight ? line_width : -line_width; + Vector2 startPosition = path.ToLocalSpace(start) + new Vector2(padding, 0); Vector2 endPosition = path.ToLocalSpace(end) + new Vector2(-padding, 0); Vector2 intermediate1 = startPosition + new Vector2(padding, 0); @@ -131,6 +141,12 @@ namespace osu.Game.Tournament.Screens.Ladder.Components destinationForWinner.Value = Pairing.Winner; } + protected override void UpdateAfterAutoSize() + { + base.UpdateAfterAutoSize(); + updateProgression(); + } + private void updateWinConditions() { if (conditions.Value == null) return; @@ -163,5 +179,20 @@ namespace osu.Game.Tournament.Screens.Ladder.Components SchedulerAfterChildren.Add(() => Scheduler.Add(updateProgression)); updateWinConditions(); } + + protected override bool OnMouseDown(InputState state, MouseDownEventArgs args) => args.Button == MouseButton.Left; + + protected override bool OnDragStart(InputState state) => true; + + protected override bool OnDrag(InputState state) + { + if (base.OnDrag(state)) return true; + + this.MoveToOffset(state.Mouse.Delta); + + var pos = Position; + Pairing.Position = new Point((int)pos.X, (int)pos.Y); + return true; + } } } diff --git a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs index 06b400976c..1077438693 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs @@ -2,11 +2,15 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; +using System.Collections.Generic; +using System.Linq; using osu.Framework.Allocation; using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Cursor; using osu.Framework.Graphics.Shapes; +using osu.Framework.Graphics.UserInterface; using osu.Framework.Input.EventArgs; using osu.Framework.Input.States; using osu.Game.Graphics; @@ -18,8 +22,9 @@ using OpenTK.Input; namespace osu.Game.Tournament.Screens.Ladder.Components { - public class DrawableMatchTeam : DrawableTournamentTeam + public class DrawableMatchTeam : DrawableTournamentTeam, IHasContextMenu { + private readonly Bindable team; private readonly MatchPairing pairing; private OsuSpriteText scoreText; private Box background; @@ -31,10 +36,12 @@ namespace osu.Game.Tournament.Screens.Ladder.Components private Color4 colourNormal; private readonly Func isWinner; + private LadderManager manager; - public DrawableMatchTeam(TournamentTeam team, MatchPairing pairing) + public DrawableMatchTeam(Bindable team, MatchPairing pairing) : base(team) { + this.team = team.GetBoundCopy(); this.pairing = pairing; Size = new Vector2(150, 40); @@ -53,14 +60,16 @@ namespace osu.Game.Tournament.Screens.Ladder.Components isWinner = () => pairing.Winner == Team; completed.BindTo(pairing.Completed); - if (team != null) - score.BindTo(team == pairing.Team1.Value ? pairing.Team1Score : pairing.Team2Score); + if (team.Value != null) + score.BindTo(team.Value == pairing.Team1.Value ? pairing.Team1Score : pairing.Team2Score); } } - [BackgroundDependencyLoader] - private void load(OsuColour colours) + [BackgroundDependencyLoader(true)] + private void load(OsuColour colours, LadderManager manager) { + this.manager = manager; + colourWinner = colours.BlueDarker; colourNormal = OsuColour.Gray(0.2f); @@ -117,7 +126,7 @@ namespace osu.Game.Tournament.Screens.Ladder.Components protected override bool OnMouseDown(InputState state, MouseDownEventArgs args) { - if (Team == null) return true; + if (Team == null) return false; if (args.Button == MouseButton.Left) { @@ -136,7 +145,7 @@ namespace osu.Game.Tournament.Screens.Ladder.Components pairing.CancelMatchStart(); } - return true; + return false; } private void updateWinStyle() @@ -147,5 +156,27 @@ namespace osu.Game.Tournament.Screens.Ladder.Components scoreText.Font = AcronymText.Font = winner ? "Exo2.0-Bold" : "Exo2.0-Regular"; } + + public MenuItem[] ContextMenuItems => new[] + { + new MenuItem("Populate team", () => team.Value = manager.Teams.Random()), + }; + } + + internal static class Extensions + { + public static T Random(this IEnumerable enumerable) + { + if (enumerable == null) + { + throw new ArgumentNullException(nameof(enumerable)); + } + + // note: creating a Random instance each call may not be correct for you, + // consider a thread-safe static instance + var r = new Random(); + var list = enumerable as IList ?? enumerable.ToList(); + return list.Count == 0 ? default(T) : list[r.Next(0, list.Count)]; + } } } diff --git a/osu.Game.Tournament/Screens/Ladder/Components/LadderInfo.cs b/osu.Game.Tournament/Screens/Ladder/Components/LadderInfo.cs new file mode 100644 index 0000000000..e65cc7a512 --- /dev/null +++ b/osu.Game.Tournament/Screens/Ladder/Components/LadderInfo.cs @@ -0,0 +1,9 @@ +using System.Collections.Generic; + +namespace osu.Game.Tournament.Screens.Ladder.Components +{ + public class LadderInfo + { + public List Pairings = new List(); + } +} diff --git a/osu.Game.Tournament/Screens/Ladder/Components/LadderManager.cs b/osu.Game.Tournament/Screens/Ladder/Components/LadderManager.cs new file mode 100644 index 0000000000..b7764f946f --- /dev/null +++ b/osu.Game.Tournament/Screens/Ladder/Components/LadderManager.cs @@ -0,0 +1,51 @@ +using System.Collections.Generic; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Input.States; +using osu.Game.Graphics.Cursor; +using osu.Game.Tournament.Components; +using SixLabors.Primitives; + +namespace osu.Game.Tournament.Screens.Ladder.Components +{ + public class LadderManager : CompositeDrawable + { + public readonly LadderInfo Info; + public readonly List Teams; + private readonly OsuContextMenuContainer content; + + public LadderManager(LadderInfo info, List teams) + { + Info = info; + Teams = teams; + + RelativeSizeAxes = Axes.Both; + + InternalChild = content = new OsuContextMenuContainer + { + RelativeSizeAxes = Axes.Both + }; + + foreach (var pairing in info.Pairings) + addPairing(pairing); + } + + protected void AddPairing(MatchPairing pairing) + { + Info.Pairings.Add(pairing); + addPairing(pairing); + } + + private void addPairing(MatchPairing pairing) => content.Add(new DrawableMatchPairing(pairing)); + + protected override bool OnClick(InputState state) + { + AddPairing(new MatchPairing + { + Position = new Point((int)state.Mouse.Position.X, (int)state.Mouse.Position.Y) + }); + + return true; + } + } +} diff --git a/osu.Game.Tournament/Screens/Ladder/Components/MatchPairing.cs b/osu.Game.Tournament/Screens/Ladder/Components/MatchPairing.cs index b615330cc2..d2a8f66cfd 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/MatchPairing.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/MatchPairing.cs @@ -1,8 +1,10 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using Newtonsoft.Json; using osu.Framework.Configuration; using osu.Game.Tournament.Components; +using SixLabors.Primitives; namespace osu.Game.Tournament.Screens.Ladder.Components { @@ -11,13 +13,22 @@ namespace osu.Game.Tournament.Screens.Ladder.Components /// public class MatchPairing { - public Bindable Team1 = new Bindable(); - public Bindable Team1Score = new Bindable(); + public readonly Bindable Team1 = new Bindable(); - public Bindable Team2 = new Bindable(); - public Bindable Team2Score = new Bindable(); + public readonly Bindable Team1Score = new Bindable(); - public Bindable Completed = new Bindable(); + public readonly Bindable Team2 = new Bindable(); + + public readonly Bindable Team2Score = new Bindable(); + + public readonly Bindable Completed = new Bindable(); + + [JsonProperty] + public Point Position; + + public MatchPairing() + { + } public MatchPairing(TournamentTeam team1 = null, TournamentTeam team2 = null) { From ff125f4c71a4f6ee0d8cd746469b3fbb9530bc6d Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 15 Sep 2018 22:13:32 +0900 Subject: [PATCH 011/317] Reduce noise in json output and handle the case the file doesn't exist --- osu.Game.Tournament.Tests/TestCaseLadderManager.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/osu.Game.Tournament.Tests/TestCaseLadderManager.cs b/osu.Game.Tournament.Tests/TestCaseLadderManager.cs index dc4633aa17..b61619de12 100644 --- a/osu.Game.Tournament.Tests/TestCaseLadderManager.cs +++ b/osu.Game.Tournament.Tests/TestCaseLadderManager.cs @@ -19,7 +19,7 @@ namespace osu.Game.Tournament.Tests public TestCaseLadderManager() { var teams = JsonConvert.DeserializeObject>(File.ReadAllText(@"teams.json")); - var ladder = JsonConvert.DeserializeObject(File.ReadAllText(@"bracket.json")) ?? new LadderInfo(); + var ladder = File.Exists(@"bracket.json") ? JsonConvert.DeserializeObject(File.ReadAllText(@"bracket.json")) : new LadderInfo(); Child = manager = new LadderManager(ladder, teams); } @@ -28,7 +28,12 @@ namespace osu.Game.Tournament.Tests { base.Dispose(isDisposing); - File.WriteAllText(@"bracket.json", JsonConvert.SerializeObject(manager.Info)); + File.WriteAllText(@"bracket.json", JsonConvert.SerializeObject(manager.Info, + new JsonSerializerSettings + { + NullValueHandling = NullValueHandling.Ignore, + DefaultValueHandling = DefaultValueHandling.Ignore + })); } } } From 74014bec408cd14cb863086469c27f501e14ac2b Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 16 Sep 2018 05:35:51 +0900 Subject: [PATCH 012/317] wip --- .../TestCaseLadderManager.cs | 6 +- .../TestCaseMatchPairings.cs | 6 +- .../Ladder/Components/DrawableMatchPairing.cs | 87 +---------- .../Ladder/Components/DrawableMatchTeam.cs | 1 + .../Screens/Ladder/Components/LadderInfo.cs | 1 + .../Ladder/Components/LadderManager.cs | 135 ++++++++++++++++-- .../Screens/Ladder/Components/MatchPairing.cs | 8 +- 7 files changed, 148 insertions(+), 96 deletions(-) diff --git a/osu.Game.Tournament.Tests/TestCaseLadderManager.cs b/osu.Game.Tournament.Tests/TestCaseLadderManager.cs index b61619de12..00a5df411f 100644 --- a/osu.Game.Tournament.Tests/TestCaseLadderManager.cs +++ b/osu.Game.Tournament.Tests/TestCaseLadderManager.cs @@ -5,6 +5,7 @@ using System.Collections.Generic; using System.IO; using Newtonsoft.Json; using osu.Framework.Allocation; +using osu.Framework.Configuration; using osu.Game.Tests.Visual; using osu.Game.Tournament.Components; using osu.Game.Tournament.Screens.Ladder.Components; @@ -16,6 +17,9 @@ namespace osu.Game.Tournament.Tests [Cached] private readonly LadderManager manager; + [Cached] + private Bindable conditions = new Bindable(new TournamentConditions { BestOf = 9 }); + public TestCaseLadderManager() { var teams = JsonConvert.DeserializeObject>(File.ReadAllText(@"teams.json")); @@ -28,7 +32,7 @@ namespace osu.Game.Tournament.Tests { base.Dispose(isDisposing); - File.WriteAllText(@"bracket.json", JsonConvert.SerializeObject(manager.Info, + File.WriteAllText(@"bracket.json", JsonConvert.SerializeObject(manager.CreateInfo(), new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore, diff --git a/osu.Game.Tournament.Tests/TestCaseMatchPairings.cs b/osu.Game.Tournament.Tests/TestCaseMatchPairings.cs index bd6b085b0f..ca2523c898 100644 --- a/osu.Game.Tournament.Tests/TestCaseMatchPairings.cs +++ b/osu.Game.Tournament.Tests/TestCaseMatchPairings.cs @@ -75,12 +75,12 @@ namespace osu.Game.Tournament.Tests } }; - level1.Children[0].Progression = level2.Children[0]; - level1.Children[1].Progression = level2.Children[0]; + level1.Children[0].Pairing.Progression.Value = level2.Children[0].Pairing; + level1.Children[1].Pairing.Progression.Value = level2.Children[0].Pairing; AddRepeatStep("change scores", () => pairing1.Team2Score.Value++, 4); AddStep("add new team", () => pairing2.Team2.Value = new TournamentTeam { FlagName = "PT", FullName = "Portugal" }); - AddStep("Add progression", () => level1.Children[2].Progression = level2.Children[1]); + AddStep("Add progression", () => level1.Children[2].Pairing.Progression.Value = level2.Children[1].Pairing); AddStep("start match", () => pairing2.StartMatch()); diff --git a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs index 62d38a2ee6..8f33cdcbbc 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs @@ -1,15 +1,12 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using System.Collections.Generic; using osu.Framework.Allocation; using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Lines; using osu.Framework.Input.EventArgs; using osu.Framework.Input.States; -using osu.Framework.MathUtils; using OpenTK; using OpenTK.Input; using SixLabors.Primitives; @@ -20,32 +17,8 @@ namespace osu.Game.Tournament.Screens.Ladder.Components { public readonly MatchPairing Pairing; private readonly FillFlowContainer flow; - private DrawableMatchPairing progression; - private readonly Bindable conditions = new Bindable(); - private readonly Path path; - - public DrawableMatchPairing Progression - { - get => progression; - set - { - if (progression == value) return; - progression = value; - - if (LoadState == LoadState.Loaded) - updateProgression(); - - path.FadeInFromZero(200); - } - } - - private Vector2 progressionStart; - private Vector2 progressionEnd; - - private const float line_width = 2; - public DrawableMatchPairing(MatchPairing pairing) { Pairing = pairing; @@ -63,14 +36,7 @@ namespace osu.Game.Tournament.Screens.Ladder.Components AutoSizeAxes = Axes.Both, Direction = FillDirection.Vertical, Spacing = new Vector2(2) - }, - path = new Path - { - Alpha = 0, - BypassAutoSizeAxes = Axes.Both, - Anchor = Anchor.CentreRight, - PathWidth = line_width, - }, + } }; pairing.Team1.BindValueChanged(_ => updateTeams()); @@ -80,6 +46,7 @@ namespace osu.Game.Tournament.Screens.Ladder.Components pairing.Team2Score.BindValueChanged(_ => updateWinConditions()); pairing.Completed.BindValueChanged(_ => updateProgression()); + pairing.Progression.BindValueChanged(_ => updateProgression()); updateTeams(); } @@ -95,58 +62,16 @@ namespace osu.Game.Tournament.Screens.Ladder.Components private void updateProgression() { - if (progression == null) - { - path.Positions = new List(); - return; - } + var progression = Pairing.Progression?.Value; - Vector2 getCenteredVector(Vector2 top, Vector2 bottom) => new Vector2(top.X, top.Y + (bottom.Y - top.Y) / 2); + if (progression == null) return; - const float padding = 5; - - var start = getCenteredVector(ScreenSpaceDrawQuad.TopRight, ScreenSpaceDrawQuad.BottomRight); - var end = getCenteredVector(progression.ScreenSpaceDrawQuad.TopLeft, progression.ScreenSpaceDrawQuad.BottomLeft); - - bool progressionAbove = progression.ScreenSpaceDrawQuad.TopLeft.Y < ScreenSpaceDrawQuad.TopLeft.Y; - bool progressionToRight = progression.ScreenSpaceDrawQuad.TopLeft.X > ScreenSpaceDrawQuad.TopLeft.X; - - if (!Precision.AlmostEquals(progressionStart, start) || !Precision.AlmostEquals(progressionEnd, end)) - { - progressionStart = start; - progressionEnd = end; - - path.Origin = progressionAbove ? Anchor.y2 : Anchor.y0; - path.Y = progressionAbove ? line_width : -line_width; - - path.Origin |= progressionToRight ? Anchor.x0 : Anchor.x2; - //path.X = progressionToRight ? line_width : -line_width; - - Vector2 startPosition = path.ToLocalSpace(start) + new Vector2(padding, 0); - Vector2 endPosition = path.ToLocalSpace(end) + new Vector2(-padding, 0); - Vector2 intermediate1 = startPosition + new Vector2(padding, 0); - Vector2 intermediate2 = new Vector2(intermediate1.X, endPosition.Y); - - path.Positions = new List - { - startPosition, - intermediate1, - intermediate2, - endPosition - }; - } - - var destinationForWinner = progressionAbove ? progression.Pairing.Team2 : progression.Pairing.Team1; + bool progressionAbove = progression.ID < Pairing.ID; + var destinationForWinner = progressionAbove ? progression.Team2 : progression.Team1; destinationForWinner.Value = Pairing.Winner; } - protected override void UpdateAfterAutoSize() - { - base.UpdateAfterAutoSize(); - updateProgression(); - } - private void updateWinConditions() { if (conditions.Value == null) return; diff --git a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs index 1077438693..fcfc87e5c3 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs @@ -160,6 +160,7 @@ namespace osu.Game.Tournament.Screens.Ladder.Components public MenuItem[] ContextMenuItems => new[] { new MenuItem("Populate team", () => team.Value = manager.Teams.Random()), + new MenuItem("Join with", () => manager.JoinRequest(pairing)), }; } diff --git a/osu.Game.Tournament/Screens/Ladder/Components/LadderInfo.cs b/osu.Game.Tournament/Screens/Ladder/Components/LadderInfo.cs index e65cc7a512..0860966502 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/LadderInfo.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/LadderInfo.cs @@ -5,5 +5,6 @@ namespace osu.Game.Tournament.Screens.Ladder.Components public class LadderInfo { public List Pairings = new List(); + public List<(int, int)> Progressions = new List<(int, int)>(); } } diff --git a/osu.Game.Tournament/Screens/Ladder/Components/LadderManager.cs b/osu.Game.Tournament/Screens/Ladder/Components/LadderManager.cs index b7764f946f..834df747d0 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/LadderManager.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/LadderManager.cs @@ -1,51 +1,166 @@ +using System; using System.Collections.Generic; +using System.Linq; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Lines; using osu.Framework.Input.States; using osu.Game.Graphics.Cursor; using osu.Game.Tournament.Components; +using OpenTK; using SixLabors.Primitives; namespace osu.Game.Tournament.Screens.Ladder.Components { public class LadderManager : CompositeDrawable { - public readonly LadderInfo Info; public readonly List Teams; - private readonly OsuContextMenuContainer content; + private readonly Container pairingsContainer; + private readonly Container paths; public LadderManager(LadderInfo info, List teams) { - Info = info; Teams = teams; RelativeSizeAxes = Axes.Both; - InternalChild = content = new OsuContextMenuContainer + InternalChild = new OsuContextMenuContainer { - RelativeSizeAxes = Axes.Both + RelativeSizeAxes = Axes.Both, + Children = new Drawable[] + { + pairingsContainer = new Container { RelativeSizeAxes = Axes.Both }, + paths = new Container { RelativeSizeAxes = Axes.Both }, + } }; + foreach (var pair in info.Progressions) + info.Pairings.Single(p => p.ID == pair.Item1).Progression.Value = info.Pairings.Single(p => p.ID == pair.Item2); + foreach (var pairing in info.Pairings) addPairing(pairing); } - protected void AddPairing(MatchPairing pairing) + public LadderInfo CreateInfo() { - Info.Pairings.Add(pairing); - addPairing(pairing); + var pairings = pairingsContainer.Select(p => p.Pairing).ToList(); + + return new LadderInfo + { + Pairings = pairings, + Progressions = pairings + .Where(p => p.Progression.Value != null) + .Select(p => (p.ID, p.Progression.Value.ID)) + .ToList() + }; } - private void addPairing(MatchPairing pairing) => content.Add(new DrawableMatchPairing(pairing)); + private void addPairing(MatchPairing pairing) => pairingsContainer.Add(new DrawableMatchPairing(pairing)); protected override bool OnClick(InputState state) { - AddPairing(new MatchPairing + addPairing(new MatchPairing { Position = new Point((int)state.Mouse.Position.X, (int)state.Mouse.Position.Y) }); return true; } + + protected override void Update() + { + base.Update(); + + paths.Clear(); + + int id = 0; + foreach (var pairing in pairingsContainer.OrderBy(d => d.Y).ThenBy(d => d.X)) + { + pairing.Pairing.ID = id++; + + if (pairing.Pairing.Progression.Value != null) + { + var progression = pairingsContainer.Single(p => p.Pairing == pairing.Pairing.Progression.Value); + + const float line_width = 2; + + var path = new Path + { + BypassAutoSizeAxes = Axes.Both, + PathWidth = line_width, + }; + + paths.Add(path); + + Vector2 getCenteredVector(Vector2 top, Vector2 bottom) => new Vector2(top.X, top.Y + (bottom.Y - top.Y) / 2); + + const float padding = 5; + + var start = getCenteredVector(pairing.ScreenSpaceDrawQuad.TopRight, pairing.ScreenSpaceDrawQuad.BottomRight); + var end = getCenteredVector(progression.ScreenSpaceDrawQuad.TopLeft, progression.ScreenSpaceDrawQuad.BottomLeft); + + bool progressionAbove = progression.ScreenSpaceDrawQuad.TopLeft.Y < pairing.ScreenSpaceDrawQuad.TopLeft.Y; + bool progressionToRight = progression.ScreenSpaceDrawQuad.TopLeft.X > pairing.ScreenSpaceDrawQuad.TopLeft.X; + + //if (!Precision.AlmostEquals(progressionStart, start) || !Precision.AlmostEquals(progressionEnd, end)) + { + // var progressionStart = start; + // var progressionEnd = end; + + Vector2 startPosition = path.ToLocalSpace(start) + new Vector2(padding, 0); + Vector2 endPosition = path.ToLocalSpace(end) + new Vector2(-padding, 0); + Vector2 intermediate1 = startPosition + new Vector2(padding, 0); + Vector2 intermediate2 = new Vector2(intermediate1.X, endPosition.Y); + + path.Positions = new List + { + startPosition, + intermediate1, + intermediate2, + endPosition + }; + } + } + } + } + + public void JoinRequest(MatchPairing pairing) + { + AddInternal(new JoinRequestHandler(pairing, handleProgression)); + } + + private bool handleProgression(JoinRequestHandler handler, InputState state) + { + var found = pairingsContainer.FirstOrDefault(d => d.ReceiveMouseInputAt(state.Mouse.NativeState.Position)); + + if (found != null) + { + handler.Source.Progression.Value = found.Pairing; + return true; + } + + return false; + } + + private class JoinRequestHandler : CompositeDrawable + { + public readonly MatchPairing Source; + private readonly Func onClick; + + public JoinRequestHandler(MatchPairing source, Func onClick) + { + Source = source; + this.onClick = onClick; + RelativeSizeAxes = Axes.Both; + } + + protected override bool OnClick(InputState state) + { + if (onClick(this, state)) + Expire(); + + return true; + } + } } } diff --git a/osu.Game.Tournament/Screens/Ladder/Components/MatchPairing.cs b/osu.Game.Tournament/Screens/Ladder/Components/MatchPairing.cs index d2a8f66cfd..47a94b854e 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/MatchPairing.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/MatchPairing.cs @@ -13,6 +13,8 @@ namespace osu.Game.Tournament.Screens.Ladder.Components /// public class MatchPairing { + public int ID; + public readonly Bindable Team1 = new Bindable(); public readonly Bindable Team1Score = new Bindable(); @@ -23,6 +25,9 @@ namespace osu.Game.Tournament.Screens.Ladder.Components public readonly Bindable Completed = new Bindable(); + [JsonIgnore] + public readonly Bindable Progression = new Bindable(); + [JsonProperty] public Point Position; @@ -36,7 +41,8 @@ namespace osu.Game.Tournament.Screens.Ladder.Components Team2.Value = team2; } - public TournamentTeam Winner => !Completed.Value ? null : (Team1Score.Value > Team2Score.Value ? Team1.Value : Team2.Value); + [JsonIgnore] + public TournamentTeam Winner => !Completed.Value ? null : Team1Score.Value > Team2Score.Value ? Team1.Value : Team2.Value; /// /// Remove scores from the match, in case of a false click or false start. From c6071f6e4d221351c87afd844a2509977919a20f Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 17 Sep 2018 23:47:01 +0900 Subject: [PATCH 013/317] Better line drawing --- .../Ladder/Components/LadderManager.cs | 46 ++++++++++--------- 1 file changed, 25 insertions(+), 21 deletions(-) diff --git a/osu.Game.Tournament/Screens/Ladder/Components/LadderManager.cs b/osu.Game.Tournament/Screens/Ladder/Components/LadderManager.cs index 834df747d0..37d2461304 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/LadderManager.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/LadderManager.cs @@ -94,32 +94,36 @@ namespace osu.Game.Tournament.Screens.Ladder.Components Vector2 getCenteredVector(Vector2 top, Vector2 bottom) => new Vector2(top.X, top.Y + (bottom.Y - top.Y) / 2); - const float padding = 5; + const float padding = 10; - var start = getCenteredVector(pairing.ScreenSpaceDrawQuad.TopRight, pairing.ScreenSpaceDrawQuad.BottomRight); - var end = getCenteredVector(progression.ScreenSpaceDrawQuad.TopLeft, progression.ScreenSpaceDrawQuad.BottomLeft); + var q1 = pairing.ScreenSpaceDrawQuad; + var q2 = progression.ScreenSpaceDrawQuad; - bool progressionAbove = progression.ScreenSpaceDrawQuad.TopLeft.Y < pairing.ScreenSpaceDrawQuad.TopLeft.Y; - bool progressionToRight = progression.ScreenSpaceDrawQuad.TopLeft.X > pairing.ScreenSpaceDrawQuad.TopLeft.X; + bool progressionToRight = q2.TopLeft.X > q1.TopLeft.X; - //if (!Precision.AlmostEquals(progressionStart, start) || !Precision.AlmostEquals(progressionEnd, end)) + if (!progressionToRight) { - // var progressionStart = start; - // var progressionEnd = end; - - Vector2 startPosition = path.ToLocalSpace(start) + new Vector2(padding, 0); - Vector2 endPosition = path.ToLocalSpace(end) + new Vector2(-padding, 0); - Vector2 intermediate1 = startPosition + new Vector2(padding, 0); - Vector2 intermediate2 = new Vector2(intermediate1.X, endPosition.Y); - - path.Positions = new List - { - startPosition, - intermediate1, - intermediate2, - endPosition - }; + var temp = q2; + q2 = q1; + q1 = temp; } + + var c1 = getCenteredVector(q1.TopRight, q1.BottomRight) + new Vector2(padding, 0); + var c2 = getCenteredVector(q2.TopLeft, q2.BottomLeft) - new Vector2(padding, 0); + + var p1 = c1; + var p2 = p1 + new Vector2(padding, 0); + + if (p2.X > c2.X) + { + c2 = getCenteredVector(q2.TopRight, q2.BottomRight) + new Vector2(padding, 0); + p2.X = c2.X + padding; + } + + var p3 = new Vector2(p2.X, c2.Y); + var p4 = new Vector2(c2.X, p3.Y); + + path.Positions = new[] { p1, p2, p3, p4 }.Select(p => path.ToLocalSpace(p)).ToList(); } } } From 1de82afd169c7a30048727d5a65a05bad2e9e1dc Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 19 Sep 2018 02:00:16 +0900 Subject: [PATCH 014/317] Betterify pairing request logic --- .../Ladder/Components/LadderManager.cs | 34 +++++++------------ 1 file changed, 13 insertions(+), 21 deletions(-) diff --git a/osu.Game.Tournament/Screens/Ladder/Components/LadderManager.cs b/osu.Game.Tournament/Screens/Ladder/Components/LadderManager.cs index 37d2461304..3e8d2649eb 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/LadderManager.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/LadderManager.cs @@ -1,4 +1,3 @@ -using System; using System.Collections.Generic; using System.Linq; using osu.Framework.Graphics; @@ -130,40 +129,33 @@ namespace osu.Game.Tournament.Screens.Ladder.Components public void JoinRequest(MatchPairing pairing) { - AddInternal(new JoinRequestHandler(pairing, handleProgression)); - } - - private bool handleProgression(JoinRequestHandler handler, InputState state) - { - var found = pairingsContainer.FirstOrDefault(d => d.ReceiveMouseInputAt(state.Mouse.NativeState.Position)); - - if (found != null) - { - handler.Source.Progression.Value = found.Pairing; - return true; - } - - return false; + AddInternal(new JoinRequestHandler(pairingsContainer, pairing)); } private class JoinRequestHandler : CompositeDrawable { + private readonly Container pairingsContainer; public readonly MatchPairing Source; - private readonly Func onClick; - public JoinRequestHandler(MatchPairing source, Func onClick) + public JoinRequestHandler(Container pairingsContainer, MatchPairing source) { + this.pairingsContainer = pairingsContainer; Source = source; - this.onClick = onClick; RelativeSizeAxes = Axes.Both; } protected override bool OnClick(InputState state) { - if (onClick(this, state)) - Expire(); + var found = pairingsContainer.FirstOrDefault(d => d.ReceiveMouseInputAt(state.Mouse.NativeState.Position)); - return true; + if (found != null) + { + Source.Progression.Value = found.Pairing; + Expire(); + return true; + } + + return false; } } } From ffadd5dfd0c0635ab60727a249dcf17a41f395fd Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 21 Sep 2018 18:51:37 +0900 Subject: [PATCH 015/317] Improve join request visual guide --- .../TestCaseLadderManager.cs | 1 + .../Ladder/Components/ProgressionPath.cs | 59 +++++++++++++ .../Ladder/{Components => }/LadderManager.cs | 84 +++++++------------ 3 files changed, 90 insertions(+), 54 deletions(-) create mode 100644 osu.Game.Tournament/Screens/Ladder/Components/ProgressionPath.cs rename osu.Game.Tournament/Screens/Ladder/{Components => }/LadderManager.cs (62%) diff --git a/osu.Game.Tournament.Tests/TestCaseLadderManager.cs b/osu.Game.Tournament.Tests/TestCaseLadderManager.cs index 00a5df411f..9544a5c17e 100644 --- a/osu.Game.Tournament.Tests/TestCaseLadderManager.cs +++ b/osu.Game.Tournament.Tests/TestCaseLadderManager.cs @@ -8,6 +8,7 @@ using osu.Framework.Allocation; using osu.Framework.Configuration; using osu.Game.Tests.Visual; using osu.Game.Tournament.Components; +using osu.Game.Tournament.Screens.Ladder; using osu.Game.Tournament.Screens.Ladder.Components; namespace osu.Game.Tournament.Tests diff --git a/osu.Game.Tournament/Screens/Ladder/Components/ProgressionPath.cs b/osu.Game.Tournament/Screens/Ladder/Components/ProgressionPath.cs new file mode 100644 index 0000000000..c44f67a171 --- /dev/null +++ b/osu.Game.Tournament/Screens/Ladder/Components/ProgressionPath.cs @@ -0,0 +1,59 @@ +using System.Linq; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Lines; +using OpenTK; + +namespace osu.Game.Tournament.Screens.Ladder.Components +{ + public class ProgressionPath : Path + { + public DrawableMatchPairing Source { get; private set; } + public DrawableMatchPairing Destination { get; private set; } + + public ProgressionPath(DrawableMatchPairing source, DrawableMatchPairing destination) + { + Source = source; + Destination = destination; + + PathWidth = 2; + BypassAutoSizeAxes = Axes.Both; + } + + protected override void LoadComplete() + { + base.LoadComplete(); + Vector2 getCenteredVector(Vector2 top, Vector2 bottom) => new Vector2(top.X, top.Y + (bottom.Y - top.Y) / 2); + + const float padding = 10; + + var q1 = Source.ScreenSpaceDrawQuad; + var q2 = Destination.ScreenSpaceDrawQuad; + + bool progressionToRight = q2.TopLeft.X > q1.TopLeft.X; + + if (!progressionToRight) + { + var temp = q2; + q2 = q1; + q1 = temp; + } + + var c1 = getCenteredVector(q1.TopRight, q1.BottomRight) + new Vector2(padding, 0); + var c2 = getCenteredVector(q2.TopLeft, q2.BottomLeft) - new Vector2(padding, 0); + + var p1 = c1; + var p2 = p1 + new Vector2(padding, 0); + + if (p2.X > c2.X) + { + c2 = getCenteredVector(q2.TopRight, q2.BottomRight) + new Vector2(padding, 0); + p2.X = c2.X + padding; + } + + var p3 = new Vector2(p2.X, c2.Y); + var p4 = new Vector2(c2.X, p3.Y); + + Positions = new[] { p1, p2, p3, p4 }.Select(ToLocalSpace).ToList(); + } + } +} diff --git a/osu.Game.Tournament/Screens/Ladder/Components/LadderManager.cs b/osu.Game.Tournament/Screens/Ladder/LadderManager.cs similarity index 62% rename from osu.Game.Tournament/Screens/Ladder/Components/LadderManager.cs rename to osu.Game.Tournament/Screens/Ladder/LadderManager.cs index 3e8d2649eb..bf66447224 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/LadderManager.cs +++ b/osu.Game.Tournament/Screens/Ladder/LadderManager.cs @@ -6,10 +6,10 @@ using osu.Framework.Graphics.Lines; using osu.Framework.Input.States; using osu.Game.Graphics.Cursor; using osu.Game.Tournament.Components; -using OpenTK; +using osu.Game.Tournament.Screens.Ladder.Components; using SixLabors.Primitives; -namespace osu.Game.Tournament.Screens.Ladder.Components +namespace osu.Game.Tournament.Screens.Ladder { public class LadderManager : CompositeDrawable { @@ -78,75 +78,51 @@ namespace osu.Game.Tournament.Screens.Ladder.Components pairing.Pairing.ID = id++; if (pairing.Pairing.Progression.Value != null) - { - var progression = pairingsContainer.Single(p => p.Pairing == pairing.Pairing.Progression.Value); - - const float line_width = 2; - - var path = new Path - { - BypassAutoSizeAxes = Axes.Both, - PathWidth = line_width, - }; - - paths.Add(path); - - Vector2 getCenteredVector(Vector2 top, Vector2 bottom) => new Vector2(top.X, top.Y + (bottom.Y - top.Y) / 2); - - const float padding = 10; - - var q1 = pairing.ScreenSpaceDrawQuad; - var q2 = progression.ScreenSpaceDrawQuad; - - bool progressionToRight = q2.TopLeft.X > q1.TopLeft.X; - - if (!progressionToRight) - { - var temp = q2; - q2 = q1; - q1 = temp; - } - - var c1 = getCenteredVector(q1.TopRight, q1.BottomRight) + new Vector2(padding, 0); - var c2 = getCenteredVector(q2.TopLeft, q2.BottomLeft) - new Vector2(padding, 0); - - var p1 = c1; - var p2 = p1 + new Vector2(padding, 0); - - if (p2.X > c2.X) - { - c2 = getCenteredVector(q2.TopRight, q2.BottomRight) + new Vector2(padding, 0); - p2.X = c2.X + padding; - } - - var p3 = new Vector2(p2.X, c2.Y); - var p4 = new Vector2(c2.X, p3.Y); - - path.Positions = new[] { p1, p2, p3, p4 }.Select(p => path.ToLocalSpace(p)).ToList(); - } + paths.Add(new ProgressionPath(pairing, pairingsContainer.Single(p => p.Pairing == pairing.Pairing.Progression.Value))); } } - public void JoinRequest(MatchPairing pairing) - { - AddInternal(new JoinRequestHandler(pairingsContainer, pairing)); - } + public void JoinRequest(MatchPairing pairing) => AddInternal(new JoinRequestHandler(pairingsContainer, pairing)); private class JoinRequestHandler : CompositeDrawable { private readonly Container pairingsContainer; public readonly MatchPairing Source; + private ProgressionPath path; + public JoinRequestHandler(Container pairingsContainer, MatchPairing source) { this.pairingsContainer = pairingsContainer; - Source = source; RelativeSizeAxes = Axes.Both; + + Source = source; + Source.Progression.Value = null; + } + + private DrawableMatchPairing findTarget(InputState state) => pairingsContainer.FirstOrDefault(d => d.ReceiveMouseInputAt(state.Mouse.NativeState.Position)); + + protected override bool OnMouseMove(InputState state) + { + var found = findTarget(state); + + if (found == path?.Destination) + return false; + + path?.Expire(); + path = null; + + if (found == null) + return false; + + AddInternal(path = new ProgressionPath(pairingsContainer.First(c => c.Pairing == Source), found) { Alpha = 0.4f }); + + return base.OnMouseMove(state); } protected override bool OnClick(InputState state) { - var found = pairingsContainer.FirstOrDefault(d => d.ReceiveMouseInputAt(state.Mouse.NativeState.Position)); + var found = findTarget(state); if (found != null) { From 0076ef34476e2099f96e6365254a4211c3f8eb80 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 21 Sep 2018 18:52:00 +0900 Subject: [PATCH 016/317] Fix layout in MatchPairing test case --- .../TestCaseMatchPairings.cs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/osu.Game.Tournament.Tests/TestCaseMatchPairings.cs b/osu.Game.Tournament.Tests/TestCaseMatchPairings.cs index ca2523c898..f1116b2db7 100644 --- a/osu.Game.Tournament.Tests/TestCaseMatchPairings.cs +++ b/osu.Game.Tournament.Tests/TestCaseMatchPairings.cs @@ -47,14 +47,16 @@ namespace osu.Game.Tournament.Tests } ); - Child = new Container + Child = new FillFlowContainer { - AutoSizeAxes = Axes.Both, + RelativeSizeAxes = Axes.Both, + Direction = FillDirection.Horizontal, Children = new Drawable[] { - level1 = new Container + level1 = new FillFlowContainer { - AutoSizeAxes = Axes.Both, + AutoSizeAxes = Axes.X, + Direction = FillDirection.Vertical, Children = new[] { new DrawableMatchPairing(pairing1), @@ -62,9 +64,10 @@ namespace osu.Game.Tournament.Tests new DrawableMatchPairing(new MatchPairing()), } }, - level2 = new Container + level2 = new FillFlowContainer { - AutoSizeAxes = Axes.Both, + AutoSizeAxes = Axes.X, + Direction = FillDirection.Vertical, Margin = new MarginPadding(20), Children = new[] { From f2f4e964c569cb7d3ca02f49896f3b0a1bb6fa30 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 21 Sep 2018 19:58:47 +0900 Subject: [PATCH 017/317] Add deletion support --- .../TestCaseLadderManager.cs | 8 +++++- .../Ladder/Components/DrawableMatchPairing.cs | 9 ++++++ .../Ladder/Components/DrawableMatchTeam.cs | 8 ++++-- .../Screens/Ladder/Components/MatchPairing.cs | 15 ++++++++++ .../Screens/Ladder/LadderManager.cs | 28 +++++++++++-------- 5 files changed, 52 insertions(+), 16 deletions(-) diff --git a/osu.Game.Tournament.Tests/TestCaseLadderManager.cs b/osu.Game.Tournament.Tests/TestCaseLadderManager.cs index 9544a5c17e..b53660c703 100644 --- a/osu.Game.Tournament.Tests/TestCaseLadderManager.cs +++ b/osu.Game.Tournament.Tests/TestCaseLadderManager.cs @@ -6,6 +6,8 @@ using System.IO; using Newtonsoft.Json; using osu.Framework.Allocation; using osu.Framework.Configuration; +using osu.Framework.Graphics; +using osu.Game.Graphics.Cursor; using osu.Game.Tests.Visual; using osu.Game.Tournament.Components; using osu.Game.Tournament.Screens.Ladder; @@ -26,7 +28,11 @@ namespace osu.Game.Tournament.Tests var teams = JsonConvert.DeserializeObject>(File.ReadAllText(@"teams.json")); var ladder = File.Exists(@"bracket.json") ? JsonConvert.DeserializeObject(File.ReadAllText(@"bracket.json")) : new LadderInfo(); - Child = manager = new LadderManager(ladder, teams); + Child = new OsuContextMenuContainer + { + RelativeSizeAxes = Axes.Both, + Child = manager = new LadderManager(ladder, teams) + }; } protected override void Dispose(bool isDisposing) diff --git a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs index 8f33cdcbbc..131959892c 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs @@ -119,5 +119,14 @@ namespace osu.Game.Tournament.Screens.Ladder.Components Pairing.Position = new Point((int)pos.X, (int)pos.Y); return true; } + + public void Remove() + { + if (Pairing.ProgressionSource.Value != null) + Pairing.ProgressionSource.Value.Progression.Value = null; + + Pairing.Progression.Value = null; + Expire(); + } } } diff --git a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs index fcfc87e5c3..e74545f073 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs @@ -15,6 +15,7 @@ using osu.Framework.Input.EventArgs; using osu.Framework.Input.States; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; +using osu.Game.Graphics.UserInterface; using osu.Game.Tournament.Components; using OpenTK; using OpenTK.Graphics; @@ -157,10 +158,11 @@ namespace osu.Game.Tournament.Screens.Ladder.Components scoreText.Font = AcronymText.Font = winner ? "Exo2.0-Bold" : "Exo2.0-Regular"; } - public MenuItem[] ContextMenuItems => new[] + public MenuItem[] ContextMenuItems => new MenuItem[] { - new MenuItem("Populate team", () => team.Value = manager.Teams.Random()), - new MenuItem("Join with", () => manager.JoinRequest(pairing)), + new OsuMenuItem("Populate team", MenuItemType.Standard, () => team.Value = manager.Teams.Random()), + new OsuMenuItem("Join with", MenuItemType.Standard, () => manager.RequestJoin(pairing)), + new OsuMenuItem("Remove", MenuItemType.Destructive, () => manager.Remove(pairing)), }; } diff --git a/osu.Game.Tournament/Screens/Ladder/Components/MatchPairing.cs b/osu.Game.Tournament/Screens/Ladder/Components/MatchPairing.cs index 47a94b854e..c0ca25e220 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/MatchPairing.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/MatchPairing.cs @@ -28,11 +28,26 @@ namespace osu.Game.Tournament.Screens.Ladder.Components [JsonIgnore] public readonly Bindable Progression = new Bindable(); + [JsonIgnore] + public readonly Bindable ProgressionSource = new Bindable(); + [JsonProperty] public Point Position; + private MatchPairing lastProgression; // todo: fix if we ever get LastValue inside Bindable<>. + public MatchPairing() { + Progression.ValueChanged += progression => + { + if (lastProgression != null) + lastProgression.ProgressionSource.Value = null; + + if (progression != null) + progression.ProgressionSource.Value = this; + + lastProgression = progression; + }; } public MatchPairing(TournamentTeam team1 = null, TournamentTeam team2 = null) diff --git a/osu.Game.Tournament/Screens/Ladder/LadderManager.cs b/osu.Game.Tournament/Screens/Ladder/LadderManager.cs index bf66447224..807b5f05a9 100644 --- a/osu.Game.Tournament/Screens/Ladder/LadderManager.cs +++ b/osu.Game.Tournament/Screens/Ladder/LadderManager.cs @@ -2,16 +2,18 @@ using System.Collections.Generic; using System.Linq; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Cursor; using osu.Framework.Graphics.Lines; +using osu.Framework.Graphics.UserInterface; using osu.Framework.Input.States; -using osu.Game.Graphics.Cursor; +using osu.Game.Graphics.UserInterface; using osu.Game.Tournament.Components; using osu.Game.Tournament.Screens.Ladder.Components; using SixLabors.Primitives; namespace osu.Game.Tournament.Screens.Ladder { - public class LadderManager : CompositeDrawable + public class LadderManager : CompositeDrawable, IHasContextMenu { public readonly List Teams; private readonly Container pairingsContainer; @@ -23,7 +25,7 @@ namespace osu.Game.Tournament.Screens.Ladder RelativeSizeAxes = Axes.Both; - InternalChild = new OsuContextMenuContainer + InternalChild = new Container { RelativeSizeAxes = Axes.Both, Children = new Drawable[] @@ -56,15 +58,14 @@ namespace osu.Game.Tournament.Screens.Ladder private void addPairing(MatchPairing pairing) => pairingsContainer.Add(new DrawableMatchPairing(pairing)); - protected override bool OnClick(InputState state) + public MenuItem[] ContextMenuItems => new MenuItem[] { - addPairing(new MatchPairing + new OsuMenuItem("Create new match", MenuItemType.Highlighted, () => { - Position = new Point((int)state.Mouse.Position.X, (int)state.Mouse.Position.Y) - }); - - return true; - } + var pos = ToLocalSpace(GetContainingInputManager().CurrentState.Mouse.Position); + addPairing(new MatchPairing { Position = new Point((int)pos.X, (int)pos.Y) }); + }), + }; protected override void Update() { @@ -82,7 +83,7 @@ namespace osu.Game.Tournament.Screens.Ladder } } - public void JoinRequest(MatchPairing pairing) => AddInternal(new JoinRequestHandler(pairingsContainer, pairing)); + public void RequestJoin(MatchPairing pairing) => AddInternal(new JoinRequestHandler(pairingsContainer, pairing)); private class JoinRequestHandler : CompositeDrawable { @@ -126,7 +127,8 @@ namespace osu.Game.Tournament.Screens.Ladder if (found != null) { - Source.Progression.Value = found.Pairing; + if (found.Pairing != Source) + Source.Progression.Value = found.Pairing; Expire(); return true; } @@ -134,5 +136,7 @@ namespace osu.Game.Tournament.Screens.Ladder return false; } } + + public void Remove(MatchPairing pairing) => pairingsContainer.FirstOrDefault(p => p.Pairing == pairing)?.Remove(); } } From cddc7f74d4b41920c172df124fb9d2e5c0f3f218 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 21 Sep 2018 22:07:03 +0900 Subject: [PATCH 018/317] Fix the possibility of a double-direction progression bind --- .../Screens/Ladder/Components/MatchPairing.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/osu.Game.Tournament/Screens/Ladder/Components/MatchPairing.cs b/osu.Game.Tournament/Screens/Ladder/Components/MatchPairing.cs index c0ca25e220..994486ffdd 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/MatchPairing.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/MatchPairing.cs @@ -41,13 +41,22 @@ namespace osu.Game.Tournament.Screens.Ladder.Components Progression.ValueChanged += progression => { if (lastProgression != null) + // clear the source from the previous progression. lastProgression.ProgressionSource.Value = null; if (progression != null) + // set the source on the new progression. progression.ProgressionSource.Value = this; lastProgression = progression; }; + + ProgressionSource.ValueChanged += source => + { + if (source != null) + // ennsure no two-way progressions. + Progression.Value = null; + }; } public MatchPairing(TournamentTeam team1 = null, TournamentTeam team2 = null) From 36e151719744f33efba1f22ab355884a20e9fe23 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 21 Sep 2018 22:24:21 +0900 Subject: [PATCH 019/317] Display paths underneath matches --- osu.Game.Tournament/Screens/Ladder/LadderManager.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Tournament/Screens/Ladder/LadderManager.cs b/osu.Game.Tournament/Screens/Ladder/LadderManager.cs index 807b5f05a9..e57f9b739b 100644 --- a/osu.Game.Tournament/Screens/Ladder/LadderManager.cs +++ b/osu.Game.Tournament/Screens/Ladder/LadderManager.cs @@ -30,8 +30,8 @@ namespace osu.Game.Tournament.Screens.Ladder RelativeSizeAxes = Axes.Both, Children = new Drawable[] { - pairingsContainer = new Container { RelativeSizeAxes = Axes.Both }, paths = new Container { RelativeSizeAxes = Axes.Both }, + pairingsContainer = new Container { RelativeSizeAxes = Axes.Both }, } }; From 2f2dcec8c765d4c359e804fc0687ddb9671347b0 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 22 Sep 2018 05:52:25 +0900 Subject: [PATCH 020/317] Complete editing support --- .../TestCaseLadderManager.cs | 2 +- .../TestCaseMatchPairings.cs | 2 +- .../Components/DrawableTournamentTeam.cs | 2 +- .../Components/TournamentTeam.cs | 6 +- .../Ladder/Components/DrawableMatchPairing.cs | 86 +++++++++- .../Ladder/Components/DrawableMatchTeam.cs | 25 ++- .../Ladder/Components/LadderSettings.cs | 147 ++++++++++++++++++ .../Screens/Ladder/Components/MatchPairing.cs | 26 +--- .../Ladder/Components/TournamentConditions.cs | 4 - .../Screens/Ladder/LadderManager.cs | 62 ++++++-- osu.Game/Overlays/Settings/SettingsItem.cs | 2 + 11 files changed, 306 insertions(+), 58 deletions(-) create mode 100644 osu.Game.Tournament/Screens/Ladder/Components/LadderSettings.cs diff --git a/osu.Game.Tournament.Tests/TestCaseLadderManager.cs b/osu.Game.Tournament.Tests/TestCaseLadderManager.cs index b53660c703..ac56803c90 100644 --- a/osu.Game.Tournament.Tests/TestCaseLadderManager.cs +++ b/osu.Game.Tournament.Tests/TestCaseLadderManager.cs @@ -21,7 +21,7 @@ namespace osu.Game.Tournament.Tests private readonly LadderManager manager; [Cached] - private Bindable conditions = new Bindable(new TournamentConditions { BestOf = 9 }); + private Bindable conditions = new Bindable(new TournamentConditions()); public TestCaseLadderManager() { diff --git a/osu.Game.Tournament.Tests/TestCaseMatchPairings.cs b/osu.Game.Tournament.Tests/TestCaseMatchPairings.cs index f1116b2db7..dc67807c64 100644 --- a/osu.Game.Tournament.Tests/TestCaseMatchPairings.cs +++ b/osu.Game.Tournament.Tests/TestCaseMatchPairings.cs @@ -24,7 +24,7 @@ namespace osu.Game.Tournament.Tests }; [Cached] - private Bindable conditions = new Bindable(new TournamentConditions { BestOf = 9 }); + private Bindable conditions = new Bindable(new TournamentConditions()); public TestCaseMatchPairings() { diff --git a/osu.Game.Tournament/Components/DrawableTournamentTeam.cs b/osu.Game.Tournament/Components/DrawableTournamentTeam.cs index ec60d24c2c..016db57773 100644 --- a/osu.Game.Tournament/Components/DrawableTournamentTeam.cs +++ b/osu.Game.Tournament/Components/DrawableTournamentTeam.cs @@ -29,7 +29,7 @@ namespace osu.Game.Tournament.Components AcronymText = new OsuSpriteText { - Text = team?.Acronym.ToUpperInvariant() ?? string.Empty, + Text = team?.Acronym?.ToUpperInvariant() ?? string.Empty, Font = @"Exo2.0-Regular" }; } diff --git a/osu.Game.Tournament/Components/TournamentTeam.cs b/osu.Game.Tournament/Components/TournamentTeam.cs index 14e874e9ef..cb6fc9fb92 100644 --- a/osu.Game.Tournament/Components/TournamentTeam.cs +++ b/osu.Game.Tournament/Components/TournamentTeam.cs @@ -20,7 +20,7 @@ namespace osu.Game.Tournament.Components /// public string FlagName { - get { return flagName ?? Acronym.Substring(0, 2); } + get { return flagName ?? Acronym?.Substring(0, 2); } set { flagName = value; } } @@ -31,10 +31,12 @@ namespace osu.Game.Tournament.Components /// public string Acronym { - get { return acronym ?? FullName.Substring(0, 3); } + get { return acronym ?? FullName?.Substring(0, 3); } set { acronym = value; } } public List Players { get; set; } + + public override string ToString() => FullName ?? Acronym; } } diff --git a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs index 131959892c..f6771d70b4 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs @@ -5,9 +5,11 @@ using osu.Framework.Allocation; using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Shapes; using osu.Framework.Input.EventArgs; using osu.Framework.Input.States; using OpenTK; +using OpenTK.Graphics; using OpenTK.Input; using SixLabors.Primitives; @@ -18,6 +20,11 @@ namespace osu.Game.Tournament.Screens.Ladder.Components public readonly MatchPairing Pairing; private readonly FillFlowContainer flow; private readonly Bindable conditions = new Bindable(); + private readonly Drawable selectionBox; + private Bindable globalSelection; + + [Resolved(CanBeNull = true)] + private LadderEditorInfo editorInfo { get; set; } = null; public DrawableMatchPairing(MatchPairing pairing) { @@ -29,8 +36,20 @@ namespace osu.Game.Tournament.Screens.Ladder.Components Margin = new MarginPadding(5); - InternalChildren = new Drawable[] + InternalChildren = new[] { + selectionBox = new Container + { + CornerRadius = 5, + Masking = true, + Scale = new Vector2(1.05f), + RelativeSizeAxes = Axes.Both, + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + Alpha = 0, + Colour = Color4.YellowGreen, + Child = new Box { RelativeSizeAxes = Axes.Both } + }, flow = new FillFlowContainer { AutoSizeAxes = Axes.Both, @@ -38,13 +57,11 @@ namespace osu.Game.Tournament.Screens.Ladder.Components Spacing = new Vector2(2) } }; - pairing.Team1.BindValueChanged(_ => updateTeams()); pairing.Team2.BindValueChanged(_ => updateTeams()); - pairing.Team1Score.BindValueChanged(_ => updateWinConditions()); pairing.Team2Score.BindValueChanged(_ => updateWinConditions()); - + pairing.BestOf.BindValueChanged(_ => updateWinConditions()); pairing.Completed.BindValueChanged(_ => updateProgression()); pairing.Progression.BindValueChanged(_ => updateProgression()); @@ -60,6 +77,27 @@ namespace osu.Game.Tournament.Screens.Ladder.Components this.conditions.BindTo(conditions); } + private bool selected; + + public bool Selected + { + get => selected; + + set + { + if (value == selected) return; + selected = value; + + if (selected) + { + selectionBox.Show(); + editorInfo.Selected.Value = Pairing; + } + else + selectionBox.Hide(); + } + } + private void updateProgression() { var progression = Pairing.Progression?.Value; @@ -76,13 +114,22 @@ namespace osu.Game.Tournament.Screens.Ladder.Components { if (conditions.Value == null) return; - Pairing.Completed.Value = Pairing.Team1Score.Value + Pairing.Team2Score.Value >= conditions.Value.BestOf; + Pairing.Completed.Value = Pairing.Team1Score.Value + Pairing.Team2Score.Value >= Pairing.BestOf.Value; } protected override void LoadComplete() { base.LoadComplete(); updateTeams(); + + if (editorInfo != null) + { + globalSelection = editorInfo.Selected.GetBoundCopy(); + globalSelection.BindValueChanged(s => + { + if (s != Pairing) Selected = false; + }); + } } private void updateTeams() @@ -109,10 +156,34 @@ namespace osu.Game.Tournament.Screens.Ladder.Components protected override bool OnDragStart(InputState state) => true; + protected override bool OnKeyDown(InputState state, KeyDownEventArgs args) + { + if (Selected && editorInfo.EditingEnabled && args.Key == Key.Delete) + { + Remove(); + return true; + } + + return base.OnKeyDown(state, args); + } + + protected override bool OnClick(InputState state) + { + if (!editorInfo.EditingEnabled) + return false; + + Selected = true; + return true; + } + protected override bool OnDrag(InputState state) { if (base.OnDrag(state)) return true; + if (!editorInfo.EditingEnabled) + return false; + + Selected = true; this.MoveToOffset(state.Mouse.Delta); var pos = Position; @@ -122,10 +193,9 @@ namespace osu.Game.Tournament.Screens.Ladder.Components public void Remove() { - if (Pairing.ProgressionSource.Value != null) - Pairing.ProgressionSource.Value.Progression.Value = null; - + Selected = false; Pairing.Progression.Value = null; + Expire(); } } diff --git a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs index e74545f073..a517c5f475 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs @@ -25,7 +25,6 @@ namespace osu.Game.Tournament.Screens.Ladder.Components { public class DrawableMatchTeam : DrawableTournamentTeam, IHasContextMenu { - private readonly Bindable team; private readonly MatchPairing pairing; private OsuSpriteText scoreText; private Box background; @@ -39,10 +38,12 @@ namespace osu.Game.Tournament.Screens.Ladder.Components private readonly Func isWinner; private LadderManager manager; + [Resolved(CanBeNull = true)] + private LadderEditorInfo editorInfo { get; set; } = null; + public DrawableMatchTeam(Bindable team, MatchPairing pairing) : base(team) { - this.team = team.GetBoundCopy(); this.pairing = pairing; Size = new Vector2(150, 40); @@ -127,7 +128,7 @@ namespace osu.Game.Tournament.Screens.Ladder.Components protected override bool OnMouseDown(InputState state, MouseDownEventArgs args) { - if (Team == null) return false; + if (Team == null || editorInfo.EditingEnabled) return false; if (args.Button == MouseButton.Left) { @@ -158,12 +159,20 @@ namespace osu.Game.Tournament.Screens.Ladder.Components scoreText.Font = AcronymText.Font = winner ? "Exo2.0-Bold" : "Exo2.0-Regular"; } - public MenuItem[] ContextMenuItems => new MenuItem[] + public MenuItem[] ContextMenuItems { - new OsuMenuItem("Populate team", MenuItemType.Standard, () => team.Value = manager.Teams.Random()), - new OsuMenuItem("Join with", MenuItemType.Standard, () => manager.RequestJoin(pairing)), - new OsuMenuItem("Remove", MenuItemType.Destructive, () => manager.Remove(pairing)), - }; + get + { + if (!editorInfo.EditingEnabled) + return new MenuItem[0]; + + return new MenuItem[] + { + new OsuMenuItem("Join with", MenuItemType.Standard, () => manager.RequestJoin(pairing)), + new OsuMenuItem("Remove", MenuItemType.Destructive, () => manager.Remove(pairing)), + }; + } + } } internal static class Extensions diff --git a/osu.Game.Tournament/Screens/Ladder/Components/LadderSettings.cs b/osu.Game.Tournament/Screens/Ladder/Components/LadderSettings.cs new file mode 100644 index 0000000000..9ef2ccfa0b --- /dev/null +++ b/osu.Game.Tournament/Screens/Ladder/Components/LadderSettings.cs @@ -0,0 +1,147 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System.Collections.Generic; +using System.Linq; +using osu.Framework.Allocation; +using osu.Framework.Configuration; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Game.Graphics.Sprites; +using osu.Game.Overlays.Settings; +using osu.Game.Screens.Play.PlayerSettings; +using osu.Game.Tournament.Components; + +namespace osu.Game.Tournament.Screens.Ladder.Components +{ + public class LadderEditorSettings : PlayerSettingsGroup + { + private const int padding = 10; + + protected override string Title => @"ladder"; + + private PlayerSliderBar sliderBestOf; + + private SettingsDropdown dropdownTeam1; + private SettingsDropdown dropdownTeam2; + + [Resolved] + private LadderEditorInfo editorInfo { get; set; } = null; + + [BackgroundDependencyLoader] + private void load() + { + var teamEntries = editorInfo.Teams.Select(t => new KeyValuePair(t.ToString(), t)).Prepend(new KeyValuePair("Empty", new TournamentTeam())); + + Children = new Drawable[] + { + new PlayerCheckbox + { + Bindable = editorInfo.EditingEnabled, + LabelText = "Enable editing" + }, + new Container + { + RelativeSizeAxes = Axes.X, + AutoSizeAxes = Axes.Y, + Padding = new MarginPadding { Horizontal = padding }, + Children = new Drawable[] + { + new OsuSpriteText + { + Anchor = Anchor.CentreLeft, + Origin = Anchor.CentreLeft, + Text = "Team1", + }, + }, + }, + dropdownTeam1 = new SettingsDropdown + { + Items = teamEntries, + Bindable = new Bindable + { + Value = teamEntries.First().Value, + Default = teamEntries.First().Value + } + }, + new Container + { + RelativeSizeAxes = Axes.X, + AutoSizeAxes = Axes.Y, + Padding = new MarginPadding { Horizontal = padding }, + Children = new Drawable[] + { + new OsuSpriteText + { + Anchor = Anchor.CentreLeft, + Origin = Anchor.CentreLeft, + Text = "Team2", + }, + }, + }, + dropdownTeam2 = new SettingsDropdown + { + Items = teamEntries, + Bindable = new Bindable + { + Value = teamEntries.First().Value, + Default = teamEntries.First().Value + } + }, + new Container + { + RelativeSizeAxes = Axes.X, + AutoSizeAxes = Axes.Y, + Padding = new MarginPadding { Horizontal = padding }, + Children = new Drawable[] + { + new OsuSpriteText + { + Anchor = Anchor.CentreLeft, + Origin = Anchor.CentreLeft, + Text = "Best of", + }, + }, + }, + sliderBestOf = new PlayerSliderBar + { + Bindable = new BindableDouble + { + Default = 5, + Value = 5, + MinValue = 1, + MaxValue = 20, + Precision = 1, + }, + } + }; + + editorInfo.Selected.ValueChanged += selection => + { + dropdownTeam1.Bindable.Value = dropdownTeam1.Items.FirstOrDefault(i => i.Value.Acronym == selection?.Team1.Value?.Acronym).Value; + dropdownTeam2.Bindable.Value = dropdownTeam1.Items.FirstOrDefault(i => i.Value.Acronym == selection?.Team2.Value?.Acronym).Value; + sliderBestOf.Bindable.Value = selection?.BestOf ?? sliderBestOf.Bindable.Default; + }; + + dropdownTeam1.Bindable.ValueChanged += val => + { + if (editorInfo.Selected.Value != null) editorInfo.Selected.Value.Team1.Value = val.Acronym == null ? null : val; + }; + + dropdownTeam2.Bindable.ValueChanged += val => + { + if (editorInfo.Selected.Value != null) editorInfo.Selected.Value.Team2.Value = val.Acronym == null ? null : val; + }; + + sliderBestOf.Bindable.ValueChanged += val => + { + if (editorInfo.Selected.Value != null) editorInfo.Selected.Value.BestOf.Value = (int)val; + }; + + editorInfo.EditingEnabled.ValueChanged += enabled => + { + if (!enabled) editorInfo.Selected.Value = null; + }; + } + } +} diff --git a/osu.Game.Tournament/Screens/Ladder/Components/MatchPairing.cs b/osu.Game.Tournament/Screens/Ladder/Components/MatchPairing.cs index 994486ffdd..772a196f37 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/MatchPairing.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/MatchPairing.cs @@ -25,38 +25,16 @@ namespace osu.Game.Tournament.Screens.Ladder.Components public readonly Bindable Completed = new Bindable(); - [JsonIgnore] - public readonly Bindable Progression = new Bindable(); + public readonly BindableInt BestOf = new BindableInt(5); [JsonIgnore] - public readonly Bindable ProgressionSource = new Bindable(); + public readonly Bindable Progression = new Bindable(); [JsonProperty] public Point Position; - private MatchPairing lastProgression; // todo: fix if we ever get LastValue inside Bindable<>. - public MatchPairing() { - Progression.ValueChanged += progression => - { - if (lastProgression != null) - // clear the source from the previous progression. - lastProgression.ProgressionSource.Value = null; - - if (progression != null) - // set the source on the new progression. - progression.ProgressionSource.Value = this; - - lastProgression = progression; - }; - - ProgressionSource.ValueChanged += source => - { - if (source != null) - // ennsure no two-way progressions. - Progression.Value = null; - }; } public MatchPairing(TournamentTeam team1 = null, TournamentTeam team2 = null) diff --git a/osu.Game.Tournament/Screens/Ladder/Components/TournamentConditions.cs b/osu.Game.Tournament/Screens/Ladder/Components/TournamentConditions.cs index fd0e8cea87..045149945c 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/TournamentConditions.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/TournamentConditions.cs @@ -5,9 +5,5 @@ namespace osu.Game.Tournament.Screens.Ladder.Components /// public class TournamentConditions { - /// - /// How many matches before a winner is decided. - /// - public int BestOf; } } diff --git a/osu.Game.Tournament/Screens/Ladder/LadderManager.cs b/osu.Game.Tournament/Screens/Ladder/LadderManager.cs index e57f9b739b..6c14a4225f 100644 --- a/osu.Game.Tournament/Screens/Ladder/LadderManager.cs +++ b/osu.Game.Tournament/Screens/Ladder/LadderManager.cs @@ -1,5 +1,8 @@ +using System; using System.Collections.Generic; using System.Linq; +using osu.Framework.Allocation; +using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Cursor; @@ -13,15 +16,25 @@ using SixLabors.Primitives; namespace osu.Game.Tournament.Screens.Ladder { + public class LadderEditorInfo + { + public readonly BindableBool EditingEnabled = new BindableBool(); + public List Teams = new List(); + public readonly Bindable Selected = new Bindable(); + } + public class LadderManager : CompositeDrawable, IHasContextMenu { public readonly List Teams; private readonly Container pairingsContainer; private readonly Container paths; + [Cached] + private readonly LadderEditorInfo editorInfo = new LadderEditorInfo(); + public LadderManager(LadderInfo info, List teams) { - Teams = teams; + editorInfo.Teams = Teams = teams; RelativeSizeAxes = Axes.Both; @@ -32,11 +45,25 @@ namespace osu.Game.Tournament.Screens.Ladder { paths = new Container { RelativeSizeAxes = Axes.Both }, pairingsContainer = new Container { RelativeSizeAxes = Axes.Both }, + new LadderEditorSettings + { + Anchor = Anchor.TopRight, + Origin = Anchor.TopRight, + Margin = new MarginPadding(5) + } } }; foreach (var pair in info.Progressions) - info.Pairings.Single(p => p.ID == pair.Item1).Progression.Value = info.Pairings.Single(p => p.ID == pair.Item2); + { + var src = info.Pairings.FirstOrDefault(p => p.ID == pair.Item1); + var dest = info.Pairings.FirstOrDefault(p => p.ID == pair.Item2); + + if (src == null) throw new InvalidOperationException(); + + if (dest != null) + src.Progression.Value = dest; + } foreach (var pairing in info.Pairings) addPairing(pairing); @@ -58,14 +85,23 @@ namespace osu.Game.Tournament.Screens.Ladder private void addPairing(MatchPairing pairing) => pairingsContainer.Add(new DrawableMatchPairing(pairing)); - public MenuItem[] ContextMenuItems => new MenuItem[] + public MenuItem[] ContextMenuItems { - new OsuMenuItem("Create new match", MenuItemType.Highlighted, () => + get { - var pos = ToLocalSpace(GetContainingInputManager().CurrentState.Mouse.Position); - addPairing(new MatchPairing { Position = new Point((int)pos.X, (int)pos.Y) }); - }), - }; + if (!editorInfo.EditingEnabled) + return new MenuItem[0]; + + return new MenuItem[] + { + new OsuMenuItem("Create new match", MenuItemType.Highlighted, () => + { + var pos = ToLocalSpace(GetContainingInputManager().CurrentState.Mouse.Position); + addPairing(new MatchPairing { Position = new Point((int)pos.X, (int)pos.Y) }); + }), + }; + } + } protected override void Update() { @@ -79,7 +115,15 @@ namespace osu.Game.Tournament.Screens.Ladder pairing.Pairing.ID = id++; if (pairing.Pairing.Progression.Value != null) - paths.Add(new ProgressionPath(pairing, pairingsContainer.Single(p => p.Pairing == pairing.Pairing.Progression.Value))); + { + var dest = pairingsContainer.FirstOrDefault(p => p.Pairing == pairing.Pairing.Progression.Value); + + if (dest == null) + // clean up outdated progressions. + pairing.Pairing.Progression.Value = null; + else + paths.Add(new ProgressionPath(pairing, dest)); + } } } diff --git a/osu.Game/Overlays/Settings/SettingsItem.cs b/osu.Game/Overlays/Settings/SettingsItem.cs index 0f8d3aa2ac..88c3971ab2 100644 --- a/osu.Game/Overlays/Settings/SettingsItem.cs +++ b/osu.Game/Overlays/Settings/SettingsItem.cs @@ -63,8 +63,10 @@ namespace osu.Game.Overlays.Settings set { + controlWithCurrent?.Current.UnbindBindings(); bindable = value; controlWithCurrent?.Current.BindTo(bindable); + if (ShowsDefaultIndicator) { restoreDefaultButton.Bindable = bindable.GetBoundCopy(); From a113cf41183d2bead8c5a95a5f685d7ac8ffce4c Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 22 Sep 2018 06:36:45 +0900 Subject: [PATCH 021/317] Start IDs at 1 --- osu.Game.Tournament/Screens/Ladder/LadderManager.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Tournament/Screens/Ladder/LadderManager.cs b/osu.Game.Tournament/Screens/Ladder/LadderManager.cs index 6c14a4225f..235ac4a86a 100644 --- a/osu.Game.Tournament/Screens/Ladder/LadderManager.cs +++ b/osu.Game.Tournament/Screens/Ladder/LadderManager.cs @@ -109,7 +109,7 @@ namespace osu.Game.Tournament.Screens.Ladder paths.Clear(); - int id = 0; + int id = 1; foreach (var pairing in pairingsContainer.OrderBy(d => d.Y).ThenBy(d => d.X)) { pairing.Pairing.ID = id++; From 8d773fec97e681cf2895d7324f13a5f4ce0cb447 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 24 Sep 2018 02:16:59 +0900 Subject: [PATCH 022/317] Fix incorrect best-of- scoring method --- .../Screens/Ladder/Components/DrawableMatchPairing.cs | 4 +++- osu.Game.Tournament/Screens/Ladder/Components/MatchPairing.cs | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs index f6771d70b4..7f8956c24d 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs @@ -114,7 +114,9 @@ namespace osu.Game.Tournament.Screens.Ladder.Components { if (conditions.Value == null) return; - Pairing.Completed.Value = Pairing.Team1Score.Value + Pairing.Team2Score.Value >= Pairing.BestOf.Value; + var instaWinAmount = Pairing.BestOf.Value / 2; + + Pairing.Completed.Value = Pairing.Team1Score + Pairing.Team2Score >= Pairing.BestOf || Pairing.Team1Score > instaWinAmount || Pairing.Team2Score > instaWinAmount; } protected override void LoadComplete() diff --git a/osu.Game.Tournament/Screens/Ladder/Components/MatchPairing.cs b/osu.Game.Tournament/Screens/Ladder/Components/MatchPairing.cs index 772a196f37..c47e3ea440 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/MatchPairing.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/MatchPairing.cs @@ -25,7 +25,7 @@ namespace osu.Game.Tournament.Screens.Ladder.Components public readonly Bindable Completed = new Bindable(); - public readonly BindableInt BestOf = new BindableInt(5); + public readonly BindableInt BestOf = new BindableInt(11); [JsonIgnore] public readonly Bindable Progression = new Bindable(); From a3a2a149ca87464d1163f5396c570df69051d193 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 24 Sep 2018 02:17:07 +0900 Subject: [PATCH 023/317] Use textbox rather than dropdowns --- .../Ladder/Components/LadderSettings.cs | 50 +++++++------------ 1 file changed, 17 insertions(+), 33 deletions(-) diff --git a/osu.Game.Tournament/Screens/Ladder/Components/LadderSettings.cs b/osu.Game.Tournament/Screens/Ladder/Components/LadderSettings.cs index 9ef2ccfa0b..a2275784a0 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/LadderSettings.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/LadderSettings.cs @@ -1,16 +1,14 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using System.Collections.Generic; using System.Linq; using osu.Framework.Allocation; using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Game.Graphics.Sprites; -using osu.Game.Overlays.Settings; +using osu.Game.Graphics.UserInterface; using osu.Game.Screens.Play.PlayerSettings; -using osu.Game.Tournament.Components; namespace osu.Game.Tournament.Screens.Ladder.Components { @@ -22,8 +20,8 @@ namespace osu.Game.Tournament.Screens.Ladder.Components private PlayerSliderBar sliderBestOf; - private SettingsDropdown dropdownTeam1; - private SettingsDropdown dropdownTeam2; + private OsuTextBox textboxTeam1; + private OsuTextBox textboxTeam2; [Resolved] private LadderEditorInfo editorInfo { get; set; } = null; @@ -31,7 +29,7 @@ namespace osu.Game.Tournament.Screens.Ladder.Components [BackgroundDependencyLoader] private void load() { - var teamEntries = editorInfo.Teams.Select(t => new KeyValuePair(t.ToString(), t)).Prepend(new KeyValuePair("Empty", new TournamentTeam())); + var teamEntries = editorInfo.Teams; Children = new Drawable[] { @@ -55,15 +53,7 @@ namespace osu.Game.Tournament.Screens.Ladder.Components }, }, }, - dropdownTeam1 = new SettingsDropdown - { - Items = teamEntries, - Bindable = new Bindable - { - Value = teamEntries.First().Value, - Default = teamEntries.First().Value - } - }, + textboxTeam1 = new OsuTextBox { RelativeSizeAxes = Axes.X, Height = 20 }, new Container { RelativeSizeAxes = Axes.X, @@ -79,15 +69,7 @@ namespace osu.Game.Tournament.Screens.Ladder.Components }, }, }, - dropdownTeam2 = new SettingsDropdown - { - Items = teamEntries, - Bindable = new Bindable - { - Value = teamEntries.First().Value, - Default = teamEntries.First().Value - } - }, + textboxTeam2 = new OsuTextBox { RelativeSizeAxes = Axes.X, Height = 20 }, new Container { RelativeSizeAxes = Axes.X, @@ -107,10 +89,10 @@ namespace osu.Game.Tournament.Screens.Ladder.Components { Bindable = new BindableDouble { - Default = 5, - Value = 5, + Default = 11, + Value = 11, MinValue = 1, - MaxValue = 20, + MaxValue = 21, Precision = 1, }, } @@ -118,19 +100,21 @@ namespace osu.Game.Tournament.Screens.Ladder.Components editorInfo.Selected.ValueChanged += selection => { - dropdownTeam1.Bindable.Value = dropdownTeam1.Items.FirstOrDefault(i => i.Value.Acronym == selection?.Team1.Value?.Acronym).Value; - dropdownTeam2.Bindable.Value = dropdownTeam1.Items.FirstOrDefault(i => i.Value.Acronym == selection?.Team2.Value?.Acronym).Value; + textboxTeam1.Text = selection?.Team1.Value?.Acronym; + textboxTeam2.Text = selection?.Team2.Value?.Acronym; sliderBestOf.Bindable.Value = selection?.BestOf ?? sliderBestOf.Bindable.Default; }; - dropdownTeam1.Bindable.ValueChanged += val => + textboxTeam1.OnCommit = (val, newText) => { - if (editorInfo.Selected.Value != null) editorInfo.Selected.Value.Team1.Value = val.Acronym == null ? null : val; + if (newText && editorInfo.Selected.Value != null) + editorInfo.Selected.Value.Team1.Value = teamEntries.FirstOrDefault(t => t.Acronym == val.Text); }; - dropdownTeam2.Bindable.ValueChanged += val => + textboxTeam2.OnCommit = (val, newText) => { - if (editorInfo.Selected.Value != null) editorInfo.Selected.Value.Team2.Value = val.Acronym == null ? null : val; + if (newText && editorInfo.Selected.Value != null) + editorInfo.Selected.Value.Team2.Value = teamEntries.FirstOrDefault(t => t.Acronym == val.Text); }; sliderBestOf.Bindable.ValueChanged += val => From 68cef7646848fb9e3bacae79bf72e7fd1ff11a8c Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 24 Sep 2018 05:19:03 +0900 Subject: [PATCH 024/317] Add grouping and move BestOf out of pairing --- .../Ladder/Components/DrawableMatchPairing.cs | 8 +-- .../Screens/Ladder/Components/LadderInfo.cs | 4 ++ .../Ladder/Components/LadderSettings.cs | 64 +++++++++---------- .../Screens/Ladder/Components/MatchPairing.cs | 2 +- .../Ladder/Components/TournamentGrouping.cs | 15 +++++ 5 files changed, 54 insertions(+), 39 deletions(-) create mode 100644 osu.Game.Tournament/Screens/Ladder/Components/TournamentGrouping.cs diff --git a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs index 7f8956c24d..a7ebbfa8b3 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs @@ -61,7 +61,7 @@ namespace osu.Game.Tournament.Screens.Ladder.Components pairing.Team2.BindValueChanged(_ => updateTeams()); pairing.Team1Score.BindValueChanged(_ => updateWinConditions()); pairing.Team2Score.BindValueChanged(_ => updateWinConditions()); - pairing.BestOf.BindValueChanged(_ => updateWinConditions()); + pairing.Grouping.BindValueChanged(_ => updateWinConditions()); pairing.Completed.BindValueChanged(_ => updateProgression()); pairing.Progression.BindValueChanged(_ => updateProgression()); @@ -112,11 +112,11 @@ namespace osu.Game.Tournament.Screens.Ladder.Components private void updateWinConditions() { - if (conditions.Value == null) return; + if (conditions.Value == null || Pairing.Grouping.Value == null) return; - var instaWinAmount = Pairing.BestOf.Value / 2; + var instaWinAmount = Pairing.Grouping.Value.BestOf / 2; - Pairing.Completed.Value = Pairing.Team1Score + Pairing.Team2Score >= Pairing.BestOf || Pairing.Team1Score > instaWinAmount || Pairing.Team2Score > instaWinAmount; + Pairing.Completed.Value = Pairing.Grouping.Value.BestOf > 0 && (Pairing.Team1Score + Pairing.Team2Score >= Pairing.Grouping.Value.BestOf || Pairing.Team1Score > instaWinAmount || Pairing.Team2Score > instaWinAmount); } protected override void LoadComplete() diff --git a/osu.Game.Tournament/Screens/Ladder/Components/LadderInfo.cs b/osu.Game.Tournament/Screens/Ladder/Components/LadderInfo.cs index 0860966502..e1da676f22 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/LadderInfo.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/LadderInfo.cs @@ -1,3 +1,6 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + using System.Collections.Generic; namespace osu.Game.Tournament.Screens.Ladder.Components @@ -6,5 +9,6 @@ namespace osu.Game.Tournament.Screens.Ladder.Components { public List Pairings = new List(); public List<(int, int)> Progressions = new List<(int, int)>(); + public List Groupings = new List(); } } diff --git a/osu.Game.Tournament/Screens/Ladder/Components/LadderSettings.cs b/osu.Game.Tournament/Screens/Ladder/Components/LadderSettings.cs index a2275784a0..7532cee0f0 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/LadderSettings.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/LadderSettings.cs @@ -3,7 +3,6 @@ using System.Linq; using osu.Framework.Allocation; -using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Game.Graphics.Sprites; @@ -18,8 +17,6 @@ namespace osu.Game.Tournament.Screens.Ladder.Components protected override string Title => @"ladder"; - private PlayerSliderBar sliderBestOf; - private OsuTextBox textboxTeam1; private OsuTextBox textboxTeam2; @@ -70,39 +67,38 @@ namespace osu.Game.Tournament.Screens.Ladder.Components }, }, textboxTeam2 = new OsuTextBox { RelativeSizeAxes = Axes.X, Height = 20 }, - new Container - { - RelativeSizeAxes = Axes.X, - AutoSizeAxes = Axes.Y, - Padding = new MarginPadding { Horizontal = padding }, - Children = new Drawable[] - { - new OsuSpriteText - { - Anchor = Anchor.CentreLeft, - Origin = Anchor.CentreLeft, - Text = "Best of", - }, - }, - }, - sliderBestOf = new PlayerSliderBar - { - Bindable = new BindableDouble - { - Default = 11, - Value = 11, - MinValue = 1, - MaxValue = 21, - Precision = 1, - }, - } + // new Container + // { + // RelativeSizeAxes = Axes.X, + // AutoSizeAxes = Axes.Y, + // Padding = new MarginPadding { Horizontal = padding }, + // Children = new Drawable[] + // { + // new OsuSpriteText + // { + // Anchor = Anchor.CentreLeft, + // Origin = Anchor.CentreLeft, + // Text = "Best of", + // }, + // }, + // }, + // sliderBestOf = new PlayerSliderBar + // { + // Bindable = new BindableDouble + // { + // Default = 11, + // Value = 11, + // MinValue = 1, + // MaxValue = 21, + // Precision = 1, + // }, + // } }; editorInfo.Selected.ValueChanged += selection => { textboxTeam1.Text = selection?.Team1.Value?.Acronym; textboxTeam2.Text = selection?.Team2.Value?.Acronym; - sliderBestOf.Bindable.Value = selection?.BestOf ?? sliderBestOf.Bindable.Default; }; textboxTeam1.OnCommit = (val, newText) => @@ -117,10 +113,10 @@ namespace osu.Game.Tournament.Screens.Ladder.Components editorInfo.Selected.Value.Team2.Value = teamEntries.FirstOrDefault(t => t.Acronym == val.Text); }; - sliderBestOf.Bindable.ValueChanged += val => - { - if (editorInfo.Selected.Value != null) editorInfo.Selected.Value.BestOf.Value = (int)val; - }; + // sliderBestOf.Bindable.ValueChanged += val => + // { + // if (editorInfo.Selected.Value != null) editorInfo.Selected.Value.BestOf.Value = (int)val; + // }; editorInfo.EditingEnabled.ValueChanged += enabled => { diff --git a/osu.Game.Tournament/Screens/Ladder/Components/MatchPairing.cs b/osu.Game.Tournament/Screens/Ladder/Components/MatchPairing.cs index c47e3ea440..0bdfb5c300 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/MatchPairing.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/MatchPairing.cs @@ -25,7 +25,7 @@ namespace osu.Game.Tournament.Screens.Ladder.Components public readonly Bindable Completed = new Bindable(); - public readonly BindableInt BestOf = new BindableInt(11); + public readonly Bindable Grouping = new Bindable(); [JsonIgnore] public readonly Bindable Progression = new Bindable(); diff --git a/osu.Game.Tournament/Screens/Ladder/Components/TournamentGrouping.cs b/osu.Game.Tournament/Screens/Ladder/Components/TournamentGrouping.cs new file mode 100644 index 0000000000..0178885307 --- /dev/null +++ b/osu.Game.Tournament/Screens/Ladder/Components/TournamentGrouping.cs @@ -0,0 +1,15 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +namespace osu.Game.Tournament.Screens.Ladder.Components +{ + public class TournamentGrouping + { + public int ID; + + public string Name; + public string Description; + + public int BestOf; + } +} From ad63ff2d069ff544061ac59aba240c0ad273ee16 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 24 Sep 2018 16:34:46 +0900 Subject: [PATCH 025/317] Add scrollability --- .../Screens/Ladder/LadderManager.cs | 25 +++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/osu.Game.Tournament/Screens/Ladder/LadderManager.cs b/osu.Game.Tournament/Screens/Ladder/LadderManager.cs index 235ac4a86a..2cf7e00314 100644 --- a/osu.Game.Tournament/Screens/Ladder/LadderManager.cs +++ b/osu.Game.Tournament/Screens/Ladder/LadderManager.cs @@ -12,6 +12,7 @@ using osu.Framework.Input.States; using osu.Game.Graphics.UserInterface; using osu.Game.Tournament.Components; using osu.Game.Tournament.Screens.Ladder.Components; +using OpenTK; using SixLabors.Primitives; namespace osu.Game.Tournament.Screens.Ladder @@ -43,8 +44,15 @@ namespace osu.Game.Tournament.Screens.Ladder RelativeSizeAxes = Axes.Both, Children = new Drawable[] { - paths = new Container { RelativeSizeAxes = Axes.Both }, - pairingsContainer = new Container { RelativeSizeAxes = Axes.Both }, + new ScrollableContainer + { + RelativeSizeAxes = Axes.Both, + Children = new Drawable[] + { + paths = new Container { RelativeSizeAxes = Axes.Both }, + pairingsContainer = new Container { RelativeSizeAxes = Axes.Both }, + } + }, new LadderEditorSettings { Anchor = Anchor.TopRight, @@ -183,4 +191,17 @@ namespace osu.Game.Tournament.Screens.Ladder public void Remove(MatchPairing pairing) => pairingsContainer.FirstOrDefault(p => p.Pairing == pairing)?.Remove(); } + + public class ScrollableContainer : Container + { + protected override bool OnDragStart(InputState state) => true; + + public override bool ReceiveMouseInputAt(Vector2 screenSpacePos) => true; + + protected override bool OnDrag(InputState state) + { + Position += state.Mouse.Delta; + return base.OnDrag(state); + } + } } From 1644775f7be43dc12301be7cf28a68045a152950 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 24 Sep 2018 23:30:37 +0900 Subject: [PATCH 026/317] Add grouping configuration --- .../Ladder/Components/LadderSettings.cs | 18 ++++++++++++++++++ .../Screens/Ladder/Components/MatchPairing.cs | 1 + .../Ladder/Components/TournamentGrouping.cs | 6 ++++-- .../Screens/Ladder/LadderManager.cs | 12 +++++++++++- 4 files changed, 34 insertions(+), 3 deletions(-) diff --git a/osu.Game.Tournament/Screens/Ladder/Components/LadderSettings.cs b/osu.Game.Tournament/Screens/Ladder/Components/LadderSettings.cs index 7532cee0f0..379bb36c09 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/LadderSettings.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/LadderSettings.cs @@ -1,12 +1,15 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using System.Collections.Generic; using System.Linq; using osu.Framework.Allocation; +using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Game.Graphics.Sprites; using osu.Game.Graphics.UserInterface; +using osu.Game.Overlays.Settings; using osu.Game.Screens.Play.PlayerSettings; namespace osu.Game.Tournament.Screens.Ladder.Components @@ -19,6 +22,7 @@ namespace osu.Game.Tournament.Screens.Ladder.Components private OsuTextBox textboxTeam1; private OsuTextBox textboxTeam2; + private SettingsDropdown groupingDropdown; [Resolved] private LadderEditorInfo editorInfo { get; set; } = null; @@ -28,6 +32,8 @@ namespace osu.Game.Tournament.Screens.Ladder.Components { var teamEntries = editorInfo.Teams; + var groupingOptions = editorInfo.Groupings.Select(g => new KeyValuePair(g.Name, g)).Prepend(new KeyValuePair("None", new TournamentGrouping())); + Children = new Drawable[] { new PlayerCheckbox @@ -67,6 +73,11 @@ namespace osu.Game.Tournament.Screens.Ladder.Components }, }, textboxTeam2 = new OsuTextBox { RelativeSizeAxes = Axes.X, Height = 20 }, + groupingDropdown = new SettingsDropdown + { + Bindable = new Bindable(), + Items = groupingOptions + }, // new Container // { // RelativeSizeAxes = Axes.X, @@ -99,6 +110,7 @@ namespace osu.Game.Tournament.Screens.Ladder.Components { textboxTeam1.Text = selection?.Team1.Value?.Acronym; textboxTeam2.Text = selection?.Team2.Value?.Acronym; + groupingDropdown.Bindable.Value = selection?.Grouping.Value ?? groupingOptions.First().Value; }; textboxTeam1.OnCommit = (val, newText) => @@ -113,6 +125,12 @@ namespace osu.Game.Tournament.Screens.Ladder.Components editorInfo.Selected.Value.Team2.Value = teamEntries.FirstOrDefault(t => t.Acronym == val.Text); }; + groupingDropdown.Bindable.ValueChanged += grouping => + { + if (editorInfo.Selected.Value != null) + editorInfo.Selected.Value.Grouping.Value = grouping; + }; + // sliderBestOf.Bindable.ValueChanged += val => // { // if (editorInfo.Selected.Value != null) editorInfo.Selected.Value.BestOf.Value = (int)val; diff --git a/osu.Game.Tournament/Screens/Ladder/Components/MatchPairing.cs b/osu.Game.Tournament/Screens/Ladder/Components/MatchPairing.cs index 0bdfb5c300..a97354a1c4 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/MatchPairing.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/MatchPairing.cs @@ -25,6 +25,7 @@ namespace osu.Game.Tournament.Screens.Ladder.Components public readonly Bindable Completed = new Bindable(); + [JsonIgnore] public readonly Bindable Grouping = new Bindable(); [JsonIgnore] diff --git a/osu.Game.Tournament/Screens/Ladder/Components/TournamentGrouping.cs b/osu.Game.Tournament/Screens/Ladder/Components/TournamentGrouping.cs index 0178885307..675bf5fc4f 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/TournamentGrouping.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/TournamentGrouping.cs @@ -1,15 +1,17 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using System.Collections.Generic; + namespace osu.Game.Tournament.Screens.Ladder.Components { public class TournamentGrouping { - public int ID; - public string Name; public string Description; public int BestOf; + + public List Pairings = new List(); } } diff --git a/osu.Game.Tournament/Screens/Ladder/LadderManager.cs b/osu.Game.Tournament/Screens/Ladder/LadderManager.cs index 2cf7e00314..8939e72be2 100644 --- a/osu.Game.Tournament/Screens/Ladder/LadderManager.cs +++ b/osu.Game.Tournament/Screens/Ladder/LadderManager.cs @@ -21,6 +21,7 @@ namespace osu.Game.Tournament.Screens.Ladder { public readonly BindableBool EditingEnabled = new BindableBool(); public List Teams = new List(); + public List Groupings = new List(); public readonly Bindable Selected = new Bindable(); } @@ -36,6 +37,7 @@ namespace osu.Game.Tournament.Screens.Ladder public LadderManager(LadderInfo info, List teams) { editorInfo.Teams = Teams = teams; + editorInfo.Groupings = info.Groupings; RelativeSizeAxes = Axes.Both; @@ -75,19 +77,27 @@ namespace osu.Game.Tournament.Screens.Ladder foreach (var pairing in info.Pairings) addPairing(pairing); + + foreach (var group in info.Groupings) + foreach (var id in group.Pairings) + info.Pairings.Single(p => p.ID == id).Grouping.Value = group; } public LadderInfo CreateInfo() { var pairings = pairingsContainer.Select(p => p.Pairing).ToList(); + foreach (var g in editorInfo.Groupings) + g.Pairings = pairings.Where(p => p.Grouping.Value == g).Select(p => p.ID).ToList(); + return new LadderInfo { Pairings = pairings, Progressions = pairings .Where(p => p.Progression.Value != null) .Select(p => (p.ID, p.Progression.Value.ID)) - .ToList() + .ToList(), + Groupings = editorInfo.Groupings }; } From c7c55f21392d029cb2f5ff851e1b08e495940af1 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 25 Sep 2018 00:57:44 +0900 Subject: [PATCH 027/317] Add headings --- .../Ladder/DrawableTournamentGrouping.cs | 39 ++++++++++++++++ .../Screens/Ladder/LadderManager.cs | 46 +++++++++++++------ .../Screens/Ladder/ScrollableContainer.cs | 22 +++++++++ 3 files changed, 93 insertions(+), 14 deletions(-) create mode 100644 osu.Game.Tournament/Screens/Ladder/DrawableTournamentGrouping.cs create mode 100644 osu.Game.Tournament/Screens/Ladder/ScrollableContainer.cs diff --git a/osu.Game.Tournament/Screens/Ladder/DrawableTournamentGrouping.cs b/osu.Game.Tournament/Screens/Ladder/DrawableTournamentGrouping.cs new file mode 100644 index 0000000000..28e1183b27 --- /dev/null +++ b/osu.Game.Tournament/Screens/Ladder/DrawableTournamentGrouping.cs @@ -0,0 +1,39 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Game.Graphics.Sprites; +using osu.Game.Tournament.Screens.Ladder.Components; + +namespace osu.Game.Tournament.Screens.Ladder +{ + public class DrawableTournamentGrouping : CompositeDrawable + { + public DrawableTournamentGrouping(TournamentGrouping grouping) + { + AutoSizeAxes = Axes.Both; + InternalChild = new FillFlowContainer + { + Direction = FillDirection.Vertical, + AutoSizeAxes = Axes.Both, + Children = new Drawable[] + { + new OsuSpriteText + { + Text = grouping.Description.ToUpper(), + Origin = Anchor.TopCentre, + Anchor = Anchor.TopCentre + }, + new OsuSpriteText + { + Text = grouping.Name.ToUpper(), + Font = "Exo2.0-Bold", + Origin = Anchor.TopCentre, + Anchor = Anchor.TopCentre + }, + } + }; + } + } +} diff --git a/osu.Game.Tournament/Screens/Ladder/LadderManager.cs b/osu.Game.Tournament/Screens/Ladder/LadderManager.cs index 8939e72be2..95b2a0a8d1 100644 --- a/osu.Game.Tournament/Screens/Ladder/LadderManager.cs +++ b/osu.Game.Tournament/Screens/Ladder/LadderManager.cs @@ -1,7 +1,9 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Runtime.InteropServices; using osu.Framework.Allocation; +using osu.Framework.Caching; using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; @@ -12,7 +14,6 @@ using osu.Framework.Input.States; using osu.Game.Graphics.UserInterface; using osu.Game.Tournament.Components; using osu.Game.Tournament.Screens.Ladder.Components; -using OpenTK; using SixLabors.Primitives; namespace osu.Game.Tournament.Screens.Ladder @@ -30,6 +31,7 @@ namespace osu.Game.Tournament.Screens.Ladder public readonly List Teams; private readonly Container pairingsContainer; private readonly Container paths; + private readonly Container headings; [Cached] private readonly LadderEditorInfo editorInfo = new LadderEditorInfo(); @@ -52,6 +54,7 @@ namespace osu.Game.Tournament.Screens.Ladder Children = new Drawable[] { paths = new Container { RelativeSizeAxes = Axes.Both }, + headings = new Container() { RelativeSizeAxes = Axes.Both }, pairingsContainer = new Container { RelativeSizeAxes = Axes.Both }, } }, @@ -81,6 +84,9 @@ namespace osu.Game.Tournament.Screens.Ladder foreach (var group in info.Groupings) foreach (var id in group.Pairings) info.Pairings.Single(p => p.ID == id).Grouping.Value = group; + + // todo: fix this + Scheduler.AddDelayed(() => layout.Invalidate(), 100, true); } public LadderInfo CreateInfo() @@ -121,11 +127,20 @@ namespace osu.Game.Tournament.Screens.Ladder } } + private Cached layout = new Cached(); + protected override void Update() { base.Update(); + if (!layout.IsValid) + updateLayout(); + } + + private void updateLayout() + { paths.Clear(); + headings.Clear(); int id = 1; foreach (var pairing in pairingsContainer.OrderBy(d => d.Y).ThenBy(d => d.X)) @@ -143,6 +158,22 @@ namespace osu.Game.Tournament.Screens.Ladder paths.Add(new ProgressionPath(pairing, dest)); } } + + foreach (var group in editorInfo.Groupings) + { + var topPairing = pairingsContainer.Where(p => p.Pairing.Grouping.Value == group).OrderBy(p => p.Y).FirstOrDefault(); + + if (topPairing == null) continue; + + headings.Add(new DrawableTournamentGrouping(group) + { + Position = headings.ToLocalSpace((topPairing.ScreenSpaceDrawQuad.TopLeft + topPairing.ScreenSpaceDrawQuad.TopRight) / 2), + Margin = new MarginPadding { Bottom = 10 }, + Origin = Anchor.BottomCentre, + }); + } + + layout.Validate(); } public void RequestJoin(MatchPairing pairing) => AddInternal(new JoinRequestHandler(pairingsContainer, pairing)); @@ -201,17 +232,4 @@ namespace osu.Game.Tournament.Screens.Ladder public void Remove(MatchPairing pairing) => pairingsContainer.FirstOrDefault(p => p.Pairing == pairing)?.Remove(); } - - public class ScrollableContainer : Container - { - protected override bool OnDragStart(InputState state) => true; - - public override bool ReceiveMouseInputAt(Vector2 screenSpacePos) => true; - - protected override bool OnDrag(InputState state) - { - Position += state.Mouse.Delta; - return base.OnDrag(state); - } - } } diff --git a/osu.Game.Tournament/Screens/Ladder/ScrollableContainer.cs b/osu.Game.Tournament/Screens/Ladder/ScrollableContainer.cs new file mode 100644 index 0000000000..bb4f2e58a9 --- /dev/null +++ b/osu.Game.Tournament/Screens/Ladder/ScrollableContainer.cs @@ -0,0 +1,22 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework.Graphics.Containers; +using osu.Framework.Input.States; +using OpenTK; + +namespace osu.Game.Tournament.Screens.Ladder +{ + public class ScrollableContainer : Container + { + protected override bool OnDragStart(InputState state) => true; + + public override bool ReceiveMouseInputAt(Vector2 screenSpacePos) => true; + + protected override bool OnDrag(InputState state) + { + Position += state.Mouse.Delta; + return base.OnDrag(state); + } + } +} From d2ce974ba8ade2586ee8ae343e2dab2cfd09a77d Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 25 Sep 2018 02:31:48 +0900 Subject: [PATCH 028/317] Add loser progressions --- .../Ladder/Components/DrawableMatchPairing.cs | 19 +++++-- .../Ladder/Components/DrawableMatchTeam.cs | 7 ++- .../Screens/Ladder/Components/LadderInfo.cs | 2 +- .../Ladder/Components/LadderSettings.cs | 16 +++++- .../Screens/Ladder/Components/MatchPairing.cs | 8 +++ .../Components/TournamentProgression.cs | 20 +++++++ .../Ladder/DrawableTournamentGrouping.cs | 4 +- .../Screens/Ladder/LadderManager.cs | 54 ++++++++++++++----- 8 files changed, 108 insertions(+), 22 deletions(-) create mode 100644 osu.Game.Tournament/Screens/Ladder/Components/TournamentProgression.cs diff --git a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs index a7ebbfa8b3..285baad872 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs @@ -64,6 +64,7 @@ namespace osu.Game.Tournament.Screens.Ladder.Components pairing.Grouping.BindValueChanged(_ => updateWinConditions()); pairing.Completed.BindValueChanged(_ => updateProgression()); pairing.Progression.BindValueChanged(_ => updateProgression()); + pairing.LosersProgression.BindValueChanged(_ => updateProgression()); updateTeams(); } @@ -102,12 +103,21 @@ namespace osu.Game.Tournament.Screens.Ladder.Components { var progression = Pairing.Progression?.Value; - if (progression == null) return; + if (progression != null) + { + bool progressionAbove = progression.ID < Pairing.ID; - bool progressionAbove = progression.ID < Pairing.ID; + var destinationForWinner = progressionAbove || progression.Team1.Value != null && progression.Team1.Value != Pairing.Winner ? progression.Team2 : progression.Team1; + destinationForWinner.Value = Pairing.Winner; + } - var destinationForWinner = progressionAbove ? progression.Team2 : progression.Team1; - destinationForWinner.Value = Pairing.Winner; + if ((progression = Pairing.LosersProgression?.Value) != null) + { + bool progressionAbove = progression.ID < Pairing.ID; + + var destinationForLoser = progressionAbove || progression.Team1.Value != null && progression.Team1.Value != Pairing.Winner ? progression.Team2 : progression.Team1; + destinationForLoser.Value = Pairing.Loser; + } } private void updateWinConditions() @@ -197,6 +207,7 @@ namespace osu.Game.Tournament.Screens.Ladder.Components { Selected = false; Pairing.Progression.Value = null; + Pairing.LosersProgression.Value = null; Expire(); } diff --git a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs index a517c5f475..c66d3fff55 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs @@ -141,6 +141,10 @@ namespace osu.Game.Tournament.Screens.Ladder.Components } else { + if (pairing.Progression.Value.Completed) + // don't allow changing scores if the match has a progression. can cause large data loss + return false; + if (score.Value > 0) score.Value--; else @@ -168,7 +172,8 @@ namespace osu.Game.Tournament.Screens.Ladder.Components return new MenuItem[] { - new OsuMenuItem("Join with", MenuItemType.Standard, () => manager.RequestJoin(pairing)), + new OsuMenuItem("Join with", MenuItemType.Standard, () => manager.RequestJoin(pairing, false)), + new OsuMenuItem("Join with (loser)", MenuItemType.Standard, () => manager.RequestJoin(pairing, true)), new OsuMenuItem("Remove", MenuItemType.Destructive, () => manager.Remove(pairing)), }; } diff --git a/osu.Game.Tournament/Screens/Ladder/Components/LadderInfo.cs b/osu.Game.Tournament/Screens/Ladder/Components/LadderInfo.cs index e1da676f22..ba64b974d9 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/LadderInfo.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/LadderInfo.cs @@ -8,7 +8,7 @@ namespace osu.Game.Tournament.Screens.Ladder.Components public class LadderInfo { public List Pairings = new List(); - public List<(int, int)> Progressions = new List<(int, int)>(); + public List Progressions = new List(); public List Groupings = new List(); } } diff --git a/osu.Game.Tournament/Screens/Ladder/Components/LadderSettings.cs b/osu.Game.Tournament/Screens/Ladder/Components/LadderSettings.cs index 379bb36c09..d8e37a5c80 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/LadderSettings.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/LadderSettings.cs @@ -23,6 +23,7 @@ namespace osu.Game.Tournament.Screens.Ladder.Components private OsuTextBox textboxTeam1; private OsuTextBox textboxTeam2; private SettingsDropdown groupingDropdown; + private PlayerCheckbox losersCheckbox; [Resolved] private LadderEditorInfo editorInfo { get; set; } = null; @@ -32,7 +33,8 @@ namespace osu.Game.Tournament.Screens.Ladder.Components { var teamEntries = editorInfo.Teams; - var groupingOptions = editorInfo.Groupings.Select(g => new KeyValuePair(g.Name, g)).Prepend(new KeyValuePair("None", new TournamentGrouping())); + var groupingOptions = editorInfo.Groupings.Select(g => new KeyValuePair(g.Name, g)) + .Prepend(new KeyValuePair("None", new TournamentGrouping())); Children = new Drawable[] { @@ -78,6 +80,11 @@ namespace osu.Game.Tournament.Screens.Ladder.Components Bindable = new Bindable(), Items = groupingOptions }, + losersCheckbox = new PlayerCheckbox + { + LabelText = "Losers Bracket", + Bindable = new Bindable() + } // new Container // { // RelativeSizeAxes = Axes.X, @@ -111,6 +118,7 @@ namespace osu.Game.Tournament.Screens.Ladder.Components textboxTeam1.Text = selection?.Team1.Value?.Acronym; textboxTeam2.Text = selection?.Team2.Value?.Acronym; groupingDropdown.Bindable.Value = selection?.Grouping.Value ?? groupingOptions.First().Value; + losersCheckbox.Current.Value = selection?.Losers.Value ?? false; }; textboxTeam1.OnCommit = (val, newText) => @@ -131,6 +139,12 @@ namespace osu.Game.Tournament.Screens.Ladder.Components editorInfo.Selected.Value.Grouping.Value = grouping; }; + losersCheckbox.Current.ValueChanged += losers => + { + if (editorInfo.Selected.Value != null) + editorInfo.Selected.Value.Losers.Value = losers; + }; + // sliderBestOf.Bindable.ValueChanged += val => // { // if (editorInfo.Selected.Value != null) editorInfo.Selected.Value.BestOf.Value = (int)val; diff --git a/osu.Game.Tournament/Screens/Ladder/Components/MatchPairing.cs b/osu.Game.Tournament/Screens/Ladder/Components/MatchPairing.cs index a97354a1c4..49a477701f 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/MatchPairing.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/MatchPairing.cs @@ -25,12 +25,17 @@ namespace osu.Game.Tournament.Screens.Ladder.Components public readonly Bindable Completed = new Bindable(); + public readonly Bindable Losers = new Bindable(); + [JsonIgnore] public readonly Bindable Grouping = new Bindable(); [JsonIgnore] public readonly Bindable Progression = new Bindable(); + [JsonIgnore] + public readonly Bindable LosersProgression = new Bindable(); + [JsonProperty] public Point Position; @@ -47,6 +52,9 @@ namespace osu.Game.Tournament.Screens.Ladder.Components [JsonIgnore] public TournamentTeam Winner => !Completed.Value ? null : Team1Score.Value > Team2Score.Value ? Team1.Value : Team2.Value; + [JsonIgnore] + public TournamentTeam Loser => !Completed.Value ? null : Team1Score.Value > Team2Score.Value ? Team2.Value : Team1.Value; + /// /// Remove scores from the match, in case of a false click or false start. /// diff --git a/osu.Game.Tournament/Screens/Ladder/Components/TournamentProgression.cs b/osu.Game.Tournament/Screens/Ladder/Components/TournamentProgression.cs new file mode 100644 index 0000000000..9f2d2c4045 --- /dev/null +++ b/osu.Game.Tournament/Screens/Ladder/Components/TournamentProgression.cs @@ -0,0 +1,20 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +namespace osu.Game.Tournament.Screens.Ladder.Components +{ + public class TournamentProgression + { + public int Item1; + public int Item2; + + public bool Losers; + + public TournamentProgression(int item1, int item2, bool losers = false) + { + Item1 = item1; + Item2 = item2; + Losers = losers; + } + } +} diff --git a/osu.Game.Tournament/Screens/Ladder/DrawableTournamentGrouping.cs b/osu.Game.Tournament/Screens/Ladder/DrawableTournamentGrouping.cs index 28e1183b27..df7f621c24 100644 --- a/osu.Game.Tournament/Screens/Ladder/DrawableTournamentGrouping.cs +++ b/osu.Game.Tournament/Screens/Ladder/DrawableTournamentGrouping.cs @@ -10,7 +10,7 @@ namespace osu.Game.Tournament.Screens.Ladder { public class DrawableTournamentGrouping : CompositeDrawable { - public DrawableTournamentGrouping(TournamentGrouping grouping) + public DrawableTournamentGrouping(TournamentGrouping grouping, bool losers = false) { AutoSizeAxes = Axes.Both; InternalChild = new FillFlowContainer @@ -27,7 +27,7 @@ namespace osu.Game.Tournament.Screens.Ladder }, new OsuSpriteText { - Text = grouping.Name.ToUpper(), + Text = ((losers ? "Losers " : "") + grouping.Name).ToUpper(), Font = "Exo2.0-Bold", Origin = Anchor.TopCentre, Anchor = Anchor.TopCentre diff --git a/osu.Game.Tournament/Screens/Ladder/LadderManager.cs b/osu.Game.Tournament/Screens/Ladder/LadderManager.cs index 95b2a0a8d1..d5ff651ef3 100644 --- a/osu.Game.Tournament/Screens/Ladder/LadderManager.cs +++ b/osu.Game.Tournament/Screens/Ladder/LadderManager.cs @@ -1,7 +1,6 @@ using System; using System.Collections.Generic; using System.Linq; -using System.Runtime.InteropServices; using osu.Framework.Allocation; using osu.Framework.Caching; using osu.Framework.Configuration; @@ -54,7 +53,7 @@ namespace osu.Game.Tournament.Screens.Ladder Children = new Drawable[] { paths = new Container { RelativeSizeAxes = Axes.Both }, - headings = new Container() { RelativeSizeAxes = Axes.Both }, + headings = new Container { RelativeSizeAxes = Axes.Both }, pairingsContainer = new Container { RelativeSizeAxes = Axes.Both }, } }, @@ -75,7 +74,12 @@ namespace osu.Game.Tournament.Screens.Ladder if (src == null) throw new InvalidOperationException(); if (dest != null) - src.Progression.Value = dest; + { + if (pair.Losers) + src.LosersProgression.Value = dest; + else + src.Progression.Value = dest; + } } foreach (var pairing in info.Pairings) @@ -99,10 +103,9 @@ namespace osu.Game.Tournament.Screens.Ladder return new LadderInfo { Pairings = pairings, - Progressions = pairings - .Where(p => p.Progression.Value != null) - .Select(p => (p.ID, p.Progression.Value.ID)) - .ToList(), + Progressions = pairings.Where(p => p.Progression.Value != null).Select(p => new TournamentProgression(p.ID, p.Progression.Value.ID)).Concat( + pairings.Where(p => p.LosersProgression.Value != null).Select(p => new TournamentProgression(p.ID, p.LosersProgression.Value.ID, true))) + .ToList(), Groupings = editorInfo.Groupings }; } @@ -120,7 +123,7 @@ namespace osu.Game.Tournament.Screens.Ladder { new OsuMenuItem("Create new match", MenuItemType.Highlighted, () => { - var pos = ToLocalSpace(GetContainingInputManager().CurrentState.Mouse.Position); + var pos = pairingsContainer.ToLocalSpace(GetContainingInputManager().CurrentState.Mouse.Position); addPairing(new MatchPairing { Position = new Point((int)pos.X, (int)pos.Y) }); }), }; @@ -161,7 +164,7 @@ namespace osu.Game.Tournament.Screens.Ladder foreach (var group in editorInfo.Groupings) { - var topPairing = pairingsContainer.Where(p => p.Pairing.Grouping.Value == group).OrderBy(p => p.Y).FirstOrDefault(); + var topPairing = pairingsContainer.Where(p => !p.Pairing.Losers && p.Pairing.Grouping.Value == group).OrderBy(p => p.Y).FirstOrDefault(); if (topPairing == null) continue; @@ -173,25 +176,44 @@ namespace osu.Game.Tournament.Screens.Ladder }); } + foreach (var group in editorInfo.Groupings) + { + var topPairing = pairingsContainer.Where(p => p.Pairing.Losers && p.Pairing.Grouping.Value == group).OrderBy(p => p.Y).FirstOrDefault(); + + if (topPairing == null) continue; + + headings.Add(new DrawableTournamentGrouping(group, true) + { + Position = headings.ToLocalSpace((topPairing.ScreenSpaceDrawQuad.TopLeft + topPairing.ScreenSpaceDrawQuad.TopRight) / 2), + Margin = new MarginPadding { Bottom = 10 }, + Origin = Anchor.BottomCentre, + }); + } + layout.Validate(); } - public void RequestJoin(MatchPairing pairing) => AddInternal(new JoinRequestHandler(pairingsContainer, pairing)); + public void RequestJoin(MatchPairing pairing, bool losers) => AddInternal(new JoinRequestHandler(pairingsContainer, pairing, losers)); private class JoinRequestHandler : CompositeDrawable { private readonly Container pairingsContainer; public readonly MatchPairing Source; + private readonly bool losers; private ProgressionPath path; - public JoinRequestHandler(Container pairingsContainer, MatchPairing source) + public JoinRequestHandler(Container pairingsContainer, MatchPairing source, bool losers) { this.pairingsContainer = pairingsContainer; RelativeSizeAxes = Axes.Both; Source = source; - Source.Progression.Value = null; + this.losers = losers; + if (losers) + Source.LosersProgression.Value = null; + else + Source.Progression.Value = null; } private DrawableMatchPairing findTarget(InputState state) => pairingsContainer.FirstOrDefault(d => d.ReceiveMouseInputAt(state.Mouse.NativeState.Position)); @@ -221,7 +243,13 @@ namespace osu.Game.Tournament.Screens.Ladder if (found != null) { if (found.Pairing != Source) - Source.Progression.Value = found.Pairing; + { + if (losers) + Source.LosersProgression.Value = found.Pairing; + else + Source.Progression.Value = found.Pairing; + } + Expire(); return true; } From baefcb9deb52a6c3336e173af6cf1fd6217934bc Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 25 Sep 2018 03:14:30 +0900 Subject: [PATCH 029/317] Simplify team storage --- .../TestCaseLadderManager.cs | 5 +---- .../Ladder/Components/DrawableMatchPairing.cs | 4 ++-- .../Ladder/Components/DrawableMatchTeam.cs | 21 ++++--------------- .../Screens/Ladder/Components/LadderInfo.cs | 2 ++ .../Screens/Ladder/Components/MatchPairing.cs | 11 ++++++++-- .../Screens/Ladder/LadderManager.cs | 13 ++++++++++-- 6 files changed, 29 insertions(+), 27 deletions(-) diff --git a/osu.Game.Tournament.Tests/TestCaseLadderManager.cs b/osu.Game.Tournament.Tests/TestCaseLadderManager.cs index ac56803c90..767681849b 100644 --- a/osu.Game.Tournament.Tests/TestCaseLadderManager.cs +++ b/osu.Game.Tournament.Tests/TestCaseLadderManager.cs @@ -1,7 +1,6 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using System.Collections.Generic; using System.IO; using Newtonsoft.Json; using osu.Framework.Allocation; @@ -9,7 +8,6 @@ using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Game.Graphics.Cursor; using osu.Game.Tests.Visual; -using osu.Game.Tournament.Components; using osu.Game.Tournament.Screens.Ladder; using osu.Game.Tournament.Screens.Ladder.Components; @@ -25,13 +23,12 @@ namespace osu.Game.Tournament.Tests public TestCaseLadderManager() { - var teams = JsonConvert.DeserializeObject>(File.ReadAllText(@"teams.json")); var ladder = File.Exists(@"bracket.json") ? JsonConvert.DeserializeObject(File.ReadAllText(@"bracket.json")) : new LadderInfo(); Child = new OsuContextMenuContainer { RelativeSizeAxes = Axes.Both, - Child = manager = new LadderManager(ladder, teams) + Child = manager = new LadderManager(ladder) }; } diff --git a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs index 285baad872..42670b7bc0 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs @@ -107,7 +107,7 @@ namespace osu.Game.Tournament.Screens.Ladder.Components { bool progressionAbove = progression.ID < Pairing.ID; - var destinationForWinner = progressionAbove || progression.Team1.Value != null && progression.Team1.Value != Pairing.Winner ? progression.Team2 : progression.Team1; + var destinationForWinner = progressionAbove || progression.Team1.Value != null && progression.Team1.Value != Pairing.Team1.Value && progression.Team1.Value != Pairing.Team2.Value ? progression.Team2 : progression.Team1; destinationForWinner.Value = Pairing.Winner; } @@ -115,7 +115,7 @@ namespace osu.Game.Tournament.Screens.Ladder.Components { bool progressionAbove = progression.ID < Pairing.ID; - var destinationForLoser = progressionAbove || progression.Team1.Value != null && progression.Team1.Value != Pairing.Winner ? progression.Team2 : progression.Team1; + var destinationForLoser = progressionAbove || progression.Team1.Value != null && progression.Team1.Value != Pairing.Team1.Value && progression.Team1.Value != Pairing.Team2.Value ? progression.Team2 : progression.Team1; destinationForLoser.Value = Pairing.Loser; } } diff --git a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs index c66d3fff55..f346e3c242 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs @@ -145,6 +145,10 @@ namespace osu.Game.Tournament.Screens.Ladder.Components // don't allow changing scores if the match has a progression. can cause large data loss return false; + if (pairing.Completed && pairing.Winner != Team) + // don't allow changing scores from the non-winner + return false; + if (score.Value > 0) score.Value--; else @@ -179,21 +183,4 @@ namespace osu.Game.Tournament.Screens.Ladder.Components } } } - - internal static class Extensions - { - public static T Random(this IEnumerable enumerable) - { - if (enumerable == null) - { - throw new ArgumentNullException(nameof(enumerable)); - } - - // note: creating a Random instance each call may not be correct for you, - // consider a thread-safe static instance - var r = new Random(); - var list = enumerable as IList ?? enumerable.ToList(); - return list.Count == 0 ? default(T) : list[r.Next(0, list.Count)]; - } - } } diff --git a/osu.Game.Tournament/Screens/Ladder/Components/LadderInfo.cs b/osu.Game.Tournament/Screens/Ladder/Components/LadderInfo.cs index ba64b974d9..567cdb0daa 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/LadderInfo.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/LadderInfo.cs @@ -2,6 +2,7 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; +using osu.Game.Tournament.Components; namespace osu.Game.Tournament.Screens.Ladder.Components { @@ -10,5 +11,6 @@ namespace osu.Game.Tournament.Screens.Ladder.Components public List Pairings = new List(); public List Progressions = new List(); public List Groupings = new List(); + public List Teams = new List(); } } diff --git a/osu.Game.Tournament/Screens/Ladder/Components/MatchPairing.cs b/osu.Game.Tournament/Screens/Ladder/Components/MatchPairing.cs index 49a477701f..93d1b7085c 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/MatchPairing.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/MatchPairing.cs @@ -15,12 +15,18 @@ namespace osu.Game.Tournament.Screens.Ladder.Components { public int ID; + [JsonIgnore] public readonly Bindable Team1 = new Bindable(); + public string Team1Acronym; + public readonly Bindable Team1Score = new Bindable(); + [JsonIgnore] public readonly Bindable Team2 = new Bindable(); + public string Team2Acronym; + public readonly Bindable Team2Score = new Bindable(); public readonly Bindable Completed = new Bindable(); @@ -36,14 +42,15 @@ namespace osu.Game.Tournament.Screens.Ladder.Components [JsonIgnore] public readonly Bindable LosersProgression = new Bindable(); - [JsonProperty] public Point Position; public MatchPairing() { + Team1.BindValueChanged(t => Team1Acronym = t?.Acronym, true); + Team2.BindValueChanged(t => Team2Acronym = t?.Acronym, true); } - public MatchPairing(TournamentTeam team1 = null, TournamentTeam team2 = null) + public MatchPairing(TournamentTeam team1 = null, TournamentTeam team2 = null) : this() { Team1.Value = team1; Team2.Value = team2; diff --git a/osu.Game.Tournament/Screens/Ladder/LadderManager.cs b/osu.Game.Tournament/Screens/Ladder/LadderManager.cs index d5ff651ef3..665230eff7 100644 --- a/osu.Game.Tournament/Screens/Ladder/LadderManager.cs +++ b/osu.Game.Tournament/Screens/Ladder/LadderManager.cs @@ -35,9 +35,9 @@ namespace osu.Game.Tournament.Screens.Ladder [Cached] private readonly LadderEditorInfo editorInfo = new LadderEditorInfo(); - public LadderManager(LadderInfo info, List teams) + public LadderManager(LadderInfo info) { - editorInfo.Teams = Teams = teams; + editorInfo.Teams = Teams = info.Teams; editorInfo.Groupings = info.Groupings; RelativeSizeAxes = Axes.Both; @@ -66,6 +66,14 @@ namespace osu.Game.Tournament.Screens.Ladder } }; + // assign teams + foreach (var pairing in info.Pairings) + { + pairing.Team1.Value = info.Teams.FirstOrDefault(t => t.Acronym == pairing.Team1Acronym); + pairing.Team2.Value = info.Teams.FirstOrDefault(t => t.Acronym == pairing.Team2Acronym); + } + + // assign progressions foreach (var pair in info.Progressions) { var src = info.Pairings.FirstOrDefault(p => p.ID == pair.Item1); @@ -106,6 +114,7 @@ namespace osu.Game.Tournament.Screens.Ladder Progressions = pairings.Where(p => p.Progression.Value != null).Select(p => new TournamentProgression(p.ID, p.Progression.Value.ID)).Concat( pairings.Where(p => p.LosersProgression.Value != null).Select(p => new TournamentProgression(p.ID, p.LosersProgression.Value.ID, true))) .ToList(), + Teams = editorInfo.Teams, Groupings = editorInfo.Groupings }; } From fdccec06b3c8809a4a2bf30a40a6327834cb6e6e Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 25 Sep 2018 03:55:24 +0900 Subject: [PATCH 030/317] Change colour for losers pairings --- .../Screens/Ladder/Components/DrawableMatchPairing.cs | 5 +++-- .../Screens/Ladder/Components/DrawableMatchTeam.cs | 8 ++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs index 42670b7bc0..ee69f5c079 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs @@ -65,6 +65,7 @@ namespace osu.Game.Tournament.Screens.Ladder.Components pairing.Completed.BindValueChanged(_ => updateProgression()); pairing.Progression.BindValueChanged(_ => updateProgression()); pairing.LosersProgression.BindValueChanged(_ => updateProgression()); + pairing.Losers.BindValueChanged(_ => updateTeams()); updateTeams(); } @@ -156,8 +157,8 @@ namespace osu.Game.Tournament.Screens.Ladder.Components flow.Children = new[] { - new DrawableMatchTeam(Pairing.Team1, Pairing), - new DrawableMatchTeam(Pairing.Team2, Pairing) + new DrawableMatchTeam(Pairing.Team1, Pairing, Pairing.Losers), + new DrawableMatchTeam(Pairing.Team2, Pairing, Pairing.Losers) }; SchedulerAfterChildren.Add(() => Scheduler.Add(updateProgression)); diff --git a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs index f346e3c242..7e3d5f4f2b 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs @@ -2,8 +2,6 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; -using System.Collections.Generic; -using System.Linq; using osu.Framework.Allocation; using osu.Framework.Configuration; using osu.Framework.Graphics; @@ -26,6 +24,7 @@ namespace osu.Game.Tournament.Screens.Ladder.Components public class DrawableMatchTeam : DrawableTournamentTeam, IHasContextMenu { private readonly MatchPairing pairing; + private readonly bool losers; private OsuSpriteText scoreText; private Box background; @@ -41,10 +40,11 @@ namespace osu.Game.Tournament.Screens.Ladder.Components [Resolved(CanBeNull = true)] private LadderEditorInfo editorInfo { get; set; } = null; - public DrawableMatchTeam(Bindable team, MatchPairing pairing) + public DrawableMatchTeam(Bindable team, MatchPairing pairing, bool losers) : base(team) { this.pairing = pairing; + this.losers = losers; Size = new Vector2(150, 40); Masking = true; @@ -72,7 +72,7 @@ namespace osu.Game.Tournament.Screens.Ladder.Components { this.manager = manager; - colourWinner = colours.BlueDarker; + colourWinner = losers ? colours.YellowDarker : colours.BlueDarker; colourNormal = OsuColour.Gray(0.2f); InternalChildren = new Drawable[] From 2bba426622371a6a1e073efc3b8e7c4cd936dceb Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 25 Sep 2018 03:55:35 +0900 Subject: [PATCH 031/317] Fix pairing line being incorrectly offset when scrolled --- .../Screens/Ladder/LadderEditorInfo.cs | 18 ++++++++++++++ .../Screens/Ladder/LadderManager.cs | 24 +++++++++---------- 2 files changed, 30 insertions(+), 12 deletions(-) create mode 100644 osu.Game.Tournament/Screens/Ladder/LadderEditorInfo.cs diff --git a/osu.Game.Tournament/Screens/Ladder/LadderEditorInfo.cs b/osu.Game.Tournament/Screens/Ladder/LadderEditorInfo.cs new file mode 100644 index 0000000000..00272b9378 --- /dev/null +++ b/osu.Game.Tournament/Screens/Ladder/LadderEditorInfo.cs @@ -0,0 +1,18 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System.Collections.Generic; +using osu.Framework.Configuration; +using osu.Game.Tournament.Components; +using osu.Game.Tournament.Screens.Ladder.Components; + +namespace osu.Game.Tournament.Screens.Ladder +{ + public class LadderEditorInfo + { + public readonly BindableBool EditingEnabled = new BindableBool(); + public List Teams = new List(); + public List Groupings = new List(); + public readonly Bindable Selected = new Bindable(); + } +} diff --git a/osu.Game.Tournament/Screens/Ladder/LadderManager.cs b/osu.Game.Tournament/Screens/Ladder/LadderManager.cs index 665230eff7..8e206a7194 100644 --- a/osu.Game.Tournament/Screens/Ladder/LadderManager.cs +++ b/osu.Game.Tournament/Screens/Ladder/LadderManager.cs @@ -3,7 +3,6 @@ using System.Collections.Generic; using System.Linq; using osu.Framework.Allocation; using osu.Framework.Caching; -using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Cursor; @@ -13,18 +12,12 @@ using osu.Framework.Input.States; using osu.Game.Graphics.UserInterface; using osu.Game.Tournament.Components; using osu.Game.Tournament.Screens.Ladder.Components; +using OpenTK; +using OpenTK.Graphics; using SixLabors.Primitives; namespace osu.Game.Tournament.Screens.Ladder { - public class LadderEditorInfo - { - public readonly BindableBool EditingEnabled = new BindableBool(); - public List Teams = new List(); - public List Groupings = new List(); - public readonly Bindable Selected = new Bindable(); - } - public class LadderManager : CompositeDrawable, IHasContextMenu { public readonly List Teams; @@ -32,6 +25,8 @@ namespace osu.Game.Tournament.Screens.Ladder private readonly Container paths; private readonly Container headings; + private readonly ScrollableContainer scrollContent; + [Cached] private readonly LadderEditorInfo editorInfo = new LadderEditorInfo(); @@ -47,7 +42,7 @@ namespace osu.Game.Tournament.Screens.Ladder RelativeSizeAxes = Axes.Both, Children = new Drawable[] { - new ScrollableContainer + scrollContent = new ScrollableContainer { RelativeSizeAxes = Axes.Both, Children = new Drawable[] @@ -202,7 +197,7 @@ namespace osu.Game.Tournament.Screens.Ladder layout.Validate(); } - public void RequestJoin(MatchPairing pairing, bool losers) => AddInternal(new JoinRequestHandler(pairingsContainer, pairing, losers)); + public void RequestJoin(MatchPairing pairing, bool losers) => scrollContent.Add(new JoinRequestHandler(pairingsContainer, pairing, losers)); private class JoinRequestHandler : CompositeDrawable { @@ -227,6 +222,8 @@ namespace osu.Game.Tournament.Screens.Ladder private DrawableMatchPairing findTarget(InputState state) => pairingsContainer.FirstOrDefault(d => d.ReceiveMouseInputAt(state.Mouse.NativeState.Position)); + public override bool ReceiveMouseInputAt(Vector2 screenSpacePos) => true; + protected override bool OnMouseMove(InputState state) { var found = findTarget(state); @@ -240,7 +237,10 @@ namespace osu.Game.Tournament.Screens.Ladder if (found == null) return false; - AddInternal(path = new ProgressionPath(pairingsContainer.First(c => c.Pairing == Source), found) { Alpha = 0.4f }); + AddInternal(path = new ProgressionPath(pairingsContainer.First(c => c.Pairing == Source), found) + { + Colour = Color4.Yellow, + }); return base.OnMouseMove(state); } From 492cdb6a05e788772bc0c79262b6a59d7654647f Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 25 Sep 2018 04:21:48 +0900 Subject: [PATCH 032/317] Fix namespacing --- .../Ladder/{ => Components}/DrawableTournamentGrouping.cs | 3 +-- .../Screens/Ladder/{ => Components}/LadderEditorInfo.cs | 6 +----- 2 files changed, 2 insertions(+), 7 deletions(-) rename osu.Game.Tournament/Screens/Ladder/{ => Components}/DrawableTournamentGrouping.cs (92%) rename osu.Game.Tournament/Screens/Ladder/{ => Components}/LadderEditorInfo.cs (65%) diff --git a/osu.Game.Tournament/Screens/Ladder/DrawableTournamentGrouping.cs b/osu.Game.Tournament/Screens/Ladder/Components/DrawableTournamentGrouping.cs similarity index 92% rename from osu.Game.Tournament/Screens/Ladder/DrawableTournamentGrouping.cs rename to osu.Game.Tournament/Screens/Ladder/Components/DrawableTournamentGrouping.cs index df7f621c24..475e735522 100644 --- a/osu.Game.Tournament/Screens/Ladder/DrawableTournamentGrouping.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/DrawableTournamentGrouping.cs @@ -4,9 +4,8 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Game.Graphics.Sprites; -using osu.Game.Tournament.Screens.Ladder.Components; -namespace osu.Game.Tournament.Screens.Ladder +namespace osu.Game.Tournament.Screens.Ladder.Components { public class DrawableTournamentGrouping : CompositeDrawable { diff --git a/osu.Game.Tournament/Screens/Ladder/LadderEditorInfo.cs b/osu.Game.Tournament/Screens/Ladder/Components/LadderEditorInfo.cs similarity index 65% rename from osu.Game.Tournament/Screens/Ladder/LadderEditorInfo.cs rename to osu.Game.Tournament/Screens/Ladder/Components/LadderEditorInfo.cs index 00272b9378..b02c6eea84 100644 --- a/osu.Game.Tournament/Screens/Ladder/LadderEditorInfo.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/LadderEditorInfo.cs @@ -1,12 +1,8 @@ -// Copyright (c) 2007-2018 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE - using System.Collections.Generic; using osu.Framework.Configuration; using osu.Game.Tournament.Components; -using osu.Game.Tournament.Screens.Ladder.Components; -namespace osu.Game.Tournament.Screens.Ladder +namespace osu.Game.Tournament.Screens.Ladder.Components { public class LadderEditorInfo { From 756141d9ed6b2ca3d2941ce73002bb3c5dbceea7 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 25 Sep 2018 04:51:40 +0900 Subject: [PATCH 033/317] Add basic scaling support --- .../Screens/Ladder/Components/ProgressionPath.cs | 4 ++-- .../Screens/Ladder/ScrollableContainer.cs | 15 ++++++++++++++- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/osu.Game.Tournament/Screens/Ladder/Components/ProgressionPath.cs b/osu.Game.Tournament/Screens/Ladder/Components/ProgressionPath.cs index c44f67a171..841148ce90 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/ProgressionPath.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/ProgressionPath.cs @@ -24,11 +24,11 @@ namespace osu.Game.Tournament.Screens.Ladder.Components base.LoadComplete(); Vector2 getCenteredVector(Vector2 top, Vector2 bottom) => new Vector2(top.X, top.Y + (bottom.Y - top.Y) / 2); - const float padding = 10; - var q1 = Source.ScreenSpaceDrawQuad; var q2 = Destination.ScreenSpaceDrawQuad; + float padding = q1.Width / 20; + bool progressionToRight = q2.TopLeft.X > q1.TopLeft.X; if (!progressionToRight) diff --git a/osu.Game.Tournament/Screens/Ladder/ScrollableContainer.cs b/osu.Game.Tournament/Screens/Ladder/ScrollableContainer.cs index bb4f2e58a9..f818a55296 100644 --- a/osu.Game.Tournament/Screens/Ladder/ScrollableContainer.cs +++ b/osu.Game.Tournament/Screens/Ladder/ScrollableContainer.cs @@ -1,6 +1,7 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Input.States; using OpenTK; @@ -13,10 +14,22 @@ namespace osu.Game.Tournament.Screens.Ladder public override bool ReceiveMouseInputAt(Vector2 screenSpacePos) => true; + private Vector2 target; + + private float scale = 1; + protected override bool OnDrag(InputState state) { - Position += state.Mouse.Delta; + this.MoveTo(target += state.Mouse.Delta, 1000, Easing.OutQuint); + return base.OnDrag(state); } + + protected override bool OnScroll(InputState state) + { + this.ScaleTo(scale += state.Mouse.ScrollDelta.Y / 15, 1000, Easing.OutQuint); + + return base.OnScroll(state); + } } } From 40ec24c721aed28fdeb82eaa8a35e18ece3c6cd9 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 25 Sep 2018 04:52:05 +0900 Subject: [PATCH 034/317] Increase line thickness to match design --- .../Screens/Ladder/Components/ProgressionPath.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Tournament/Screens/Ladder/Components/ProgressionPath.cs b/osu.Game.Tournament/Screens/Ladder/Components/ProgressionPath.cs index 841148ce90..56add9dc3d 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/ProgressionPath.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/ProgressionPath.cs @@ -15,7 +15,7 @@ namespace osu.Game.Tournament.Screens.Ladder.Components Source = source; Destination = destination; - PathWidth = 2; + PathWidth = 3; BypassAutoSizeAxes = Axes.Both; } From fbda872a53efc74e62134f92c52ad42dd6cf8461 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 25 Sep 2018 04:58:34 +0900 Subject: [PATCH 035/317] Update line colours to match bracket type --- .../Screens/Ladder/LadderManager.cs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/osu.Game.Tournament/Screens/Ladder/LadderManager.cs b/osu.Game.Tournament/Screens/Ladder/LadderManager.cs index 8e206a7194..5e0b5a8449 100644 --- a/osu.Game.Tournament/Screens/Ladder/LadderManager.cs +++ b/osu.Game.Tournament/Screens/Ladder/LadderManager.cs @@ -3,12 +3,14 @@ using System.Collections.Generic; using System.Linq; using osu.Framework.Allocation; using osu.Framework.Caching; +using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Cursor; using osu.Framework.Graphics.Lines; using osu.Framework.Graphics.UserInterface; using osu.Framework.Input.States; +using osu.Game.Graphics; using osu.Game.Graphics.UserInterface; using osu.Game.Tournament.Components; using osu.Game.Tournament.Screens.Ladder.Components; @@ -144,6 +146,16 @@ namespace osu.Game.Tournament.Screens.Ladder updateLayout(); } + private Color4 normalPathColour; + private Color4 losersPathColour; + + [BackgroundDependencyLoader] + private void load(OsuColour colours) + { + normalPathColour = colours.BlueDarker.Darken(2); + losersPathColour = colours.YellowDarker.Darken(2); + } + private void updateLayout() { paths.Clear(); @@ -162,7 +174,7 @@ namespace osu.Game.Tournament.Screens.Ladder // clean up outdated progressions. pairing.Pairing.Progression.Value = null; else - paths.Add(new ProgressionPath(pairing, dest)); + paths.Add(new ProgressionPath(pairing, dest) { Colour = pairing.Pairing.Losers ? losersPathColour : normalPathColour }); } } From 56981acc9256390b08b80fba2e69ab5f72e44f6d Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 25 Sep 2018 05:54:42 +0900 Subject: [PATCH 036/317] Fix default value of dropdown --- osu.Game.Tournament/Screens/Ladder/Components/LadderSettings.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Tournament/Screens/Ladder/Components/LadderSettings.cs b/osu.Game.Tournament/Screens/Ladder/Components/LadderSettings.cs index d8e37a5c80..1cf155ffde 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/LadderSettings.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/LadderSettings.cs @@ -77,7 +77,7 @@ namespace osu.Game.Tournament.Screens.Ladder.Components textboxTeam2 = new OsuTextBox { RelativeSizeAxes = Axes.X, Height = 20 }, groupingDropdown = new SettingsDropdown { - Bindable = new Bindable(), + Bindable = new Bindable { Default = groupingOptions.First().Value }, Items = groupingOptions }, losersCheckbox = new PlayerCheckbox From a5888feca4dab0e82f9097cfa98571e18f907a08 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 25 Sep 2018 10:21:50 +0900 Subject: [PATCH 037/317] Wip zoomable container logic --- .../Screens/Ladder/ScrollableContainer.cs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/osu.Game.Tournament/Screens/Ladder/ScrollableContainer.cs b/osu.Game.Tournament/Screens/Ladder/ScrollableContainer.cs index f818a55296..f9263760fb 100644 --- a/osu.Game.Tournament/Screens/Ladder/ScrollableContainer.cs +++ b/osu.Game.Tournament/Screens/Ladder/ScrollableContainer.cs @@ -20,16 +20,24 @@ namespace osu.Game.Tournament.Screens.Ladder protected override bool OnDrag(InputState state) { - this.MoveTo(target += state.Mouse.Delta, 1000, Easing.OutQuint); - + this.TransformTo(nameof(OriginPosition), target -= state.Mouse.Delta / scale, 1000, Easing.OutQuint); return base.OnDrag(state); } + protected override bool OnScroll(InputState state) { - this.ScaleTo(scale += state.Mouse.ScrollDelta.Y / 15, 1000, Easing.OutQuint); + this.ScaleTo(scale += state.Mouse.ScrollDelta.Y / 15 * scale, 1000, Easing.OutQuint); + target = ToLocalSpace(state.Mouse.NativeState.Position) / 2; + this.TransformTo(nameof(OriginPosition), target, 1000, Easing.OutQuint); return base.OnScroll(state); } + + protected override void Update() + { + base.Update(); + Invalidate(); + } } } From 991d85a9f34d9fd36a810b4d131e03a61feeb746 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 25 Sep 2018 10:27:54 +0900 Subject: [PATCH 038/317] Cleanups --- .../TestCaseLadderManager.cs | 4 --- .../TestCaseMatchPairings.cs | 5 ---- .../Ladder/Components/DrawableMatchPairing.cs | 12 +-------- .../Ladder/Components/LadderEditorInfo.cs | 3 +++ ...derSettings.cs => LadderEditorSettings.cs} | 26 ------------------- .../Ladder/Components/ProgressionPath.cs | 3 +++ .../Ladder/Components/TournamentConditions.cs | 9 ------- .../Screens/Ladder/LadderManager.cs | 3 +++ 8 files changed, 10 insertions(+), 55 deletions(-) rename osu.Game.Tournament/Screens/Ladder/Components/{LadderSettings.cs => LadderEditorSettings.cs} (83%) delete mode 100644 osu.Game.Tournament/Screens/Ladder/Components/TournamentConditions.cs diff --git a/osu.Game.Tournament.Tests/TestCaseLadderManager.cs b/osu.Game.Tournament.Tests/TestCaseLadderManager.cs index 767681849b..2dfb1b8a63 100644 --- a/osu.Game.Tournament.Tests/TestCaseLadderManager.cs +++ b/osu.Game.Tournament.Tests/TestCaseLadderManager.cs @@ -4,7 +4,6 @@ using System.IO; using Newtonsoft.Json; using osu.Framework.Allocation; -using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Game.Graphics.Cursor; using osu.Game.Tests.Visual; @@ -18,9 +17,6 @@ namespace osu.Game.Tournament.Tests [Cached] private readonly LadderManager manager; - [Cached] - private Bindable conditions = new Bindable(new TournamentConditions()); - public TestCaseLadderManager() { var ladder = File.Exists(@"bracket.json") ? JsonConvert.DeserializeObject(File.ReadAllText(@"bracket.json")) : new LadderInfo(); diff --git a/osu.Game.Tournament.Tests/TestCaseMatchPairings.cs b/osu.Game.Tournament.Tests/TestCaseMatchPairings.cs index dc67807c64..b4a754e439 100644 --- a/osu.Game.Tournament.Tests/TestCaseMatchPairings.cs +++ b/osu.Game.Tournament.Tests/TestCaseMatchPairings.cs @@ -3,8 +3,6 @@ using System; using System.Collections.Generic; -using osu.Framework.Allocation; -using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Game.Tests.Visual; @@ -23,9 +21,6 @@ namespace osu.Game.Tournament.Tests typeof(DrawableTournamentTeam), }; - [Cached] - private Bindable conditions = new Bindable(new TournamentConditions()); - public TestCaseMatchPairings() { Container level1; diff --git a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs index ee69f5c079..9b50322098 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs @@ -19,7 +19,6 @@ namespace osu.Game.Tournament.Screens.Ladder.Components { public readonly MatchPairing Pairing; private readonly FillFlowContainer flow; - private readonly Bindable conditions = new Bindable(); private readonly Drawable selectionBox; private Bindable globalSelection; @@ -70,15 +69,6 @@ namespace osu.Game.Tournament.Screens.Ladder.Components updateTeams(); } - [BackgroundDependencyLoader(true)] - private void load(Bindable conditions) - { - this.conditions.BindValueChanged(_ => updateWinConditions()); - - if (conditions != null) - this.conditions.BindTo(conditions); - } - private bool selected; public bool Selected @@ -123,7 +113,7 @@ namespace osu.Game.Tournament.Screens.Ladder.Components private void updateWinConditions() { - if (conditions.Value == null || Pairing.Grouping.Value == null) return; + if (Pairing.Grouping.Value == null) return; var instaWinAmount = Pairing.Grouping.Value.BestOf / 2; diff --git a/osu.Game.Tournament/Screens/Ladder/Components/LadderEditorInfo.cs b/osu.Game.Tournament/Screens/Ladder/Components/LadderEditorInfo.cs index b02c6eea84..cc91c98188 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/LadderEditorInfo.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/LadderEditorInfo.cs @@ -1,3 +1,6 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + using System.Collections.Generic; using osu.Framework.Configuration; using osu.Game.Tournament.Components; diff --git a/osu.Game.Tournament/Screens/Ladder/Components/LadderSettings.cs b/osu.Game.Tournament/Screens/Ladder/Components/LadderEditorSettings.cs similarity index 83% rename from osu.Game.Tournament/Screens/Ladder/Components/LadderSettings.cs rename to osu.Game.Tournament/Screens/Ladder/Components/LadderEditorSettings.cs index 1cf155ffde..95067e8803 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/LadderSettings.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/LadderEditorSettings.cs @@ -85,32 +85,6 @@ namespace osu.Game.Tournament.Screens.Ladder.Components LabelText = "Losers Bracket", Bindable = new Bindable() } - // new Container - // { - // RelativeSizeAxes = Axes.X, - // AutoSizeAxes = Axes.Y, - // Padding = new MarginPadding { Horizontal = padding }, - // Children = new Drawable[] - // { - // new OsuSpriteText - // { - // Anchor = Anchor.CentreLeft, - // Origin = Anchor.CentreLeft, - // Text = "Best of", - // }, - // }, - // }, - // sliderBestOf = new PlayerSliderBar - // { - // Bindable = new BindableDouble - // { - // Default = 11, - // Value = 11, - // MinValue = 1, - // MaxValue = 21, - // Precision = 1, - // }, - // } }; editorInfo.Selected.ValueChanged += selection => diff --git a/osu.Game.Tournament/Screens/Ladder/Components/ProgressionPath.cs b/osu.Game.Tournament/Screens/Ladder/Components/ProgressionPath.cs index 56add9dc3d..4496430e79 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/ProgressionPath.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/ProgressionPath.cs @@ -1,3 +1,6 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + using System.Linq; using osu.Framework.Graphics; using osu.Framework.Graphics.Lines; diff --git a/osu.Game.Tournament/Screens/Ladder/Components/TournamentConditions.cs b/osu.Game.Tournament/Screens/Ladder/Components/TournamentConditions.cs deleted file mode 100644 index 045149945c..0000000000 --- a/osu.Game.Tournament/Screens/Ladder/Components/TournamentConditions.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace osu.Game.Tournament.Screens.Ladder.Components -{ - /// - /// Conditions governing a tournament. - /// - public class TournamentConditions - { - } -} diff --git a/osu.Game.Tournament/Screens/Ladder/LadderManager.cs b/osu.Game.Tournament/Screens/Ladder/LadderManager.cs index 5e0b5a8449..3c3d8243a3 100644 --- a/osu.Game.Tournament/Screens/Ladder/LadderManager.cs +++ b/osu.Game.Tournament/Screens/Ladder/LadderManager.cs @@ -1,3 +1,6 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + using System; using System.Collections.Generic; using System.Linq; From e74fd042aa4e8244efc8c38c97d4f08575a1b236 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 25 Sep 2018 10:35:00 +0900 Subject: [PATCH 039/317] Use MouseUp instead of MouseDown for now --- .../Screens/Ladder/Components/DrawableMatchPairing.cs | 7 ++----- .../Screens/Ladder/Components/DrawableMatchTeam.cs | 3 ++- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs index 9b50322098..5f58ca0ba5 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs @@ -155,9 +155,9 @@ namespace osu.Game.Tournament.Screens.Ladder.Components updateWinConditions(); } - protected override bool OnMouseDown(InputState state, MouseDownEventArgs args) => args.Button == MouseButton.Left; + protected override bool OnMouseDown(InputState state, MouseDownEventArgs args) => editorInfo.EditingEnabled; - protected override bool OnDragStart(InputState state) => true; + protected override bool OnDragStart(InputState state) => editorInfo.EditingEnabled; protected override bool OnKeyDown(InputState state, KeyDownEventArgs args) { @@ -183,9 +183,6 @@ namespace osu.Game.Tournament.Screens.Ladder.Components { if (base.OnDrag(state)) return true; - if (!editorInfo.EditingEnabled) - return false; - Selected = true; this.MoveToOffset(state.Mouse.Delta); diff --git a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs index 7e3d5f4f2b..b0570a24dc 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs @@ -126,7 +126,8 @@ namespace osu.Game.Tournament.Screens.Ladder.Components }, true); } - protected override bool OnMouseDown(InputState state, MouseDownEventArgs args) + //TODO: use OnClick instead once we have per-button clicks. + protected override bool OnMouseUp(InputState state, MouseUpEventArgs args) { if (Team == null || editorInfo.EditingEnabled) return false; From c210ea7c39d0b1e6180348132f4eb36dd7406501 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 25 Sep 2018 10:46:09 +0900 Subject: [PATCH 040/317] Improve zoom logic --- .../Screens/Ladder/ScrollableContainer.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/osu.Game.Tournament/Screens/Ladder/ScrollableContainer.cs b/osu.Game.Tournament/Screens/Ladder/ScrollableContainer.cs index f9263760fb..9d4ad2eccf 100644 --- a/osu.Game.Tournament/Screens/Ladder/ScrollableContainer.cs +++ b/osu.Game.Tournament/Screens/Ladder/ScrollableContainer.cs @@ -20,18 +20,18 @@ namespace osu.Game.Tournament.Screens.Ladder protected override bool OnDrag(InputState state) { - this.TransformTo(nameof(OriginPosition), target -= state.Mouse.Delta / scale, 1000, Easing.OutQuint); - return base.OnDrag(state); + this.MoveTo(target += state.Mouse.Delta, 1000, Easing.OutQuint); + return true; } - protected override bool OnScroll(InputState state) { - this.ScaleTo(scale += state.Mouse.ScrollDelta.Y / 15 * scale, 1000, Easing.OutQuint); - target = ToLocalSpace(state.Mouse.NativeState.Position) / 2; - this.TransformTo(nameof(OriginPosition), target, 1000, Easing.OutQuint); + var newScale = scale + state.Mouse.ScrollDelta.Y / 15 * scale; + this.MoveTo(target = target - state.Mouse.Position * (newScale - scale), 1000, Easing.OutQuint); - return base.OnScroll(state); + this.ScaleTo(scale = newScale, 1000, Easing.OutQuint); + + return true; } protected override void Update() From 2abe96fb9c18f0bf9f4d9f88943b945b55579b29 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 25 Sep 2018 13:39:27 +0900 Subject: [PATCH 041/317] Fix crash --- .../Screens/Ladder/Components/DrawableMatchTeam.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs index b0570a24dc..12638609b6 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs @@ -142,7 +142,7 @@ namespace osu.Game.Tournament.Screens.Ladder.Components } else { - if (pairing.Progression.Value.Completed) + if (pairing.Progression.Value?.Completed.Value != false) // don't allow changing scores if the match has a progression. can cause large data loss return false; From 73f451f27af420ec923da06c6e4d404de84db9aa Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 25 Sep 2018 13:39:33 +0900 Subject: [PATCH 042/317] Fix right click regression --- .../Screens/Ladder/Components/DrawableMatchPairing.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs index 5f58ca0ba5..6e4674b3bf 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs @@ -155,7 +155,7 @@ namespace osu.Game.Tournament.Screens.Ladder.Components updateWinConditions(); } - protected override bool OnMouseDown(InputState state, MouseDownEventArgs args) => editorInfo.EditingEnabled; + protected override bool OnMouseDown(InputState state, MouseDownEventArgs args) => args.Button == MouseButton.Left && editorInfo.EditingEnabled; protected override bool OnDragStart(InputState state) => editorInfo.EditingEnabled; From c26d226a75fa4e7e4e975b32fa6b5035c21b78dc Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 13 Oct 2018 07:09:33 +0900 Subject: [PATCH 043/317] Make saving the ladder to disk a button-based operation rather than on dispose --- osu.Game.Tournament.Tests/LadderTestCase.cs | 43 +++++++++++++++++++ .../TestCaseLadderManager.cs | 26 +++-------- 2 files changed, 50 insertions(+), 19 deletions(-) create mode 100644 osu.Game.Tournament.Tests/LadderTestCase.cs diff --git a/osu.Game.Tournament.Tests/LadderTestCase.cs b/osu.Game.Tournament.Tests/LadderTestCase.cs new file mode 100644 index 0000000000..3044451a9e --- /dev/null +++ b/osu.Game.Tournament.Tests/LadderTestCase.cs @@ -0,0 +1,43 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System.IO; +using Newtonsoft.Json; +using osu.Framework.Graphics; +using osu.Game.Graphics.UserInterface; +using osu.Game.Tests.Visual; +using osu.Game.Tournament.Screens.Ladder.Components; + +namespace osu.Game.Tournament.Tests +{ + public abstract class LadderTestCase : OsuTestCase + { + protected LadderInfo Ladder; + + protected LadderTestCase() + { + Ladder = File.Exists(@"bracket.json") ? JsonConvert.DeserializeObject(File.ReadAllText(@"bracket.json")) : new LadderInfo(); + + Add(new OsuButton + { + Text = "Save Changes", + Width = 140, + Height = 50, + Anchor = Anchor.BottomRight, + Origin = Anchor.BottomRight, + Padding = new MarginPadding(10), + Action = SaveChanges, + }); + } + + protected virtual void SaveChanges() + { + File.WriteAllText(@"bracket.json", JsonConvert.SerializeObject(Ladder, + new JsonSerializerSettings + { + NullValueHandling = NullValueHandling.Ignore, + DefaultValueHandling = DefaultValueHandling.Ignore + })); + } + } +} diff --git a/osu.Game.Tournament.Tests/TestCaseLadderManager.cs b/osu.Game.Tournament.Tests/TestCaseLadderManager.cs index 2dfb1b8a63..a7b93c8055 100644 --- a/osu.Game.Tournament.Tests/TestCaseLadderManager.cs +++ b/osu.Game.Tournament.Tests/TestCaseLadderManager.cs @@ -1,43 +1,31 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using System.IO; -using Newtonsoft.Json; using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Game.Graphics.Cursor; -using osu.Game.Tests.Visual; using osu.Game.Tournament.Screens.Ladder; -using osu.Game.Tournament.Screens.Ladder.Components; namespace osu.Game.Tournament.Tests { - public class TestCaseLadderManager : OsuTestCase + public class TestCaseLadderManager : LadderTestCase { [Cached] private readonly LadderManager manager; public TestCaseLadderManager() { - var ladder = File.Exists(@"bracket.json") ? JsonConvert.DeserializeObject(File.ReadAllText(@"bracket.json")) : new LadderInfo(); - - Child = new OsuContextMenuContainer + Add(new OsuContextMenuContainer { RelativeSizeAxes = Axes.Both, - Child = manager = new LadderManager(ladder) - }; + Child = manager = new LadderManager(Ladder) + }); } - protected override void Dispose(bool isDisposing) + protected override void SaveChanges() { - base.Dispose(isDisposing); - - File.WriteAllText(@"bracket.json", JsonConvert.SerializeObject(manager.CreateInfo(), - new JsonSerializerSettings - { - NullValueHandling = NullValueHandling.Ignore, - DefaultValueHandling = DefaultValueHandling.Ignore - })); + Ladder = manager.CreateInfo(); + base.SaveChanges(); } } } From a4bb4255b167cf051dd9fe60a1942641790529e5 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 13 Oct 2018 07:10:13 +0900 Subject: [PATCH 044/317] Add grouping manager --- .../TestCaseGroupingManager.cs | 50 +++++++++++++++++++ .../Components/DrawableTournamentGrouping.cs | 2 +- .../Ladder/Components/TournamentGrouping.cs | 5 +- osu.Game/Overlays/Settings/SettingsTextBox.cs | 2 +- 4 files changed, 55 insertions(+), 4 deletions(-) create mode 100644 osu.Game.Tournament.Tests/TestCaseGroupingManager.cs diff --git a/osu.Game.Tournament.Tests/TestCaseGroupingManager.cs b/osu.Game.Tournament.Tests/TestCaseGroupingManager.cs new file mode 100644 index 0000000000..0d39ef1c73 --- /dev/null +++ b/osu.Game.Tournament.Tests/TestCaseGroupingManager.cs @@ -0,0 +1,50 @@ +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Game.Overlays.Settings; +using osu.Game.Tournament.Screens.Ladder.Components; + +namespace osu.Game.Tournament.Tests +{ + public class TestCaseGroupingManager : LadderTestCase + { + public TestCaseGroupingManager() + { + FillFlowContainer items; + + Add(items = new FillFlowContainer + { + Direction = FillDirection.Vertical, + RelativeSizeAxes = Axes.Both + }); + + foreach (var g in Ladder.Groupings) + items.Add(new GroupingRow(g)); + } + + public class GroupingRow : CompositeDrawable + { + public readonly TournamentGrouping Grouping; + + public GroupingRow(TournamentGrouping grouping) + { + Grouping = grouping; + InternalChildren = new Drawable[] + { + new FillFlowContainer + { + Direction = FillDirection.Horizontal, + RelativeSizeAxes = Axes.Both, + Children = new Drawable[] + { + new SettingsTextBox { Width = 0.4f, Bindable = Grouping.Name }, + new SettingsTextBox { Width = 0.4f, Bindable = Grouping.Description }, + } + } + }; + + RelativeSizeAxes = Axes.X; + Height = 40; + } + } + } +} diff --git a/osu.Game.Tournament/Screens/Ladder/Components/DrawableTournamentGrouping.cs b/osu.Game.Tournament/Screens/Ladder/Components/DrawableTournamentGrouping.cs index 475e735522..8a38f402aa 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/DrawableTournamentGrouping.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/DrawableTournamentGrouping.cs @@ -20,7 +20,7 @@ namespace osu.Game.Tournament.Screens.Ladder.Components { new OsuSpriteText { - Text = grouping.Description.ToUpper(), + Text = grouping.Description.Value.ToUpper(), Origin = Anchor.TopCentre, Anchor = Anchor.TopCentre }, diff --git a/osu.Game.Tournament/Screens/Ladder/Components/TournamentGrouping.cs b/osu.Game.Tournament/Screens/Ladder/Components/TournamentGrouping.cs index 675bf5fc4f..2e72e1fe06 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/TournamentGrouping.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/TournamentGrouping.cs @@ -2,13 +2,14 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; +using osu.Framework.Configuration; namespace osu.Game.Tournament.Screens.Ladder.Components { public class TournamentGrouping { - public string Name; - public string Description; + public readonly Bindable Name = new Bindable(); + public readonly Bindable Description = new Bindable(); public int BestOf; diff --git a/osu.Game/Overlays/Settings/SettingsTextBox.cs b/osu.Game/Overlays/Settings/SettingsTextBox.cs index ce9218bbe7..106b2372e0 100644 --- a/osu.Game/Overlays/Settings/SettingsTextBox.cs +++ b/osu.Game/Overlays/Settings/SettingsTextBox.cs @@ -8,6 +8,6 @@ namespace osu.Game.Overlays.Settings { public class SettingsTextBox : SettingsItem { - protected override Drawable CreateControl() => new OsuTextBox(); + protected override Drawable CreateControl() => new OsuTextBox { RelativeSizeAxes = Axes.X }; } } From 2173f46a4678eb2c708be15ea2362030e845528e Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 13 Oct 2018 19:45:59 +0900 Subject: [PATCH 045/317] Add missing licence header --- osu.Game.Tournament.Tests/TestCaseGroupingManager.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/osu.Game.Tournament.Tests/TestCaseGroupingManager.cs b/osu.Game.Tournament.Tests/TestCaseGroupingManager.cs index 0d39ef1c73..e9df1eb62e 100644 --- a/osu.Game.Tournament.Tests/TestCaseGroupingManager.cs +++ b/osu.Game.Tournament.Tests/TestCaseGroupingManager.cs @@ -1,3 +1,6 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Game.Overlays.Settings; From bac7d644370bdb210b1a1aa6af71d7c53754a58f Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 13 Oct 2018 23:45:52 +0900 Subject: [PATCH 046/317] Improve the completeness of APIBeatmap's transform methods --- osu.Game/Online/API/Requests/Responses/APIBeatmap.cs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/osu.Game/Online/API/Requests/Responses/APIBeatmap.cs b/osu.Game/Online/API/Requests/Responses/APIBeatmap.cs index 193ccf1f6b..c9ea66d05f 100644 --- a/osu.Game/Online/API/Requests/Responses/APIBeatmap.cs +++ b/osu.Game/Online/API/Requests/Responses/APIBeatmap.cs @@ -61,17 +61,13 @@ namespace osu.Game.Online.API.Requests.Responses { return new BeatmapInfo { - Metadata = this, + Metadata = !string.IsNullOrEmpty(Artist) ? this : (BeatmapMetadata)BeatmapSet, Ruleset = rulesets.GetRuleset(ruleset), StarDifficulty = starDifficulty, OnlineBeatmapID = OnlineBeatmapID, Version = version, Status = Status, - BeatmapSet = new BeatmapSetInfo - { - OnlineBeatmapSetID = OnlineBeatmapSetID, - Status = BeatmapSet?.Status ?? BeatmapSetOnlineStatus.None - }, + BeatmapSet = BeatmapSet.ToBeatmapSet(rulesets), BaseDifficulty = new BeatmapDifficulty { DrainRate = drainRate, From 522f106f746f34a3a80f64ff236704c506103b30 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 14 Oct 2018 00:40:33 +0900 Subject: [PATCH 047/317] Add initial version of beatmap card --- .../TestCaseBeatmapPanel.cs | 42 +++++++ .../Components/TournamentBeatmapPanel.cs | 110 ++++++++++++++++++ 2 files changed, 152 insertions(+) create mode 100644 osu.Game.Tournament.Tests/TestCaseBeatmapPanel.cs create mode 100644 osu.Game.Tournament/Components/TournamentBeatmapPanel.cs diff --git a/osu.Game.Tournament.Tests/TestCaseBeatmapPanel.cs b/osu.Game.Tournament.Tests/TestCaseBeatmapPanel.cs new file mode 100644 index 0000000000..8298cbd8ea --- /dev/null +++ b/osu.Game.Tournament.Tests/TestCaseBeatmapPanel.cs @@ -0,0 +1,42 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework.Allocation; +using osu.Framework.Graphics; +using osu.Game.Beatmaps; +using osu.Game.Online.API; +using osu.Game.Online.API.Requests; +using osu.Game.Online.API.Requests.Responses; +using osu.Game.Rulesets; +using osu.Game.Tests.Visual; +using osu.Game.Tournament.Components; + +namespace osu.Game.Tournament.Tests +{ + public class TestCaseBeatmapPanel : OsuTestCase + { + [Resolved] + protected APIAccess API { get; set; } + + [Resolved] + protected RulesetStore Rulesets { get; set; } + + [BackgroundDependencyLoader] + private void load() + { + var req = new GetBeatmapRequest(new BeatmapInfo { OnlineBeatmapID = 1091460 }); + req.Success += success; + API.Queue(req); + } + + private void success(APIBeatmap apiBeatmap) + { + var beatmap = apiBeatmap.ToBeatmap(Rulesets); + Add(new TournamentBeatmapPanel(beatmap) + { + Anchor = Anchor.Centre, + Origin = Anchor.Centre + }); + } + } +} diff --git a/osu.Game.Tournament/Components/TournamentBeatmapPanel.cs b/osu.Game.Tournament/Components/TournamentBeatmapPanel.cs new file mode 100644 index 0000000000..5eb597a3c6 --- /dev/null +++ b/osu.Game.Tournament/Components/TournamentBeatmapPanel.cs @@ -0,0 +1,110 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework.Allocation; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Shapes; +using osu.Framework.Localisation; +using osu.Game.Beatmaps; +using osu.Game.Beatmaps.Drawables; +using osu.Game.Graphics; +using osu.Game.Graphics.Sprites; +using OpenTK.Graphics; + +namespace osu.Game.Tournament.Components +{ + public class TournamentBeatmapPanel : CompositeDrawable + { + private readonly BeatmapInfo beatmap; + private const float horizontal_padding = 10; + private const float vertical_padding = 5; + + public TournamentBeatmapPanel(BeatmapInfo beatmap) + { + this.beatmap = beatmap; + Width = 400; + Height = 50; + } + + [BackgroundDependencyLoader] + private void load() + { + CornerRadius = 25; + Masking = true; + + AddRangeInternal(new Drawable[] + { + new Box + { + RelativeSizeAxes = Axes.Both, + Colour = Color4.Black, + }, + new UpdateableBeatmapSetCover + { + RelativeSizeAxes = Axes.Both, + Colour = OsuColour.Gray(0.5f), + BeatmapSet = beatmap.BeatmapSet, + }, + new FillFlowContainer + { + AutoSizeAxes = Axes.Both, + Anchor = Anchor.TopCentre, + Origin = Anchor.TopCentre, + Padding = new MarginPadding(vertical_padding), + Direction = FillDirection.Vertical, + Children = new Drawable[] + { + new OsuSpriteText + { + Anchor = Anchor.TopCentre, + Origin = Anchor.TopCentre, + Text = new LocalisedString(( + $"{beatmap.Metadata.ArtistUnicode} - {beatmap.Metadata.TitleUnicode}", + $"{beatmap.Metadata.Artist} - {beatmap.Metadata.Title}")), + Font = @"Exo2.0-BoldItalic", + }, + new FillFlowContainer + { + AutoSizeAxes = Axes.Both, + Anchor = Anchor.TopCentre, + Origin = Anchor.TopCentre, + Padding = new MarginPadding(vertical_padding), + Direction = FillDirection.Horizontal, + Children = new Drawable[] + { + new OsuSpriteText + { + Text = "mapper", + Font = @"Exo2.0-RegularItalic", + Padding = new MarginPadding { Right = 5 }, + TextSize = 14 + }, + new OsuSpriteText + { + Text = beatmap.Metadata.AuthorString, + Font = @"Exo2.0-BoldItalic", + Padding = new MarginPadding { Right = 20 }, + TextSize = 14 + }, + new OsuSpriteText + { + Text = "difficulty", + Font = @"Exo2.0-RegularItalic", + Padding = new MarginPadding { Right = 5 }, + TextSize = 14 + }, + new OsuSpriteText + { + Text = beatmap.Version, + Font = @"Exo2.0-BoldItalic", + TextSize = 14 + }, + } + } + }, + }, + }); + } + } +} From f5716c3d213c3d6e4ed597aa18116a9372cb5cee Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 14 Oct 2018 01:03:04 +0900 Subject: [PATCH 048/317] Add ability to change best of, add and delete groupings --- .../TestCaseGroupingManager.cs | 44 ++++++++++++++++--- .../Ladder/Components/TournamentGrouping.cs | 2 +- 2 files changed, 39 insertions(+), 7 deletions(-) diff --git a/osu.Game.Tournament.Tests/TestCaseGroupingManager.cs b/osu.Game.Tournament.Tests/TestCaseGroupingManager.cs index e9df1eb62e..a0a4dfdc8b 100644 --- a/osu.Game.Tournament.Tests/TestCaseGroupingManager.cs +++ b/osu.Game.Tournament.Tests/TestCaseGroupingManager.cs @@ -1,8 +1,10 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using System.Linq; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; +using osu.Game.Graphics.UserInterface; using osu.Game.Overlays.Settings; using osu.Game.Tournament.Screens.Ladder.Components; @@ -10,20 +12,43 @@ namespace osu.Game.Tournament.Tests { public class TestCaseGroupingManager : LadderTestCase { + private readonly FillFlowContainer items; + public TestCaseGroupingManager() { - FillFlowContainer items; - - Add(items = new FillFlowContainer + Add(new FillFlowContainer { Direction = FillDirection.Vertical, - RelativeSizeAxes = Axes.Both + RelativeSizeAxes = Axes.Both, + Children = new Drawable[] + { + items = new FillFlowContainer + { + Direction = FillDirection.Vertical, + RelativeSizeAxes = Axes.X, + AutoSizeAxes = Axes.Y, + }, + new TriangleButton + { + Width = 100, + Text = "Add", + Action = addNew + }, + } }); foreach (var g in Ladder.Groupings) items.Add(new GroupingRow(g)); } + protected override void SaveChanges() + { + Ladder.Groupings = items.Children.Select(c => c.Grouping).ToList(); + base.SaveChanges(); + } + + private void addNew() => items.Add(new GroupingRow(new TournamentGrouping())); + public class GroupingRow : CompositeDrawable { public readonly TournamentGrouping Grouping; @@ -39,8 +64,15 @@ namespace osu.Game.Tournament.Tests RelativeSizeAxes = Axes.Both, Children = new Drawable[] { - new SettingsTextBox { Width = 0.4f, Bindable = Grouping.Name }, - new SettingsTextBox { Width = 0.4f, Bindable = Grouping.Description }, + new SettingsTextBox { Width = 0.3f, Bindable = Grouping.Name }, + new SettingsTextBox { Width = 0.3f, Bindable = Grouping.Description }, + new SettingsSlider { LabelText = "Best of", Width = 0.3f, Bindable = Grouping.BestOf }, + new DangerousSettingsButton + { + Width = 0.1f, + Text = "Delete", + Action = () => Expire() + }, } } }; diff --git a/osu.Game.Tournament/Screens/Ladder/Components/TournamentGrouping.cs b/osu.Game.Tournament/Screens/Ladder/Components/TournamentGrouping.cs index 2e72e1fe06..d7c89cb006 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/TournamentGrouping.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/TournamentGrouping.cs @@ -11,7 +11,7 @@ namespace osu.Game.Tournament.Screens.Ladder.Components public readonly Bindable Name = new Bindable(); public readonly Bindable Description = new Bindable(); - public int BestOf; + public readonly BindableInt BestOf = new BindableInt(9) { Default = 9, MinValue = 3, MaxValue = 23 }; public List Pairings = new List(); } From e136f72c8ec8cae0e3e43ec057eeabc38e33b249 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 14 Oct 2018 03:03:17 +0900 Subject: [PATCH 049/317] Fix incorrect access definitions --- osu.Game.Tournament.Tests/TestCaseBeatmapPanel.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/osu.Game.Tournament.Tests/TestCaseBeatmapPanel.cs b/osu.Game.Tournament.Tests/TestCaseBeatmapPanel.cs index 8298cbd8ea..e5cb2f155c 100644 --- a/osu.Game.Tournament.Tests/TestCaseBeatmapPanel.cs +++ b/osu.Game.Tournament.Tests/TestCaseBeatmapPanel.cs @@ -16,22 +16,22 @@ namespace osu.Game.Tournament.Tests public class TestCaseBeatmapPanel : OsuTestCase { [Resolved] - protected APIAccess API { get; set; } + private APIAccess api { get; set; } [Resolved] - protected RulesetStore Rulesets { get; set; } + private RulesetStore rulesets { get; set; } [BackgroundDependencyLoader] private void load() { var req = new GetBeatmapRequest(new BeatmapInfo { OnlineBeatmapID = 1091460 }); req.Success += success; - API.Queue(req); + api.Queue(req); } private void success(APIBeatmap apiBeatmap) { - var beatmap = apiBeatmap.ToBeatmap(Rulesets); + var beatmap = apiBeatmap.ToBeatmap(rulesets); Add(new TournamentBeatmapPanel(beatmap) { Anchor = Anchor.Centre, From b1862a863bd3f7d8c881c3eb50606cbc15191c6b Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 14 Oct 2018 03:03:40 +0900 Subject: [PATCH 050/317] Fix not being able to decrement scores of matches with no defined progression --- .../Screens/Ladder/Components/DrawableMatchTeam.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs index 3edc28b4e5..dca8d0f0a8 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs @@ -141,7 +141,7 @@ namespace osu.Game.Tournament.Screens.Ladder.Components } else { - if (pairing.Progression.Value?.Completed.Value != false) + if (pairing.Progression.Value?.Completed.Value == true) // don't allow changing scores if the match has a progression. can cause large data loss return false; From c4b486f1d4cf3d38219fea14d68589b16a0db29b Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 14 Oct 2018 03:04:06 +0900 Subject: [PATCH 051/317] Fix transfer of teams in the case loser and winner progression are equal --- .../Ladder/Components/DrawableMatchPairing.cs | 54 ++++++++++++++----- 1 file changed, 41 insertions(+), 13 deletions(-) diff --git a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs index da56f83d68..1f58bc86ea 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs @@ -7,6 +7,7 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; using osu.Framework.Input.Events; +using osu.Game.Tournament.Components; using OpenTK; using OpenTK.Graphics; using OpenTK.Input; @@ -91,23 +92,50 @@ namespace osu.Game.Tournament.Screens.Ladder.Components private void updateProgression() { - var progression = Pairing.Progression?.Value; - - if (progression != null) + if (!Pairing.Completed) { - bool progressionAbove = progression.ID < Pairing.ID; + // ensure we clear any of our teams from our progression. + // this is not pretty logic but should suffice for now. + if (Pairing.Progression.Value != null && Pairing.Progression.Value.Team1.Value == Pairing.Team1.Value) + Pairing.Progression.Value.Team1.Value = null; - var destinationForWinner = progressionAbove || progression.Team1.Value != null && progression.Team1.Value != Pairing.Team1.Value && progression.Team1.Value != Pairing.Team2.Value ? progression.Team2 : progression.Team1; - destinationForWinner.Value = Pairing.Winner; + if (Pairing.Progression.Value != null && Pairing.Progression.Value.Team2.Value == Pairing.Team2.Value) + Pairing.Progression.Value.Team2.Value = null; + + if (Pairing.LosersProgression.Value != null && Pairing.LosersProgression.Value.Team1.Value == Pairing.Team1.Value) + Pairing.LosersProgression.Value.Team1.Value = null; + + if (Pairing.LosersProgression.Value != null && Pairing.LosersProgression.Value.Team2.Value == Pairing.Team2.Value) + Pairing.LosersProgression.Value.Team2.Value = null; + } + else + { + transferProgression(Pairing.Progression?.Value, Pairing.Winner); + transferProgression(Pairing.LosersProgression?.Value, Pairing.Loser); + } + } + + private void transferProgression(MatchPairing destination, TournamentTeam team) + { + if (destination == null) return; + + bool progressionAbove = destination.ID < Pairing.ID; + + Bindable destinationTeam; + + // check for the case where we have already transferred out value + if (destination.Team1.Value == team) + destinationTeam = destination.Team1; + else if (destination.Team2.Value == team) + destinationTeam = destination.Team2; + else + { + destinationTeam = progressionAbove ? destination.Team2 : destination.Team1; + if (destinationTeam.Value != null) + destinationTeam = progressionAbove ? destination.Team1 : destination.Team2; } - if ((progression = Pairing.LosersProgression?.Value) != null) - { - bool progressionAbove = progression.ID < Pairing.ID; - - var destinationForLoser = progressionAbove || progression.Team1.Value != null && progression.Team1.Value != Pairing.Team1.Value && progression.Team1.Value != Pairing.Team2.Value ? progression.Team2 : progression.Team1; - destinationForLoser.Value = Pairing.Loser; - } + destinationTeam.Value = team; } private void updateWinConditions() From b17ead22a362082c4ac8d19983fe32cced8411c2 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 14 Oct 2018 03:05:34 +0900 Subject: [PATCH 052/317] fixup! Fix incorrect access definitions --- osu.Game.Tournament.Tests/TestCaseBeatmapPanel.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game.Tournament.Tests/TestCaseBeatmapPanel.cs b/osu.Game.Tournament.Tests/TestCaseBeatmapPanel.cs index e5cb2f155c..d6c9e0c901 100644 --- a/osu.Game.Tournament.Tests/TestCaseBeatmapPanel.cs +++ b/osu.Game.Tournament.Tests/TestCaseBeatmapPanel.cs @@ -16,10 +16,10 @@ namespace osu.Game.Tournament.Tests public class TestCaseBeatmapPanel : OsuTestCase { [Resolved] - private APIAccess api { get; set; } + private APIAccess api { get; set; } = null; [Resolved] - private RulesetStore rulesets { get; set; } + private RulesetStore rulesets { get; set; } = null; [BackgroundDependencyLoader] private void load() From a02caeef64d5fb12de8271be48e119193c01a532 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 14 Oct 2018 05:19:50 +0900 Subject: [PATCH 053/317] Add team intro screen Also adds dates to groups and matches (must be manually populated via json) --- .../TestCaseTeamOverview.cs | 18 ++ .../Screens/Ladder/Components/MatchPairing.cs | 3 + .../Ladder/Components/TournamentGrouping.cs | 3 + .../Screens/TeamIntro/TeamIntro.cs | 192 ++++++++++++++++++ 4 files changed, 216 insertions(+) create mode 100644 osu.Game.Tournament.Tests/TestCaseTeamOverview.cs create mode 100644 osu.Game.Tournament/Screens/TeamIntro/TeamIntro.cs diff --git a/osu.Game.Tournament.Tests/TestCaseTeamOverview.cs b/osu.Game.Tournament.Tests/TestCaseTeamOverview.cs new file mode 100644 index 0000000000..b853abb27c --- /dev/null +++ b/osu.Game.Tournament.Tests/TestCaseTeamOverview.cs @@ -0,0 +1,18 @@ +using System.Linq; +using osu.Game.Tournament.Screens.TeamIntro; + +namespace osu.Game.Tournament.Tests +{ + public class TestCaseTeamIntro : LadderTestCase + { + public TestCaseTeamIntro() + { + var team1 = Ladder.Teams.First(t => t.Acronym == "USA"); + var team2 = Ladder.Teams.First(t => t.Acronym == "JPN"); + + var round = Ladder.Groupings.First(g => g.Name == "Quarter Finals"); + + Add(new TeamIntroScreen(team1, team2, round)); + } + } +} diff --git a/osu.Game.Tournament/Screens/Ladder/Components/MatchPairing.cs b/osu.Game.Tournament/Screens/Ladder/Components/MatchPairing.cs index 93d1b7085c..5dc2009c4d 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/MatchPairing.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/MatchPairing.cs @@ -1,6 +1,7 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using System; using Newtonsoft.Json; using osu.Framework.Configuration; using osu.Game.Tournament.Components; @@ -42,6 +43,8 @@ namespace osu.Game.Tournament.Screens.Ladder.Components [JsonIgnore] public readonly Bindable LosersProgression = new Bindable(); + public readonly Bindable Date = new Bindable(); + public Point Position; public MatchPairing() diff --git a/osu.Game.Tournament/Screens/Ladder/Components/TournamentGrouping.cs b/osu.Game.Tournament/Screens/Ladder/Components/TournamentGrouping.cs index d7c89cb006..d8680b7210 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/TournamentGrouping.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/TournamentGrouping.cs @@ -1,6 +1,7 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using System; using System.Collections.Generic; using osu.Framework.Configuration; @@ -13,6 +14,8 @@ namespace osu.Game.Tournament.Screens.Ladder.Components public readonly BindableInt BestOf = new BindableInt(9) { Default = 9, MinValue = 3, MaxValue = 23 }; + public readonly Bindable StartDate = new Bindable(); + public List Pairings = new List(); } } diff --git a/osu.Game.Tournament/Screens/TeamIntro/TeamIntro.cs b/osu.Game.Tournament/Screens/TeamIntro/TeamIntro.cs new file mode 100644 index 0000000000..fce29a2c89 --- /dev/null +++ b/osu.Game.Tournament/Screens/TeamIntro/TeamIntro.cs @@ -0,0 +1,192 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Shapes; +using osu.Game.Graphics; +using osu.Game.Graphics.Sprites; +using osu.Game.Screens; +using osu.Game.Tournament.Components; +using osu.Game.Tournament.Screens.Ladder.Components; +using OpenTK; +using OpenTK.Graphics; + +namespace osu.Game.Tournament.Screens.TeamIntro +{ + public class TeamIntroScreen : OsuScreen + { + public TeamIntroScreen(TournamentTeam team1, TournamentTeam team2, TournamentGrouping round) + { + RelativeSizeAxes = Axes.Both; + + InternalChildren = new Drawable[] + { + new Box + { + Colour = Color4.White, + RelativeSizeAxes = Axes.Both + }, + new TeamWithPlayers(team1, true) + { + RelativeSizeAxes = Axes.Both, + Margin = new MarginPadding(40), + Width = 0.5f, + Height = 0.6f, + Anchor = Anchor.Centre, + Origin = Anchor.CentreRight + }, + new TeamWithPlayers(team2) + { + RelativeSizeAxes = Axes.Both, + Margin = new MarginPadding(40), + Width = 0.5f, + Height = 0.6f, + Anchor = Anchor.Centre, + Origin = Anchor.CentreLeft + }, + new RoundDisplay(round) + { + RelativeSizeAxes = Axes.Both, + Height = 0.3f, + Anchor = Anchor.BottomCentre, + Origin = Anchor.BottomCentre, + } + }; + } + + private class RoundDisplay : CompositeDrawable + { + public RoundDisplay(TournamentGrouping group) + { + var col = OsuColour.Gray(0.33f); + + InternalChildren = new Drawable[] + { + new FillFlowContainer + { + AutoSizeAxes = Axes.Both, + Anchor = Anchor.TopCentre, + Origin = Anchor.TopCentre, + Direction = FillDirection.Vertical, + Spacing = new Vector2(0, 10), + Children = new Drawable[] + { + new OsuSpriteText + { + Anchor = Anchor.TopCentre, + Origin = Anchor.TopCentre, + Colour = col, + Text = "COMING UP NEXT", + Font = "Exo2.0-SemiBold", + TextSize = 15, + }, + new OsuSpriteText + { + Anchor = Anchor.TopCentre, + Origin = Anchor.TopCentre, + Colour = col, + Text = group.Name.Value, + Font = "Exo2.0-Light", + Spacing = new Vector2(10, 0), + TextSize = 50, + }, + new OsuSpriteText + { + Anchor = Anchor.TopCentre, + Origin = Anchor.TopCentre, + Colour = col, + Text = group.StartDate.Value.ToString("dd MMMM HH:mm UTC"), + TextSize = 20, + }, + } + } + }; + } + } + + private class TeamWithPlayers : CompositeDrawable + { + private readonly Color4 red = new Color4(129, 68, 65, 255); + private readonly Color4 blue = new Color4(41, 91, 97, 255); + + public TeamWithPlayers(TournamentTeam team, bool left = false) + { + FillFlowContainer players; + var colour = left ? red : blue; + InternalChildren = new Drawable[] + { + new TeamDisplay(team, left ? "Team Red" : "Team Blue", colour) + { + Anchor = left ? Anchor.CentreRight : Anchor.CentreLeft, + Origin = left ? Anchor.CentreRight : Anchor.CentreLeft, + }, + players = new FillFlowContainer + { + Direction = FillDirection.Vertical, + AutoSizeAxes = Axes.Both, + Spacing = new Vector2(0, 5), + Padding = new MarginPadding(20), + Anchor = !left ? Anchor.CentreRight : Anchor.CentreLeft, + Origin = !left ? Anchor.CentreRight : Anchor.CentreLeft, + RelativePositionAxes = Axes.Both, + X = left ? 0.1f : -0.1f, + }, + }; + + foreach (var p in team.Players) + players.Add(new OsuSpriteText + { + Text = p.Username, + TextSize = 24, + Colour = colour, + Anchor = left ? Anchor.CentreRight : Anchor.CentreLeft, + Origin = left ? Anchor.CentreRight : Anchor.CentreLeft, + }); + } + + private class TeamDisplay : DrawableTournamentTeam + { + public TeamDisplay(TournamentTeam team, string teamName, Color4 colour) + : base(team) + { + AutoSizeAxes = Axes.Both; + + Flag.Anchor = Flag.Origin = Anchor.TopCentre; + Flag.RelativeSizeAxes = Axes.None; + Flag.Size = new Vector2(300, 200); + Flag.Scale = new Vector2(0.4f); + Flag.Margin = new MarginPadding { Bottom = 20 }; + + InternalChild = new FillFlowContainer + { + AutoSizeAxes = Axes.Both, + Direction = FillDirection.Vertical, + Spacing = new Vector2(0, 5), + Children = new Drawable[] + { + Flag, + new OsuSpriteText + { + Text = team.FullName.ToUpper(), + TextSize = 40, + Colour = Color4.Black, + Font = "Exo2.0-Light", + Origin = Anchor.TopCentre, + Anchor = Anchor.TopCentre, + }, + new OsuSpriteText + { + Text = teamName.ToUpper(), + TextSize = 20, + Colour = colour, + Origin = Anchor.TopCentre, + Anchor = Anchor.TopCentre, + } + } + }; + } + } + } + } +} From 0c4ea4beb102d0df710c94472a2fc92ed8e36e20 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 14 Oct 2018 05:20:10 +0900 Subject: [PATCH 054/317] Allow dynamic recompilation of beatmap panel testcase --- osu.Game.Tournament.Tests/TestCaseBeatmapPanel.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/osu.Game.Tournament.Tests/TestCaseBeatmapPanel.cs b/osu.Game.Tournament.Tests/TestCaseBeatmapPanel.cs index d6c9e0c901..93068f6224 100644 --- a/osu.Game.Tournament.Tests/TestCaseBeatmapPanel.cs +++ b/osu.Game.Tournament.Tests/TestCaseBeatmapPanel.cs @@ -1,6 +1,8 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using System; +using System.Collections.Generic; using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Game.Beatmaps; @@ -21,6 +23,11 @@ namespace osu.Game.Tournament.Tests [Resolved] private RulesetStore rulesets { get; set; } = null; + public override IReadOnlyList RequiredTypes => new[] + { + typeof(TournamentBeatmapPanel), + }; + [BackgroundDependencyLoader] private void load() { From 63fbe4e946fc3bfcda0397646303207e66062a4c Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 14 Oct 2018 18:00:28 +0900 Subject: [PATCH 055/317] Add map pool beatmaps to groupings --- osu.Game.Tournament.Tests/TestCaseTeamOverview.cs | 5 ++++- .../Screens/Ladder/Components/GroupingBeatmap.cs | 11 +++++++++++ .../Screens/Ladder/Components/TournamentGrouping.cs | 2 ++ 3 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 osu.Game.Tournament/Screens/Ladder/Components/GroupingBeatmap.cs diff --git a/osu.Game.Tournament.Tests/TestCaseTeamOverview.cs b/osu.Game.Tournament.Tests/TestCaseTeamOverview.cs index b853abb27c..006c8805c1 100644 --- a/osu.Game.Tournament.Tests/TestCaseTeamOverview.cs +++ b/osu.Game.Tournament.Tests/TestCaseTeamOverview.cs @@ -1,3 +1,6 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + using System.Linq; using osu.Game.Tournament.Screens.TeamIntro; @@ -10,7 +13,7 @@ namespace osu.Game.Tournament.Tests var team1 = Ladder.Teams.First(t => t.Acronym == "USA"); var team2 = Ladder.Teams.First(t => t.Acronym == "JPN"); - var round = Ladder.Groupings.First(g => g.Name == "Quarter Finals"); + var round = Ladder.Groupings.First(g => g.Name == "Finals"); Add(new TeamIntroScreen(team1, team2, round)); } diff --git a/osu.Game.Tournament/Screens/Ladder/Components/GroupingBeatmap.cs b/osu.Game.Tournament/Screens/Ladder/Components/GroupingBeatmap.cs new file mode 100644 index 0000000000..7395a2ae5f --- /dev/null +++ b/osu.Game.Tournament/Screens/Ladder/Components/GroupingBeatmap.cs @@ -0,0 +1,11 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +namespace osu.Game.Tournament.Screens.Ladder.Components +{ + public class GroupingBeatmap + { + public int ID; + public string Mods; + } +} diff --git a/osu.Game.Tournament/Screens/Ladder/Components/TournamentGrouping.cs b/osu.Game.Tournament/Screens/Ladder/Components/TournamentGrouping.cs index d8680b7210..7530910bc1 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/TournamentGrouping.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/TournamentGrouping.cs @@ -14,6 +14,8 @@ namespace osu.Game.Tournament.Screens.Ladder.Components public readonly BindableInt BestOf = new BindableInt(9) { Default = 9, MinValue = 3, MaxValue = 23 }; + public readonly List Beatmaps = new List(); + public readonly Bindable StartDate = new Bindable(); public List Pairings = new List(); From 61083190d08472cb709fa69382d4159db2fd6c6c Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 14 Oct 2018 18:09:22 +0900 Subject: [PATCH 056/317] Add WIP map pool testcase --- osu.Game.Tournament.Tests/TestCaseMapPool.cs | 42 ++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 osu.Game.Tournament.Tests/TestCaseMapPool.cs diff --git a/osu.Game.Tournament.Tests/TestCaseMapPool.cs b/osu.Game.Tournament.Tests/TestCaseMapPool.cs new file mode 100644 index 0000000000..11d9a7806b --- /dev/null +++ b/osu.Game.Tournament.Tests/TestCaseMapPool.cs @@ -0,0 +1,42 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System.Linq; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Game.Beatmaps; +using osu.Game.Tournament.Components; +using osu.Game.Tournament.Screens.Ladder.Components; + +namespace osu.Game.Tournament.Tests +{ + public class TestCaseMapPool : LadderTestCase + { + public TestCaseMapPool() + { + var round = Ladder.Groupings.First(g => g.Name == "Finals"); + + Add(new MapPoolScreen(round)); + } + } + + public class MapPoolScreen : CompositeDrawable + { + private readonly FillFlowContainer maps; + + public MapPoolScreen(TournamentGrouping round) + { + InternalChildren = new Drawable[] + { + maps = new FillFlowContainer + { + Direction = FillDirection.Full, + RelativeSizeAxes = Axes.Both, + }, + }; + + //foreach (var b in round.Beatmaps) + // maps.Add(new TournamentBeatmapPanel(new BeatmapInfo() { OnlineBeatmapID = b.ID })); + } + } +} From 3a5af47ee8c1149d53c8a3a315d1dc49017ce2a7 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 16 Oct 2018 15:20:12 +0900 Subject: [PATCH 057/317] Populate beatmaps with api information when not present --- osu.Game.Tournament.Tests/LadderTestCase.cs | 32 ++++++++++++++++++- .../TestCaseGroupingManager.cs | 6 ++++ .../TestCaseLadderManager.cs | 5 +-- osu.Game.Tournament.Tests/TestCaseMapPool.cs | 13 ++++---- .../TestCaseTeamOverview.cs | 4 ++- .../Ladder/Components/GroupingBeatmap.cs | 4 +++ osu.sln.DotSettings | 1 + 7 files changed, 55 insertions(+), 10 deletions(-) diff --git a/osu.Game.Tournament.Tests/LadderTestCase.cs b/osu.Game.Tournament.Tests/LadderTestCase.cs index 3044451a9e..ee8cfb8f8a 100644 --- a/osu.Game.Tournament.Tests/LadderTestCase.cs +++ b/osu.Game.Tournament.Tests/LadderTestCase.cs @@ -3,8 +3,13 @@ using System.IO; using Newtonsoft.Json; +using osu.Framework.Allocation; using osu.Framework.Graphics; +using osu.Game.Beatmaps; using osu.Game.Graphics.UserInterface; +using osu.Game.Online.API; +using osu.Game.Online.API.Requests; +using osu.Game.Rulesets; using osu.Game.Tests.Visual; using osu.Game.Tournament.Screens.Ladder.Components; @@ -14,10 +19,35 @@ namespace osu.Game.Tournament.Tests { protected LadderInfo Ladder; - protected LadderTestCase() + [Resolved] + private APIAccess api { get; set; } = null; + + [Resolved] + private RulesetStore rulesets { get; set; } = null; + + [BackgroundDependencyLoader] + private void load() { Ladder = File.Exists(@"bracket.json") ? JsonConvert.DeserializeObject(File.ReadAllText(@"bracket.json")) : new LadderInfo(); + bool addedInfo = false; + + foreach (var g in Ladder.Groupings) + foreach (var b in g.Beatmaps) + { + if (b.BeatmapInfo == null) + { + var req = new GetBeatmapRequest(new BeatmapInfo { OnlineBeatmapID = b.ID }); + req.Success += i => b.BeatmapInfo = i.ToBeatmap(rulesets); + req.Perform(api); + + addedInfo = true; + } + } + + if (addedInfo) + SaveChanges(); + Add(new OsuButton { Text = "Save Changes", diff --git a/osu.Game.Tournament.Tests/TestCaseGroupingManager.cs b/osu.Game.Tournament.Tests/TestCaseGroupingManager.cs index a0a4dfdc8b..2b79ba0225 100644 --- a/osu.Game.Tournament.Tests/TestCaseGroupingManager.cs +++ b/osu.Game.Tournament.Tests/TestCaseGroupingManager.cs @@ -2,6 +2,7 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Linq; +using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Game.Graphics.UserInterface; @@ -37,6 +38,11 @@ namespace osu.Game.Tournament.Tests } }); + } + + [BackgroundDependencyLoader] + private void load() + { foreach (var g in Ladder.Groupings) items.Add(new GroupingRow(g)); } diff --git a/osu.Game.Tournament.Tests/TestCaseLadderManager.cs b/osu.Game.Tournament.Tests/TestCaseLadderManager.cs index a7b93c8055..35a86e83b8 100644 --- a/osu.Game.Tournament.Tests/TestCaseLadderManager.cs +++ b/osu.Game.Tournament.Tests/TestCaseLadderManager.cs @@ -11,9 +11,10 @@ namespace osu.Game.Tournament.Tests public class TestCaseLadderManager : LadderTestCase { [Cached] - private readonly LadderManager manager; + private LadderManager manager; - public TestCaseLadderManager() + [BackgroundDependencyLoader] + private void load() { Add(new OsuContextMenuContainer { diff --git a/osu.Game.Tournament.Tests/TestCaseMapPool.cs b/osu.Game.Tournament.Tests/TestCaseMapPool.cs index 11d9a7806b..2c6999d6ae 100644 --- a/osu.Game.Tournament.Tests/TestCaseMapPool.cs +++ b/osu.Game.Tournament.Tests/TestCaseMapPool.cs @@ -2,9 +2,9 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Linq; +using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; -using osu.Game.Beatmaps; using osu.Game.Tournament.Components; using osu.Game.Tournament.Screens.Ladder.Components; @@ -12,7 +12,8 @@ namespace osu.Game.Tournament.Tests { public class TestCaseMapPool : LadderTestCase { - public TestCaseMapPool() + [BackgroundDependencyLoader] + private void load() { var round = Ladder.Groupings.First(g => g.Name == "Finals"); @@ -22,10 +23,10 @@ namespace osu.Game.Tournament.Tests public class MapPoolScreen : CompositeDrawable { - private readonly FillFlowContainer maps; - public MapPoolScreen(TournamentGrouping round) { + FillFlowContainer maps; + InternalChildren = new Drawable[] { maps = new FillFlowContainer @@ -35,8 +36,8 @@ namespace osu.Game.Tournament.Tests }, }; - //foreach (var b in round.Beatmaps) - // maps.Add(new TournamentBeatmapPanel(new BeatmapInfo() { OnlineBeatmapID = b.ID })); + foreach (var b in round.Beatmaps) + maps.Add(new TournamentBeatmapPanel(b.BeatmapInfo)); } } } diff --git a/osu.Game.Tournament.Tests/TestCaseTeamOverview.cs b/osu.Game.Tournament.Tests/TestCaseTeamOverview.cs index 006c8805c1..52a5a7204c 100644 --- a/osu.Game.Tournament.Tests/TestCaseTeamOverview.cs +++ b/osu.Game.Tournament.Tests/TestCaseTeamOverview.cs @@ -2,13 +2,15 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Linq; +using osu.Framework.Allocation; using osu.Game.Tournament.Screens.TeamIntro; namespace osu.Game.Tournament.Tests { public class TestCaseTeamIntro : LadderTestCase { - public TestCaseTeamIntro() + [BackgroundDependencyLoader] + private void load() { var team1 = Ladder.Teams.First(t => t.Acronym == "USA"); var team2 = Ladder.Teams.First(t => t.Acronym == "JPN"); diff --git a/osu.Game.Tournament/Screens/Ladder/Components/GroupingBeatmap.cs b/osu.Game.Tournament/Screens/Ladder/Components/GroupingBeatmap.cs index 7395a2ae5f..416f960404 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/GroupingBeatmap.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/GroupingBeatmap.cs @@ -1,11 +1,15 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using osu.Game.Beatmaps; + namespace osu.Game.Tournament.Screens.Ladder.Components { public class GroupingBeatmap { public int ID; public string Mods; + + public BeatmapInfo BeatmapInfo; } } diff --git a/osu.sln.DotSettings b/osu.sln.DotSettings index 404b19deda..345400305c 100644 --- a/osu.sln.DotSettings +++ b/osu.sln.DotSettings @@ -666,6 +666,7 @@ Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/maste True True True + True True True True From f324072d44d70ec439fe8ef17e95f7dff2d426a2 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 16 Oct 2018 15:25:56 +0900 Subject: [PATCH 058/317] Make map pool layout more correct --- osu.Game.Tournament.Tests/TestCaseMapPool.cs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/osu.Game.Tournament.Tests/TestCaseMapPool.cs b/osu.Game.Tournament.Tests/TestCaseMapPool.cs index 2c6999d6ae..10ebd4e63c 100644 --- a/osu.Game.Tournament.Tests/TestCaseMapPool.cs +++ b/osu.Game.Tournament.Tests/TestCaseMapPool.cs @@ -5,8 +5,10 @@ using System.Linq; using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; +using osu.Game.Screens; using osu.Game.Tournament.Components; using osu.Game.Tournament.Screens.Ladder.Components; +using OpenTK; namespace osu.Game.Tournament.Tests { @@ -21,7 +23,7 @@ namespace osu.Game.Tournament.Tests } } - public class MapPoolScreen : CompositeDrawable + public class MapPoolScreen : OsuScreen { public MapPoolScreen(TournamentGrouping round) { @@ -31,13 +33,19 @@ namespace osu.Game.Tournament.Tests { maps = new FillFlowContainer { + Spacing = new Vector2(20), + Padding = new MarginPadding(50), Direction = FillDirection.Full, RelativeSizeAxes = Axes.Both, }, }; foreach (var b in round.Beatmaps) - maps.Add(new TournamentBeatmapPanel(b.BeatmapInfo)); + maps.Add(new TournamentBeatmapPanel(b.BeatmapInfo) + { + Anchor = Anchor.TopCentre, + Origin = Anchor.TopCentre, + }); } } } From dfaff3aaed193ade60771e9e1b3b5a6e84158e72 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 16 Oct 2018 15:45:41 +0900 Subject: [PATCH 059/317] Fix filename mismatch --- .../{TestCaseTeamOverview.cs => TestCaseTeamIntro.cs} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename osu.Game.Tournament.Tests/{TestCaseTeamOverview.cs => TestCaseTeamIntro.cs} (100%) diff --git a/osu.Game.Tournament.Tests/TestCaseTeamOverview.cs b/osu.Game.Tournament.Tests/TestCaseTeamIntro.cs similarity index 100% rename from osu.Game.Tournament.Tests/TestCaseTeamOverview.cs rename to osu.Game.Tournament.Tests/TestCaseTeamIntro.cs From 830eda2a9f15f274cd830b62005a62f0119d0346 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 16 Oct 2018 16:07:59 +0900 Subject: [PATCH 060/317] Fix unused properties --- osu.Game.Tournament/Components/TournamentTeam.cs | 4 ++++ .../Screens/Ladder/Components/TournamentGrouping.cs | 3 +++ 2 files changed, 7 insertions(+) diff --git a/osu.Game.Tournament/Components/TournamentTeam.cs b/osu.Game.Tournament/Components/TournamentTeam.cs index cb6fc9fb92..78e1386706 100644 --- a/osu.Game.Tournament/Components/TournamentTeam.cs +++ b/osu.Game.Tournament/Components/TournamentTeam.cs @@ -1,11 +1,14 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using System; using System.Collections.Generic; +using Newtonsoft.Json; using osu.Game.Users; namespace osu.Game.Tournament.Components { + [Serializable] public class TournamentTeam { /// @@ -35,6 +38,7 @@ namespace osu.Game.Tournament.Components set { acronym = value; } } + [JsonProperty] public List Players { get; set; } public override string ToString() => FullName ?? Acronym; diff --git a/osu.Game.Tournament/Screens/Ladder/Components/TournamentGrouping.cs b/osu.Game.Tournament/Screens/Ladder/Components/TournamentGrouping.cs index 7530910bc1..17f76a0143 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/TournamentGrouping.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/TournamentGrouping.cs @@ -3,10 +3,12 @@ using System; using System.Collections.Generic; +using Newtonsoft.Json; using osu.Framework.Configuration; namespace osu.Game.Tournament.Screens.Ladder.Components { + [Serializable] public class TournamentGrouping { public readonly Bindable Name = new Bindable(); @@ -14,6 +16,7 @@ namespace osu.Game.Tournament.Screens.Ladder.Components public readonly BindableInt BestOf = new BindableInt(9) { Default = 9, MinValue = 3, MaxValue = 23 }; + [JsonProperty] public readonly List Beatmaps = new List(); public readonly Bindable StartDate = new Bindable(); From 216de3c53d80882e4c3ef49f0d02167890790aa5 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 16 Oct 2018 17:34:58 +0900 Subject: [PATCH 061/317] Don't cache manager --- osu.Game.Tournament.Tests/TestCaseLadderManager.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/osu.Game.Tournament.Tests/TestCaseLadderManager.cs b/osu.Game.Tournament.Tests/TestCaseLadderManager.cs index 35a86e83b8..a7af038ca8 100644 --- a/osu.Game.Tournament.Tests/TestCaseLadderManager.cs +++ b/osu.Game.Tournament.Tests/TestCaseLadderManager.cs @@ -10,7 +10,6 @@ namespace osu.Game.Tournament.Tests { public class TestCaseLadderManager : LadderTestCase { - [Cached] private LadderManager manager; [BackgroundDependencyLoader] From 143d9d54f9ae5f8e3141ecf3158f8c66b039a905 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 16 Oct 2018 18:02:47 +0900 Subject: [PATCH 062/317] Add basic scene manager --- .../TestCaseSceneManager.cs | 93 +++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 osu.Game.Tournament.Tests/TestCaseSceneManager.cs diff --git a/osu.Game.Tournament.Tests/TestCaseSceneManager.cs b/osu.Game.Tournament.Tests/TestCaseSceneManager.cs new file mode 100644 index 0000000000..8a56ec883e --- /dev/null +++ b/osu.Game.Tournament.Tests/TestCaseSceneManager.cs @@ -0,0 +1,93 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System.Linq; +using osu.Framework.Allocation; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Shapes; +using osu.Game.Graphics.UserInterface; +using osu.Game.Tournament.Screens.Ladder; +using osu.Game.Tournament.Screens.TeamIntro; +using OpenTK; +using OpenTK.Graphics; + +namespace osu.Game.Tournament.Tests +{ + public class TestCaseSceneManager : LadderTestCase + { + private LadderManager bracket; + private MapPoolScreen mapPool; + private TeamIntroScreen teamIntro; + private Container screens; + + [BackgroundDependencyLoader] + private void load() + { + Children = new Drawable[] + { + new Container + { + RelativeSizeAxes = Axes.Both, + Width = 0.2f, + Children = new Drawable[] + { + new Box + { + Colour = Color4.Black, + RelativeSizeAxes = Axes.Both, + }, + new FillFlowContainer + { + RelativeSizeAxes = Axes.Both, + Direction = FillDirection.Vertical, + Children = new Drawable[] + { + new OsuButton { RelativeSizeAxes = Axes.X, Text = "TeamIntro", Action = () => setScreen(teamIntro) }, + new OsuButton { RelativeSizeAxes = Axes.X, Text = "MapPool", Action = () => setScreen(mapPool) }, + new OsuButton { RelativeSizeAxes = Axes.X, Text = "Bracket", Action = () => setScreen(bracket) }, + } + }, + }, + }, + new Container + { + RelativeSizeAxes = Axes.Both, + Anchor = Anchor.TopRight, + Origin = Anchor.TopRight, + Size = new Vector2(0.8f), + Masking = true, + Children = new Drawable[] + { + new Box + { + Colour = Color4.White, + RelativeSizeAxes = Axes.Both, + }, + screens = new Container + { + RelativeSizeAxes = Axes.Both, + Children = new Drawable[] + { + bracket = new LadderManager(Ladder), + mapPool = new MapPoolScreen(Ladder.Groupings.First(g => g.Name == "Finals")), + teamIntro = new TeamIntroScreen(Ladder.Teams.First(t => t.Acronym == "USA"), Ladder.Teams.First(t => t.Acronym == "JPN"), Ladder.Groupings.First(g => g.Name == "Finals")) + } + }, + } + }, + }; + } + + private void setScreen(Drawable screen) + { + foreach (var s in screens.Children) + { + if (s == screen) + s.FadeIn(100); + else + s.FadeOut(100); + } + } + } +} From 7a753ad9e2750dcc6ee0f22b7748250edabf9e1f Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 18 Oct 2018 02:17:54 +0900 Subject: [PATCH 063/317] Change grouping title colours to match white background --- .../Screens/Ladder/Components/DrawableTournamentGrouping.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/osu.Game.Tournament/Screens/Ladder/Components/DrawableTournamentGrouping.cs b/osu.Game.Tournament/Screens/Ladder/Components/DrawableTournamentGrouping.cs index 8a38f402aa..bb984dd61b 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/DrawableTournamentGrouping.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/DrawableTournamentGrouping.cs @@ -4,6 +4,7 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Game.Graphics.Sprites; +using OpenTK.Graphics; namespace osu.Game.Tournament.Screens.Ladder.Components { @@ -21,6 +22,7 @@ namespace osu.Game.Tournament.Screens.Ladder.Components new OsuSpriteText { Text = grouping.Description.Value.ToUpper(), + Colour = Color4.Black, Origin = Anchor.TopCentre, Anchor = Anchor.TopCentre }, @@ -28,6 +30,7 @@ namespace osu.Game.Tournament.Screens.Ladder.Components { Text = ((losers ? "Losers " : "") + grouping.Name).ToUpper(), Font = "Exo2.0-Bold", + Colour = Color4.Black, Origin = Anchor.TopCentre, Anchor = Anchor.TopCentre }, From 12c0b2c37d208b17e3787af4936da18178e6fe17 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 18 Oct 2018 02:18:09 +0900 Subject: [PATCH 064/317] Add test videos and adjust alignment to match --- .../TestCaseSceneManager.cs | 14 ++++++++++---- osu.Game.Tournament.Tests/TestCaseTeamIntro.cs | 7 ++++++- .../Screens/TeamIntro/TeamIntro.cs | 16 ++++++++-------- osu.Game/osu.Game.csproj | 2 +- 4 files changed, 25 insertions(+), 14 deletions(-) diff --git a/osu.Game.Tournament.Tests/TestCaseSceneManager.cs b/osu.Game.Tournament.Tests/TestCaseSceneManager.cs index 8a56ec883e..a1434b3a31 100644 --- a/osu.Game.Tournament.Tests/TestCaseSceneManager.cs +++ b/osu.Game.Tournament.Tests/TestCaseSceneManager.cs @@ -6,6 +6,7 @@ using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; +using osu.Framework.Graphics.Video; using osu.Game.Graphics.UserInterface; using osu.Game.Tournament.Screens.Ladder; using osu.Game.Tournament.Screens.TeamIntro; @@ -53,16 +54,18 @@ namespace osu.Game.Tournament.Tests new Container { RelativeSizeAxes = Axes.Both, + FillMode = FillMode.Fit, + FillAspectRatio = 16/9f, Anchor = Anchor.TopRight, Origin = Anchor.TopRight, - Size = new Vector2(0.8f), + Size = new Vector2(0.8f, 1), Masking = true, Children = new Drawable[] { - new Box + new VideoSprite(@"C:\Users\Dean\BG Side Logo - OWC.m4v") { - Colour = Color4.White, RelativeSizeAxes = Axes.Both, + FillMode = FillMode.Fit, }, screens = new Container { @@ -71,12 +74,15 @@ namespace osu.Game.Tournament.Tests { bracket = new LadderManager(Ladder), mapPool = new MapPoolScreen(Ladder.Groupings.First(g => g.Name == "Finals")), - teamIntro = new TeamIntroScreen(Ladder.Teams.First(t => t.Acronym == "USA"), Ladder.Teams.First(t => t.Acronym == "JPN"), Ladder.Groupings.First(g => g.Name == "Finals")) + teamIntro = new TeamIntroScreen(Ladder.Teams.First(t => t.Acronym == "USA"), Ladder.Teams.First(t => t.Acronym == "JPN"), + Ladder.Groupings.First(g => g.Name == "Finals")) } }, } }, }; + + setScreen(teamIntro); } private void setScreen(Drawable screen) diff --git a/osu.Game.Tournament.Tests/TestCaseTeamIntro.cs b/osu.Game.Tournament.Tests/TestCaseTeamIntro.cs index 52a5a7204c..fff28ba900 100644 --- a/osu.Game.Tournament.Tests/TestCaseTeamIntro.cs +++ b/osu.Game.Tournament.Tests/TestCaseTeamIntro.cs @@ -3,6 +3,7 @@ using System.Linq; using osu.Framework.Allocation; +using osu.Framework.Graphics; using osu.Game.Tournament.Screens.TeamIntro; namespace osu.Game.Tournament.Tests @@ -17,7 +18,11 @@ namespace osu.Game.Tournament.Tests var round = Ladder.Groupings.First(g => g.Name == "Finals"); - Add(new TeamIntroScreen(team1, team2, round)); + Add(new TeamIntroScreen(team1, team2, round) + { + FillMode = FillMode.Fit, + FillAspectRatio = 16 / 9f + }); } } } diff --git a/osu.Game.Tournament/Screens/TeamIntro/TeamIntro.cs b/osu.Game.Tournament/Screens/TeamIntro/TeamIntro.cs index fce29a2c89..f8820d570a 100644 --- a/osu.Game.Tournament/Screens/TeamIntro/TeamIntro.cs +++ b/osu.Game.Tournament/Screens/TeamIntro/TeamIntro.cs @@ -3,7 +3,7 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Shapes; +using osu.Framework.Graphics.Video; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; using osu.Game.Screens; @@ -22,15 +22,14 @@ namespace osu.Game.Tournament.Screens.TeamIntro InternalChildren = new Drawable[] { - new Box + new VideoSprite(@"C:\Users\Dean\BG Team - Both OWC.m4v") { - Colour = Color4.White, - RelativeSizeAxes = Axes.Both + RelativeSizeAxes = Axes.Both, + Loop = true, }, new TeamWithPlayers(team1, true) { RelativeSizeAxes = Axes.Both, - Margin = new MarginPadding(40), Width = 0.5f, Height = 0.6f, Anchor = Anchor.Centre, @@ -39,7 +38,6 @@ namespace osu.Game.Tournament.Screens.TeamIntro new TeamWithPlayers(team2) { RelativeSizeAxes = Axes.Both, - Margin = new MarginPadding(40), Width = 0.5f, Height = 0.6f, Anchor = Anchor.Centre, @@ -48,7 +46,7 @@ namespace osu.Game.Tournament.Screens.TeamIntro new RoundDisplay(round) { RelativeSizeAxes = Axes.Both, - Height = 0.3f, + Height = 0.25f, Anchor = Anchor.BottomCentre, Origin = Anchor.BottomCentre, } @@ -119,7 +117,9 @@ namespace osu.Game.Tournament.Screens.TeamIntro new TeamDisplay(team, left ? "Team Red" : "Team Blue", colour) { Anchor = left ? Anchor.CentreRight : Anchor.CentreLeft, - Origin = left ? Anchor.CentreRight : Anchor.CentreLeft, + Origin = Anchor.Centre, + RelativePositionAxes = Axes.Both, + X = (left ? -1 : 1) * 0.36f, }, players = new FillFlowContainer { diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index cc21f4f6a4..cf1863a58c 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -18,7 +18,7 @@ - + From 5568e9ff8a6b9993dae33e41388e768a67366f74 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 25 Oct 2018 01:29:08 +0900 Subject: [PATCH 065/317] Reduce test case crashes when missing data is present --- osu.Game.Tournament.Tests/TestCaseMapPool.cs | 7 +++-- .../TestCaseTeamIntro.cs | 6 ++-- .../Screens/TeamIntro/TeamIntro.cs | 28 +++++++++++-------- 3 files changed, 23 insertions(+), 18 deletions(-) diff --git a/osu.Game.Tournament.Tests/TestCaseMapPool.cs b/osu.Game.Tournament.Tests/TestCaseMapPool.cs index 10ebd4e63c..e4637b8fc3 100644 --- a/osu.Game.Tournament.Tests/TestCaseMapPool.cs +++ b/osu.Game.Tournament.Tests/TestCaseMapPool.cs @@ -17,9 +17,10 @@ namespace osu.Game.Tournament.Tests [BackgroundDependencyLoader] private void load() { - var round = Ladder.Groupings.First(g => g.Name == "Finals"); + var round = Ladder.Groupings.FirstOrDefault(g => g.Name == "Finals"); - Add(new MapPoolScreen(round)); + if (round != null) + Add(new MapPoolScreen(round)); } } @@ -37,7 +38,7 @@ namespace osu.Game.Tournament.Tests Padding = new MarginPadding(50), Direction = FillDirection.Full, RelativeSizeAxes = Axes.Both, - }, + } }; foreach (var b in round.Beatmaps) diff --git a/osu.Game.Tournament.Tests/TestCaseTeamIntro.cs b/osu.Game.Tournament.Tests/TestCaseTeamIntro.cs index fff28ba900..845f5638a0 100644 --- a/osu.Game.Tournament.Tests/TestCaseTeamIntro.cs +++ b/osu.Game.Tournament.Tests/TestCaseTeamIntro.cs @@ -13,10 +13,10 @@ namespace osu.Game.Tournament.Tests [BackgroundDependencyLoader] private void load() { - var team1 = Ladder.Teams.First(t => t.Acronym == "USA"); - var team2 = Ladder.Teams.First(t => t.Acronym == "JPN"); + var team1 = Ladder.Teams.FirstOrDefault(t => t.Acronym == "USA"); + var team2 = Ladder.Teams.FirstOrDefault(t => t.Acronym == "JPN"); - var round = Ladder.Groupings.First(g => g.Name == "Finals"); + var round = Ladder.Groupings.FirstOrDefault(g => g.Name == "Finals"); Add(new TeamIntroScreen(team1, team2, round) { diff --git a/osu.Game.Tournament/Screens/TeamIntro/TeamIntro.cs b/osu.Game.Tournament/Screens/TeamIntro/TeamIntro.cs index f8820d570a..766feaa806 100644 --- a/osu.Game.Tournament/Screens/TeamIntro/TeamIntro.cs +++ b/osu.Game.Tournament/Screens/TeamIntro/TeamIntro.cs @@ -1,6 +1,7 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using System; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Video; @@ -84,7 +85,7 @@ namespace osu.Game.Tournament.Screens.TeamIntro Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, Colour = col, - Text = group.Name.Value, + Text = group?.Name.Value ?? "Unknown Grouping", Font = "Exo2.0-Light", Spacing = new Vector2(10, 0), TextSize = 50, @@ -94,7 +95,7 @@ namespace osu.Game.Tournament.Screens.TeamIntro Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, Colour = col, - Text = group.StartDate.Value.ToString("dd MMMM HH:mm UTC"), + Text = (group?.StartDate.Value ?? DateTimeOffset.Now).ToString("dd MMMM HH:mm UTC"), TextSize = 20, }, } @@ -134,15 +135,18 @@ namespace osu.Game.Tournament.Screens.TeamIntro }, }; - foreach (var p in team.Players) - players.Add(new OsuSpriteText - { - Text = p.Username, - TextSize = 24, - Colour = colour, - Anchor = left ? Anchor.CentreRight : Anchor.CentreLeft, - Origin = left ? Anchor.CentreRight : Anchor.CentreLeft, - }); + if (team != null) + { + foreach (var p in team.Players) + players.Add(new OsuSpriteText + { + Text = p.Username, + TextSize = 24, + Colour = colour, + Anchor = left ? Anchor.CentreRight : Anchor.CentreLeft, + Origin = left ? Anchor.CentreRight : Anchor.CentreLeft, + }); + } } private class TeamDisplay : DrawableTournamentTeam @@ -168,7 +172,7 @@ namespace osu.Game.Tournament.Screens.TeamIntro Flag, new OsuSpriteText { - Text = team.FullName.ToUpper(), + Text = team?.FullName.ToUpper() ?? "???", TextSize = 40, Colour = Color4.Black, Font = "Exo2.0-Light", From eacc0fe7964ca94fcdaf9ad170e4804ae3d14ab3 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 2 Sep 2018 02:12:09 +0900 Subject: [PATCH 066/317] Use local framework --- osu.Game/osu.Game.csproj | 2 +- osu.sln | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index cf1863a58c..3022b66762 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -11,6 +11,7 @@ + @@ -18,7 +19,6 @@ - diff --git a/osu.sln b/osu.sln index f6ed7a5c42..c62fc02dba 100644 --- a/osu.sln +++ b/osu.sln @@ -31,6 +31,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "osu.Game.Tournament", "osu. EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "osu.Game.Tournament.Tests", "osu.Game.Tournament.Tests\osu.Game.Tournament.Tests.csproj", "{5789E78D-38F9-4072-AB7B-978F34B2C17F}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "osu.Framework", "..\osu-framework\osu.Framework\osu.Framework.csproj", "{7A69A230-45A1-4444-8C43-A582E4F48C1E}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -93,6 +95,10 @@ Global {5789E78D-38F9-4072-AB7B-978F34B2C17F}.Debug|Any CPU.Build.0 = Debug|Any CPU {5789E78D-38F9-4072-AB7B-978F34B2C17F}.Release|Any CPU.ActiveCfg = Release|Any CPU {5789E78D-38F9-4072-AB7B-978F34B2C17F}.Release|Any CPU.Build.0 = Release|Any CPU + {7A69A230-45A1-4444-8C43-A582E4F48C1E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7A69A230-45A1-4444-8C43-A582E4F48C1E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7A69A230-45A1-4444-8C43-A582E4F48C1E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7A69A230-45A1-4444-8C43-A582E4F48C1E}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE From 9f5546fd62f92a863ce7e0b930271a7ab936ed44 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 2 Nov 2018 21:13:46 +0900 Subject: [PATCH 067/317] Fix API regression in direct --- osu.Game/Online/API/Requests/Responses/APIBeatmap.cs | 4 ++-- osu.Game/osu.Game.csproj | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/osu.Game/Online/API/Requests/Responses/APIBeatmap.cs b/osu.Game/Online/API/Requests/Responses/APIBeatmap.cs index c9ea66d05f..55eee11664 100644 --- a/osu.Game/Online/API/Requests/Responses/APIBeatmap.cs +++ b/osu.Game/Online/API/Requests/Responses/APIBeatmap.cs @@ -61,13 +61,13 @@ namespace osu.Game.Online.API.Requests.Responses { return new BeatmapInfo { - Metadata = !string.IsNullOrEmpty(Artist) ? this : (BeatmapMetadata)BeatmapSet, + Metadata = !string.IsNullOrEmpty(Artist) ? this : BeatmapSet as BeatmapMetadata, Ruleset = rulesets.GetRuleset(ruleset), StarDifficulty = starDifficulty, OnlineBeatmapID = OnlineBeatmapID, Version = version, Status = Status, - BeatmapSet = BeatmapSet.ToBeatmapSet(rulesets), + BeatmapSet = BeatmapSet?.ToBeatmapSet(rulesets), BaseDifficulty = new BeatmapDifficulty { DrainRate = drainRate, diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 921da942f0..e641c93ad3 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -19,7 +19,7 @@ - + From b610095ff598e29e0020dcd68ca75705feac1c7c Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 4 Nov 2018 04:58:35 +0900 Subject: [PATCH 068/317] Update drawings design --- .../Components/ScrollingTeamContainer.cs | 3 + .../Screens/Drawings/DrawingsScreen.cs | 260 +++++++++--------- 2 files changed, 131 insertions(+), 132 deletions(-) diff --git a/osu.Game.Tournament/Screens/Drawings/Components/ScrollingTeamContainer.cs b/osu.Game.Tournament/Screens/Drawings/Components/ScrollingTeamContainer.cs index 816a3ef958..6e050fd0bb 100644 --- a/osu.Game.Tournament/Screens/Drawings/Components/ScrollingTeamContainer.cs +++ b/osu.Game.Tournament/Screens/Drawings/Components/ScrollingTeamContainer.cs @@ -10,6 +10,7 @@ using osu.Framework.Graphics.Colour; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; using osu.Framework.Threading; +using osu.Game.Graphics; using osu.Game.Tournament.Components; using OpenTK; using OpenTK.Graphics; @@ -52,6 +53,7 @@ namespace osu.Game.Tournament.Screens.Drawings.Components Origin = Anchor.Centre, AutoSizeAxes = Axes.Both, + Colour = OsuColour.Gray(0.33f), Masking = true, CornerRadius = 10f, @@ -358,6 +360,7 @@ namespace osu.Game.Tournament.Screens.Drawings.Components outline = new Box { RelativeSizeAxes = Axes.Both, + Colour = OsuColour.Gray(0.33f), Alpha = 0 }, Flag diff --git a/osu.Game.Tournament/Screens/Drawings/DrawingsScreen.cs b/osu.Game.Tournament/Screens/Drawings/DrawingsScreen.cs index 8e6738d8d6..38f0be0d5a 100644 --- a/osu.Game.Tournament/Screens/Drawings/DrawingsScreen.cs +++ b/osu.Game.Tournament/Screens/Drawings/DrawingsScreen.cs @@ -12,13 +12,14 @@ using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Textures; +using osu.Framework.Graphics.Video; using osu.Framework.IO.Stores; using osu.Framework.Logging; using osu.Framework.Platform; +using osu.Game.Graphics; using osu.Game.Graphics.Sprites; using osu.Game.Graphics.UserInterface; using osu.Game.Screens; -using osu.Game.Screens.Backgrounds; using osu.Game.Tournament.Components; using osu.Game.Tournament.Screens.Drawings.Components; using OpenTK; @@ -32,7 +33,7 @@ namespace osu.Game.Tournament.Screens.Drawings protected override bool HideOverlaysOnEnter => true; - protected override BackgroundScreen CreateBackground() => new BackgroundScreenDefault(); + protected override BackgroundScreen CreateBackground() => null; private ScrollingTeamContainer teamsContainer; private GroupContainer groupsContainer; @@ -56,6 +57,8 @@ namespace osu.Game.Tournament.Screens.Drawings [BackgroundDependencyLoader] private void load(TextureStore textures, Storage storage) { + RelativeSizeAxes = Axes.Both; + this.storage = storage; TextureStore flagStore = new TextureStore(); @@ -79,168 +82,161 @@ namespace osu.Game.Tournament.Screens.Drawings Children = new Drawable[] { - new Box + // Main container + new Container { RelativeSizeAxes = Axes.Both, - Colour = new Color4(77, 77, 77, 255) + Children = new Drawable[] + { + new VideoSprite(@"C:\Users\Dean\BG Logoless - OWC.m4v") + { + RelativeSizeAxes = Axes.Both, + Loop = true, + }, + new Sprite + { + RelativeSizeAxes = Axes.Both, + FillMode = FillMode.Fill, + Texture = textures.Get(@"Backgrounds/Drawings/background.png") + }, + // Visualiser + new VisualiserContainer + { + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + + RelativeSizeAxes = Axes.X, + Size = new Vector2(1, 10), + + Colour = new Color4(255, 204, 34, 255), + + Lines = 6 + }, + // Groups + groupsContainer = new GroupContainer(drawingsConfig.Get(DrawingsConfig.Groups), drawingsConfig.Get(DrawingsConfig.TeamsPerGroup)) + { + Anchor = Anchor.TopCentre, + Origin = Anchor.TopCentre, + + RelativeSizeAxes = Axes.Y, + AutoSizeAxes = Axes.X, + + Padding = new MarginPadding + { + Top = 35f, + Bottom = 35f + } + }, + // Scrolling teams + teamsContainer = new ScrollingTeamContainer + { + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + + RelativeSizeAxes = Axes.X, + }, + // Scrolling team name + fullTeamNameText = new OsuSpriteText + { + Anchor = Anchor.Centre, + Origin = Anchor.TopCentre, + + Position = new Vector2(0, 45f), + + Colour = OsuColour.Gray(0.33f), + + Alpha = 0, + + Font = "Exo2.0-Light", + TextSize = 42f + } + } }, - new Sprite + // Control panel container + new Container { RelativeSizeAxes = Axes.Both, - FillMode = FillMode.Fill, - Texture = textures.Get(@"Backgrounds/Drawings/background.png") - }, - new FillFlowContainer - { - RelativeSizeAxes = Axes.Both, - Direction = FillDirection.Horizontal, + AlwaysPresent = true, + Width = 0.15f, + Anchor = Anchor.TopRight, Children = new Drawable[] { - // Main container - new Container + new Box { RelativeSizeAxes = Axes.Both, - Width = 0.85f, + Colour = new Color4(54, 54, 54, 255) + }, + new OsuSpriteText + { + Anchor = Anchor.TopCentre, + Origin = Anchor.TopCentre, + + Text = "Control Panel", + TextSize = 22f, + Font = "Exo2.0-Bold" + }, + new FillFlowContainer + { + Anchor = Anchor.TopCentre, + Origin = Anchor.TopCentre, + + RelativeSizeAxes = Axes.X, + AutoSizeAxes = Axes.Y, + Width = 0.75f, + + Position = new Vector2(0, 35f), + + Direction = FillDirection.Vertical, + Spacing = new Vector2(0, 5f), Children = new Drawable[] { - // Visualiser - new VisualiserContainer + new TriangleButton { - Anchor = Anchor.Centre, - Origin = Anchor.Centre, - RelativeSizeAxes = Axes.X, - Size = new Vector2(1, 10), - Colour = new Color4(255, 204, 34, 255), - - Lines = 6 + Text = "Begin random", + Action = teamsContainer.StartScrolling, }, - // Groups - groupsContainer = new GroupContainer(drawingsConfig.Get(DrawingsConfig.Groups), drawingsConfig.Get(DrawingsConfig.TeamsPerGroup)) + new TriangleButton { - Anchor = Anchor.TopCentre, - Origin = Anchor.TopCentre, - - RelativeSizeAxes = Axes.Y, - AutoSizeAxes = Axes.X, - - Padding = new MarginPadding - { - Top = 35f, - Bottom = 35f - } - }, - // Scrolling teams - teamsContainer = new ScrollingTeamContainer - { - Anchor = Anchor.Centre, - Origin = Anchor.Centre, - RelativeSizeAxes = Axes.X, + + Text = "Stop random", + Action = teamsContainer.StopScrolling, }, - // Scrolling team name - fullTeamNameText = new OsuSpriteText + new TriangleButton { - Anchor = Anchor.Centre, - Origin = Anchor.TopCentre, + RelativeSizeAxes = Axes.X, - Position = new Vector2(0, 45f), - - Alpha = 0, - - Font = "Exo2.0-Light", - TextSize = 42f + Text = "Reload", + Action = reloadTeams } } }, - // Control panel container - new Container + new FillFlowContainer { - RelativeSizeAxes = Axes.Both, - Width = 0.15f, + Anchor = Anchor.BottomCentre, + Origin = Anchor.BottomCentre, + + RelativeSizeAxes = Axes.X, + AutoSizeAxes = Axes.Y, + Width = 0.75f, + + Position = new Vector2(0, -5f), + + Direction = FillDirection.Vertical, + Spacing = new Vector2(0, 5f), Children = new Drawable[] { - new Box + new TriangleButton { - RelativeSizeAxes = Axes.Both, - Colour = new Color4(54, 54, 54, 255) - }, - new OsuSpriteText - { - Anchor = Anchor.TopCentre, - Origin = Anchor.TopCentre, - - Text = "Control Panel", - TextSize = 22f, - Font = "Exo2.0-Bold" - }, - new FillFlowContainer - { - Anchor = Anchor.TopCentre, - Origin = Anchor.TopCentre, - RelativeSizeAxes = Axes.X, - AutoSizeAxes = Axes.Y, - Width = 0.75f, - Position = new Vector2(0, 35f), - - Direction = FillDirection.Vertical, - Spacing = new Vector2(0, 5f), - - Children = new Drawable[] - { - new TriangleButton - { - RelativeSizeAxes = Axes.X, - - Text = "Begin random", - Action = teamsContainer.StartScrolling, - }, - new TriangleButton - { - RelativeSizeAxes = Axes.X, - - Text = "Stop random", - Action = teamsContainer.StopScrolling, - }, - new TriangleButton - { - RelativeSizeAxes = Axes.X, - - Text = "Reload", - Action = reloadTeams - } - } - }, - new FillFlowContainer - { - Anchor = Anchor.BottomCentre, - Origin = Anchor.BottomCentre, - - RelativeSizeAxes = Axes.X, - AutoSizeAxes = Axes.Y, - Width = 0.75f, - - Position = new Vector2(0, -5f), - - Direction = FillDirection.Vertical, - Spacing = new Vector2(0, 5f), - - Children = new Drawable[] - { - new TriangleButton - { - RelativeSizeAxes = Axes.X, - - Text = "Reset", - Action = () => reset() - } - } + Text = "Reset", + Action = () => reset() } } } From a918e83b1e4b1523c48b4d54cdb1a81eb88b6982 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 4 Nov 2018 04:58:59 +0900 Subject: [PATCH 069/317] Add drawings screen --- osu.Game.Tournament.Tests/TestCaseSceneManager.cs | 15 +++++++++++---- .../Screens/Ladder/Components/ProgressionPath.cs | 2 +- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/osu.Game.Tournament.Tests/TestCaseSceneManager.cs b/osu.Game.Tournament.Tests/TestCaseSceneManager.cs index a1434b3a31..9454a5674c 100644 --- a/osu.Game.Tournament.Tests/TestCaseSceneManager.cs +++ b/osu.Game.Tournament.Tests/TestCaseSceneManager.cs @@ -8,6 +8,7 @@ using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Video; using osu.Game.Graphics.UserInterface; +using osu.Game.Tournament.Screens.Drawings; using osu.Game.Tournament.Screens.Ladder; using osu.Game.Tournament.Screens.TeamIntro; using OpenTK; @@ -20,6 +21,7 @@ namespace osu.Game.Tournament.Tests private LadderManager bracket; private MapPoolScreen mapPool; private TeamIntroScreen teamIntro; + private DrawingsScreen drawings; private Container screens; [BackgroundDependencyLoader] @@ -44,6 +46,7 @@ namespace osu.Game.Tournament.Tests Direction = FillDirection.Vertical, Children = new Drawable[] { + new OsuButton { RelativeSizeAxes = Axes.X, Text = "Drawings", Action = () => setScreen(drawings) }, new OsuButton { RelativeSizeAxes = Axes.X, Text = "TeamIntro", Action = () => setScreen(teamIntro) }, new OsuButton { RelativeSizeAxes = Axes.X, Text = "MapPool", Action = () => setScreen(mapPool) }, new OsuButton { RelativeSizeAxes = Axes.X, Text = "Bracket", Action = () => setScreen(bracket) }, @@ -54,16 +57,19 @@ namespace osu.Game.Tournament.Tests new Container { RelativeSizeAxes = Axes.Both, + RelativePositionAxes = Axes.Both, + X = 0.2f, FillMode = FillMode.Fit, FillAspectRatio = 16/9f, - Anchor = Anchor.TopRight, - Origin = Anchor.TopRight, + Anchor = Anchor.TopLeft, + Origin = Anchor.TopLeft, Size = new Vector2(0.8f, 1), - Masking = true, + //Masking = true, Children = new Drawable[] { new VideoSprite(@"C:\Users\Dean\BG Side Logo - OWC.m4v") { + Loop = true, RelativeSizeAxes = Axes.Both, FillMode = FillMode.Fit, }, @@ -75,7 +81,8 @@ namespace osu.Game.Tournament.Tests bracket = new LadderManager(Ladder), mapPool = new MapPoolScreen(Ladder.Groupings.First(g => g.Name == "Finals")), teamIntro = new TeamIntroScreen(Ladder.Teams.First(t => t.Acronym == "USA"), Ladder.Teams.First(t => t.Acronym == "JPN"), - Ladder.Groupings.First(g => g.Name == "Finals")) + Ladder.Groupings.First(g => g.Name == "Finals")), + drawings = new DrawingsScreen() } }, } diff --git a/osu.Game.Tournament/Screens/Ladder/Components/ProgressionPath.cs b/osu.Game.Tournament/Screens/Ladder/Components/ProgressionPath.cs index 4496430e79..880b2fefa4 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/ProgressionPath.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/ProgressionPath.cs @@ -56,7 +56,7 @@ namespace osu.Game.Tournament.Screens.Ladder.Components var p3 = new Vector2(p2.X, c2.Y); var p4 = new Vector2(c2.X, p3.Y); - Positions = new[] { p1, p2, p3, p4 }.Select(ToLocalSpace).ToList(); + Vertices = new[] { p1, p2, p3, p4 }.Select(ToLocalSpace).ToList(); } } } From 97b32a72f52ccb255e505710c8cde83d5b1ba69c Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 4 Nov 2018 04:59:11 +0900 Subject: [PATCH 070/317] Read and write bracket from storage instead of arbitrary location --- osu.Game.Tournament.Tests/LadderTestCase.cs | 34 ++++++++++++++++----- 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/osu.Game.Tournament.Tests/LadderTestCase.cs b/osu.Game.Tournament.Tests/LadderTestCase.cs index ee8cfb8f8a..ebc78e14be 100644 --- a/osu.Game.Tournament.Tests/LadderTestCase.cs +++ b/osu.Game.Tournament.Tests/LadderTestCase.cs @@ -5,6 +5,7 @@ using System.IO; using Newtonsoft.Json; using osu.Framework.Allocation; using osu.Framework.Graphics; +using osu.Framework.Platform; using osu.Game.Beatmaps; using osu.Game.Graphics.UserInterface; using osu.Game.Online.API; @@ -17,7 +18,10 @@ namespace osu.Game.Tournament.Tests { public abstract class LadderTestCase : OsuTestCase { + private const string bracket_filename = "bracket.json"; + protected LadderInfo Ladder; + private Storage storage; [Resolved] private APIAccess api { get; set; } = null; @@ -26,9 +30,19 @@ namespace osu.Game.Tournament.Tests private RulesetStore rulesets { get; set; } = null; [BackgroundDependencyLoader] - private void load() + private void load(Storage storage) { - Ladder = File.Exists(@"bracket.json") ? JsonConvert.DeserializeObject(File.ReadAllText(@"bracket.json")) : new LadderInfo(); + this.storage = storage; + + string content = null; + if (storage.Exists(bracket_filename)) + { + using (Stream stream = storage.GetStream(bracket_filename, FileAccess.Read, FileMode.Open)) + using (var sr = new StreamReader(stream)) + content = sr.ReadToEnd(); + } + + Ladder = content != null ? JsonConvert.DeserializeObject(content) : new LadderInfo(); bool addedInfo = false; @@ -62,12 +76,16 @@ namespace osu.Game.Tournament.Tests protected virtual void SaveChanges() { - File.WriteAllText(@"bracket.json", JsonConvert.SerializeObject(Ladder, - new JsonSerializerSettings - { - NullValueHandling = NullValueHandling.Ignore, - DefaultValueHandling = DefaultValueHandling.Ignore - })); + using (var stream = storage.GetStream(bracket_filename, FileAccess.Write, FileMode.Create)) + using (var sw = new StreamWriter(stream)) + { + sw.Write(JsonConvert.SerializeObject(Ladder, + new JsonSerializerSettings + { + NullValueHandling = NullValueHandling.Ignore, + DefaultValueHandling = DefaultValueHandling.Ignore + })); + } } } } From 2e348edd8dadbc6f88e45390bae49a0ffdcae66c Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 4 Nov 2018 05:29:06 +0900 Subject: [PATCH 071/317] Fix filename --- .../Screens/TeamIntro/{TeamIntro.cs => TeamIntroScreen.cs} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename osu.Game.Tournament/Screens/TeamIntro/{TeamIntro.cs => TeamIntroScreen.cs} (100%) diff --git a/osu.Game.Tournament/Screens/TeamIntro/TeamIntro.cs b/osu.Game.Tournament/Screens/TeamIntro/TeamIntroScreen.cs similarity index 100% rename from osu.Game.Tournament/Screens/TeamIntro/TeamIntro.cs rename to osu.Game.Tournament/Screens/TeamIntro/TeamIntroScreen.cs From 54a02ee2d7f7bd50455955d6d85d524f53742e02 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 4 Nov 2018 07:12:07 +0900 Subject: [PATCH 072/317] Add showcase screen --- .../TestCaseSceneManager.cs | 4 + osu.Game.Tournament.Tests/TestCaseShowcase.cs | 18 +++ .../Components/TournamentBeatmapPanel.cs | 4 +- .../Screens/Showcase/ShowcaseScreen.cs | 143 ++++++++++++++++++ 4 files changed, 168 insertions(+), 1 deletion(-) create mode 100644 osu.Game.Tournament.Tests/TestCaseShowcase.cs create mode 100644 osu.Game.Tournament/Screens/Showcase/ShowcaseScreen.cs diff --git a/osu.Game.Tournament.Tests/TestCaseSceneManager.cs b/osu.Game.Tournament.Tests/TestCaseSceneManager.cs index 9454a5674c..aec9038356 100644 --- a/osu.Game.Tournament.Tests/TestCaseSceneManager.cs +++ b/osu.Game.Tournament.Tests/TestCaseSceneManager.cs @@ -10,6 +10,7 @@ using osu.Framework.Graphics.Video; using osu.Game.Graphics.UserInterface; using osu.Game.Tournament.Screens.Drawings; using osu.Game.Tournament.Screens.Ladder; +using osu.Game.Tournament.Screens.Showcase; using osu.Game.Tournament.Screens.TeamIntro; using OpenTK; using OpenTK.Graphics; @@ -23,6 +24,7 @@ namespace osu.Game.Tournament.Tests private TeamIntroScreen teamIntro; private DrawingsScreen drawings; private Container screens; + private ShowcaseScreen showcase; [BackgroundDependencyLoader] private void load() @@ -47,6 +49,7 @@ namespace osu.Game.Tournament.Tests Children = new Drawable[] { new OsuButton { RelativeSizeAxes = Axes.X, Text = "Drawings", Action = () => setScreen(drawings) }, + new OsuButton { RelativeSizeAxes = Axes.X, Text = "Showcase", Action = () => setScreen(showcase) }, new OsuButton { RelativeSizeAxes = Axes.X, Text = "TeamIntro", Action = () => setScreen(teamIntro) }, new OsuButton { RelativeSizeAxes = Axes.X, Text = "MapPool", Action = () => setScreen(mapPool) }, new OsuButton { RelativeSizeAxes = Axes.X, Text = "Bracket", Action = () => setScreen(bracket) }, @@ -79,6 +82,7 @@ namespace osu.Game.Tournament.Tests Children = new Drawable[] { bracket = new LadderManager(Ladder), + showcase = new ShowcaseScreen(), mapPool = new MapPoolScreen(Ladder.Groupings.First(g => g.Name == "Finals")), teamIntro = new TeamIntroScreen(Ladder.Teams.First(t => t.Acronym == "USA"), Ladder.Teams.First(t => t.Acronym == "JPN"), Ladder.Groupings.First(g => g.Name == "Finals")), diff --git a/osu.Game.Tournament.Tests/TestCaseShowcase.cs b/osu.Game.Tournament.Tests/TestCaseShowcase.cs new file mode 100644 index 0000000000..66183683d1 --- /dev/null +++ b/osu.Game.Tournament.Tests/TestCaseShowcase.cs @@ -0,0 +1,18 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework.Allocation; +using osu.Game.Tests.Visual; +using osu.Game.Tournament.Screens.Showcase; + +namespace osu.Game.Tournament.Tests +{ + public class TestCaseShowcase : OsuTestCase + { + [BackgroundDependencyLoader] + private void load() + { + Add(new ShowcaseScreen()); + } + } +} diff --git a/osu.Game.Tournament/Components/TournamentBeatmapPanel.cs b/osu.Game.Tournament/Components/TournamentBeatmapPanel.cs index 5eb597a3c6..9542c26faf 100644 --- a/osu.Game.Tournament/Components/TournamentBeatmapPanel.cs +++ b/osu.Game.Tournament/Components/TournamentBeatmapPanel.cs @@ -20,11 +20,13 @@ namespace osu.Game.Tournament.Components private const float horizontal_padding = 10; private const float vertical_padding = 5; + public const float HEIGHT = 50; + public TournamentBeatmapPanel(BeatmapInfo beatmap) { this.beatmap = beatmap; Width = 400; - Height = 50; + Height = HEIGHT; } [BackgroundDependencyLoader] diff --git a/osu.Game.Tournament/Screens/Showcase/ShowcaseScreen.cs b/osu.Game.Tournament/Screens/Showcase/ShowcaseScreen.cs new file mode 100644 index 0000000000..7585ad4078 --- /dev/null +++ b/osu.Game.Tournament/Screens/Showcase/ShowcaseScreen.cs @@ -0,0 +1,143 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework.Allocation; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Shapes; +using osu.Game.Beatmaps; +using osu.Game.Graphics; +using osu.Game.Graphics.Sprites; +using osu.Game.Online.API; +using osu.Game.Online.API.Requests; +using osu.Game.Online.API.Requests.Responses; +using osu.Game.Rulesets; +using osu.Game.Screens; +using osu.Game.Screens.Menu; +using osu.Game.Tournament.Components; +using OpenTK; + +namespace osu.Game.Tournament.Screens.Showcase +{ + public class ShowcaseScreen : OsuScreen + { + private readonly Container panelContainer; + + [Resolved] + private APIAccess api { get; set; } = null; + + [Resolved] + private RulesetStore rulesets { get; set; } = null; + + [BackgroundDependencyLoader] + private void load() + { + var req = new GetBeatmapRequest(new BeatmapInfo { OnlineBeatmapID = 1091460 }); + req.Success += success; + api.Queue(req); + } + + private void success(APIBeatmap apiBeatmap) + { + var beatmap = apiBeatmap.ToBeatmap(rulesets); + panelContainer.Children = new Drawable[] + { + new OsuSpriteText + { + Text = $"Length {beatmap.OnlineInfo.Length}s", + Margin = new MarginPadding { Horizontal = 15, Vertical = 5 }, + Colour = OsuColour.Gray(0.33f), + Anchor = Anchor.TopLeft, + Origin = Anchor.TopLeft, + }, + new OsuSpriteText + { + Text = $"BPM {beatmap.BeatmapSet.OnlineInfo.BPM:0.#}", + Margin = new MarginPadding { Horizontal = 15, Vertical = 5 }, + Colour = OsuColour.Gray(0.33f), + Anchor = Anchor.BottomLeft, + Origin = Anchor.BottomLeft + }, + new OsuSpriteText + { + Text = $"AR {beatmap.BaseDifficulty.ApproachRate:0.#}", + Margin = new MarginPadding { Horizontal = 15, Vertical = 5 }, + Colour = OsuColour.Gray(0.33f), + Anchor = Anchor.TopRight, + Origin = Anchor.TopRight + }, + new OsuSpriteText + { + Text = $"Star Rating {beatmap.StarDifficulty:0.#}", + Margin = new MarginPadding { Horizontal = 15, Vertical = 5 }, + Colour = OsuColour.Gray(0.33f), + Anchor = Anchor.BottomRight, + Origin = Anchor.BottomRight + }, + new TournamentBeatmapPanel(beatmap) + { + Anchor = Anchor.Centre, + Origin = Anchor.Centre + } + }; + } + + public ShowcaseScreen() + { + RelativeSizeAxes = Axes.Both; + + Children = new Drawable[] + { + new Container + { + Masking = true, + RelativeSizeAxes = Axes.X, + Anchor = Anchor.BottomCentre, + Origin = Anchor.BottomCentre, + Y = -10, + Width = 0.9f, + Height = TournamentBeatmapPanel.HEIGHT, + CornerRadius = TournamentBeatmapPanel.HEIGHT / 2, + Children = new Drawable[] + { + new Box + { + RelativeSizeAxes = Axes.Both, + Colour = OsuColour.Gray(0.93f), + }, + new Container + { + Masking = true, + CornerRadius = TournamentBeatmapPanel.HEIGHT / 2, + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + RelativeSizeAxes = Axes.Both, + Width = 0.7f, + Children = new Drawable[] + { + new Box + { + RelativeSizeAxes = Axes.Both, + Colour = OsuColour.Gray(0.86f), + }, + panelContainer = new Container + { + RelativeSizeAxes = Axes.Both, + } + } + }, + new OsuLogo() + { + Triangles = false, + Colour = OsuColour.Gray(0.33f), + Scale = new Vector2(0.08f), + Margin = new MarginPadding(50), + Anchor = Anchor.CentreRight, + Origin = Anchor.CentreRight, + } + } + } + }; + } + } +} From 89a1414c635d39261a6c65090086b63bb65bdbe3 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 4 Nov 2018 21:14:16 +0900 Subject: [PATCH 073/317] Read flag name from file --- .../Screens/Drawings/Components/StorageBackedTeamList.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/osu.Game.Tournament/Screens/Drawings/Components/StorageBackedTeamList.cs b/osu.Game.Tournament/Screens/Drawings/Components/StorageBackedTeamList.cs index 625f05edac..fa7ce5edfa 100644 --- a/osu.Game.Tournament/Screens/Drawings/Components/StorageBackedTeamList.cs +++ b/osu.Game.Tournament/Screens/Drawings/Components/StorageBackedTeamList.cs @@ -51,7 +51,8 @@ namespace osu.Game.Tournament.Screens.Drawings.Components teams.Add(new TournamentTeam { FullName = split[1].Trim(), - Acronym = split.Length >= 3 ? split[2].Trim() : null + Acronym = split.Length >= 3 ? split[2].Trim() : null, + FlagName = split[0].Trim() }); } } From 7e092c608400fab60c139b1dab4d24c01ab07bf5 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 4 Nov 2018 21:15:02 +0900 Subject: [PATCH 074/317] Read videos from storage --- .../TestCaseSceneManager.cs | 5 +++-- .../Screens/Drawings/DrawingsScreen.cs | 2 +- .../Screens/Showcase/ShowcaseScreen.cs | 2 +- .../Screens/TeamIntro/TeamIntroScreen.cs | 16 +++++++++++++++- 4 files changed, 20 insertions(+), 5 deletions(-) diff --git a/osu.Game.Tournament.Tests/TestCaseSceneManager.cs b/osu.Game.Tournament.Tests/TestCaseSceneManager.cs index aec9038356..32a47e2c19 100644 --- a/osu.Game.Tournament.Tests/TestCaseSceneManager.cs +++ b/osu.Game.Tournament.Tests/TestCaseSceneManager.cs @@ -7,6 +7,7 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Video; +using osu.Framework.Platform; using osu.Game.Graphics.UserInterface; using osu.Game.Tournament.Screens.Drawings; using osu.Game.Tournament.Screens.Ladder; @@ -27,7 +28,7 @@ namespace osu.Game.Tournament.Tests private ShowcaseScreen showcase; [BackgroundDependencyLoader] - private void load() + private void load(Storage storage) { Children = new Drawable[] { @@ -70,7 +71,7 @@ namespace osu.Game.Tournament.Tests //Masking = true, Children = new Drawable[] { - new VideoSprite(@"C:\Users\Dean\BG Side Logo - OWC.m4v") + new VideoSprite(storage.GetStream(@"BG Side Logo - OWC.m4v")) { Loop = true, RelativeSizeAxes = Axes.Both, diff --git a/osu.Game.Tournament/Screens/Drawings/DrawingsScreen.cs b/osu.Game.Tournament/Screens/Drawings/DrawingsScreen.cs index 38f0be0d5a..625d881bdb 100644 --- a/osu.Game.Tournament/Screens/Drawings/DrawingsScreen.cs +++ b/osu.Game.Tournament/Screens/Drawings/DrawingsScreen.cs @@ -88,7 +88,7 @@ namespace osu.Game.Tournament.Screens.Drawings RelativeSizeAxes = Axes.Both, Children = new Drawable[] { - new VideoSprite(@"C:\Users\Dean\BG Logoless - OWC.m4v") + new VideoSprite(storage.GetStream("BG Logoless - OWC.m4v")) { RelativeSizeAxes = Axes.Both, Loop = true, diff --git a/osu.Game.Tournament/Screens/Showcase/ShowcaseScreen.cs b/osu.Game.Tournament/Screens/Showcase/ShowcaseScreen.cs index 7585ad4078..81ecd45746 100644 --- a/osu.Game.Tournament/Screens/Showcase/ShowcaseScreen.cs +++ b/osu.Game.Tournament/Screens/Showcase/ShowcaseScreen.cs @@ -126,7 +126,7 @@ namespace osu.Game.Tournament.Screens.Showcase } } }, - new OsuLogo() + new OsuLogo { Triangles = false, Colour = OsuColour.Gray(0.33f), diff --git a/osu.Game.Tournament/Screens/TeamIntro/TeamIntroScreen.cs b/osu.Game.Tournament/Screens/TeamIntro/TeamIntroScreen.cs index 766feaa806..2c50970624 100644 --- a/osu.Game.Tournament/Screens/TeamIntro/TeamIntroScreen.cs +++ b/osu.Game.Tournament/Screens/TeamIntro/TeamIntroScreen.cs @@ -2,9 +2,11 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; +using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Video; +using osu.Framework.Platform; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; using osu.Game.Screens; @@ -17,13 +19,25 @@ namespace osu.Game.Tournament.Screens.TeamIntro { public class TeamIntroScreen : OsuScreen { + private readonly TournamentTeam team1; + private readonly TournamentTeam team2; + private readonly TournamentGrouping round; + public TeamIntroScreen(TournamentTeam team1, TournamentTeam team2, TournamentGrouping round) + { + this.team1 = team1; + this.team2 = team2; + this.round = round; + } + + [BackgroundDependencyLoader] + private void load(Storage storage) { RelativeSizeAxes = Axes.Both; InternalChildren = new Drawable[] { - new VideoSprite(@"C:\Users\Dean\BG Team - Both OWC.m4v") + new VideoSprite(storage.GetStream(@"BG Team - Both OWC.m4v")) { RelativeSizeAxes = Axes.Both, Loop = true, From c7e5ae0573820149efc327a94f63d79e7fcc03e4 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 4 Nov 2018 21:25:45 +0900 Subject: [PATCH 075/317] Read from stable --- .../Screens/Showcase/ShowcaseScreen.cs | 124 ++++++++++++++++-- 1 file changed, 112 insertions(+), 12 deletions(-) diff --git a/osu.Game.Tournament/Screens/Showcase/ShowcaseScreen.cs b/osu.Game.Tournament/Screens/Showcase/ShowcaseScreen.cs index 81ecd45746..95d11e2143 100644 --- a/osu.Game.Tournament/Screens/Showcase/ShowcaseScreen.cs +++ b/osu.Game.Tournament/Screens/Showcase/ShowcaseScreen.cs @@ -1,11 +1,15 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using System; +using System.IO; using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; +using osu.Framework.Platform.Windows; using osu.Game.Beatmaps; +using osu.Game.Beatmaps.Legacy; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; using osu.Game.Online.API; @@ -21,7 +25,8 @@ namespace osu.Game.Tournament.Screens.Showcase { public class ShowcaseScreen : OsuScreen { - private readonly Container panelContainer; + private Container panel; + private readonly Container panelContents; [Resolved] private APIAccess api { get; set; } = null; @@ -29,22 +34,78 @@ namespace osu.Game.Tournament.Screens.Showcase [Resolved] private RulesetStore rulesets { get; set; } = null; + private int lastBeatmapId; + private int lastMods; + [BackgroundDependencyLoader] private void load() { - var req = new GetBeatmapRequest(new BeatmapInfo { OnlineBeatmapID = 1091460 }); - req.Success += success; - api.Queue(req); + var stable = new StableStorage(); + + const string file_ipc_filename = "ipc.txt"; + + if (stable.Exists(file_ipc_filename)) + { + Scheduler.AddDelayed(delegate + { + try + { + using (var stream = stable.GetStream(file_ipc_filename)) + using (var sr = new StreamReader(stream)) + { + var beatmapId = int.Parse(sr.ReadLine()); + var mods = int.Parse(sr.ReadLine()); + + if (lastBeatmapId == beatmapId) + return; + + lastMods = mods; + lastBeatmapId = beatmapId; + + var req = new GetBeatmapRequest(new BeatmapInfo { OnlineBeatmapID = beatmapId }); + req.Success += success; + api.Queue(req); + } + } + catch + { + // file might be in use. + } + }, 250, true); + } } private void success(APIBeatmap apiBeatmap) { + panel.FadeInFromZero(300, Easing.OutQuint); + var beatmap = apiBeatmap.ToBeatmap(rulesets); - panelContainer.Children = new Drawable[] + + var legacyMods = (LegacyMods)lastMods; + var bpm = beatmap.BeatmapSet.OnlineInfo.BPM; + var length = beatmap.OnlineInfo.Length; + string extra = ""; + + var ar = beatmap.BaseDifficulty.ApproachRate; + if ((legacyMods & LegacyMods.HardRock) > 0) + { + //ar *= 1.4f; + extra = "*"; + } + + if ((legacyMods & LegacyMods.DoubleTime) > 0) + { + //ar *= 1.5f; + bpm *= 1.5f; + length /= 1.5f; + extra = "*"; + } + + panelContents.Children = new Drawable[] { new OsuSpriteText { - Text = $"Length {beatmap.OnlineInfo.Length}s", + Text = $"Length {length}s", Margin = new MarginPadding { Horizontal = 15, Vertical = 5 }, Colour = OsuColour.Gray(0.33f), Anchor = Anchor.TopLeft, @@ -52,7 +113,7 @@ namespace osu.Game.Tournament.Screens.Showcase }, new OsuSpriteText { - Text = $"BPM {beatmap.BeatmapSet.OnlineInfo.BPM:0.#}", + Text = $"BPM {bpm:0.#}", Margin = new MarginPadding { Horizontal = 15, Vertical = 5 }, Colour = OsuColour.Gray(0.33f), Anchor = Anchor.BottomLeft, @@ -60,7 +121,7 @@ namespace osu.Game.Tournament.Screens.Showcase }, new OsuSpriteText { - Text = $"AR {beatmap.BaseDifficulty.ApproachRate:0.#}", + Text = $"AR {ar:0.#}{extra}", Margin = new MarginPadding { Horizontal = 15, Vertical = 5 }, Colour = OsuColour.Gray(0.33f), Anchor = Anchor.TopRight, @@ -68,7 +129,7 @@ namespace osu.Game.Tournament.Screens.Showcase }, new OsuSpriteText { - Text = $"Star Rating {beatmap.StarDifficulty:0.#}", + Text = $"Star Rating {beatmap.StarDifficulty:0.#}{extra}", Margin = new MarginPadding { Horizontal = 15, Vertical = 5 }, Colour = OsuColour.Gray(0.33f), Anchor = Anchor.BottomRight, @@ -95,7 +156,7 @@ namespace osu.Game.Tournament.Screens.Showcase Anchor = Anchor.BottomCentre, Origin = Anchor.BottomCentre, Y = -10, - Width = 0.9f, + Width = 0.95f, Height = TournamentBeatmapPanel.HEIGHT, CornerRadius = TournamentBeatmapPanel.HEIGHT / 2, Children = new Drawable[] @@ -105,7 +166,7 @@ namespace osu.Game.Tournament.Screens.Showcase RelativeSizeAxes = Axes.Both, Colour = OsuColour.Gray(0.93f), }, - new Container + panel = new Container { Masking = true, CornerRadius = TournamentBeatmapPanel.HEIGHT / 2, @@ -120,7 +181,7 @@ namespace osu.Game.Tournament.Screens.Showcase RelativeSizeAxes = Axes.Both, Colour = OsuColour.Gray(0.86f), }, - panelContainer = new Container + panelContents = new Container { RelativeSizeAxes = Axes.Both, } @@ -139,5 +200,44 @@ namespace osu.Game.Tournament.Screens.Showcase } }; } + + /// + /// A method of accessing an osu-stable install in a controlled fashion. + /// + private class StableStorage : WindowsStorage + { + protected override string LocateBasePath() + { + bool checkExists(string p) => Directory.Exists(Path.Combine(p, "Songs")); + + string stableInstallPath; + + try + { + stableInstallPath = "E:\\osu!mappool"; + + if (checkExists(stableInstallPath)) + return stableInstallPath; + } + catch + { + } + + stableInstallPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), @"osu!"); + if (checkExists(stableInstallPath)) + return stableInstallPath; + + stableInstallPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".osu"); + if (checkExists(stableInstallPath)) + return stableInstallPath; + + return null; + } + + public StableStorage() + : base(string.Empty, null) + { + } + } } } From fb93aea909383075518ddf2393dc17454443356a Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 5 Nov 2018 23:15:30 +0900 Subject: [PATCH 076/317] Use logo-less video by default --- osu.Game.Tournament.Tests/TestCaseSceneManager.cs | 3 ++- osu.Game.Tournament/Screens/Drawings/DrawingsScreen.cs | 6 ------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/osu.Game.Tournament.Tests/TestCaseSceneManager.cs b/osu.Game.Tournament.Tests/TestCaseSceneManager.cs index 32a47e2c19..13c00f081a 100644 --- a/osu.Game.Tournament.Tests/TestCaseSceneManager.cs +++ b/osu.Game.Tournament.Tests/TestCaseSceneManager.cs @@ -71,9 +71,10 @@ namespace osu.Game.Tournament.Tests //Masking = true, Children = new Drawable[] { - new VideoSprite(storage.GetStream(@"BG Side Logo - OWC.m4v")) + new VideoSprite(storage.GetStream("BG Logoless - OWC.m4v")) { Loop = true, + ShowLastFrameDuringHideCutoff = true, RelativeSizeAxes = Axes.Both, FillMode = FillMode.Fit, }, diff --git a/osu.Game.Tournament/Screens/Drawings/DrawingsScreen.cs b/osu.Game.Tournament/Screens/Drawings/DrawingsScreen.cs index 625d881bdb..9e8074d7dc 100644 --- a/osu.Game.Tournament/Screens/Drawings/DrawingsScreen.cs +++ b/osu.Game.Tournament/Screens/Drawings/DrawingsScreen.cs @@ -12,7 +12,6 @@ using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Textures; -using osu.Framework.Graphics.Video; using osu.Framework.IO.Stores; using osu.Framework.Logging; using osu.Framework.Platform; @@ -88,11 +87,6 @@ namespace osu.Game.Tournament.Screens.Drawings RelativeSizeAxes = Axes.Both, Children = new Drawable[] { - new VideoSprite(storage.GetStream("BG Logoless - OWC.m4v")) - { - RelativeSizeAxes = Axes.Both, - Loop = true, - }, new Sprite { RelativeSizeAxes = Axes.Both, From 9c5eddea549cfcac278714a1b24296bcfae46646 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 6 Nov 2018 14:49:09 +0900 Subject: [PATCH 077/317] Allow running tournament tools from main executable --- osu.Desktop/Program.cs | 4 + osu.Desktop/osu.Desktop.csproj | 1 + osu.Game.Tournament.Tests/TestCaseMapPool.cs | 33 +---- .../TestCaseSceneManager.cs | 97 +-------------- .../Screens/MapPool/MapPoolScreen.cs | 35 ++++++ .../Screens/TournamentSceneManager.cs | 113 ++++++++++++++++++ osu.Game.Tournament/TournamentGame.cs | 99 +++++++++++++++ osu.Game/OsuGameBase.cs | 12 +- 8 files changed, 262 insertions(+), 132 deletions(-) create mode 100644 osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs create mode 100644 osu.Game.Tournament/Screens/TournamentSceneManager.cs create mode 100644 osu.Game.Tournament/TournamentGame.cs diff --git a/osu.Desktop/Program.cs b/osu.Desktop/Program.cs index 257155478f..b864cf3c64 100644 --- a/osu.Desktop/Program.cs +++ b/osu.Desktop/Program.cs @@ -11,6 +11,7 @@ using osu.Framework.Development; using osu.Framework.Logging; using osu.Framework.Platform; using osu.Game.IPC; +using osu.Game.Tournament; namespace osu.Desktop { @@ -45,6 +46,9 @@ namespace osu.Desktop default: host.Run(new OsuGameDesktop(args)); break; + case "--tournament": + host.Run(new TournamentGame()); + break; } } diff --git a/osu.Desktop/osu.Desktop.csproj b/osu.Desktop/osu.Desktop.csproj index e1e59804e5..a3e7625c44 100644 --- a/osu.Desktop/osu.Desktop.csproj +++ b/osu.Desktop/osu.Desktop.csproj @@ -17,6 +17,7 @@ osu.Desktop.Program + diff --git a/osu.Game.Tournament.Tests/TestCaseMapPool.cs b/osu.Game.Tournament.Tests/TestCaseMapPool.cs index e4637b8fc3..1101d2828a 100644 --- a/osu.Game.Tournament.Tests/TestCaseMapPool.cs +++ b/osu.Game.Tournament.Tests/TestCaseMapPool.cs @@ -3,12 +3,7 @@ using System.Linq; using osu.Framework.Allocation; -using osu.Framework.Graphics; -using osu.Framework.Graphics.Containers; -using osu.Game.Screens; -using osu.Game.Tournament.Components; -using osu.Game.Tournament.Screens.Ladder.Components; -using OpenTK; +using osu.Game.Tournament.Screens.MapPool; namespace osu.Game.Tournament.Tests { @@ -23,30 +18,4 @@ namespace osu.Game.Tournament.Tests Add(new MapPoolScreen(round)); } } - - public class MapPoolScreen : OsuScreen - { - public MapPoolScreen(TournamentGrouping round) - { - FillFlowContainer maps; - - InternalChildren = new Drawable[] - { - maps = new FillFlowContainer - { - Spacing = new Vector2(20), - Padding = new MarginPadding(50), - Direction = FillDirection.Full, - RelativeSizeAxes = Axes.Both, - } - }; - - foreach (var b in round.Beatmaps) - maps.Add(new TournamentBeatmapPanel(b.BeatmapInfo) - { - Anchor = Anchor.TopCentre, - Origin = Anchor.TopCentre, - }); - } - } } diff --git a/osu.Game.Tournament.Tests/TestCaseSceneManager.cs b/osu.Game.Tournament.Tests/TestCaseSceneManager.cs index 62e5f77802..9853e31ee3 100644 --- a/osu.Game.Tournament.Tests/TestCaseSceneManager.cs +++ b/osu.Game.Tournament.Tests/TestCaseSceneManager.cs @@ -1,111 +1,18 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using System.Linq; using osu.Framework.Allocation; -using osu.Framework.Graphics; -using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Shapes; -using osu.Framework.Graphics.Video; using osu.Framework.Platform; -using osu.Game.Graphics.UserInterface; -using osu.Game.Tournament.Screens.Drawings; -using osu.Game.Tournament.Screens.Ladder; -using osu.Game.Tournament.Screens.Showcase; -using osu.Game.Tournament.Screens.TeamIntro; -using OpenTK; -using OpenTK.Graphics; +using osu.Game.Tournament.Screens; namespace osu.Game.Tournament.Tests { public class TestCaseSceneManager : LadderTestCase { - private LadderManager bracket; - private MapPoolScreen mapPool; - private TeamIntroScreen teamIntro; - private DrawingsScreen drawings; - private Container screens; - private ShowcaseScreen showcase; - [BackgroundDependencyLoader] private void load(Storage storage) { - Children = new Drawable[] - { - new Container - { - RelativeSizeAxes = Axes.Both, - Width = 0.2f, - Children = new Drawable[] - { - new Box - { - Colour = Color4.Black, - RelativeSizeAxes = Axes.Both, - }, - new FillFlowContainer - { - RelativeSizeAxes = Axes.Both, - Direction = FillDirection.Vertical, - Children = new Drawable[] - { - new OsuButton { RelativeSizeAxes = Axes.X, Text = "Drawings", Action = () => setScreen(drawings) }, - new OsuButton { RelativeSizeAxes = Axes.X, Text = "Showcase", Action = () => setScreen(showcase) }, - new OsuButton { RelativeSizeAxes = Axes.X, Text = "TeamIntro", Action = () => setScreen(teamIntro) }, - new OsuButton { RelativeSizeAxes = Axes.X, Text = "MapPool", Action = () => setScreen(mapPool) }, - new OsuButton { RelativeSizeAxes = Axes.X, Text = "Bracket", Action = () => setScreen(bracket) }, - } - }, - }, - }, - new Container - { - RelativeSizeAxes = Axes.Both, - RelativePositionAxes = Axes.Both, - X = 0.2f, - FillMode = FillMode.Fit, - FillAspectRatio = 16/9f, - Anchor = Anchor.TopLeft, - Origin = Anchor.TopLeft, - Size = new Vector2(0.8f, 1), - //Masking = true, - Children = new Drawable[] - { - new VideoSprite(storage.GetStream("BG Logoless - OWC.m4v")) - { - Loop = true, - RelativeSizeAxes = Axes.Both, - FillMode = FillMode.Fit, - }, - screens = new Container - { - RelativeSizeAxes = Axes.Both, - Children = new Drawable[] - { - bracket = new LadderManager(Ladder), - showcase = new ShowcaseScreen(), - mapPool = new MapPoolScreen(Ladder.Groupings.First(g => g.Name == "Finals")), - teamIntro = new TeamIntroScreen(Ladder.Teams.First(t => t.Acronym == "USA"), Ladder.Teams.First(t => t.Acronym == "JPN"), - Ladder.Groupings.First(g => g.Name == "Finals")), - drawings = new DrawingsScreen() - } - }, - } - }, - }; - - setScreen(teamIntro); - } - - private void setScreen(Drawable screen) - { - foreach (var s in screens.Children) - { - if (s == screen) - s.FadeIn(100); - else - s.FadeOut(100); - } + Add(new TournamentSceneManager()); } } } diff --git a/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs b/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs new file mode 100644 index 0000000000..be7b3a0b3b --- /dev/null +++ b/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs @@ -0,0 +1,35 @@ +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Game.Screens; +using osu.Game.Tournament.Components; +using osu.Game.Tournament.Screens.Ladder.Components; +using OpenTK; + +namespace osu.Game.Tournament.Screens.MapPool +{ + public class MapPoolScreen : OsuScreen + { + public MapPoolScreen(TournamentGrouping round) + { + FillFlowContainer maps; + + InternalChildren = new Drawable[] + { + maps = new FillFlowContainer + { + Spacing = new Vector2(20), + Padding = new MarginPadding(50), + Direction = FillDirection.Full, + RelativeSizeAxes = Axes.Both, + } + }; + + foreach (var b in round.Beatmaps) + maps.Add(new TournamentBeatmapPanel(b.BeatmapInfo) + { + Anchor = Anchor.TopCentre, + Origin = Anchor.TopCentre, + }); + } + } +} diff --git a/osu.Game.Tournament/Screens/TournamentSceneManager.cs b/osu.Game.Tournament/Screens/TournamentSceneManager.cs new file mode 100644 index 0000000000..82f17a85c4 --- /dev/null +++ b/osu.Game.Tournament/Screens/TournamentSceneManager.cs @@ -0,0 +1,113 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System.Linq; +using osu.Framework.Allocation; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Shapes; +using osu.Framework.Graphics.Video; +using osu.Framework.Platform; +using osu.Game.Graphics.UserInterface; +using osu.Game.Screens; +using osu.Game.Tournament.Screens.Drawings; +using osu.Game.Tournament.Screens.Ladder; +using osu.Game.Tournament.Screens.Ladder.Components; +using osu.Game.Tournament.Screens.MapPool; +using osu.Game.Tournament.Screens.Showcase; +using osu.Game.Tournament.Screens.TeamIntro; +using OpenTK; +using OpenTK.Graphics; + +namespace osu.Game.Tournament.Screens +{ + public class TournamentSceneManager : OsuScreen + { + private LadderManager bracket; + private MapPoolScreen mapPool; + private TeamIntroScreen teamIntro; + private DrawingsScreen drawings; + private Container screens; + private ShowcaseScreen showcase; + + [BackgroundDependencyLoader] + private void load(LadderInfo ladder, Storage storage) + { + Children = new Drawable[] + { + new Container + { + RelativeSizeAxes = Axes.Y, + Width = 200, + Children = new Drawable[] + { + new Box + { + Colour = Color4.Black, + RelativeSizeAxes = Axes.Both, + }, + new FillFlowContainer + { + RelativeSizeAxes = Axes.Both, + Direction = FillDirection.Vertical, + Children = new Drawable[] + { + new OsuButton { RelativeSizeAxes = Axes.X, Text = "Drawings", Action = () => setScreen(drawings) }, + new OsuButton { RelativeSizeAxes = Axes.X, Text = "Showcase", Action = () => setScreen(showcase) }, + new OsuButton { RelativeSizeAxes = Axes.X, Text = "TeamIntro", Action = () => setScreen(teamIntro) }, + new OsuButton { RelativeSizeAxes = Axes.X, Text = "MapPool", Action = () => setScreen(mapPool) }, + new OsuButton { RelativeSizeAxes = Axes.X, Text = "Bracket", Action = () => setScreen(bracket) }, + } + }, + }, + }, + new Container + { + RelativeSizeAxes = Axes.Both, + X = 200, + FillMode = FillMode.Fit, + FillAspectRatio = 16/9f, + Anchor = Anchor.TopLeft, + Origin = Anchor.TopLeft, + Size = new Vector2(0.8f, 1), + //Masking = true, + Children = new Drawable[] + { + new VideoSprite(storage.GetStream("BG Logoless - OWC.m4v")) + { + Loop = true, + RelativeSizeAxes = Axes.Both, + FillMode = FillMode.Fit, + }, + screens = new Container + { + RelativeSizeAxes = Axes.Both, + Children = new Drawable[] + { + bracket = new LadderManager(ladder), + showcase = new ShowcaseScreen(), + mapPool = new MapPoolScreen(ladder.Groupings.First(g => g.Name == "Finals")), + teamIntro = new TeamIntroScreen(ladder.Teams.First(t => t.Acronym == "USA"), ladder.Teams.First(t => t.Acronym == "JPN"), + ladder.Groupings.First(g => g.Name == "Finals")), + drawings = new DrawingsScreen() + } + }, + } + }, + }; + + setScreen(teamIntro); + } + + private void setScreen(Drawable screen) + { + foreach (var s in screens.Children) + { + if (s == screen) + s.FadeIn(100); + else + s.FadeOut(100); + } + } + } +} diff --git a/osu.Game.Tournament/TournamentGame.cs b/osu.Game.Tournament/TournamentGame.cs new file mode 100644 index 0000000000..1bbbfdc37a --- /dev/null +++ b/osu.Game.Tournament/TournamentGame.cs @@ -0,0 +1,99 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System.IO; +using Newtonsoft.Json; +using osu.Framework.Allocation; +using osu.Framework.Configuration; +using osu.Framework.Graphics; +using osu.Framework.Platform; +using osu.Game.Beatmaps; +using osu.Game.Graphics.UserInterface; +using osu.Game.Online.API.Requests; +using osu.Game.Rulesets; +using osu.Game.Tournament.Screens; +using osu.Game.Tournament.Screens.Ladder.Components; + +namespace osu.Game.Tournament +{ + public class TournamentGame : OsuGameBase + { + private const string bracket_filename = "bracket.json"; + + protected LadderInfo Ladder; + private Storage storage; + + private DependencyContainer dependencies; + + [Cached] + private readonly Bindable ruleset = new Bindable(); + + protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnlyDependencyContainer parent) => dependencies = new DependencyContainer(base.CreateChildDependencies(parent)); + + [BackgroundDependencyLoader] + private void load(Storage storage) + { + this.storage = storage; + + string content = null; + if (storage.Exists(bracket_filename)) + { + using (Stream stream = storage.GetStream(bracket_filename, FileAccess.Read, FileMode.Open)) + using (var sr = new StreamReader(stream)) + content = sr.ReadToEnd(); + } + + Ladder = content != null ? JsonConvert.DeserializeObject(content) : new LadderInfo(); + dependencies.Cache(Ladder); + + bool addedInfo = false; + + foreach (var g in Ladder.Groupings) + foreach (var b in g.Beatmaps) + { + if (b.BeatmapInfo == null) + { + var req = new GetBeatmapRequest(new BeatmapInfo { OnlineBeatmapID = b.ID }); + req.Success += i => b.BeatmapInfo = i.ToBeatmap(RulesetStore); + req.Perform(API); + + addedInfo = true; + } + } + + if (addedInfo) + SaveChanges(); + + Add(new OsuButton + { + Text = "Save Changes", + Width = 140, + Height = 50, + Anchor = Anchor.BottomRight, + Origin = Anchor.BottomRight, + Padding = new MarginPadding(10), + Action = SaveChanges, + }); + } + + protected override void LoadComplete() + { + base.LoadComplete(); + Add(new TournamentSceneManager()); + } + + protected virtual void SaveChanges() + { + using (var stream = storage.GetStream(bracket_filename, FileAccess.Write, FileMode.Create)) + using (var sw = new StreamWriter(stream)) + { + sw.Write(JsonConvert.SerializeObject(Ladder, + new JsonSerializerSettings + { + NullValueHandling = NullValueHandling.Ignore, + DefaultValueHandling = DefaultValueHandling.Ignore + })); + } + } + } +} diff --git a/osu.Game/OsuGameBase.cs b/osu.Game/OsuGameBase.cs index 73c970ce5d..ea1dbfa369 100644 --- a/osu.Game/OsuGameBase.cs +++ b/osu.Game/OsuGameBase.cs @@ -62,6 +62,8 @@ namespace osu.Game protected MenuCursorContainer MenuCursorContainer; + protected APIAccess API; + private Container content; protected override Container Content => content; @@ -146,14 +148,14 @@ namespace osu.Game dependencies.Cache(SkinManager = new SkinManager(Host.Storage, contextFactory, Host, Audio)); dependencies.CacheAs(SkinManager); - var api = new APIAccess(LocalConfig); + API = new APIAccess(LocalConfig); - dependencies.Cache(api); - dependencies.CacheAs(api); + dependencies.Cache(API); + dependencies.CacheAs(API); dependencies.Cache(RulesetStore = new RulesetStore(contextFactory)); dependencies.Cache(FileStore = new FileStore(contextFactory, Host.Storage)); - dependencies.Cache(BeatmapManager = new BeatmapManager(Host.Storage, contextFactory, RulesetStore, api, Audio, Host)); + dependencies.Cache(BeatmapManager = new BeatmapManager(Host.Storage, contextFactory, RulesetStore, API, Audio, Host)); dependencies.Cache(ScoreStore = new ScoreStore(contextFactory, Host, BeatmapManager, RulesetStore)); dependencies.Cache(KeyBindingStore = new KeyBindingStore(contextFactory, RulesetStore)); dependencies.Cache(SettingsStore = new SettingsStore(contextFactory)); @@ -177,7 +179,7 @@ namespace osu.Game FileStore.Cleanup(); - AddInternal(api); + AddInternal(API); GlobalActionContainer globalBinding; From 6f2554873714d10c8c09057cdccff0a7690f0e87 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 6 Nov 2018 14:49:20 +0900 Subject: [PATCH 078/317] Remove now unnecessary null setters --- osu.Game.Tournament.Tests/LadderTestCase.cs | 4 ++-- osu.Game.Tournament.Tests/TestCaseBeatmapPanel.cs | 4 ++-- .../Screens/Ladder/Components/DrawableMatchPairing.cs | 2 +- .../Screens/Ladder/Components/DrawableMatchTeam.cs | 2 +- .../Screens/Ladder/Components/LadderEditorSettings.cs | 2 +- osu.Game.Tournament/Screens/Showcase/ShowcaseScreen.cs | 6 +++--- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/osu.Game.Tournament.Tests/LadderTestCase.cs b/osu.Game.Tournament.Tests/LadderTestCase.cs index ebc78e14be..7c8d8856e6 100644 --- a/osu.Game.Tournament.Tests/LadderTestCase.cs +++ b/osu.Game.Tournament.Tests/LadderTestCase.cs @@ -24,10 +24,10 @@ namespace osu.Game.Tournament.Tests private Storage storage; [Resolved] - private APIAccess api { get; set; } = null; + private APIAccess api { get; set; } [Resolved] - private RulesetStore rulesets { get; set; } = null; + private RulesetStore rulesets { get; set; } [BackgroundDependencyLoader] private void load(Storage storage) diff --git a/osu.Game.Tournament.Tests/TestCaseBeatmapPanel.cs b/osu.Game.Tournament.Tests/TestCaseBeatmapPanel.cs index 93068f6224..de80d36067 100644 --- a/osu.Game.Tournament.Tests/TestCaseBeatmapPanel.cs +++ b/osu.Game.Tournament.Tests/TestCaseBeatmapPanel.cs @@ -18,10 +18,10 @@ namespace osu.Game.Tournament.Tests public class TestCaseBeatmapPanel : OsuTestCase { [Resolved] - private APIAccess api { get; set; } = null; + private APIAccess api { get; set; } [Resolved] - private RulesetStore rulesets { get; set; } = null; + private RulesetStore rulesets { get; set; } public override IReadOnlyList RequiredTypes => new[] { diff --git a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs index 1f58bc86ea..81b3223ea7 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs @@ -23,7 +23,7 @@ namespace osu.Game.Tournament.Screens.Ladder.Components private Bindable globalSelection; [Resolved(CanBeNull = true)] - private LadderEditorInfo editorInfo { get; set; } = null; + private LadderEditorInfo editorInfo { get; set; } public DrawableMatchPairing(MatchPairing pairing) { diff --git a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs index dca8d0f0a8..70ddb6b664 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs @@ -37,7 +37,7 @@ namespace osu.Game.Tournament.Screens.Ladder.Components private LadderManager manager; [Resolved(CanBeNull = true)] - private LadderEditorInfo editorInfo { get; set; } = null; + private LadderEditorInfo editorInfo { get; set; } public DrawableMatchTeam(Bindable team, MatchPairing pairing, bool losers) : base(team) diff --git a/osu.Game.Tournament/Screens/Ladder/Components/LadderEditorSettings.cs b/osu.Game.Tournament/Screens/Ladder/Components/LadderEditorSettings.cs index 95067e8803..d7b827237a 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/LadderEditorSettings.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/LadderEditorSettings.cs @@ -26,7 +26,7 @@ namespace osu.Game.Tournament.Screens.Ladder.Components private PlayerCheckbox losersCheckbox; [Resolved] - private LadderEditorInfo editorInfo { get; set; } = null; + private LadderEditorInfo editorInfo { get; set; } [BackgroundDependencyLoader] private void load() diff --git a/osu.Game.Tournament/Screens/Showcase/ShowcaseScreen.cs b/osu.Game.Tournament/Screens/Showcase/ShowcaseScreen.cs index 95d11e2143..dcbaad8ab5 100644 --- a/osu.Game.Tournament/Screens/Showcase/ShowcaseScreen.cs +++ b/osu.Game.Tournament/Screens/Showcase/ShowcaseScreen.cs @@ -25,14 +25,14 @@ namespace osu.Game.Tournament.Screens.Showcase { public class ShowcaseScreen : OsuScreen { - private Container panel; + private readonly Container panel; private readonly Container panelContents; [Resolved] - private APIAccess api { get; set; } = null; + private APIAccess api { get; set; } [Resolved] - private RulesetStore rulesets { get; set; } = null; + private RulesetStore rulesets { get; set; } private int lastBeatmapId; private int lastMods; From 85fe4db2ec86674fa60afe936fd2fe21daa551f3 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 6 Nov 2018 15:08:14 +0900 Subject: [PATCH 079/317] Hide game cursor so it is not included in stream --- osu.Game.Tournament/TournamentGame.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/osu.Game.Tournament/TournamentGame.cs b/osu.Game.Tournament/TournamentGame.cs index 1bbbfdc37a..d4e6ee2a44 100644 --- a/osu.Game.Tournament/TournamentGame.cs +++ b/osu.Game.Tournament/TournamentGame.cs @@ -80,6 +80,8 @@ namespace osu.Game.Tournament { base.LoadComplete(); Add(new TournamentSceneManager()); + + MenuCursorContainer.Cursor.Alpha = 0; } protected virtual void SaveChanges() From a2b28e0bf4326b94b46e77945626940268526056 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 6 Nov 2018 16:15:03 +0900 Subject: [PATCH 080/317] Add missing header --- osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs b/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs index be7b3a0b3b..6d7dca0aad 100644 --- a/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs +++ b/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs @@ -1,3 +1,6 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Game.Screens; From 49d3beac1930db116fb5c7a8a45cfb9752ebda70 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 6 Nov 2018 16:31:43 +0900 Subject: [PATCH 081/317] Add rider config for tournament run --- .../runConfigurations/osu___Tournament_.xml | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 .idea/.idea.osu/.idea/runConfigurations/osu___Tournament_.xml diff --git a/.idea/.idea.osu/.idea/runConfigurations/osu___Tournament_.xml b/.idea/.idea.osu/.idea/runConfigurations/osu___Tournament_.xml new file mode 100644 index 0000000000..a5f93489e8 --- /dev/null +++ b/.idea/.idea.osu/.idea/runConfigurations/osu___Tournament_.xml @@ -0,0 +1,20 @@ + + + + \ No newline at end of file From 5a4292717fbe707f93e3e1ad3e74c030dcfbd545 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 6 Nov 2018 17:59:01 +0900 Subject: [PATCH 082/317] Allow tests to run custom game --- osu.Game.Tournament.Tests/LadderTestCase.cs | 79 +------------------ .../TestCaseGroupingManager.cs | 4 +- .../TestCaseLadderManager.cs | 4 +- .../TestCaseSceneManager.cs | 3 +- .../TournamentTestBrowser.cs | 27 +++++++ .../TournamentTestRunner.cs | 22 ++++++ .../osu.Game.Tournament.Tests.csproj | 3 + 7 files changed, 60 insertions(+), 82 deletions(-) create mode 100644 osu.Game.Tournament.Tests/TournamentTestBrowser.cs create mode 100644 osu.Game.Tournament.Tests/TournamentTestRunner.cs diff --git a/osu.Game.Tournament.Tests/LadderTestCase.cs b/osu.Game.Tournament.Tests/LadderTestCase.cs index 7c8d8856e6..fcc4d7dc1b 100644 --- a/osu.Game.Tournament.Tests/LadderTestCase.cs +++ b/osu.Game.Tournament.Tests/LadderTestCase.cs @@ -1,91 +1,16 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using System.IO; -using Newtonsoft.Json; using osu.Framework.Allocation; -using osu.Framework.Graphics; -using osu.Framework.Platform; -using osu.Game.Beatmaps; -using osu.Game.Graphics.UserInterface; -using osu.Game.Online.API; -using osu.Game.Online.API.Requests; -using osu.Game.Rulesets; using osu.Game.Tests.Visual; using osu.Game.Tournament.Screens.Ladder.Components; namespace osu.Game.Tournament.Tests { - public abstract class LadderTestCase : OsuTestCase + public class LadderTestCase : OsuTestCase { - private const string bracket_filename = "bracket.json"; - - protected LadderInfo Ladder; - private Storage storage; [Resolved] - private APIAccess api { get; set; } - - [Resolved] - private RulesetStore rulesets { get; set; } - - [BackgroundDependencyLoader] - private void load(Storage storage) - { - this.storage = storage; - - string content = null; - if (storage.Exists(bracket_filename)) - { - using (Stream stream = storage.GetStream(bracket_filename, FileAccess.Read, FileMode.Open)) - using (var sr = new StreamReader(stream)) - content = sr.ReadToEnd(); - } - - Ladder = content != null ? JsonConvert.DeserializeObject(content) : new LadderInfo(); - - bool addedInfo = false; - - foreach (var g in Ladder.Groupings) - foreach (var b in g.Beatmaps) - { - if (b.BeatmapInfo == null) - { - var req = new GetBeatmapRequest(new BeatmapInfo { OnlineBeatmapID = b.ID }); - req.Success += i => b.BeatmapInfo = i.ToBeatmap(rulesets); - req.Perform(api); - - addedInfo = true; - } - } - - if (addedInfo) - SaveChanges(); - - Add(new OsuButton - { - Text = "Save Changes", - Width = 140, - Height = 50, - Anchor = Anchor.BottomRight, - Origin = Anchor.BottomRight, - Padding = new MarginPadding(10), - Action = SaveChanges, - }); - } - - protected virtual void SaveChanges() - { - using (var stream = storage.GetStream(bracket_filename, FileAccess.Write, FileMode.Create)) - using (var sw = new StreamWriter(stream)) - { - sw.Write(JsonConvert.SerializeObject(Ladder, - new JsonSerializerSettings - { - NullValueHandling = NullValueHandling.Ignore, - DefaultValueHandling = DefaultValueHandling.Ignore - })); - } - } + protected LadderInfo Ladder { get; set; } } } diff --git a/osu.Game.Tournament.Tests/TestCaseGroupingManager.cs b/osu.Game.Tournament.Tests/TestCaseGroupingManager.cs index 2b79ba0225..531019c28c 100644 --- a/osu.Game.Tournament.Tests/TestCaseGroupingManager.cs +++ b/osu.Game.Tournament.Tests/TestCaseGroupingManager.cs @@ -47,10 +47,10 @@ namespace osu.Game.Tournament.Tests items.Add(new GroupingRow(g)); } - protected override void SaveChanges() + protected override void Dispose(bool isDisposing) { Ladder.Groupings = items.Children.Select(c => c.Grouping).ToList(); - base.SaveChanges(); + base.Dispose(isDisposing); } private void addNew() => items.Add(new GroupingRow(new TournamentGrouping())); diff --git a/osu.Game.Tournament.Tests/TestCaseLadderManager.cs b/osu.Game.Tournament.Tests/TestCaseLadderManager.cs index a7af038ca8..7a7f7e0771 100644 --- a/osu.Game.Tournament.Tests/TestCaseLadderManager.cs +++ b/osu.Game.Tournament.Tests/TestCaseLadderManager.cs @@ -22,10 +22,10 @@ namespace osu.Game.Tournament.Tests }); } - protected override void SaveChanges() + protected override void Dispose(bool isDisposing) { + base.Dispose(isDisposing); Ladder = manager.CreateInfo(); - base.SaveChanges(); } } } diff --git a/osu.Game.Tournament.Tests/TestCaseSceneManager.cs b/osu.Game.Tournament.Tests/TestCaseSceneManager.cs index 9853e31ee3..a19c933d8b 100644 --- a/osu.Game.Tournament.Tests/TestCaseSceneManager.cs +++ b/osu.Game.Tournament.Tests/TestCaseSceneManager.cs @@ -3,11 +3,12 @@ using osu.Framework.Allocation; using osu.Framework.Platform; +using osu.Game.Tests.Visual; using osu.Game.Tournament.Screens; namespace osu.Game.Tournament.Tests { - public class TestCaseSceneManager : LadderTestCase + public class TestCaseSceneManager : OsuTestCase { [BackgroundDependencyLoader] private void load(Storage storage) diff --git a/osu.Game.Tournament.Tests/TournamentTestBrowser.cs b/osu.Game.Tournament.Tests/TournamentTestBrowser.cs new file mode 100644 index 0000000000..8549be0879 --- /dev/null +++ b/osu.Game.Tournament.Tests/TournamentTestBrowser.cs @@ -0,0 +1,27 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework.Testing; +using osu.Game.Graphics; +using osu.Game.Screens.Backgrounds; + +namespace osu.Game.Tournament.Tests +{ + public class TournamentTestBrowser : TournamentGame + { + protected override void LoadComplete() + { + base.LoadComplete(); + + LoadComponentAsync(new BackgroundScreenDefault + { + Colour = OsuColour.Gray(0.5f), + Depth = 10 + }, AddInternal); + + // Have to construct this here, rather than in the constructor, because + // we depend on some dependencies to be loaded within OsuGameBase.load(). + Add(new TestBrowser()); + } + } +} diff --git a/osu.Game.Tournament.Tests/TournamentTestRunner.cs b/osu.Game.Tournament.Tests/TournamentTestRunner.cs new file mode 100644 index 0000000000..51c2c65cb4 --- /dev/null +++ b/osu.Game.Tournament.Tests/TournamentTestRunner.cs @@ -0,0 +1,22 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System; +using osu.Framework; +using osu.Framework.Platform; + +namespace osu.Game.Tournament.Tests +{ + public static class TournamentTestRunner + { + [STAThread] + public static int Main(string[] args) + { + using (DesktopGameHost host = Host.GetSuitableHost(@"osu", true)) + { + host.Run(new TournamentTestBrowser()); + return 0; + } + } + } +} diff --git a/osu.Game.Tournament.Tests/osu.Game.Tournament.Tests.csproj b/osu.Game.Tournament.Tests/osu.Game.Tournament.Tests.csproj index b3090d5b78..4a65846d68 100644 --- a/osu.Game.Tournament.Tests/osu.Game.Tournament.Tests.csproj +++ b/osu.Game.Tournament.Tests/osu.Game.Tournament.Tests.csproj @@ -1,5 +1,8 @@  + + osu.Game.Tournament.Tests.TournamentTestRunner + From afb3b38098d275d40117cc69140fda47e485add0 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 6 Nov 2018 18:32:59 +0900 Subject: [PATCH 083/317] Fix regression in testing logic --- osu.Game.Tournament.Tests/LadderTestCase.cs | 3 +- .../TestCaseLadderManager.cs | 8 +- .../TournamentTestBrowser.cs | 2 +- .../Screens/Showcase/ShowcaseScreen.cs | 229 +++++++++++------- osu.Game.Tournament/TournamentGame.cs | 85 +------ osu.Game.Tournament/TournamentGameBase.cs | 98 ++++++++ 6 files changed, 247 insertions(+), 178 deletions(-) create mode 100644 osu.Game.Tournament/TournamentGameBase.cs diff --git a/osu.Game.Tournament.Tests/LadderTestCase.cs b/osu.Game.Tournament.Tests/LadderTestCase.cs index fcc4d7dc1b..b296956d42 100644 --- a/osu.Game.Tournament.Tests/LadderTestCase.cs +++ b/osu.Game.Tournament.Tests/LadderTestCase.cs @@ -9,8 +9,7 @@ namespace osu.Game.Tournament.Tests { public class LadderTestCase : OsuTestCase { - [Resolved] - protected LadderInfo Ladder { get; set; } + protected LadderInfo Ladder { get; private set; } } } diff --git a/osu.Game.Tournament.Tests/TestCaseLadderManager.cs b/osu.Game.Tournament.Tests/TestCaseLadderManager.cs index 7a7f7e0771..5fa378a854 100644 --- a/osu.Game.Tournament.Tests/TestCaseLadderManager.cs +++ b/osu.Game.Tournament.Tests/TestCaseLadderManager.cs @@ -25,7 +25,13 @@ namespace osu.Game.Tournament.Tests protected override void Dispose(bool isDisposing) { base.Dispose(isDisposing); - Ladder = manager.CreateInfo(); + + var newInfo = manager.CreateInfo(); + + Ladder.Teams = newInfo.Teams; + Ladder.Groupings = newInfo.Groupings; + Ladder.Pairings = newInfo.Pairings; + Ladder.Progressions = newInfo.Progressions; } } } diff --git a/osu.Game.Tournament.Tests/TournamentTestBrowser.cs b/osu.Game.Tournament.Tests/TournamentTestBrowser.cs index 8549be0879..429adb2c0d 100644 --- a/osu.Game.Tournament.Tests/TournamentTestBrowser.cs +++ b/osu.Game.Tournament.Tests/TournamentTestBrowser.cs @@ -7,7 +7,7 @@ using osu.Game.Screens.Backgrounds; namespace osu.Game.Tournament.Tests { - public class TournamentTestBrowser : TournamentGame + public class TournamentTestBrowser : TournamentGameBase { protected override void LoadComplete() { diff --git a/osu.Game.Tournament/Screens/Showcase/ShowcaseScreen.cs b/osu.Game.Tournament/Screens/Showcase/ShowcaseScreen.cs index dcbaad8ab5..6c0eac1c23 100644 --- a/osu.Game.Tournament/Screens/Showcase/ShowcaseScreen.cs +++ b/osu.Game.Tournament/Screens/Showcase/ShowcaseScreen.cs @@ -23,77 +23,116 @@ using OpenTK; namespace osu.Game.Tournament.Screens.Showcase { - public class ShowcaseScreen : OsuScreen + public class SongBar : CompositeDrawable { - private readonly Container panel; - private readonly Container panelContents; + private BeatmapInfo beatmap; - [Resolved] - private APIAccess api { get; set; } + public BeatmapInfo Beatmap + { + get { return beatmap; } + set + { + if (beatmap == value) + return; - [Resolved] - private RulesetStore rulesets { get; set; } + beatmap = value; + update(); + } + } - private int lastBeatmapId; - private int lastMods; + private LegacyMods mods; + + public LegacyMods Mods + { + get { return mods; } + set + { + mods = value; + update(); + } + } + + private Container panelContents; [BackgroundDependencyLoader] private void load() { - var stable = new StableStorage(); + RelativeSizeAxes = Axes.Both; - const string file_ipc_filename = "ipc.txt"; - - if (stable.Exists(file_ipc_filename)) + InternalChildren = new Drawable[] { - Scheduler.AddDelayed(delegate + new Container { - try + Masking = true, + RelativeSizeAxes = Axes.X, + Anchor = Anchor.BottomCentre, + Origin = Anchor.BottomCentre, + Y = -10, + Width = 0.95f, + Height = TournamentBeatmapPanel.HEIGHT, + CornerRadius = TournamentBeatmapPanel.HEIGHT / 2, + Children = new Drawable[] { - using (var stream = stable.GetStream(file_ipc_filename)) - using (var sr = new StreamReader(stream)) + new Box { - var beatmapId = int.Parse(sr.ReadLine()); - var mods = int.Parse(sr.ReadLine()); - - if (lastBeatmapId == beatmapId) - return; - - lastMods = mods; - lastBeatmapId = beatmapId; - - var req = new GetBeatmapRequest(new BeatmapInfo { OnlineBeatmapID = beatmapId }); - req.Success += success; - api.Queue(req); + RelativeSizeAxes = Axes.Both, + Colour = OsuColour.Gray(0.93f), + }, + new Container + { + Masking = true, + CornerRadius = TournamentBeatmapPanel.HEIGHT / 2, + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + RelativeSizeAxes = Axes.Both, + Width = 0.7f, + Children = new Drawable[] + { + new Box + { + RelativeSizeAxes = Axes.Both, + Colour = OsuColour.Gray(0.86f), + }, + panelContents = new Container + { + RelativeSizeAxes = Axes.Both, + } + } + }, + new OsuLogo + { + Triangles = false, + Colour = OsuColour.Gray(0.33f), + Scale = new Vector2(0.08f), + Margin = new MarginPadding(50), + Anchor = Anchor.CentreRight, + Origin = Anchor.CentreRight, } } - catch - { - // file might be in use. - } - }, 250, true); - } + } + }; } - private void success(APIBeatmap apiBeatmap) + private void update() { - panel.FadeInFromZero(300, Easing.OutQuint); + if (beatmap == null) + { + panelContents.Clear(); + return; + } - var beatmap = apiBeatmap.ToBeatmap(rulesets); - - var legacyMods = (LegacyMods)lastMods; var bpm = beatmap.BeatmapSet.OnlineInfo.BPM; var length = beatmap.OnlineInfo.Length; string extra = ""; var ar = beatmap.BaseDifficulty.ApproachRate; - if ((legacyMods & LegacyMods.HardRock) > 0) + if ((mods & LegacyMods.HardRock) > 0) { //ar *= 1.4f; extra = "*"; } - if ((legacyMods & LegacyMods.DoubleTime) > 0) + if ((mods & LegacyMods.DoubleTime) > 0) { //ar *= 1.5f; bpm *= 1.5f; @@ -142,63 +181,73 @@ namespace osu.Game.Tournament.Screens.Showcase } }; } + } + + public class ShowcaseScreen : OsuScreen + { + [Resolved] + private APIAccess api { get; set; } + + [Resolved] + private RulesetStore rulesets { get; set; } + + private int lastBeatmapId; + private int lastMods; + + private readonly SongBar songBar; public ShowcaseScreen() { - RelativeSizeAxes = Axes.Both; - - Children = new Drawable[] + Add(songBar = new SongBar { - new Container + Anchor = Anchor.BottomCentre, + Origin = Anchor.BottomCentre + }); + } + + [BackgroundDependencyLoader] + private void load() + { + var stable = new StableStorage(); + + const string file_ipc_filename = "ipc.txt"; + + if (stable.Exists(file_ipc_filename)) + { + Scheduler.AddDelayed(delegate { - Masking = true, - RelativeSizeAxes = Axes.X, - Anchor = Anchor.BottomCentre, - Origin = Anchor.BottomCentre, - Y = -10, - Width = 0.95f, - Height = TournamentBeatmapPanel.HEIGHT, - CornerRadius = TournamentBeatmapPanel.HEIGHT / 2, - Children = new Drawable[] + try { - new Box + using (var stream = stable.GetStream(file_ipc_filename)) + using (var sr = new StreamReader(stream)) { - RelativeSizeAxes = Axes.Both, - Colour = OsuColour.Gray(0.93f), - }, - panel = new Container - { - Masking = true, - CornerRadius = TournamentBeatmapPanel.HEIGHT / 2, - Anchor = Anchor.Centre, - Origin = Anchor.Centre, - RelativeSizeAxes = Axes.Both, - Width = 0.7f, - Children = new Drawable[] - { - new Box - { - RelativeSizeAxes = Axes.Both, - Colour = OsuColour.Gray(0.86f), - }, - panelContents = new Container - { - RelativeSizeAxes = Axes.Both, - } - } - }, - new OsuLogo - { - Triangles = false, - Colour = OsuColour.Gray(0.33f), - Scale = new Vector2(0.08f), - Margin = new MarginPadding(50), - Anchor = Anchor.CentreRight, - Origin = Anchor.CentreRight, + var beatmapId = int.Parse(sr.ReadLine()); + var mods = int.Parse(sr.ReadLine()); + + if (lastBeatmapId == beatmapId) + return; + + lastMods = mods; + lastBeatmapId = beatmapId; + + var req = new GetBeatmapRequest(new BeatmapInfo { OnlineBeatmapID = beatmapId }); + req.Success += success; + api.Queue(req); } } - } - }; + catch + { + // file might be in use. + } + }, 250, true); + } + } + + private void success(APIBeatmap apiBeatmap) + { + songBar.FadeInFromZero(300, Easing.OutQuint); + songBar.Mods = (LegacyMods)lastMods; + songBar.Beatmap = apiBeatmap.ToBeatmap(rulesets); } /// diff --git a/osu.Game.Tournament/TournamentGame.cs b/osu.Game.Tournament/TournamentGame.cs index d4e6ee2a44..b4bdf250b6 100644 --- a/osu.Game.Tournament/TournamentGame.cs +++ b/osu.Game.Tournament/TournamentGame.cs @@ -1,81 +1,12 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using System.IO; -using Newtonsoft.Json; -using osu.Framework.Allocation; -using osu.Framework.Configuration; -using osu.Framework.Graphics; -using osu.Framework.Platform; -using osu.Game.Beatmaps; -using osu.Game.Graphics.UserInterface; -using osu.Game.Online.API.Requests; -using osu.Game.Rulesets; using osu.Game.Tournament.Screens; -using osu.Game.Tournament.Screens.Ladder.Components; namespace osu.Game.Tournament { - public class TournamentGame : OsuGameBase + public class TournamentGame : TournamentGameBase { - private const string bracket_filename = "bracket.json"; - - protected LadderInfo Ladder; - private Storage storage; - - private DependencyContainer dependencies; - - [Cached] - private readonly Bindable ruleset = new Bindable(); - - protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnlyDependencyContainer parent) => dependencies = new DependencyContainer(base.CreateChildDependencies(parent)); - - [BackgroundDependencyLoader] - private void load(Storage storage) - { - this.storage = storage; - - string content = null; - if (storage.Exists(bracket_filename)) - { - using (Stream stream = storage.GetStream(bracket_filename, FileAccess.Read, FileMode.Open)) - using (var sr = new StreamReader(stream)) - content = sr.ReadToEnd(); - } - - Ladder = content != null ? JsonConvert.DeserializeObject(content) : new LadderInfo(); - dependencies.Cache(Ladder); - - bool addedInfo = false; - - foreach (var g in Ladder.Groupings) - foreach (var b in g.Beatmaps) - { - if (b.BeatmapInfo == null) - { - var req = new GetBeatmapRequest(new BeatmapInfo { OnlineBeatmapID = b.ID }); - req.Success += i => b.BeatmapInfo = i.ToBeatmap(RulesetStore); - req.Perform(API); - - addedInfo = true; - } - } - - if (addedInfo) - SaveChanges(); - - Add(new OsuButton - { - Text = "Save Changes", - Width = 140, - Height = 50, - Anchor = Anchor.BottomRight, - Origin = Anchor.BottomRight, - Padding = new MarginPadding(10), - Action = SaveChanges, - }); - } - protected override void LoadComplete() { base.LoadComplete(); @@ -83,19 +14,5 @@ namespace osu.Game.Tournament MenuCursorContainer.Cursor.Alpha = 0; } - - protected virtual void SaveChanges() - { - using (var stream = storage.GetStream(bracket_filename, FileAccess.Write, FileMode.Create)) - using (var sw = new StreamWriter(stream)) - { - sw.Write(JsonConvert.SerializeObject(Ladder, - new JsonSerializerSettings - { - NullValueHandling = NullValueHandling.Ignore, - DefaultValueHandling = DefaultValueHandling.Ignore - })); - } - } } } diff --git a/osu.Game.Tournament/TournamentGameBase.cs b/osu.Game.Tournament/TournamentGameBase.cs new file mode 100644 index 0000000000..e76038d818 --- /dev/null +++ b/osu.Game.Tournament/TournamentGameBase.cs @@ -0,0 +1,98 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System.IO; +using Newtonsoft.Json; +using osu.Framework.Allocation; +using osu.Framework.Configuration; +using osu.Framework.Graphics; +using osu.Framework.Platform; +using osu.Game.Beatmaps; +using osu.Game.Graphics.UserInterface; +using osu.Game.Online.API.Requests; +using osu.Game.Rulesets; +using osu.Game.Tournament.Screens.Ladder.Components; + +namespace osu.Game.Tournament +{ + public abstract class TournamentGameBase : OsuGameBase + { + private const string bracket_filename = "bracket.json"; + + protected LadderInfo Ladder; + private Storage storage; + + private DependencyContainer dependencies; + + [Cached] + private readonly Bindable ruleset = new Bindable(); + + protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnlyDependencyContainer parent) + { + return dependencies = new DependencyContainer(base.CreateChildDependencies(parent)); + } + + [BackgroundDependencyLoader] + private void load(Storage storage) + { + this.storage = storage; + + string content = null; + if (storage.Exists(bracket_filename)) + using (Stream stream = storage.GetStream(bracket_filename, FileAccess.Read, FileMode.Open)) + using (var sr = new StreamReader(stream)) + { + content = sr.ReadToEnd(); + } + + Ladder = content != null ? JsonConvert.DeserializeObject(content) : new LadderInfo(); + dependencies.Cache(Ladder); + + bool addedInfo = false; + + foreach (var g in Ladder.Groupings) + foreach (var b in g.Beatmaps) + if (b.BeatmapInfo == null) + { + var req = new GetBeatmapRequest(new BeatmapInfo { OnlineBeatmapID = b.ID }); + req.Success += i => b.BeatmapInfo = i.ToBeatmap(RulesetStore); + req.Perform(API); + + addedInfo = true; + } + + if (addedInfo) + SaveChanges(); + + Add(new OsuButton + { + Text = "Save Changes", + Width = 140, + Height = 50, + Anchor = Anchor.BottomRight, + Origin = Anchor.BottomRight, + Padding = new MarginPadding(10), + Action = SaveChanges, + }); + } + + protected override void LoadComplete() + { + MenuCursorContainer.Cursor.Alpha = 0; + } + + protected virtual void SaveChanges() + { + using (var stream = storage.GetStream(bracket_filename, FileAccess.Write, FileMode.Create)) + using (var sw = new StreamWriter(stream)) + { + sw.Write(JsonConvert.SerializeObject(Ladder, + new JsonSerializerSettings + { + NullValueHandling = NullValueHandling.Ignore, + DefaultValueHandling = DefaultValueHandling.Ignore + })); + } + } + } +} From ca9df94ea282a0c8932dfde261fd6618c003ea69 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 6 Nov 2018 19:23:03 +0900 Subject: [PATCH 084/317] Add skeleton for gameplay screen --- osu.Game.Tournament.Tests/TestCaseGameplay.cs | 25 ++ osu.Game.Tournament.Tests/TestCaseShowcase.cs | 7 + osu.Game.Tournament/Components/SongBar.cs | 172 +++++++++++ .../Screens/BeatmapInfoScreen.cs | 127 ++++++++ .../Screens/Gameplay/GameplayScreen.cs | 10 + .../Screens/Showcase/ShowcaseScreen.cs | 285 +----------------- .../Screens/TournamentSceneManager.cs | 10 +- 7 files changed, 350 insertions(+), 286 deletions(-) create mode 100644 osu.Game.Tournament.Tests/TestCaseGameplay.cs create mode 100644 osu.Game.Tournament/Components/SongBar.cs create mode 100644 osu.Game.Tournament/Screens/BeatmapInfoScreen.cs create mode 100644 osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs diff --git a/osu.Game.Tournament.Tests/TestCaseGameplay.cs b/osu.Game.Tournament.Tests/TestCaseGameplay.cs new file mode 100644 index 0000000000..eefcd79661 --- /dev/null +++ b/osu.Game.Tournament.Tests/TestCaseGameplay.cs @@ -0,0 +1,25 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System; +using System.Collections.Generic; +using osu.Framework.Allocation; +using osu.Game.Tests.Visual; +using osu.Game.Tournament.Screens.Gameplay; + +namespace osu.Game.Tournament.Tests +{ + public class TestCaseGameplay : OsuTestCase + { + public override IReadOnlyList RequiredTypes => new[] + { + typeof(GameplayScreen) + }; + + [BackgroundDependencyLoader] + private void load() + { + Add(new GameplayScreen()); + } + } +} diff --git a/osu.Game.Tournament.Tests/TestCaseShowcase.cs b/osu.Game.Tournament.Tests/TestCaseShowcase.cs index 66183683d1..dcd4b6aec7 100644 --- a/osu.Game.Tournament.Tests/TestCaseShowcase.cs +++ b/osu.Game.Tournament.Tests/TestCaseShowcase.cs @@ -1,6 +1,8 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using System; +using System.Collections.Generic; using osu.Framework.Allocation; using osu.Game.Tests.Visual; using osu.Game.Tournament.Screens.Showcase; @@ -9,6 +11,11 @@ namespace osu.Game.Tournament.Tests { public class TestCaseShowcase : OsuTestCase { + public override IReadOnlyList RequiredTypes => new[] + { + typeof(ShowcaseScreen) + }; + [BackgroundDependencyLoader] private void load() { diff --git a/osu.Game.Tournament/Components/SongBar.cs b/osu.Game.Tournament/Components/SongBar.cs new file mode 100644 index 0000000000..880b80edf8 --- /dev/null +++ b/osu.Game.Tournament/Components/SongBar.cs @@ -0,0 +1,172 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework.Allocation; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Shapes; +using osu.Game.Beatmaps; +using osu.Game.Beatmaps.Legacy; +using osu.Game.Graphics; +using osu.Game.Graphics.Sprites; +using osu.Game.Screens.Menu; +using OpenTK; + +namespace osu.Game.Tournament.Components +{ + public class SongBar : CompositeDrawable + { + private BeatmapInfo beatmap; + + public BeatmapInfo Beatmap + { + get => beatmap; + set + { + if (beatmap == value) + return; + + beatmap = value; + update(); + } + } + + private LegacyMods mods; + + public LegacyMods Mods + { + get => mods; + set + { + mods = value; + update(); + } + } + + private Container panelContents; + + [BackgroundDependencyLoader] + private void load() + { + RelativeSizeAxes = Axes.Both; + + InternalChildren = new Drawable[] + { + new Container + { + Masking = true, + RelativeSizeAxes = Axes.X, + Anchor = Anchor.BottomCentre, + Origin = Anchor.BottomCentre, + Y = -10, + Width = 0.95f, + Height = TournamentBeatmapPanel.HEIGHT, + CornerRadius = TournamentBeatmapPanel.HEIGHT / 2, + Children = new Drawable[] + { + new Box + { + RelativeSizeAxes = Axes.Both, + Colour = OsuColour.Gray(0.93f), + }, + new Container + { + Masking = true, + CornerRadius = TournamentBeatmapPanel.HEIGHT / 2, + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + RelativeSizeAxes = Axes.Both, + Width = 0.7f, + Children = new Drawable[] + { + new Box + { + RelativeSizeAxes = Axes.Both, + Colour = OsuColour.Gray(0.86f), + }, + panelContents = new Container + { + RelativeSizeAxes = Axes.Both, + } + } + }, + new OsuLogo + { + Triangles = false, + Colour = OsuColour.Gray(0.33f), + Scale = new Vector2(0.08f), + Margin = new MarginPadding(50), + Anchor = Anchor.CentreRight, + Origin = Anchor.CentreRight, + } + } + } + }; + } + + private void update() + { + if (beatmap == null) + { + panelContents.Clear(); + return; + } + + var bpm = beatmap.BeatmapSet.OnlineInfo.BPM; + var length = beatmap.OnlineInfo.Length; + string extra = ""; + + var ar = beatmap.BaseDifficulty.ApproachRate; + if ((mods & LegacyMods.HardRock) > 0) extra = "*"; + + if ((mods & LegacyMods.DoubleTime) > 0) + { + //ar *= 1.5f; + bpm *= 1.5f; + length /= 1.5f; + extra = "*"; + } + + panelContents.Children = new Drawable[] + { + new OsuSpriteText + { + Text = $"Length {length}s", + Margin = new MarginPadding { Horizontal = 15, Vertical = 5 }, + Colour = OsuColour.Gray(0.33f), + Anchor = Anchor.TopLeft, + Origin = Anchor.TopLeft, + }, + new OsuSpriteText + { + Text = $"BPM {bpm:0.#}", + Margin = new MarginPadding { Horizontal = 15, Vertical = 5 }, + Colour = OsuColour.Gray(0.33f), + Anchor = Anchor.BottomLeft, + Origin = Anchor.BottomLeft + }, + new OsuSpriteText + { + Text = $"AR {ar:0.#}{extra}", + Margin = new MarginPadding { Horizontal = 15, Vertical = 5 }, + Colour = OsuColour.Gray(0.33f), + Anchor = Anchor.TopRight, + Origin = Anchor.TopRight + }, + new OsuSpriteText + { + Text = $"Star Rating {beatmap.StarDifficulty:0.#}{extra}", + Margin = new MarginPadding { Horizontal = 15, Vertical = 5 }, + Colour = OsuColour.Gray(0.33f), + Anchor = Anchor.BottomRight, + Origin = Anchor.BottomRight + }, + new TournamentBeatmapPanel(beatmap) + { + Anchor = Anchor.Centre, + Origin = Anchor.Centre + } + }; + } + } +} diff --git a/osu.Game.Tournament/Screens/BeatmapInfoScreen.cs b/osu.Game.Tournament/Screens/BeatmapInfoScreen.cs new file mode 100644 index 0000000000..18ba947582 --- /dev/null +++ b/osu.Game.Tournament/Screens/BeatmapInfoScreen.cs @@ -0,0 +1,127 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System; +using System.IO; +using osu.Framework.Allocation; +using osu.Framework.Graphics; +using osu.Framework.Platform.Windows; +using osu.Game.Beatmaps; +using osu.Game.Beatmaps.Legacy; +using osu.Game.Online.API; +using osu.Game.Online.API.Requests; +using osu.Game.Online.API.Requests.Responses; +using osu.Game.Rulesets; +using osu.Game.Screens; +using osu.Game.Tournament.Components; + +namespace osu.Game.Tournament.Screens +{ + public abstract class BeatmapInfoScreen : OsuScreen + { + [Resolved] + protected APIAccess API { get; private set; } + + [Resolved] + protected RulesetStore Rulesets { get; private set; } + + private int lastBeatmapId; + private int lastMods; + + protected readonly SongBar SongBar; + + protected BeatmapInfoScreen() + { + Add(SongBar = new SongBar + { + Anchor = Anchor.BottomCentre, + Origin = Anchor.BottomCentre + }); + } + + [BackgroundDependencyLoader] + private void load() + { + var stable = new StableStorage(); + + const string file_ipc_filename = "ipc.txt"; + + if (stable.Exists(file_ipc_filename)) + Scheduler.AddDelayed(delegate + { + try + { + using (var stream = stable.GetStream(file_ipc_filename)) + using (var sr = new StreamReader(stream)) + { + var beatmapId = int.Parse(sr.ReadLine()); + var mods = int.Parse(sr.ReadLine()); + + if (lastBeatmapId == beatmapId) + return; + + lastMods = mods; + lastBeatmapId = beatmapId; + + var req = new GetBeatmapRequest(new BeatmapInfo { OnlineBeatmapID = beatmapId }); + req.Success += success; + API.Queue(req); + } + } + catch + { + // file might be in use. + } + }, 250, true); + } + + private void success(APIBeatmap apiBeatmap) + { + SongBar.FadeInFromZero(300, Easing.OutQuint); + SongBar.Mods = (LegacyMods)lastMods; + SongBar.Beatmap = apiBeatmap.ToBeatmap(Rulesets); + } + + /// + /// A method of accessing an osu-stable install in a controlled fashion. + /// + private class StableStorage : WindowsStorage + { + protected override string LocateBasePath() + { + bool checkExists(string p) + { + return Directory.Exists(Path.Combine(p, "Songs")); + } + + string stableInstallPath; + + try + { + stableInstallPath = "E:\\osu!mappool"; + + if (checkExists(stableInstallPath)) + return stableInstallPath; + } + catch + { + } + + stableInstallPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), @"osu!"); + if (checkExists(stableInstallPath)) + return stableInstallPath; + + stableInstallPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".osu"); + if (checkExists(stableInstallPath)) + return stableInstallPath; + + return null; + } + + public StableStorage() + : base(string.Empty, null) + { + } + } + } +} diff --git a/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs b/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs new file mode 100644 index 0000000000..2a9754b066 --- /dev/null +++ b/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs @@ -0,0 +1,10 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +namespace osu.Game.Tournament.Screens.Gameplay +{ + public class GameplayScreen : BeatmapInfoScreen + { + + } +} diff --git a/osu.Game.Tournament/Screens/Showcase/ShowcaseScreen.cs b/osu.Game.Tournament/Screens/Showcase/ShowcaseScreen.cs index 6c0eac1c23..ce458413a5 100644 --- a/osu.Game.Tournament/Screens/Showcase/ShowcaseScreen.cs +++ b/osu.Game.Tournament/Screens/Showcase/ShowcaseScreen.cs @@ -1,292 +1,9 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using System; -using System.IO; -using osu.Framework.Allocation; -using osu.Framework.Graphics; -using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Shapes; -using osu.Framework.Platform.Windows; -using osu.Game.Beatmaps; -using osu.Game.Beatmaps.Legacy; -using osu.Game.Graphics; -using osu.Game.Graphics.Sprites; -using osu.Game.Online.API; -using osu.Game.Online.API.Requests; -using osu.Game.Online.API.Requests.Responses; -using osu.Game.Rulesets; -using osu.Game.Screens; -using osu.Game.Screens.Menu; -using osu.Game.Tournament.Components; -using OpenTK; - namespace osu.Game.Tournament.Screens.Showcase { - public class SongBar : CompositeDrawable + public class ShowcaseScreen : BeatmapInfoScreen { - private BeatmapInfo beatmap; - - public BeatmapInfo Beatmap - { - get { return beatmap; } - set - { - if (beatmap == value) - return; - - beatmap = value; - update(); - } - } - - private LegacyMods mods; - - public LegacyMods Mods - { - get { return mods; } - set - { - mods = value; - update(); - } - } - - private Container panelContents; - - [BackgroundDependencyLoader] - private void load() - { - RelativeSizeAxes = Axes.Both; - - InternalChildren = new Drawable[] - { - new Container - { - Masking = true, - RelativeSizeAxes = Axes.X, - Anchor = Anchor.BottomCentre, - Origin = Anchor.BottomCentre, - Y = -10, - Width = 0.95f, - Height = TournamentBeatmapPanel.HEIGHT, - CornerRadius = TournamentBeatmapPanel.HEIGHT / 2, - Children = new Drawable[] - { - new Box - { - RelativeSizeAxes = Axes.Both, - Colour = OsuColour.Gray(0.93f), - }, - new Container - { - Masking = true, - CornerRadius = TournamentBeatmapPanel.HEIGHT / 2, - Anchor = Anchor.Centre, - Origin = Anchor.Centre, - RelativeSizeAxes = Axes.Both, - Width = 0.7f, - Children = new Drawable[] - { - new Box - { - RelativeSizeAxes = Axes.Both, - Colour = OsuColour.Gray(0.86f), - }, - panelContents = new Container - { - RelativeSizeAxes = Axes.Both, - } - } - }, - new OsuLogo - { - Triangles = false, - Colour = OsuColour.Gray(0.33f), - Scale = new Vector2(0.08f), - Margin = new MarginPadding(50), - Anchor = Anchor.CentreRight, - Origin = Anchor.CentreRight, - } - } - } - }; - } - - private void update() - { - if (beatmap == null) - { - panelContents.Clear(); - return; - } - - var bpm = beatmap.BeatmapSet.OnlineInfo.BPM; - var length = beatmap.OnlineInfo.Length; - string extra = ""; - - var ar = beatmap.BaseDifficulty.ApproachRate; - if ((mods & LegacyMods.HardRock) > 0) - { - //ar *= 1.4f; - extra = "*"; - } - - if ((mods & LegacyMods.DoubleTime) > 0) - { - //ar *= 1.5f; - bpm *= 1.5f; - length /= 1.5f; - extra = "*"; - } - - panelContents.Children = new Drawable[] - { - new OsuSpriteText - { - Text = $"Length {length}s", - Margin = new MarginPadding { Horizontal = 15, Vertical = 5 }, - Colour = OsuColour.Gray(0.33f), - Anchor = Anchor.TopLeft, - Origin = Anchor.TopLeft, - }, - new OsuSpriteText - { - Text = $"BPM {bpm:0.#}", - Margin = new MarginPadding { Horizontal = 15, Vertical = 5 }, - Colour = OsuColour.Gray(0.33f), - Anchor = Anchor.BottomLeft, - Origin = Anchor.BottomLeft - }, - new OsuSpriteText - { - Text = $"AR {ar:0.#}{extra}", - Margin = new MarginPadding { Horizontal = 15, Vertical = 5 }, - Colour = OsuColour.Gray(0.33f), - Anchor = Anchor.TopRight, - Origin = Anchor.TopRight - }, - new OsuSpriteText - { - Text = $"Star Rating {beatmap.StarDifficulty:0.#}{extra}", - Margin = new MarginPadding { Horizontal = 15, Vertical = 5 }, - Colour = OsuColour.Gray(0.33f), - Anchor = Anchor.BottomRight, - Origin = Anchor.BottomRight - }, - new TournamentBeatmapPanel(beatmap) - { - Anchor = Anchor.Centre, - Origin = Anchor.Centre - } - }; - } - } - - public class ShowcaseScreen : OsuScreen - { - [Resolved] - private APIAccess api { get; set; } - - [Resolved] - private RulesetStore rulesets { get; set; } - - private int lastBeatmapId; - private int lastMods; - - private readonly SongBar songBar; - - public ShowcaseScreen() - { - Add(songBar = new SongBar - { - Anchor = Anchor.BottomCentre, - Origin = Anchor.BottomCentre - }); - } - - [BackgroundDependencyLoader] - private void load() - { - var stable = new StableStorage(); - - const string file_ipc_filename = "ipc.txt"; - - if (stable.Exists(file_ipc_filename)) - { - Scheduler.AddDelayed(delegate - { - try - { - using (var stream = stable.GetStream(file_ipc_filename)) - using (var sr = new StreamReader(stream)) - { - var beatmapId = int.Parse(sr.ReadLine()); - var mods = int.Parse(sr.ReadLine()); - - if (lastBeatmapId == beatmapId) - return; - - lastMods = mods; - lastBeatmapId = beatmapId; - - var req = new GetBeatmapRequest(new BeatmapInfo { OnlineBeatmapID = beatmapId }); - req.Success += success; - api.Queue(req); - } - } - catch - { - // file might be in use. - } - }, 250, true); - } - } - - private void success(APIBeatmap apiBeatmap) - { - songBar.FadeInFromZero(300, Easing.OutQuint); - songBar.Mods = (LegacyMods)lastMods; - songBar.Beatmap = apiBeatmap.ToBeatmap(rulesets); - } - - /// - /// A method of accessing an osu-stable install in a controlled fashion. - /// - private class StableStorage : WindowsStorage - { - protected override string LocateBasePath() - { - bool checkExists(string p) => Directory.Exists(Path.Combine(p, "Songs")); - - string stableInstallPath; - - try - { - stableInstallPath = "E:\\osu!mappool"; - - if (checkExists(stableInstallPath)) - return stableInstallPath; - } - catch - { - } - - stableInstallPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), @"osu!"); - if (checkExists(stableInstallPath)) - return stableInstallPath; - - stableInstallPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".osu"); - if (checkExists(stableInstallPath)) - return stableInstallPath; - - return null; - } - - public StableStorage() - : base(string.Empty, null) - { - } - } } } diff --git a/osu.Game.Tournament/Screens/TournamentSceneManager.cs b/osu.Game.Tournament/Screens/TournamentSceneManager.cs index 82f17a85c4..87223c04a6 100644 --- a/osu.Game.Tournament/Screens/TournamentSceneManager.cs +++ b/osu.Game.Tournament/Screens/TournamentSceneManager.cs @@ -11,6 +11,7 @@ using osu.Framework.Platform; using osu.Game.Graphics.UserInterface; using osu.Game.Screens; using osu.Game.Tournament.Screens.Drawings; +using osu.Game.Tournament.Screens.Gameplay; using osu.Game.Tournament.Screens.Ladder; using osu.Game.Tournament.Screens.Ladder.Components; using osu.Game.Tournament.Screens.MapPool; @@ -25,6 +26,7 @@ namespace osu.Game.Tournament.Screens { private LadderManager bracket; private MapPoolScreen mapPool; + private GameplayScreen gameplay; private TeamIntroScreen teamIntro; private DrawingsScreen drawings; private Container screens; @@ -54,9 +56,12 @@ namespace osu.Game.Tournament.Screens { new OsuButton { RelativeSizeAxes = Axes.X, Text = "Drawings", Action = () => setScreen(drawings) }, new OsuButton { RelativeSizeAxes = Axes.X, Text = "Showcase", Action = () => setScreen(showcase) }, + new Container { RelativeSizeAxes = Axes.X, Height = 50 }, + new OsuButton { RelativeSizeAxes = Axes.X, Text = "Bracket", Action = () => setScreen(bracket) }, new OsuButton { RelativeSizeAxes = Axes.X, Text = "TeamIntro", Action = () => setScreen(teamIntro) }, new OsuButton { RelativeSizeAxes = Axes.X, Text = "MapPool", Action = () => setScreen(mapPool) }, - new OsuButton { RelativeSizeAxes = Axes.X, Text = "Bracket", Action = () => setScreen(bracket) }, + new Container { RelativeSizeAxes = Axes.X, Height = 50 }, + new OsuButton { RelativeSizeAxes = Axes.X, Text = "Gameplay", Action = () => setScreen(gameplay) }, } }, }, @@ -89,7 +94,8 @@ namespace osu.Game.Tournament.Screens mapPool = new MapPoolScreen(ladder.Groupings.First(g => g.Name == "Finals")), teamIntro = new TeamIntroScreen(ladder.Teams.First(t => t.Acronym == "USA"), ladder.Teams.First(t => t.Acronym == "JPN"), ladder.Groupings.First(g => g.Name == "Finals")), - drawings = new DrawingsScreen() + drawings = new DrawingsScreen(), + gameplay = new GameplayScreen() } }, } From 3427127589afb95b16de9ce6963122ceffc06748 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 6 Nov 2018 19:23:16 +0900 Subject: [PATCH 085/317] Automatically keep window wide enough to display correctly --- osu.Game.Tournament/TournamentGameBase.cs | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/osu.Game.Tournament/TournamentGameBase.cs b/osu.Game.Tournament/TournamentGameBase.cs index e76038d818..cbb7a9fd35 100644 --- a/osu.Game.Tournament/TournamentGameBase.cs +++ b/osu.Game.Tournament/TournamentGameBase.cs @@ -1,6 +1,7 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using System.Drawing; using System.IO; using Newtonsoft.Json; using osu.Framework.Allocation; @@ -27,16 +28,20 @@ namespace osu.Game.Tournament [Cached] private readonly Bindable ruleset = new Bindable(); + private Bindable windowSize; + protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnlyDependencyContainer parent) { return dependencies = new DependencyContainer(base.CreateChildDependencies(parent)); } [BackgroundDependencyLoader] - private void load(Storage storage) + private void load(Storage storage, FrameworkConfigManager frameworkConfig) { this.storage = storage; + windowSize = frameworkConfig.GetBindable(FrameworkSetting.WindowedSize); + string content = null; if (storage.Exists(bracket_filename)) using (Stream stream = storage.GetStream(bracket_filename, FileAccess.Read, FileMode.Open)) @@ -81,6 +86,18 @@ namespace osu.Game.Tournament MenuCursorContainer.Cursor.Alpha = 0; } + protected override void Update() + { + + base.Update(); + var minWidth = (int)(windowSize.Value.Height / 9f * 16 + 400); + if (windowSize.Value.Width < minWidth) + { + // todo: can be removed after ppy/osu-framework#1975 + windowSize.Value = Host.Window.ClientSize = new Size(minWidth, windowSize.Value.Height); + } + } + protected virtual void SaveChanges() { using (var stream = storage.GetStream(bracket_filename, FileAccess.Write, FileMode.Create)) From 4e872880493fc64a051dea9b889ac1be18feb43c Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 6 Nov 2018 20:13:04 +0900 Subject: [PATCH 086/317] Add the concept of "current match" --- .../TestCaseTeamIntro.cs | 16 +++++--- .../Screens/TeamIntro/TeamIntroScreen.cs | 39 +++++++++++-------- osu.Game.Tournament/TournamentGameBase.cs | 8 ++++ 3 files changed, 41 insertions(+), 22 deletions(-) diff --git a/osu.Game.Tournament.Tests/TestCaseTeamIntro.cs b/osu.Game.Tournament.Tests/TestCaseTeamIntro.cs index 845f5638a0..6fab1fd875 100644 --- a/osu.Game.Tournament.Tests/TestCaseTeamIntro.cs +++ b/osu.Game.Tournament.Tests/TestCaseTeamIntro.cs @@ -3,22 +3,28 @@ using System.Linq; using osu.Framework.Allocation; +using osu.Framework.Configuration; using osu.Framework.Graphics; +using osu.Game.Tournament.Screens.Ladder.Components; using osu.Game.Tournament.Screens.TeamIntro; namespace osu.Game.Tournament.Tests { public class TestCaseTeamIntro : LadderTestCase { + [Cached] + private readonly Bindable currentMatch = new Bindable(); + [BackgroundDependencyLoader] private void load() { - var team1 = Ladder.Teams.FirstOrDefault(t => t.Acronym == "USA"); - var team2 = Ladder.Teams.FirstOrDefault(t => t.Acronym == "JPN"); + var pairing = new MatchPairing(); + pairing.Team1.Value = Ladder.Teams.FirstOrDefault(t => t.Acronym == "USA"); + pairing.Team2.Value = Ladder.Teams.FirstOrDefault(t => t.Acronym == "JPN"); + pairing.Grouping.Value = Ladder.Groupings.FirstOrDefault(g => g.Name == "Finals"); + currentMatch.Value = pairing; - var round = Ladder.Groupings.FirstOrDefault(g => g.Name == "Finals"); - - Add(new TeamIntroScreen(team1, team2, round) + Add(new TeamIntroScreen() { FillMode = FillMode.Fit, FillAspectRatio = 16 / 9f diff --git a/osu.Game.Tournament/Screens/TeamIntro/TeamIntroScreen.cs b/osu.Game.Tournament/Screens/TeamIntro/TeamIntroScreen.cs index 2c50970624..4b5e9aaf09 100644 --- a/osu.Game.Tournament/Screens/TeamIntro/TeamIntroScreen.cs +++ b/osu.Game.Tournament/Screens/TeamIntro/TeamIntroScreen.cs @@ -3,6 +3,7 @@ using System; using osu.Framework.Allocation; +using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Video; @@ -19,30 +20,34 @@ namespace osu.Game.Tournament.Screens.TeamIntro { public class TeamIntroScreen : OsuScreen { - private readonly TournamentTeam team1; - private readonly TournamentTeam team2; - private readonly TournamentGrouping round; + private VideoSprite background; - public TeamIntroScreen(TournamentTeam team1, TournamentTeam team2, TournamentGrouping round) - { - this.team1 = team1; - this.team2 = team2; - this.round = round; - } + [Resolved] + private Bindable currentMatch { get; set; } [BackgroundDependencyLoader] private void load(Storage storage) { RelativeSizeAxes = Axes.Both; + background = new VideoSprite(storage.GetStream(@"BG Team - Both OWC.m4v")) + { + RelativeSizeAxes = Axes.Both, + Loop = true, + }; + + currentMatch.BindValueChanged(matchChanged, true); + } + + private void matchChanged(MatchPairing pairing) + { + if (pairing == null) + return; + InternalChildren = new Drawable[] { - new VideoSprite(storage.GetStream(@"BG Team - Both OWC.m4v")) - { - RelativeSizeAxes = Axes.Both, - Loop = true, - }, - new TeamWithPlayers(team1, true) + background, + new TeamWithPlayers(pairing.Team1, true) { RelativeSizeAxes = Axes.Both, Width = 0.5f, @@ -50,7 +55,7 @@ namespace osu.Game.Tournament.Screens.TeamIntro Anchor = Anchor.Centre, Origin = Anchor.CentreRight }, - new TeamWithPlayers(team2) + new TeamWithPlayers(pairing.Team2) { RelativeSizeAxes = Axes.Both, Width = 0.5f, @@ -58,7 +63,7 @@ namespace osu.Game.Tournament.Screens.TeamIntro Anchor = Anchor.Centre, Origin = Anchor.CentreLeft }, - new RoundDisplay(round) + new RoundDisplay(pairing.Grouping) { RelativeSizeAxes = Axes.Both, Height = 0.25f, diff --git a/osu.Game.Tournament/TournamentGameBase.cs b/osu.Game.Tournament/TournamentGameBase.cs index cbb7a9fd35..9e9ed58297 100644 --- a/osu.Game.Tournament/TournamentGameBase.cs +++ b/osu.Game.Tournament/TournamentGameBase.cs @@ -3,6 +3,7 @@ using System.Drawing; using System.IO; +using System.Linq; using Newtonsoft.Json; using osu.Framework.Allocation; using osu.Framework.Configuration; @@ -28,6 +29,9 @@ namespace osu.Game.Tournament [Cached] private readonly Bindable ruleset = new Bindable(); + [Cached] + private readonly Bindable currentMatch = new Bindable(); + private Bindable windowSize; protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnlyDependencyContainer parent) @@ -51,6 +55,10 @@ namespace osu.Game.Tournament } Ladder = content != null ? JsonConvert.DeserializeObject(content) : new LadderInfo(); + + //todo: temp + currentMatch.Value = Ladder.Pairings.FirstOrDefault(); + dependencies.Cache(Ladder); bool addedInfo = false; From 968d39c0e6858ad0d4ba423931ab43ad37a83fb0 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 6 Nov 2018 20:13:09 +0900 Subject: [PATCH 087/317] Rearrange scenes --- osu.Game.Tournament/Screens/TournamentSceneManager.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/osu.Game.Tournament/Screens/TournamentSceneManager.cs b/osu.Game.Tournament/Screens/TournamentSceneManager.cs index 87223c04a6..303e15aa8d 100644 --- a/osu.Game.Tournament/Screens/TournamentSceneManager.cs +++ b/osu.Game.Tournament/Screens/TournamentSceneManager.cs @@ -58,9 +58,9 @@ namespace osu.Game.Tournament.Screens new OsuButton { RelativeSizeAxes = Axes.X, Text = "Showcase", Action = () => setScreen(showcase) }, new Container { RelativeSizeAxes = Axes.X, Height = 50 }, new OsuButton { RelativeSizeAxes = Axes.X, Text = "Bracket", Action = () => setScreen(bracket) }, + new Container { RelativeSizeAxes = Axes.X, Height = 50 }, new OsuButton { RelativeSizeAxes = Axes.X, Text = "TeamIntro", Action = () => setScreen(teamIntro) }, new OsuButton { RelativeSizeAxes = Axes.X, Text = "MapPool", Action = () => setScreen(mapPool) }, - new Container { RelativeSizeAxes = Axes.X, Height = 50 }, new OsuButton { RelativeSizeAxes = Axes.X, Text = "Gameplay", Action = () => setScreen(gameplay) }, } }, @@ -92,8 +92,7 @@ namespace osu.Game.Tournament.Screens bracket = new LadderManager(ladder), showcase = new ShowcaseScreen(), mapPool = new MapPoolScreen(ladder.Groupings.First(g => g.Name == "Finals")), - teamIntro = new TeamIntroScreen(ladder.Teams.First(t => t.Acronym == "USA"), ladder.Teams.First(t => t.Acronym == "JPN"), - ladder.Groupings.First(g => g.Name == "Finals")), + teamIntro = new TeamIntroScreen(), drawings = new DrawingsScreen(), gameplay = new GameplayScreen() } From 53ec01d51f972c7117f56d8c9b0577f86ad89beb Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 6 Nov 2018 20:18:11 +0900 Subject: [PATCH 088/317] Perform mappings earlier in execution --- .../TestCaseTeamIntro.cs | 2 +- .../Screens/Ladder/LadderManager.cs | 29 --------------- osu.Game.Tournament/TournamentGameBase.cs | 35 +++++++++++++++++-- 3 files changed, 33 insertions(+), 33 deletions(-) diff --git a/osu.Game.Tournament.Tests/TestCaseTeamIntro.cs b/osu.Game.Tournament.Tests/TestCaseTeamIntro.cs index 6fab1fd875..004009f269 100644 --- a/osu.Game.Tournament.Tests/TestCaseTeamIntro.cs +++ b/osu.Game.Tournament.Tests/TestCaseTeamIntro.cs @@ -24,7 +24,7 @@ namespace osu.Game.Tournament.Tests pairing.Grouping.Value = Ladder.Groupings.FirstOrDefault(g => g.Name == "Finals"); currentMatch.Value = pairing; - Add(new TeamIntroScreen() + Add(new TeamIntroScreen { FillMode = FillMode.Fit, FillAspectRatio = 16 / 9f diff --git a/osu.Game.Tournament/Screens/Ladder/LadderManager.cs b/osu.Game.Tournament/Screens/Ladder/LadderManager.cs index ebac91c4f7..2ad296dd77 100644 --- a/osu.Game.Tournament/Screens/Ladder/LadderManager.cs +++ b/osu.Game.Tournament/Screens/Ladder/LadderManager.cs @@ -1,7 +1,6 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using System; using System.Collections.Generic; using System.Linq; using osu.Framework.Allocation; @@ -67,37 +66,9 @@ namespace osu.Game.Tournament.Screens.Ladder } }; - // assign teams - foreach (var pairing in info.Pairings) - { - pairing.Team1.Value = info.Teams.FirstOrDefault(t => t.Acronym == pairing.Team1Acronym); - pairing.Team2.Value = info.Teams.FirstOrDefault(t => t.Acronym == pairing.Team2Acronym); - } - - // assign progressions - foreach (var pair in info.Progressions) - { - var src = info.Pairings.FirstOrDefault(p => p.ID == pair.Item1); - var dest = info.Pairings.FirstOrDefault(p => p.ID == pair.Item2); - - if (src == null) throw new InvalidOperationException(); - - if (dest != null) - { - if (pair.Losers) - src.LosersProgression.Value = dest; - else - src.Progression.Value = dest; - } - } - foreach (var pairing in info.Pairings) addPairing(pairing); - foreach (var group in info.Groupings) - foreach (var id in group.Pairings) - info.Pairings.Single(p => p.ID == id).Grouping.Value = group; - // todo: fix this Scheduler.AddDelayed(() => layout.Invalidate(), 100, true); } diff --git a/osu.Game.Tournament/TournamentGameBase.cs b/osu.Game.Tournament/TournamentGameBase.cs index 9e9ed58297..f7b829b4c7 100644 --- a/osu.Game.Tournament/TournamentGameBase.cs +++ b/osu.Game.Tournament/TournamentGameBase.cs @@ -1,6 +1,7 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using System; using System.Drawing; using System.IO; using System.Linq; @@ -56,13 +57,38 @@ namespace osu.Game.Tournament Ladder = content != null ? JsonConvert.DeserializeObject(content) : new LadderInfo(); - //todo: temp - currentMatch.Value = Ladder.Pairings.FirstOrDefault(); - dependencies.Cache(Ladder); bool addedInfo = false; + // assign teams + foreach (var pairing in Ladder.Pairings) + { + pairing.Team1.Value = Ladder.Teams.FirstOrDefault(t => t.Acronym == pairing.Team1Acronym); + pairing.Team2.Value = Ladder.Teams.FirstOrDefault(t => t.Acronym == pairing.Team2Acronym); + } + + // assign progressions + foreach (var pair in Ladder.Progressions) + { + var src = Ladder.Pairings.FirstOrDefault(p => p.ID == pair.Item1); + var dest = Ladder.Pairings.FirstOrDefault(p => p.ID == pair.Item2); + + if (src == null) throw new InvalidOperationException(); + + if (dest != null) + { + if (pair.Losers) + src.LosersProgression.Value = dest; + else + src.Progression.Value = dest; + } + } + + foreach (var group in Ladder.Groupings) + foreach (var id in group.Pairings) + Ladder.Pairings.Single(p => p.ID == id).Grouping.Value = group; + foreach (var g in Ladder.Groupings) foreach (var b in g.Beatmaps) if (b.BeatmapInfo == null) @@ -74,6 +100,9 @@ namespace osu.Game.Tournament addedInfo = true; } + //todo: temp + currentMatch.Value = Ladder.Pairings.FirstOrDefault(); + if (addedInfo) SaveChanges(); From 555d63165b04f716a42434f0702c766bd1b1a367 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 7 Nov 2018 00:27:12 +0900 Subject: [PATCH 089/317] Add custom font --- .../Resources/Fonts/Aquatico-Light.bin | Bin 0 -> 4998 bytes .../Resources/Fonts/Aquatico-Light_0.png | Bin 0 -> 68407 bytes .../Resources/Fonts/Aquatico-Regular.bin | Bin 0 -> 4994 bytes .../Resources/Fonts/Aquatico-Regular_0.png | Bin 0 -> 69000 bytes .../Screens/TeamIntro/TeamIntroScreen.cs | 9 +++++---- osu.Game.Tournament/TournamentGameBase.cs | 6 ++++++ 6 files changed, 11 insertions(+), 4 deletions(-) create mode 100644 osu.Game.Tournament/Resources/Fonts/Aquatico-Light.bin create mode 100644 osu.Game.Tournament/Resources/Fonts/Aquatico-Light_0.png create mode 100644 osu.Game.Tournament/Resources/Fonts/Aquatico-Regular.bin create mode 100644 osu.Game.Tournament/Resources/Fonts/Aquatico-Regular_0.png diff --git a/osu.Game.Tournament/Resources/Fonts/Aquatico-Light.bin b/osu.Game.Tournament/Resources/Fonts/Aquatico-Light.bin new file mode 100644 index 0000000000000000000000000000000000000000..42cfdf08de4977e66acd9063ef31741f88715f0f GIT binary patch literal 4998 zcmZ9O$&XZ36vof1YC$6UOoK#>Od^8_O?Lw-Gzv7>Ey|#X4HzR~kimgL8AMGq{sB0| zg_`Kb7$YVoy3mDjr7K z#f*s9A3y8r5Jg8vtUG>k&xynPj?Uh6_~4-vQ7Q9^$8;|`ioB$wI$eMNzivrh*R}WX zk=@;0$BrC~j*Al_W^2WY7>YvwN9>C^5v8uERR>~H^hY(Ogmx}(llEmXznB^~WlcMm zbETb+598j(x_)W5OZ!pR(%7bTH)!uD=jr$2%Es6j>+`c)rOlUipx72GV}rELxKG*w zY3CJVVoa4bHLjPoP};*vZANU#&njklhqUjrwmGjuTO{orJ$p;sEbXS4E$vQebBaYp zPb`r(GwzbMSlSQG7#nkpCDLxJ%qwn<30k)-RBPEKty-C1Op1xpwqy^MO5?wt*ePvt z-mhD~zo|s5j{Bu`#yUOQBki|p#Po(QGo|%PJ0lNzvIm`Ux3p!_K9{z%;R{|Zm-cq$ zP5EN)*GQ8d9~F;i9bQezo~o8Orx?o`aaU@c_KfeU=cBvvEc@LftxxNgx2)6Jc%kjt zRnms!)udRU7TTX{khY_Ef80#oFYTYoh3IWOi}wT4&dRHv7Hv@4CwdpwG-gtJm5Lp&SKk;HccZjp zs^i+mvo~nngVHXjM+@{UIcv_!hoqI2U*(>2mdE8LX}x;3tD&jip7%7g16sFJ z+6Bd3(a`W8fcn7dVbawao1Hst{k!(Wa(&-qd|@aIU3VIz4Zi9 zuW6`BthKhINyM?{taz3fqj?wNn)obS$r>;GmBhr6-&iJcHc^L(+Due#!VMESo2X+f zF}JQ4vImfTf$SB;e)aqW`wsJvWRJZzLtr8)Do+SR?ox=(@>Lm z-kN*P6Ye?Won$lY7ox_nh;Ab;Ai_-EhtYx|E5#Cc8mKM|F+lyLJuDPC|AU zBF;$S_jX1hLlSZlSq@ z5ViU4@g_NY?mByjtVR<5OyO?I#9b4aj%AHZ#}aGEY9td`nd}gE$;z6YM6rpLSZON_R^srgHccA%;GON{0(G2|~X@~J+?1$`T}Co-x1R75t)4a3nVd6ExDLp*L9Q3F2atV%>=pg- zevqR<)LTyw^_r;HM7<_w#X2e)%}-FJ$!8dMeTFduxG|O>GBA;qiA+soZ=xa-Rhp=L zEHO#!SI^{%&|D?t$|1V}v7et{KNI_zsAD+qM;*h7)o3XbT1reNaYr%{*F;e(XUNeYX8<`X$eHrSvTis*tQ*dmItE!eF63Mw=l369{|p2G literal 0 HcmV?d00001 diff --git a/osu.Game.Tournament/Resources/Fonts/Aquatico-Light_0.png b/osu.Game.Tournament/Resources/Fonts/Aquatico-Light_0.png new file mode 100644 index 0000000000000000000000000000000000000000..332d9ca0564224402f3b28d295b9ec05d3736822 GIT binary patch literal 68407 zcmXtfWmr^g*Y;2X(jncAfCxjkNT-U@rN96J4k=xVG?D^CONw+i3`jFWNOwxZ&?=k7?(r^vwhCO z0L+1+5y$Y+E%u{!;-#5!if$D27V2uPx+Vbq2vxHFWc^IcG6Vt@vwnQ?>^Tb^N&90t zd^v+{D5H|N(M0)U=a@=XPq5;YiJy!WRyg1&!0q126EG<|BDJD~6MsP;3&av)gw2g|f3_|tCZ#$xc()6((ihU7qxnJ8)rSC%;LMfoHtnol&?_}$8 ziNuSsfFY8h-s1uC_;Pr1R-*|AA2dBH1aO@4<#ic7I>(9&cGgCAP0)f1vln81x3^@< z{qaRK%K zUUk&HjCEDgz?qk|q_vIplQnJWhC2#ZNmoTm=YSN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ament/Resources/Fonts/Aquatico-Regular.bin new file mode 100644 index 0000000000000000000000000000000000000000..3047c2eb3ef7354d250cf4c88b919269a696a06c GIT binary patch literal 4994 zcmZ9OOKeqD6o%Kit%`~{S|k_|M0qG6rId;Sf>54Sd8&YDROBUyAdjLlFp-f%;s9}= zaUuzcP8m6IVB)}mF>0KsL~({OUL6+fhu4 zh&}PGKAocI?2MI12X~z~u=_~V%6#ovsnJ>Fi=7>l_5c4X=55`(fAG+*W8JSDIQ&vi z_Zx@zN9Uy*Bc^H1m0}UOQT3S~;F6{wn zOBLf*#USn-(jJudwNjfFPi0Mem9wR7&Dw^hHb>fD#q?rIOqMn=ly5m#+VNs$(Hrxn zO^rvSJtXa+W{mYY#yn|X*6u0pjhnTuH&jE}E$xW3QZ;nM`s~4cY5erY4r#aK{d)BM zy^e^-VvV#eIT7UoX+Ox9$(1kiv+R|&JU)(v*@G_C9_2!5zsEp_rk1 zyH&@`T<=n8|HK?=i>1xV+GEm|6|*W&XJ!wUN&7T(rRFWxw|T!> z+S%F}dF^#tQ?8MAQS-d8((r1nw83USCggssllE0DG>h(~?kg2LcGi9z6L&z`_c6B^ zU+veWbx%n9wqqb>D{Ib&=BIp8+SJ<5WA1%Q+9$fVr@B|YEjLKpq@1ajx!3-s&Pd#; z{aWW>le8=HYMt_{Y1Xt?xmnsfs;#fOm;P>%#(b=ct=g|Ew12r(-=Eh^F0R(8KjqWX zF2%Dt9X^BfP5#HJ_@kLK>-1F7&!@4ZWhS>t`JrV_)w6QDw0`yXaWuBRr zH>I5~HjkN?x1^0%ey#KJwzRV?XOI}Dq%CX9?}9X5V;eQ`%)REjykYfty#%HA>yr}1 zBf_KuUJ;K2YaDo!j$uU{WNRE>69?495j1hgOpKq20W&dHCWgtxxR@9c6Juba`6k+H zqJbt_WLhO^^KCS-W|uzoOmxEJxLkEEkn@9_Gu>n7M!we-an)5qt{k!(Wa(&-qd|@a zIU3VIy^RD>uW4J8SZi&2lZa!@S#d8hM)EGiHSt>bH)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t)=fo92=i*19pfu7BxM&q&%t7|wAAKlr zBJSd(xFewYpNpuj0~c1yD+vAfl7IE`uQ7m5@voEo|Ah=T^u7H6K!pdl^D+Gw0{(@7 z|6d^BtSe|k6#)NKUv=$sGHHR+R{%f;mb-w?aQWhRo#x_roAcu6sCse4qArdo2;|}) z^xqpU)bOvCR4>%(FrameworkSetting.WindowedSize); From a0d64c1b13f779488dbfb4a7d952b0e07bbfbfa8 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 7 Nov 2018 01:20:32 +0900 Subject: [PATCH 090/317] Add ability to select current match --- osu.Game.Tournament.Tests/LadderTestCase.cs | 1 - .../Ladder/Components => }/LadderInfo.cs | 8 ++++- .../Ladder/Components/DrawableMatchPairing.cs | 25 ++++++++++++++- .../Ladder/Components/DrawableMatchTeam.cs | 9 +++++- .../Screens/Ladder/Components/MatchPairing.cs | 5 +++ .../Screens/Ladder/LadderManager.cs | 13 ++++++++ .../Screens/TeamIntro/TeamIntroScreen.cs | 32 ++++++++++++------- .../Screens/TournamentSceneManager.cs | 1 - osu.Game.Tournament/TournamentGame.cs | 9 +++++- osu.Game.Tournament/TournamentGameBase.cs | 9 ++---- 10 files changed, 88 insertions(+), 24 deletions(-) rename osu.Game.Tournament/{Screens/Ladder/Components => }/LadderInfo.cs (70%) diff --git a/osu.Game.Tournament.Tests/LadderTestCase.cs b/osu.Game.Tournament.Tests/LadderTestCase.cs index b296956d42..acc96930ee 100644 --- a/osu.Game.Tournament.Tests/LadderTestCase.cs +++ b/osu.Game.Tournament.Tests/LadderTestCase.cs @@ -3,7 +3,6 @@ using osu.Framework.Allocation; using osu.Game.Tests.Visual; -using osu.Game.Tournament.Screens.Ladder.Components; namespace osu.Game.Tournament.Tests { diff --git a/osu.Game.Tournament/Screens/Ladder/Components/LadderInfo.cs b/osu.Game.Tournament/LadderInfo.cs similarity index 70% rename from osu.Game.Tournament/Screens/Ladder/Components/LadderInfo.cs rename to osu.Game.Tournament/LadderInfo.cs index 567cdb0daa..c433987491 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/LadderInfo.cs +++ b/osu.Game.Tournament/LadderInfo.cs @@ -2,9 +2,12 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; +using Newtonsoft.Json; +using osu.Framework.Configuration; using osu.Game.Tournament.Components; +using osu.Game.Tournament.Screens.Ladder.Components; -namespace osu.Game.Tournament.Screens.Ladder.Components +namespace osu.Game.Tournament { public class LadderInfo { @@ -12,5 +15,8 @@ namespace osu.Game.Tournament.Screens.Ladder.Components public List Progressions = new List(); public List Groupings = new List(); public List Teams = new List(); + + [JsonIgnore] + public Bindable CurrentMatch = new Bindable(); } } diff --git a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs index 81b3223ea7..5d0837c542 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs @@ -20,6 +20,7 @@ namespace osu.Game.Tournament.Screens.Ladder.Components public readonly MatchPairing Pairing; private readonly FillFlowContainer flow; private readonly Drawable selectionBox; + private readonly Drawable currentMatchSelectionBox; private Bindable globalSelection; [Resolved(CanBeNull = true)] @@ -49,6 +50,18 @@ namespace osu.Game.Tournament.Screens.Ladder.Components Colour = Color4.YellowGreen, Child = new Box { RelativeSizeAxes = Axes.Both } }, + currentMatchSelectionBox = new Container + { + CornerRadius = 5, + Masking = true, + Scale = new Vector2(1.05f), + RelativeSizeAxes = Axes.Both, + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + Alpha = 0, + Colour = Color4.OrangeRed, + Child = new Box { RelativeSizeAxes = Axes.Both } + }, flow = new FillFlowContainer { AutoSizeAxes = Axes.Both, @@ -65,10 +78,19 @@ namespace osu.Game.Tournament.Screens.Ladder.Components pairing.Progression.BindValueChanged(_ => updateProgression()); pairing.LosersProgression.BindValueChanged(_ => updateProgression()); pairing.Losers.BindValueChanged(_ => updateTeams()); + pairing.Current.BindValueChanged(_ => updateCurrentMatch(), true); updateTeams(); } + private void updateCurrentMatch() + { + if (Pairing.Current.Value) + currentMatchSelectionBox.Show(); + else + currentMatchSelectionBox.Hide(); + } + private bool selected; public bool Selected @@ -144,7 +166,8 @@ namespace osu.Game.Tournament.Screens.Ladder.Components var instaWinAmount = Pairing.Grouping.Value.BestOf / 2; - Pairing.Completed.Value = Pairing.Grouping.Value.BestOf > 0 && (Pairing.Team1Score + Pairing.Team2Score >= Pairing.Grouping.Value.BestOf || Pairing.Team1Score > instaWinAmount || Pairing.Team2Score > instaWinAmount); + Pairing.Completed.Value = Pairing.Grouping.Value.BestOf > 0 + && (Pairing.Team1Score + Pairing.Team2Score >= Pairing.Grouping.Value.BestOf || Pairing.Team1Score > instaWinAmount || Pairing.Team2Score > instaWinAmount); } protected override void LoadComplete() diff --git a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs index 70ddb6b664..804680ba28 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs @@ -126,10 +126,16 @@ namespace osu.Game.Tournament.Screens.Ladder.Components } //TODO: use OnClick instead once we have per-button clicks. - protected override bool OnMouseUp(MouseUpEvent e) + protected override bool OnClick(ClickEvent e) { if (Team == null || editorInfo.EditingEnabled) return false; + if (!pairing.Current.Value) + { + manager.SetCurrent(pairing); + return true; + } + if (e.Button == MouseButton.Left) { if (score.Value == null) @@ -176,6 +182,7 @@ namespace osu.Game.Tournament.Screens.Ladder.Components return new MenuItem[] { + new OsuMenuItem("Set as current", MenuItemType.Standard, () => manager.SetCurrent(pairing)), new OsuMenuItem("Join with", MenuItemType.Standard, () => manager.RequestJoin(pairing, false)), new OsuMenuItem("Join with (loser)", MenuItemType.Standard, () => manager.RequestJoin(pairing, true)), new OsuMenuItem("Remove", MenuItemType.Destructive, () => manager.Remove(pairing)), diff --git a/osu.Game.Tournament/Screens/Ladder/Components/MatchPairing.cs b/osu.Game.Tournament/Screens/Ladder/Components/MatchPairing.cs index 5dc2009c4d..aa0c3229c9 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/MatchPairing.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/MatchPairing.cs @@ -43,6 +43,11 @@ namespace osu.Game.Tournament.Screens.Ladder.Components [JsonIgnore] public readonly Bindable LosersProgression = new Bindable(); + /// + /// Should not be set directly. Use LadderInfo.CurrentMatch.Value = this instead. + /// + public readonly Bindable Current = new Bindable(); + public readonly Bindable Date = new Bindable(); public Point Position; diff --git a/osu.Game.Tournament/Screens/Ladder/LadderManager.cs b/osu.Game.Tournament/Screens/Ladder/LadderManager.cs index 2ad296dd77..f348eff571 100644 --- a/osu.Game.Tournament/Screens/Ladder/LadderManager.cs +++ b/osu.Game.Tournament/Screens/Ladder/LadderManager.cs @@ -23,6 +23,7 @@ using SixLabors.Primitives; namespace osu.Game.Tournament.Screens.Ladder { + [Cached] public class LadderManager : CompositeDrawable, IHasContextMenu { public readonly List Teams; @@ -30,6 +31,8 @@ namespace osu.Game.Tournament.Screens.Ladder private readonly Container paths; private readonly Container headings; + private readonly LadderInfo info; + private readonly ScrollableContainer scrollContent; [Cached] @@ -37,6 +40,7 @@ namespace osu.Game.Tournament.Screens.Ladder public LadderManager(LadderInfo info) { + this.info = info; editorInfo.Teams = Teams = info.Teams; editorInfo.Groupings = info.Groupings; @@ -255,5 +259,14 @@ namespace osu.Game.Tournament.Screens.Ladder } public void Remove(MatchPairing pairing) => pairingsContainer.FirstOrDefault(p => p.Pairing == pairing)?.Remove(); + + public void SetCurrent(MatchPairing pairing) + { + if (info.CurrentMatch.Value != null) + info.CurrentMatch.Value.Current.Value = false; + + info.CurrentMatch.Value = pairing; + info.CurrentMatch.Value.Current.Value = true; + } } } diff --git a/osu.Game.Tournament/Screens/TeamIntro/TeamIntroScreen.cs b/osu.Game.Tournament/Screens/TeamIntro/TeamIntroScreen.cs index 522af5f6c9..d515312dd0 100644 --- a/osu.Game.Tournament/Screens/TeamIntro/TeamIntroScreen.cs +++ b/osu.Game.Tournament/Screens/TeamIntro/TeamIntroScreen.cs @@ -3,7 +3,6 @@ using System; using osu.Framework.Allocation; -using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Video; @@ -20,33 +19,42 @@ namespace osu.Game.Tournament.Screens.TeamIntro { public class TeamIntroScreen : OsuScreen { - private VideoSprite background; + private Container mainContainer; [Resolved] - private Bindable currentMatch { get; set; } + private LadderInfo ladderInfo { get; set; } [BackgroundDependencyLoader] private void load(Storage storage) { RelativeSizeAxes = Axes.Both; - background = new VideoSprite(storage.GetStream(@"BG Team - Both OWC.m4v")) + InternalChildren = new Drawable[] { - RelativeSizeAxes = Axes.Both, - Loop = true, + new VideoSprite(storage.GetStream(@"BG Team - Both OWC.m4v")) + { + RelativeSizeAxes = Axes.Both, + Loop = true, + }, + mainContainer = new Container + { + RelativeSizeAxes = Axes.Both, + } }; - currentMatch.BindValueChanged(matchChanged, true); + ladderInfo.CurrentMatch.BindValueChanged(matchChanged, true); } private void matchChanged(MatchPairing pairing) { if (pairing == null) - return; - - InternalChildren = new Drawable[] { - background, + mainContainer.Clear(); + return; + } + + mainContainer.Children = new Drawable[] + { new TeamWithPlayers(pairing.Team1, true) { RelativeSizeAxes = Axes.Both, @@ -148,6 +156,8 @@ namespace osu.Game.Tournament.Screens.TeamIntro AutoSizeAxes = Axes.Both, Spacing = new Vector2(0, 5), Padding = new MarginPadding(20), + + Anchor = !left ? Anchor.CentreRight : Anchor.CentreLeft, Origin = !left ? Anchor.CentreRight : Anchor.CentreLeft, RelativePositionAxes = Axes.Both, diff --git a/osu.Game.Tournament/Screens/TournamentSceneManager.cs b/osu.Game.Tournament/Screens/TournamentSceneManager.cs index 303e15aa8d..91d389b63d 100644 --- a/osu.Game.Tournament/Screens/TournamentSceneManager.cs +++ b/osu.Game.Tournament/Screens/TournamentSceneManager.cs @@ -13,7 +13,6 @@ using osu.Game.Screens; using osu.Game.Tournament.Screens.Drawings; using osu.Game.Tournament.Screens.Gameplay; using osu.Game.Tournament.Screens.Ladder; -using osu.Game.Tournament.Screens.Ladder.Components; using osu.Game.Tournament.Screens.MapPool; using osu.Game.Tournament.Screens.Showcase; using osu.Game.Tournament.Screens.TeamIntro; diff --git a/osu.Game.Tournament/TournamentGame.cs b/osu.Game.Tournament/TournamentGame.cs index b4bdf250b6..f970700fc5 100644 --- a/osu.Game.Tournament/TournamentGame.cs +++ b/osu.Game.Tournament/TournamentGame.cs @@ -1,6 +1,8 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using osu.Framework.Graphics; +using osu.Game.Graphics.Cursor; using osu.Game.Tournament.Screens; namespace osu.Game.Tournament @@ -10,7 +12,12 @@ namespace osu.Game.Tournament protected override void LoadComplete() { base.LoadComplete(); - Add(new TournamentSceneManager()); + + Add(new OsuContextMenuContainer + { + RelativeSizeAxes = Axes.Both, + Child = new TournamentSceneManager() + }); MenuCursorContainer.Cursor.Alpha = 0; } diff --git a/osu.Game.Tournament/TournamentGameBase.cs b/osu.Game.Tournament/TournamentGameBase.cs index 6eb1feaf6d..2ae6c60067 100644 --- a/osu.Game.Tournament/TournamentGameBase.cs +++ b/osu.Game.Tournament/TournamentGameBase.cs @@ -15,7 +15,6 @@ using osu.Game.Beatmaps; using osu.Game.Graphics.UserInterface; using osu.Game.Online.API.Requests; using osu.Game.Rulesets; -using osu.Game.Tournament.Screens.Ladder.Components; namespace osu.Game.Tournament { @@ -31,9 +30,6 @@ namespace osu.Game.Tournament [Cached] private readonly Bindable ruleset = new Bindable(); - [Cached] - private readonly Bindable currentMatch = new Bindable(); - private Bindable windowSize; protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnlyDependencyContainer parent) @@ -95,6 +91,8 @@ namespace osu.Game.Tournament foreach (var id in group.Pairings) Ladder.Pairings.Single(p => p.ID == id).Grouping.Value = group; + Ladder.CurrentMatch.Value = Ladder.Pairings.FirstOrDefault(p => p.Current.Value); + foreach (var g in Ladder.Groupings) foreach (var b in g.Beatmaps) if (b.BeatmapInfo == null) @@ -106,9 +104,6 @@ namespace osu.Game.Tournament addedInfo = true; } - //todo: temp - currentMatch.Value = Ladder.Pairings.FirstOrDefault(); - if (addedInfo) SaveChanges(); From 878b16c596a30e0cd9272cd44a68f75815142750 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 7 Nov 2018 02:50:44 +0900 Subject: [PATCH 091/317] Add automatic country/user information lookups --- .../Components/TournamentTeam.cs | 2 +- osu.Game.Tournament/Resources/countries.json | 1252 +++++++++++++++++ osu.Game.Tournament/TournamentGameBase.cs | 35 +- 3 files changed, 1287 insertions(+), 2 deletions(-) create mode 100644 osu.Game.Tournament/Resources/countries.json diff --git a/osu.Game.Tournament/Components/TournamentTeam.cs b/osu.Game.Tournament/Components/TournamentTeam.cs index 78e1386706..62dc703fee 100644 --- a/osu.Game.Tournament/Components/TournamentTeam.cs +++ b/osu.Game.Tournament/Components/TournamentTeam.cs @@ -39,7 +39,7 @@ namespace osu.Game.Tournament.Components } [JsonProperty] - public List Players { get; set; } + public List Players { get; set; } = new List(); public override string ToString() => FullName ?? Acronym; } diff --git a/osu.Game.Tournament/Resources/countries.json b/osu.Game.Tournament/Resources/countries.json new file mode 100644 index 0000000000..ec2ca2bf37 --- /dev/null +++ b/osu.Game.Tournament/Resources/countries.json @@ -0,0 +1,1252 @@ +[ + { + "FlagName": "BD", + "FullName": "Bangladesh", + "Acronym": "BGD" + }, + { + "FlagName": "BE", + "FullName": "Belgium", + "Acronym": "BEL" + }, + { + "FlagName": "BF", + "FullName": "Burkina Faso", + "Acronym": "BFA" + }, + { + "FlagName": "BG", + "FullName": "Bulgaria", + "Acronym": "BGR" + }, + { + "FlagName": "BA", + "FullName": "Bosnia and Herzegovina", + "Acronym": "BIH" + }, + { + "FlagName": "BB", + "FullName": "Barbados", + "Acronym": "BRB" + }, + { + "FlagName": "WF", + "FullName": "Wallis and Futuna", + "Acronym": "WLF" + }, + { + "FlagName": "BL", + "FullName": "Saint Barthelemy", + "Acronym": "BLM" + }, + { + "FlagName": "BM", + "FullName": "Bermuda", + "Acronym": "BMU" + }, + { + "FlagName": "BN", + "FullName": "Brunei", + "Acronym": "BRN" + }, + { + "FlagName": "BO", + "FullName": "Bolivia", + "Acronym": "BOL" + }, + { + "FlagName": "BH", + "FullName": "Bahrain", + "Acronym": "BHR" + }, + { + "FlagName": "BI", + "FullName": "Burundi", + "Acronym": "BDI" + }, + { + "FlagName": "BJ", + "FullName": "Benin", + "Acronym": "BEN" + }, + { + "FlagName": "BT", + "FullName": "Bhutan", + "Acronym": "BTN" + }, + { + "FlagName": "JM", + "FullName": "Jamaica", + "Acronym": "JAM" + }, + { + "FlagName": "BV", + "FullName": "Bouvet Island", + "Acronym": "BVT" + }, + { + "FlagName": "BW", + "FullName": "Botswana", + "Acronym": "BWA" + }, + { + "FlagName": "WS", + "FullName": "Samoa", + "Acronym": "WSM" + }, + { + "FlagName": "BQ", + "FullName": "Bonaire, Saint Eustatius and Saba", + "Acronym": "BES" + }, + { + "FlagName": "BR", + "FullName": "Brazil", + "Acronym": "BRA" + }, + { + "FlagName": "BS", + "FullName": "Bahamas", + "Acronym": "BHS" + }, + { + "FlagName": "JE", + "FullName": "Jersey", + "Acronym": "JEY" + }, + { + "FlagName": "BY", + "FullName": "Belarus", + "Acronym": "BLR" + }, + { + "FlagName": "BZ", + "FullName": "Belize", + "Acronym": "BLZ" + }, + { + "FlagName": "RU", + "FullName": "Russia", + "Acronym": "RUS" + }, + { + "FlagName": "RW", + "FullName": "Rwanda", + "Acronym": "RWA" + }, + { + "FlagName": "RS", + "FullName": "Serbia", + "Acronym": "SRB" + }, + { + "FlagName": "TL", + "FullName": "East Timor", + "Acronym": "TLS" + }, + { + "FlagName": "RE", + "FullName": "Reunion", + "Acronym": "REU" + }, + { + "FlagName": "TM", + "FullName": "Turkmenistan", + "Acronym": "TKM" + }, + { + "FlagName": "TJ", + "FullName": "Tajikistan", + "Acronym": "TJK" + }, + { + "FlagName": "RO", + "FullName": "Romania", + "Acronym": "ROU" + }, + { + "FlagName": "TK", + "FullName": "Tokelau", + "Acronym": "TKL" + }, + { + "FlagName": "GW", + "FullName": "Guinea-Bissau", + "Acronym": "GNB" + }, + { + "FlagName": "GU", + "FullName": "Guam", + "Acronym": "GUM" + }, + { + "FlagName": "GT", + "FullName": "Guatemala", + "Acronym": "GTM" + }, + { + "FlagName": "GS", + "FullName": "South Georgia and the South Sandwich Islands", + "Acronym": "SGS" + }, + { + "FlagName": "GR", + "FullName": "Greece", + "Acronym": "GRC" + }, + { + "FlagName": "GQ", + "FullName": "Equatorial Guinea", + "Acronym": "GNQ" + }, + { + "FlagName": "GP", + "FullName": "Guadeloupe", + "Acronym": "GLP" + }, + { + "FlagName": "JP", + "FullName": "Japan", + "Acronym": "JPN" + }, + { + "FlagName": "GY", + "FullName": "Guyana", + "Acronym": "GUY" + }, + { + "FlagName": "GG", + "FullName": "Guernsey", + "Acronym": "GGY" + }, + { + "FlagName": "GF", + "FullName": "French Guiana", + "Acronym": "GUF" + }, + { + "FlagName": "GE", + "FullName": "Georgia", + "Acronym": "GEO" + }, + { + "FlagName": "GD", + "FullName": "Grenada", + "Acronym": "GRD" + }, + { + "FlagName": "GB", + "FullName": "United Kingdom", + "Acronym": "GBR" + }, + { + "FlagName": "GA", + "FullName": "Gabon", + "Acronym": "GAB" + }, + { + "FlagName": "SV", + "FullName": "El Salvador", + "Acronym": "SLV" + }, + { + "FlagName": "GN", + "FullName": "Guinea", + "Acronym": "GIN" + }, + { + "FlagName": "GM", + "FullName": "Gambia", + "Acronym": "GMB" + }, + { + "FlagName": "GL", + "FullName": "Greenland", + "Acronym": "GRL" + }, + { + "FlagName": "GI", + "FullName": "Gibraltar", + "Acronym": "GIB" + }, + { + "FlagName": "GH", + "FullName": "Ghana", + "Acronym": "GHA" + }, + { + "FlagName": "OM", + "FullName": "Oman", + "Acronym": "OMN" + }, + { + "FlagName": "TN", + "FullName": "Tunisia", + "Acronym": "TUN" + }, + { + "FlagName": "JO", + "FullName": "Jordan", + "Acronym": "JOR" + }, + { + "FlagName": "HR", + "FullName": "Croatia", + "Acronym": "HRV" + }, + { + "FlagName": "HT", + "FullName": "Haiti", + "Acronym": "HTI" + }, + { + "FlagName": "HU", + "FullName": "Hungary", + "Acronym": "HUN" + }, + { + "FlagName": "HK", + "FullName": "Hong Kong", + "Acronym": "HKG" + }, + { + "FlagName": "HN", + "FullName": "Honduras", + "Acronym": "HND" + }, + { + "FlagName": "HM", + "FullName": "Heard Island and McDonald Islands", + "Acronym": "HMD" + }, + { + "FlagName": "VE", + "FullName": "Venezuela", + "Acronym": "VEN" + }, + { + "FlagName": "PR", + "FullName": "Puerto Rico", + "Acronym": "PRI" + }, + { + "FlagName": "PS", + "FullName": "Palestinian Territory", + "Acronym": "PSE" + }, + { + "FlagName": "PW", + "FullName": "Palau", + "Acronym": "PLW" + }, + { + "FlagName": "PT", + "FullName": "Portugal", + "Acronym": "PRT" + }, + { + "FlagName": "SJ", + "FullName": "Svalbard and Jan Mayen", + "Acronym": "SJM" + }, + { + "FlagName": "PY", + "FullName": "Paraguay", + "Acronym": "PRY" + }, + { + "FlagName": "IQ", + "FullName": "Iraq", + "Acronym": "IRQ" + }, + { + "FlagName": "PA", + "FullName": "Panama", + "Acronym": "PAN" + }, + { + "FlagName": "PF", + "FullName": "French Polynesia", + "Acronym": "PYF" + }, + { + "FlagName": "PG", + "FullName": "Papua New Guinea", + "Acronym": "PNG" + }, + { + "FlagName": "PE", + "FullName": "Peru", + "Acronym": "PER" + }, + { + "FlagName": "PK", + "FullName": "Pakistan", + "Acronym": "PAK" + }, + { + "FlagName": "PH", + "FullName": "Philippines", + "Acronym": "PHL" + }, + { + "FlagName": "PN", + "FullName": "Pitcairn", + "Acronym": "PCN" + }, + { + "FlagName": "PL", + "FullName": "Poland", + "Acronym": "POL" + }, + { + "FlagName": "PM", + "FullName": "Saint Pierre and Miquelon", + "Acronym": "SPM" + }, + { + "FlagName": "ZM", + "FullName": "Zambia", + "Acronym": "ZMB" + }, + { + "FlagName": "EH", + "FullName": "Western Sahara", + "Acronym": "ESH" + }, + { + "FlagName": "EE", + "FullName": "Estonia", + "Acronym": "EST" + }, + { + "FlagName": "EG", + "FullName": "Egypt", + "Acronym": "EGY" + }, + { + "FlagName": "ZA", + "FullName": "South Africa", + "Acronym": "ZAF" + }, + { + "FlagName": "EC", + "FullName": "Ecuador", + "Acronym": "ECU" + }, + { + "FlagName": "IT", + "FullName": "Italy", + "Acronym": "ITA" + }, + { + "FlagName": "VN", + "FullName": "Vietnam", + "Acronym": "VNM" + }, + { + "FlagName": "SB", + "FullName": "Solomon Islands", + "Acronym": "SLB" + }, + { + "FlagName": "ET", + "FullName": "Ethiopia", + "Acronym": "ETH" + }, + { + "FlagName": "SO", + "FullName": "Somalia", + "Acronym": "SOM" + }, + { + "FlagName": "ZW", + "FullName": "Zimbabwe", + "Acronym": "ZWE" + }, + { + "FlagName": "SA", + "FullName": "Saudi Arabia", + "Acronym": "SAU" + }, + { + "FlagName": "ES", + "FullName": "Spain", + "Acronym": "ESP" + }, + { + "FlagName": "ER", + "FullName": "Eritrea", + "Acronym": "ERI" + }, + { + "FlagName": "ME", + "FullName": "Montenegro", + "Acronym": "MNE" + }, + { + "FlagName": "MD", + "FullName": "Moldova", + "Acronym": "MDA" + }, + { + "FlagName": "MG", + "FullName": "Madagascar", + "Acronym": "MDG" + }, + { + "FlagName": "MF", + "FullName": "Saint Martin", + "Acronym": "MAF" + }, + { + "FlagName": "MA", + "FullName": "Morocco", + "Acronym": "MAR" + }, + { + "FlagName": "MC", + "FullName": "Monaco", + "Acronym": "MCO" + }, + { + "FlagName": "UZ", + "FullName": "Uzbekistan", + "Acronym": "UZB" + }, + { + "FlagName": "MM", + "FullName": "Myanmar", + "Acronym": "MMR" + }, + { + "FlagName": "ML", + "FullName": "Mali", + "Acronym": "MLI" + }, + { + "FlagName": "MO", + "FullName": "Macao", + "Acronym": "MAC" + }, + { + "FlagName": "MN", + "FullName": "Mongolia", + "Acronym": "MNG" + }, + { + "FlagName": "MH", + "FullName": "Marshall Islands", + "Acronym": "MHL" + }, + { + "FlagName": "MK", + "FullName": "Macedonia", + "Acronym": "MKD" + }, + { + "FlagName": "MU", + "FullName": "Mauritius", + "Acronym": "MUS" + }, + { + "FlagName": "MT", + "FullName": "Malta", + "Acronym": "MLT" + }, + { + "FlagName": "MW", + "FullName": "Malawi", + "Acronym": "MWI" + }, + { + "FlagName": "MV", + "FullName": "Maldives", + "Acronym": "MDV" + }, + { + "FlagName": "MQ", + "FullName": "Martinique", + "Acronym": "MTQ" + }, + { + "FlagName": "MP", + "FullName": "Northern Mariana Islands", + "Acronym": "MNP" + }, + { + "FlagName": "MS", + "FullName": "Montserrat", + "Acronym": "MSR" + }, + { + "FlagName": "MR", + "FullName": "Mauritania", + "Acronym": "MRT" + }, + { + "FlagName": "IM", + "FullName": "Isle of Man", + "Acronym": "IMN" + }, + { + "FlagName": "UG", + "FullName": "Uganda", + "Acronym": "UGA" + }, + { + "FlagName": "TZ", + "FullName": "Tanzania", + "Acronym": "TZA" + }, + { + "FlagName": "MY", + "FullName": "Malaysia", + "Acronym": "MYS" + }, + { + "FlagName": "MX", + "FullName": "Mexico", + "Acronym": "MEX" + }, + { + "FlagName": "IL", + "FullName": "Israel", + "Acronym": "ISR" + }, + { + "FlagName": "FR", + "FullName": "France", + "Acronym": "FRA" + }, + { + "FlagName": "IO", + "FullName": "British Indian Ocean Territory", + "Acronym": "IOT" + }, + { + "FlagName": "SH", + "FullName": "Saint Helena", + "Acronym": "SHN" + }, + { + "FlagName": "FI", + "FullName": "Finland", + "Acronym": "FIN" + }, + { + "FlagName": "FJ", + "FullName": "Fiji", + "Acronym": "FJI" + }, + { + "FlagName": "FK", + "FullName": "Falkland Islands", + "Acronym": "FLK" + }, + { + "FlagName": "FM", + "FullName": "Micronesia", + "Acronym": "FSM" + }, + { + "FlagName": "FO", + "FullName": "Faroe Islands", + "Acronym": "FRO" + }, + { + "FlagName": "NI", + "FullName": "Nicaragua", + "Acronym": "NIC" + }, + { + "FlagName": "NL", + "FullName": "Netherlands", + "Acronym": "NLD" + }, + { + "FlagName": "NO", + "FullName": "Norway", + "Acronym": "NOR" + }, + { + "FlagName": "NA", + "FullName": "Namibia", + "Acronym": "NAM" + }, + { + "FlagName": "VU", + "FullName": "Vanuatu", + "Acronym": "VUT" + }, + { + "FlagName": "NC", + "FullName": "New Caledonia", + "Acronym": "NCL" + }, + { + "FlagName": "NE", + "FullName": "Niger", + "Acronym": "NER" + }, + { + "FlagName": "NF", + "FullName": "Norfolk Island", + "Acronym": "NFK" + }, + { + "FlagName": "NG", + "FullName": "Nigeria", + "Acronym": "NGA" + }, + { + "FlagName": "NZ", + "FullName": "New Zealand", + "Acronym": "NZL" + }, + { + "FlagName": "NP", + "FullName": "Nepal", + "Acronym": "NPL" + }, + { + "FlagName": "NR", + "FullName": "Nauru", + "Acronym": "NRU" + }, + { + "FlagName": "NU", + "FullName": "Niue", + "Acronym": "NIU" + }, + { + "FlagName": "CK", + "FullName": "Cook Islands", + "Acronym": "COK" + }, + { + "FlagName": "XK", + "FullName": "Kosovo", + "Acronym": "XKX" + }, + { + "FlagName": "CI", + "FullName": "Ivory Coast", + "Acronym": "CIV" + }, + { + "FlagName": "CH", + "FullName": "Switzerland", + "Acronym": "CHE" + }, + { + "FlagName": "CO", + "FullName": "Colombia", + "Acronym": "COL" + }, + { + "FlagName": "CN", + "FullName": "China", + "Acronym": "CHN" + }, + { + "FlagName": "CM", + "FullName": "Cameroon", + "Acronym": "CMR" + }, + { + "FlagName": "CL", + "FullName": "Chile", + "Acronym": "CHL" + }, + { + "FlagName": "CC", + "FullName": "Cocos Islands", + "Acronym": "CCK" + }, + { + "FlagName": "CA", + "FullName": "Canada", + "Acronym": "CAN" + }, + { + "FlagName": "CG", + "FullName": "Republic of the Congo", + "Acronym": "COG" + }, + { + "FlagName": "CF", + "FullName": "Central African Republic", + "Acronym": "CAF" + }, + { + "FlagName": "CD", + "FullName": "Democratic Republic of the Congo", + "Acronym": "COD" + }, + { + "FlagName": "CZ", + "FullName": "Czech Republic", + "Acronym": "CZE" + }, + { + "FlagName": "CY", + "FullName": "Cyprus", + "Acronym": "CYP" + }, + { + "FlagName": "CX", + "FullName": "Christmas Island", + "Acronym": "CXR" + }, + { + "FlagName": "CR", + "FullName": "Costa Rica", + "Acronym": "CRI" + }, + { + "FlagName": "CW", + "FullName": "Curacao", + "Acronym": "CUW" + }, + { + "FlagName": "CV", + "FullName": "Cape Verde", + "Acronym": "CPV" + }, + { + "FlagName": "CU", + "FullName": "Cuba", + "Acronym": "CUB" + }, + { + "FlagName": "SZ", + "FullName": "Swaziland", + "Acronym": "SWZ" + }, + { + "FlagName": "SY", + "FullName": "Syria", + "Acronym": "SYR" + }, + { + "FlagName": "SX", + "FullName": "Sint Maarten", + "Acronym": "SXM" + }, + { + "FlagName": "KG", + "FullName": "Kyrgyzstan", + "Acronym": "KGZ" + }, + { + "FlagName": "KE", + "FullName": "Kenya", + "Acronym": "KEN" + }, + { + "FlagName": "SS", + "FullName": "South Sudan", + "Acronym": "SSD" + }, + { + "FlagName": "SR", + "FullName": "Suriname", + "Acronym": "SUR" + }, + { + "FlagName": "KI", + "FullName": "Kiribati", + "Acronym": "KIR" + }, + { + "FlagName": "KH", + "FullName": "Cambodia", + "Acronym": "KHM" + }, + { + "FlagName": "KN", + "FullName": "Saint Kitts and Nevis", + "Acronym": "KNA" + }, + { + "FlagName": "KM", + "FullName": "Comoros", + "Acronym": "COM" + }, + { + "FlagName": "ST", + "FullName": "Sao Tome and Principe", + "Acronym": "STP" + }, + { + "FlagName": "SK", + "FullName": "Slovakia", + "Acronym": "SVK" + }, + { + "FlagName": "KR", + "FullName": "South Korea", + "Acronym": "KOR" + }, + { + "FlagName": "SI", + "FullName": "Slovenia", + "Acronym": "SVN" + }, + { + "FlagName": "KP", + "FullName": "North Korea", + "Acronym": "PRK" + }, + { + "FlagName": "KW", + "FullName": "Kuwait", + "Acronym": "KWT" + }, + { + "FlagName": "SN", + "FullName": "Senegal", + "Acronym": "SEN" + }, + { + "FlagName": "SM", + "FullName": "San Marino", + "Acronym": "SMR" + }, + { + "FlagName": "SL", + "FullName": "Sierra Leone", + "Acronym": "SLE" + }, + { + "FlagName": "SC", + "FullName": "Seychelles", + "Acronym": "SYC" + }, + { + "FlagName": "KZ", + "FullName": "Kazakhstan", + "Acronym": "KAZ" + }, + { + "FlagName": "KY", + "FullName": "Cayman Islands", + "Acronym": "CYM" + }, + { + "FlagName": "SG", + "FullName": "Singapore", + "Acronym": "SGP" + }, + { + "FlagName": "SE", + "FullName": "Sweden", + "Acronym": "SWE" + }, + { + "FlagName": "SD", + "FullName": "Sudan", + "Acronym": "SDN" + }, + { + "FlagName": "DO", + "FullName": "Dominican Republic", + "Acronym": "DOM" + }, + { + "FlagName": "DM", + "FullName": "Dominica", + "Acronym": "DMA" + }, + { + "FlagName": "DJ", + "FullName": "Djibouti", + "Acronym": "DJI" + }, + { + "FlagName": "DK", + "FullName": "Denmark", + "Acronym": "DNK" + }, + { + "FlagName": "VG", + "FullName": "British Virgin Islands", + "Acronym": "VGB" + }, + { + "FlagName": "DE", + "FullName": "Germany", + "Acronym": "DEU" + }, + { + "FlagName": "YE", + "FullName": "Yemen", + "Acronym": "YEM" + }, + { + "FlagName": "DZ", + "FullName": "Algeria", + "Acronym": "DZA" + }, + { + "FlagName": "US", + "FullName": "United States", + "Acronym": "USA" + }, + { + "FlagName": "UY", + "FullName": "Uruguay", + "Acronym": "URY" + }, + { + "FlagName": "YT", + "FullName": "Mayotte", + "Acronym": "MYT" + }, + { + "FlagName": "UM", + "FullName": "United States Minor Outlying Islands", + "Acronym": "UMI" + }, + { + "FlagName": "LB", + "FullName": "Lebanon", + "Acronym": "LBN" + }, + { + "FlagName": "LC", + "FullName": "Saint Lucia", + "Acronym": "LCA" + }, + { + "FlagName": "LA", + "FullName": "Laos", + "Acronym": "LAO" + }, + { + "FlagName": "TV", + "FullName": "Tuvalu", + "Acronym": "TUV" + }, + { + "FlagName": "TW", + "FullName": "Taiwan", + "Acronym": "TWN" + }, + { + "FlagName": "TT", + "FullName": "Trinidad and Tobago", + "Acronym": "TTO" + }, + { + "FlagName": "TR", + "FullName": "Turkey", + "Acronym": "TUR" + }, + { + "FlagName": "LK", + "FullName": "Sri Lanka", + "Acronym": "LKA" + }, + { + "FlagName": "LI", + "FullName": "Liechtenstein", + "Acronym": "LIE" + }, + { + "FlagName": "LV", + "FullName": "Latvia", + "Acronym": "LVA" + }, + { + "FlagName": "TO", + "FullName": "Tonga", + "Acronym": "TON" + }, + { + "FlagName": "LT", + "FullName": "Lithuania", + "Acronym": "LTU" + }, + { + "FlagName": "LU", + "FullName": "Luxembourg", + "Acronym": "LUX" + }, + { + "FlagName": "LR", + "FullName": "Liberia", + "Acronym": "LBR" + }, + { + "FlagName": "LS", + "FullName": "Lesotho", + "Acronym": "LSO" + }, + { + "FlagName": "TH", + "FullName": "Thailand", + "Acronym": "THA" + }, + { + "FlagName": "TF", + "FullName": "French Southern Territories", + "Acronym": "ATF" + }, + { + "FlagName": "TG", + "FullName": "Togo", + "Acronym": "TGO" + }, + { + "FlagName": "TD", + "FullName": "Chad", + "Acronym": "TCD" + }, + { + "FlagName": "TC", + "FullName": "Turks and Caicos Islands", + "Acronym": "TCA" + }, + { + "FlagName": "LY", + "FullName": "Libya", + "Acronym": "LBY" + }, + { + "FlagName": "VA", + "FullName": "Vatican", + "Acronym": "VAT" + }, + { + "FlagName": "VC", + "FullName": "Saint Vincent and the Grenadines", + "Acronym": "VCT" + }, + { + "FlagName": "AE", + "FullName": "United Arab Emirates", + "Acronym": "ARE" + }, + { + "FlagName": "AD", + "FullName": "Andorra", + "Acronym": "AND" + }, + { + "FlagName": "AG", + "FullName": "Antigua and Barbuda", + "Acronym": "ATG" + }, + { + "FlagName": "AF", + "FullName": "Afghanistan", + "Acronym": "AFG" + }, + { + "FlagName": "AI", + "FullName": "Anguilla", + "Acronym": "AIA" + }, + { + "FlagName": "VI", + "FullName": "U.S. Virgin Islands", + "Acronym": "VIR" + }, + { + "FlagName": "IS", + "FullName": "Iceland", + "Acronym": "ISL" + }, + { + "FlagName": "IR", + "FullName": "Iran", + "Acronym": "IRN" + }, + { + "FlagName": "AM", + "FullName": "Armenia", + "Acronym": "ARM" + }, + { + "FlagName": "AL", + "FullName": "Albania", + "Acronym": "ALB" + }, + { + "FlagName": "AO", + "FullName": "Angola", + "Acronym": "AGO" + }, + { + "FlagName": "AQ", + "FullName": "Antarctica", + "Acronym": "ATA" + }, + { + "FlagName": "AS", + "FullName": "American Samoa", + "Acronym": "ASM" + }, + { + "FlagName": "AR", + "FullName": "Argentina", + "Acronym": "ARG" + }, + { + "FlagName": "AU", + "FullName": "Australia", + "Acronym": "AUS" + }, + { + "FlagName": "AT", + "FullName": "Austria", + "Acronym": "AUT" + }, + { + "FlagName": "AW", + "FullName": "Aruba", + "Acronym": "ABW" + }, + { + "FlagName": "IN", + "FullName": "India", + "Acronym": "IND" + }, + { + "FlagName": "AX", + "FullName": "Aland Islands", + "Acronym": "ALA" + }, + { + "FlagName": "AZ", + "FullName": "Azerbaijan", + "Acronym": "AZE" + }, + { + "FlagName": "IE", + "FullName": "Ireland", + "Acronym": "IRL" + }, + { + "FlagName": "ID", + "FullName": "Indonesia", + "Acronym": "IDN" + }, + { + "FlagName": "UA", + "FullName": "Ukraine", + "Acronym": "UKR" + }, + { + "FlagName": "QA", + "FullName": "Qatar", + "Acronym": "QAT" + }, + { + "FlagName": "MZ", + "FullName": "Mozambique", + "Acronym": "MOZ" + } +] \ No newline at end of file diff --git a/osu.Game.Tournament/TournamentGameBase.cs b/osu.Game.Tournament/TournamentGameBase.cs index 2ae6c60067..f398dd0a3d 100644 --- a/osu.Game.Tournament/TournamentGameBase.cs +++ b/osu.Game.Tournament/TournamentGameBase.cs @@ -2,6 +2,7 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; +using System.Collections.Generic; using System.Drawing; using System.IO; using System.Linq; @@ -15,6 +16,7 @@ using osu.Game.Beatmaps; using osu.Game.Graphics.UserInterface; using osu.Game.Online.API.Requests; using osu.Game.Rulesets; +using osu.Game.Tournament.Components; namespace osu.Game.Tournament { @@ -87,12 +89,26 @@ namespace osu.Game.Tournament } } + // link pairings to groupings foreach (var group in Ladder.Groupings) foreach (var id in group.Pairings) Ladder.Pairings.Single(p => p.ID == id).Grouping.Value = group; Ladder.CurrentMatch.Value = Ladder.Pairings.FirstOrDefault(p => p.Current.Value); + // add full player info based on user IDs + foreach (var t in Ladder.Teams) + foreach (var p in t.Players) + if (p.Id == 1) + { + var req = new GetUserRequest(p.Id); + req.Success += i => p.Username = i.Username; + req.Perform(API); + + addedInfo = true; + } + + // add full beatmap info based on beatmap IDs foreach (var g in Ladder.Groupings) foreach (var b in g.Beatmaps) if (b.BeatmapInfo == null) @@ -104,6 +120,24 @@ namespace osu.Game.Tournament addedInfo = true; } + + List countries; + using (Stream stream = Resources.GetStream("Resources/countries.json")) + using (var sr = new StreamReader(stream)) + countries = JsonConvert.DeserializeObject>(sr.ReadToEnd()); + + foreach (var t in Ladder.Teams) + if (string.IsNullOrEmpty(t.FullName)) + { + var result = countries.FirstOrDefault(c => c.Acronym == t.Acronym); + if (result != null) + { + t.Acronym = result.Acronym; + t.FlagName = result.FlagName; + t.FullName = result.FullName; + } + } + if (addedInfo) SaveChanges(); @@ -126,7 +160,6 @@ namespace osu.Game.Tournament protected override void Update() { - base.Update(); var minWidth = (int)(windowSize.Value.Height / 9f * 16 + 400); if (windowSize.Value.Width < minWidth) From 3eabac0e3de1cbc04db391ca80421f91c9b5cd7c Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 8 Nov 2018 01:23:00 +0900 Subject: [PATCH 092/317] Move all IPC handling to its own class --- osu.Game.Tournament/IPC/FileBasedIPC.cs | 107 ++++++++++++++++++ .../Screens/BeatmapInfoScreen.cs | 104 ++--------------- osu.Game.Tournament/TournamentGameBase.cs | 5 + 3 files changed, 123 insertions(+), 93 deletions(-) create mode 100644 osu.Game.Tournament/IPC/FileBasedIPC.cs diff --git a/osu.Game.Tournament/IPC/FileBasedIPC.cs b/osu.Game.Tournament/IPC/FileBasedIPC.cs new file mode 100644 index 0000000000..c42ccc11c2 --- /dev/null +++ b/osu.Game.Tournament/IPC/FileBasedIPC.cs @@ -0,0 +1,107 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System; +using System.IO; +using osu.Framework.Allocation; +using osu.Framework.Configuration; +using osu.Framework.Graphics; +using osu.Framework.Platform.Windows; +using osu.Game.Beatmaps; +using osu.Game.Beatmaps.Legacy; +using osu.Game.Online.API; +using osu.Game.Online.API.Requests; +using osu.Game.Rulesets; + +namespace osu.Game.Tournament.IPC +{ + public class FileBasedIPC : Component + { + [Resolved] + protected APIAccess API { get; private set; } + + [Resolved] + protected RulesetStore Rulesets { get; private set; } + + public readonly Bindable Beatmap = new Bindable(); + + public readonly Bindable Mods = new Bindable(); + + [BackgroundDependencyLoader] + private void load() + { + var stable = new StableStorage(); + + const string file_ipc_filename = "ipc.txt"; + + if (stable.Exists(file_ipc_filename)) + Scheduler.AddDelayed(delegate + { + try + { + using (var stream = stable.GetStream(file_ipc_filename)) + using (var sr = new StreamReader(stream)) + { + var beatmapId = int.Parse(sr.ReadLine()); + var mods = int.Parse(sr.ReadLine()); + + if (Beatmap.Value?.OnlineBeatmapID != beatmapId) + { + var req = new GetBeatmapRequest(new BeatmapInfo { OnlineBeatmapID = beatmapId }); + req.Success += b => Beatmap.Value = b.ToBeatmap(Rulesets); + API.Queue(req); + } + + Mods.Value = (LegacyMods)mods; + } + } + catch + { + // file might be in use. + } + }, 250, true); + } + + /// + /// A method of accessing an osu-stable install in a controlled fashion. + /// + private class StableStorage : WindowsStorage + { + protected override string LocateBasePath() + { + bool checkExists(string p) + { + return Directory.Exists(Path.Combine(p, "Songs")); + } + + string stableInstallPath; + + try + { + stableInstallPath = "E:\\osu!mappool"; + + if (checkExists(stableInstallPath)) + return stableInstallPath; + } + catch + { + } + + stableInstallPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), @"osu!"); + if (checkExists(stableInstallPath)) + return stableInstallPath; + + stableInstallPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".osu"); + if (checkExists(stableInstallPath)) + return stableInstallPath; + + return null; + } + + public StableStorage() + : base(string.Empty, null) + { + } + } + } +} diff --git a/osu.Game.Tournament/Screens/BeatmapInfoScreen.cs b/osu.Game.Tournament/Screens/BeatmapInfoScreen.cs index 18ba947582..11cbb56b49 100644 --- a/osu.Game.Tournament/Screens/BeatmapInfoScreen.cs +++ b/osu.Game.Tournament/Screens/BeatmapInfoScreen.cs @@ -1,33 +1,18 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using System; -using System.IO; using osu.Framework.Allocation; using osu.Framework.Graphics; -using osu.Framework.Platform.Windows; using osu.Game.Beatmaps; using osu.Game.Beatmaps.Legacy; -using osu.Game.Online.API; -using osu.Game.Online.API.Requests; -using osu.Game.Online.API.Requests.Responses; -using osu.Game.Rulesets; using osu.Game.Screens; using osu.Game.Tournament.Components; +using osu.Game.Tournament.IPC; namespace osu.Game.Tournament.Screens { public abstract class BeatmapInfoScreen : OsuScreen { - [Resolved] - protected APIAccess API { get; private set; } - - [Resolved] - protected RulesetStore Rulesets { get; private set; } - - private int lastBeatmapId; - private int lastMods; - protected readonly SongBar SongBar; protected BeatmapInfoScreen() @@ -40,88 +25,21 @@ namespace osu.Game.Tournament.Screens } [BackgroundDependencyLoader] - private void load() + private void load(FileBasedIPC ipc) { - var stable = new StableStorage(); - - const string file_ipc_filename = "ipc.txt"; - - if (stable.Exists(file_ipc_filename)) - Scheduler.AddDelayed(delegate - { - try - { - using (var stream = stable.GetStream(file_ipc_filename)) - using (var sr = new StreamReader(stream)) - { - var beatmapId = int.Parse(sr.ReadLine()); - var mods = int.Parse(sr.ReadLine()); - - if (lastBeatmapId == beatmapId) - return; - - lastMods = mods; - lastBeatmapId = beatmapId; - - var req = new GetBeatmapRequest(new BeatmapInfo { OnlineBeatmapID = beatmapId }); - req.Success += success; - API.Queue(req); - } - } - catch - { - // file might be in use. - } - }, 250, true); + ipc.Beatmap.BindValueChanged(beatmapChanged, true); + ipc.Mods.BindValueChanged(modsChanged, true); } - private void success(APIBeatmap apiBeatmap) + private void modsChanged(LegacyMods mods) + { + SongBar.Mods = mods; + } + + private void beatmapChanged(BeatmapInfo beatmap) { SongBar.FadeInFromZero(300, Easing.OutQuint); - SongBar.Mods = (LegacyMods)lastMods; - SongBar.Beatmap = apiBeatmap.ToBeatmap(Rulesets); - } - - /// - /// A method of accessing an osu-stable install in a controlled fashion. - /// - private class StableStorage : WindowsStorage - { - protected override string LocateBasePath() - { - bool checkExists(string p) - { - return Directory.Exists(Path.Combine(p, "Songs")); - } - - string stableInstallPath; - - try - { - stableInstallPath = "E:\\osu!mappool"; - - if (checkExists(stableInstallPath)) - return stableInstallPath; - } - catch - { - } - - stableInstallPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), @"osu!"); - if (checkExists(stableInstallPath)) - return stableInstallPath; - - stableInstallPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".osu"); - if (checkExists(stableInstallPath)) - return stableInstallPath; - - return null; - } - - public StableStorage() - : base(string.Empty, null) - { - } + SongBar.Beatmap = beatmap; } } } diff --git a/osu.Game.Tournament/TournamentGameBase.cs b/osu.Game.Tournament/TournamentGameBase.cs index f398dd0a3d..562b141095 100644 --- a/osu.Game.Tournament/TournamentGameBase.cs +++ b/osu.Game.Tournament/TournamentGameBase.cs @@ -17,6 +17,7 @@ using osu.Game.Graphics.UserInterface; using osu.Game.Online.API.Requests; using osu.Game.Rulesets; using osu.Game.Tournament.Components; +using osu.Game.Tournament.IPC; namespace osu.Game.Tournament { @@ -33,6 +34,7 @@ namespace osu.Game.Tournament private readonly Bindable ruleset = new Bindable(); private Bindable windowSize; + private FileBasedIPC ipc; protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnlyDependencyContainer parent) { @@ -63,6 +65,9 @@ namespace osu.Game.Tournament dependencies.Cache(Ladder); + dependencies.Cache(ipc = new FileBasedIPC()); + Add(ipc); + bool addedInfo = false; // assign teams From e4a767d656c9add79f0d4fc1863f363396fcb0c9 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 8 Nov 2018 03:51:39 +0900 Subject: [PATCH 093/317] Move control panel logic to its own class --- .../Components/ControlPanel.cs | 73 ++++++++++++ .../Screens/Drawings/DrawingsScreen.cs | 106 ++++-------------- 2 files changed, 97 insertions(+), 82 deletions(-) create mode 100644 osu.Game.Tournament/Components/ControlPanel.cs diff --git a/osu.Game.Tournament/Components/ControlPanel.cs b/osu.Game.Tournament/Components/ControlPanel.cs new file mode 100644 index 0000000000..f016eb30a4 --- /dev/null +++ b/osu.Game.Tournament/Components/ControlPanel.cs @@ -0,0 +1,73 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Shapes; +using osu.Game.Graphics.Sprites; +using OpenTK; +using OpenTK.Graphics; + +namespace osu.Game.Tournament.Components +{ + /// + /// An element anchored to the right-hand area of a screen that provides streamer level controls. + /// Should be off-screen. + /// + public class ControlPanel : Container + { + private readonly FillFlowContainer buttons; + + protected override Container Content => buttons; + + public ControlPanel() + { + RelativeSizeAxes = Axes.Both; + AlwaysPresent = true; + Width = 0.15f; + Anchor = Anchor.TopRight; + + InternalChildren = new Drawable[] + { + new Box + { + RelativeSizeAxes = Axes.Both, + Colour = new Color4(54, 54, 54, 255) + }, + new OsuSpriteText + { + Anchor = Anchor.TopCentre, + Origin = Anchor.TopCentre, + + Text = "Control Panel", + TextSize = 22f, + Font = "Exo2.0-Bold" + }, + buttons = new FillFlowContainer + { + Anchor = Anchor.TopCentre, + Origin = Anchor.TopCentre, + + RelativeSizeAxes = Axes.X, + AutoSizeAxes = Axes.Y, + Width = 0.75f, + + Position = new Vector2(0, 35f), + + Direction = FillDirection.Vertical, + Spacing = new Vector2(0, 5f), + }, + }; + } + + public class Spacer : CompositeDrawable + { + public Spacer(float height = 20) + { + RelativeSizeAxes = Axes.X; + Height = height; + AlwaysPresent = true; + } + } + } +} diff --git a/osu.Game.Tournament/Screens/Drawings/DrawingsScreen.cs b/osu.Game.Tournament/Screens/Drawings/DrawingsScreen.cs index 9e8074d7dc..f94c882c85 100644 --- a/osu.Game.Tournament/Screens/Drawings/DrawingsScreen.cs +++ b/osu.Game.Tournament/Screens/Drawings/DrawingsScreen.cs @@ -9,7 +9,6 @@ using System.Threading.Tasks; using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Textures; using osu.Framework.IO.Stores; @@ -147,93 +146,36 @@ namespace osu.Game.Tournament.Screens.Drawings } }, // Control panel container - new Container + new ControlPanel { - RelativeSizeAxes = Axes.Both, - AlwaysPresent = true, - Width = 0.15f, - Anchor = Anchor.TopRight, - - Children = new Drawable[] + new TriangleButton { - new Box - { - RelativeSizeAxes = Axes.Both, - Colour = new Color4(54, 54, 54, 255) - }, - new OsuSpriteText - { - Anchor = Anchor.TopCentre, - Origin = Anchor.TopCentre, + RelativeSizeAxes = Axes.X, - Text = "Control Panel", - TextSize = 22f, - Font = "Exo2.0-Bold" - }, - new FillFlowContainer - { - Anchor = Anchor.TopCentre, - Origin = Anchor.TopCentre, + Text = "Begin random", + Action = teamsContainer.StartScrolling, + }, + new TriangleButton + { + RelativeSizeAxes = Axes.X, - RelativeSizeAxes = Axes.X, - AutoSizeAxes = Axes.Y, - Width = 0.75f, + Text = "Stop random", + Action = teamsContainer.StopScrolling, + }, + new TriangleButton + { + RelativeSizeAxes = Axes.X, - Position = new Vector2(0, 35f), + Text = "Reload", + Action = reloadTeams + }, + new ControlPanel.Spacer(), + new TriangleButton + { + RelativeSizeAxes = Axes.X, - Direction = FillDirection.Vertical, - Spacing = new Vector2(0, 5f), - - Children = new Drawable[] - { - new TriangleButton - { - RelativeSizeAxes = Axes.X, - - Text = "Begin random", - Action = teamsContainer.StartScrolling, - }, - new TriangleButton - { - RelativeSizeAxes = Axes.X, - - Text = "Stop random", - Action = teamsContainer.StopScrolling, - }, - new TriangleButton - { - RelativeSizeAxes = Axes.X, - - Text = "Reload", - Action = reloadTeams - } - } - }, - new FillFlowContainer - { - Anchor = Anchor.BottomCentre, - Origin = Anchor.BottomCentre, - - RelativeSizeAxes = Axes.X, - AutoSizeAxes = Axes.Y, - Width = 0.75f, - - Position = new Vector2(0, -5f), - - Direction = FillDirection.Vertical, - Spacing = new Vector2(0, 5f), - - Children = new Drawable[] - { - new TriangleButton - { - RelativeSizeAxes = Axes.X, - - Text = "Reset", - Action = () => reset() - } - } - } + Text = "Reset", + Action = () => reset() } } }; From 5c84c3c0a8157b65a64ddcffaa871d9446297de2 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 8 Nov 2018 06:29:04 +0900 Subject: [PATCH 094/317] Add support for picks and bans --- .../TestCaseLadderManager.cs | 2 +- osu.Game.Tournament.Tests/TestCaseMapPool.cs | 13 +- .../Components/TournamentBeatmapPanel.cs | 68 ++++++++-- .../Ladder/Components/BeatmapChoice.cs | 24 ++++ .../Screens/Ladder/Components/MatchPairing.cs | 6 +- .../Screens/Ladder/LadderManager.cs | 27 ++-- .../Screens/MapPool/MapPoolScreen.cs | 125 +++++++++++++++++- .../Screens/TournamentSceneManager.cs | 5 +- 8 files changed, 232 insertions(+), 38 deletions(-) create mode 100644 osu.Game.Tournament/Screens/Ladder/Components/BeatmapChoice.cs diff --git a/osu.Game.Tournament.Tests/TestCaseLadderManager.cs b/osu.Game.Tournament.Tests/TestCaseLadderManager.cs index 5fa378a854..3ddd52eeac 100644 --- a/osu.Game.Tournament.Tests/TestCaseLadderManager.cs +++ b/osu.Game.Tournament.Tests/TestCaseLadderManager.cs @@ -18,7 +18,7 @@ namespace osu.Game.Tournament.Tests Add(new OsuContextMenuContainer { RelativeSizeAxes = Axes.Both, - Child = manager = new LadderManager(Ladder) + Child = manager = new LadderManager() }); } diff --git a/osu.Game.Tournament.Tests/TestCaseMapPool.cs b/osu.Game.Tournament.Tests/TestCaseMapPool.cs index 1101d2828a..d953dbc5d3 100644 --- a/osu.Game.Tournament.Tests/TestCaseMapPool.cs +++ b/osu.Game.Tournament.Tests/TestCaseMapPool.cs @@ -1,7 +1,8 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using System.Linq; +using System; +using System.Collections.Generic; using osu.Framework.Allocation; using osu.Game.Tournament.Screens.MapPool; @@ -9,13 +10,15 @@ namespace osu.Game.Tournament.Tests { public class TestCaseMapPool : LadderTestCase { + public override IReadOnlyList RequiredTypes => new[] + { + typeof(MapPoolScreen) + }; + [BackgroundDependencyLoader] private void load() { - var round = Ladder.Groupings.FirstOrDefault(g => g.Name == "Finals"); - - if (round != null) - Add(new MapPoolScreen(round)); + Add(new MapPoolScreen { Width = 0.7f }); } } } diff --git a/osu.Game.Tournament/Components/TournamentBeatmapPanel.cs b/osu.Game.Tournament/Components/TournamentBeatmapPanel.cs index 9542c26faf..7f9494e3c9 100644 --- a/osu.Game.Tournament/Components/TournamentBeatmapPanel.cs +++ b/osu.Game.Tournament/Components/TournamentBeatmapPanel.cs @@ -1,7 +1,11 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using System.Collections.ObjectModel; +using System.Collections.Specialized; +using System.Linq; using osu.Framework.Allocation; +using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; @@ -10,28 +14,35 @@ using osu.Game.Beatmaps; using osu.Game.Beatmaps.Drawables; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; +using osu.Game.Tournament.Screens.Ladder.Components; using OpenTK.Graphics; namespace osu.Game.Tournament.Components { public class TournamentBeatmapPanel : CompositeDrawable { - private readonly BeatmapInfo beatmap; + public readonly BeatmapInfo Beatmap; + private const float horizontal_padding = 10; private const float vertical_padding = 5; public const float HEIGHT = 50; + private readonly Bindable currentMatch = new Bindable(); + public TournamentBeatmapPanel(BeatmapInfo beatmap) { - this.beatmap = beatmap; + Beatmap = beatmap; Width = 400; Height = HEIGHT; } [BackgroundDependencyLoader] - private void load() + private void load(LadderInfo ladder) { + currentMatch.BindValueChanged(matchChanged); + currentMatch.BindTo(ladder.CurrentMatch); + CornerRadius = 25; Masking = true; @@ -46,7 +57,7 @@ namespace osu.Game.Tournament.Components { RelativeSizeAxes = Axes.Both, Colour = OsuColour.Gray(0.5f), - BeatmapSet = beatmap.BeatmapSet, + BeatmapSet = Beatmap.BeatmapSet, }, new FillFlowContainer { @@ -62,8 +73,8 @@ namespace osu.Game.Tournament.Components Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, Text = new LocalisedString(( - $"{beatmap.Metadata.ArtistUnicode} - {beatmap.Metadata.TitleUnicode}", - $"{beatmap.Metadata.Artist} - {beatmap.Metadata.Title}")), + $"{Beatmap.Metadata.ArtistUnicode} - {Beatmap.Metadata.TitleUnicode}", + $"{Beatmap.Metadata.Artist} - {Beatmap.Metadata.Title}")), Font = @"Exo2.0-BoldItalic", }, new FillFlowContainer @@ -84,7 +95,7 @@ namespace osu.Game.Tournament.Components }, new OsuSpriteText { - Text = beatmap.Metadata.AuthorString, + Text = Beatmap.Metadata.AuthorString, Font = @"Exo2.0-BoldItalic", Padding = new MarginPadding { Right = 20 }, TextSize = 14 @@ -98,7 +109,7 @@ namespace osu.Game.Tournament.Components }, new OsuSpriteText { - Text = beatmap.Version, + Text = Beatmap.Version, Font = @"Exo2.0-BoldItalic", TextSize = 14 }, @@ -108,5 +119,46 @@ namespace osu.Game.Tournament.Components }, }); } + + private void matchChanged(MatchPairing match) + { + match.PicksBans.CollectionChanged += picksBansOnCollectionChanged; + updateState(); + } + + private void updateState() + { + var found = currentMatch.Value.PicksBans.FirstOrDefault(p => p.BeatmapID == Beatmap.OnlineBeatmapID); + + if (found != null) + { + switch (found.Team) + { + case TeamColour.Red: + Colour = Color4.Red; + break; + case TeamColour.Blue: + Colour = Color4.Blue; + break; + } + } + else + { + Colour = Color4.White; + } + } + + private void picksBansOnCollectionChanged(object sender, NotifyCollectionChangedEventArgs e) + { + var list = (ObservableCollection)sender; + if (sender != currentMatch.Value.PicksBans) + { + // todo: we need a last attribute in bindable valuechanged events badly. + list.CollectionChanged -= picksBansOnCollectionChanged; + return; + } + + updateState(); + } } } diff --git a/osu.Game.Tournament/Screens/Ladder/Components/BeatmapChoice.cs b/osu.Game.Tournament/Screens/Ladder/Components/BeatmapChoice.cs new file mode 100644 index 0000000000..d0b2556603 --- /dev/null +++ b/osu.Game.Tournament/Screens/Ladder/Components/BeatmapChoice.cs @@ -0,0 +1,24 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +namespace osu.Game.Tournament.Screens.Ladder.Components +{ + public class BeatmapChoice + { + public TeamColour Team; + public ChoiceType Type; + public int BeatmapID; + } + + public enum TeamColour + { + Red, + Blue + } + + public enum ChoiceType + { + Pick, + Ban, + } +} diff --git a/osu.Game.Tournament/Screens/Ladder/Components/MatchPairing.cs b/osu.Game.Tournament/Screens/Ladder/Components/MatchPairing.cs index aa0c3229c9..63c96d350d 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/MatchPairing.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/MatchPairing.cs @@ -2,6 +2,7 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; +using System.Collections.ObjectModel; using Newtonsoft.Json; using osu.Framework.Configuration; using osu.Game.Tournament.Components; @@ -34,6 +35,8 @@ namespace osu.Game.Tournament.Screens.Ladder.Components public readonly Bindable Losers = new Bindable(); + public readonly ObservableCollection PicksBans = new ObservableCollection(); + [JsonIgnore] public readonly Bindable Grouping = new Bindable(); @@ -58,7 +61,8 @@ namespace osu.Game.Tournament.Screens.Ladder.Components Team2.BindValueChanged(t => Team2Acronym = t?.Acronym, true); } - public MatchPairing(TournamentTeam team1 = null, TournamentTeam team2 = null) : this() + public MatchPairing(TournamentTeam team1 = null, TournamentTeam team2 = null) + : this() { Team1.Value = team1; Team2.Value = team2; diff --git a/osu.Game.Tournament/Screens/Ladder/LadderManager.cs b/osu.Game.Tournament/Screens/Ladder/LadderManager.cs index f348eff571..805358e231 100644 --- a/osu.Game.Tournament/Screens/Ladder/LadderManager.cs +++ b/osu.Game.Tournament/Screens/Ladder/LadderManager.cs @@ -26,20 +26,24 @@ namespace osu.Game.Tournament.Screens.Ladder [Cached] public class LadderManager : CompositeDrawable, IHasContextMenu { - public readonly List Teams; - private readonly Container pairingsContainer; - private readonly Container paths; - private readonly Container headings; + public List Teams; + private Container pairingsContainer; + private Container paths; + private Container headings; - private readonly LadderInfo info; + private LadderInfo info; - private readonly ScrollableContainer scrollContent; + private ScrollableContainer scrollContent; [Cached] - private readonly LadderEditorInfo editorInfo = new LadderEditorInfo(); + private LadderEditorInfo editorInfo = new LadderEditorInfo(); - public LadderManager(LadderInfo info) + [BackgroundDependencyLoader] + private void load(LadderInfo info, OsuColour colours) { + normalPathColour = colours.BlueDarker.Darken(2); + losersPathColour = colours.YellowDarker.Darken(2); + this.info = info; editorInfo.Teams = Teams = info.Teams; editorInfo.Groupings = info.Groupings; @@ -128,13 +132,6 @@ namespace osu.Game.Tournament.Screens.Ladder private Color4 normalPathColour; private Color4 losersPathColour; - [BackgroundDependencyLoader] - private void load(OsuColour colours) - { - normalPathColour = colours.BlueDarker.Darken(2); - losersPathColour = colours.YellowDarker.Darken(2); - } - private void updateLayout() { paths.Clear(); diff --git a/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs b/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs index 6d7dca0aad..94f52267de 100644 --- a/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs +++ b/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs @@ -1,33 +1,148 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using System.Linq; +using osu.Framework.Allocation; +using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; +using osu.Framework.Input.Events; +using osu.Game.Graphics.Sprites; +using osu.Game.Graphics.UserInterface; using osu.Game.Screens; using osu.Game.Tournament.Components; using osu.Game.Tournament.Screens.Ladder.Components; using OpenTK; +using OpenTK.Input; namespace osu.Game.Tournament.Screens.MapPool { public class MapPoolScreen : OsuScreen { - public MapPoolScreen(TournamentGrouping round) - { - FillFlowContainer maps; + private readonly FillFlowContainer maps; + private readonly Bindable currentMatch = new Bindable(); + + public MapPoolScreen() + { InternalChildren = new Drawable[] { - maps = new FillFlowContainer + maps = new FillFlowContainer { Spacing = new Vector2(20), Padding = new MarginPadding(50), Direction = FillDirection.Full, RelativeSizeAxes = Axes.Both, + }, + new ControlPanel + { + Children = new Drawable[] + { + new OsuSpriteText + { + Text = "Current Mode" + }, + buttonRedBan = new TriangleButton + { + RelativeSizeAxes = Axes.X, + Text = "Red Ban", + Action = () => setMode(TeamColour.Red, ChoiceType.Ban) + }, + buttonBlueBan = new TriangleButton + { + RelativeSizeAxes = Axes.X, + Text = "Blue Ban", + Action = () => setMode(TeamColour.Blue, ChoiceType.Ban) + }, + buttonRedPick = new TriangleButton + { + RelativeSizeAxes = Axes.X, + Text = "Red Pick", + Action = () => setMode(TeamColour.Red, ChoiceType.Pick) + }, + buttonBluePick = new TriangleButton + { + RelativeSizeAxes = Axes.X, + Text = "Blue Pick", + Action = () => setMode(TeamColour.Blue, ChoiceType.Pick) + } + } } }; + } - foreach (var b in round.Beatmaps) + private TeamColour pickColour; + private ChoiceType pickType; + + private readonly TriangleButton buttonRedBan; + private readonly TriangleButton buttonBlueBan; + private readonly TriangleButton buttonRedPick; + private readonly TriangleButton buttonBluePick; + + private void setMode(TeamColour colour, ChoiceType choiceType) + { + pickColour = colour; + pickType = choiceType; + + var enabled = currentMatch.Value.PicksBans.Count == 0; + + buttonRedBan.Enabled.Value = enabled || pickColour == TeamColour.Red && pickType == ChoiceType.Ban; + buttonBlueBan.Enabled.Value = enabled || pickColour == TeamColour.Blue && pickType == ChoiceType.Ban; + buttonRedPick.Enabled.Value = enabled || pickColour == TeamColour.Red && pickType == ChoiceType.Pick; + buttonBluePick.Enabled.Value = enabled || pickColour == TeamColour.Blue && pickType == ChoiceType.Pick; + } + + private void setNextMode() + { + const TeamColour roll_winner = TeamColour.Red; //todo: draw from match + + var nextColour = (currentMatch.Value.PicksBans.LastOrDefault()?.Team ?? roll_winner) == TeamColour.Red ? TeamColour.Blue : TeamColour.Red; + + setMode(nextColour, currentMatch.Value.PicksBans.Count(p => p.Type == ChoiceType.Ban) >= 2 ? ChoiceType.Pick : ChoiceType.Ban); + } + + protected override bool OnMouseDown(MouseDownEvent e) + { + var map = maps.FirstOrDefault(m => m.ReceivePositionalInputAt(e.ScreenSpaceMousePosition)); + if (map != null) + { + if (e.Button == MouseButton.Left) + { + currentMatch.Value.PicksBans.Add(new BeatmapChoice + { + Team = pickColour, + Type = pickType, + BeatmapID = map.Beatmap.OnlineBeatmapID ?? -1 + }); + + setNextMode(); + } + else + { + var existing = currentMatch.Value.PicksBans.FirstOrDefault(p => p.BeatmapID == map.Beatmap.OnlineBeatmapID); + if (existing != null) + { + currentMatch.Value.PicksBans.Remove(existing); + setNextMode(); + } + } + + return true; + } + + return base.OnMouseDown(e); + } + + [BackgroundDependencyLoader] + private void load(LadderInfo ladder) + { + currentMatch.BindValueChanged(matchChanged); + currentMatch.BindTo(ladder.CurrentMatch); + } + + private void matchChanged(MatchPairing match) + { + foreach (var b in match.Grouping.Value.Beatmaps) maps.Add(new TournamentBeatmapPanel(b.BeatmapInfo) { Anchor = Anchor.TopCentre, diff --git a/osu.Game.Tournament/Screens/TournamentSceneManager.cs b/osu.Game.Tournament/Screens/TournamentSceneManager.cs index 91d389b63d..4cd6c681fa 100644 --- a/osu.Game.Tournament/Screens/TournamentSceneManager.cs +++ b/osu.Game.Tournament/Screens/TournamentSceneManager.cs @@ -1,7 +1,6 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using System.Linq; using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; @@ -88,9 +87,9 @@ namespace osu.Game.Tournament.Screens RelativeSizeAxes = Axes.Both, Children = new Drawable[] { - bracket = new LadderManager(ladder), + bracket = new LadderManager(), showcase = new ShowcaseScreen(), - mapPool = new MapPoolScreen(ladder.Groupings.First(g => g.Name == "Finals")), + mapPool = new MapPoolScreen(), teamIntro = new TeamIntroScreen(), drawings = new DrawingsScreen(), gameplay = new GameplayScreen() From 5da6f11a141b76c5d98c0cd52a2baef7aea16405 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 8 Nov 2018 06:36:36 +0900 Subject: [PATCH 095/317] Automate picks and bans from IPC --- .../Screens/MapPool/MapPoolScreen.cs | 63 ++++++++++++------- 1 file changed, 42 insertions(+), 21 deletions(-) diff --git a/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs b/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs index 94f52267de..fb9bd7b9a5 100644 --- a/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs +++ b/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs @@ -7,10 +7,12 @@ using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Input.Events; +using osu.Game.Beatmaps; using osu.Game.Graphics.Sprites; using osu.Game.Graphics.UserInterface; using osu.Game.Screens; using osu.Game.Tournament.Components; +using osu.Game.Tournament.IPC; using osu.Game.Tournament.Screens.Ladder.Components; using OpenTK; using OpenTK.Input; @@ -23,6 +25,14 @@ namespace osu.Game.Tournament.Screens.MapPool private readonly Bindable currentMatch = new Bindable(); + private TeamColour pickColour; + private ChoiceType pickType; + + private readonly TriangleButton buttonRedBan; + private readonly TriangleButton buttonBlueBan; + private readonly TriangleButton buttonRedPick; + private readonly TriangleButton buttonBluePick; + public MapPoolScreen() { InternalChildren = new Drawable[] @@ -71,13 +81,20 @@ namespace osu.Game.Tournament.Screens.MapPool }; } - private TeamColour pickColour; - private ChoiceType pickType; + [BackgroundDependencyLoader] + private void load(LadderInfo ladder, FileBasedIPC ipc) + { + currentMatch.BindValueChanged(matchChanged); + currentMatch.BindTo(ladder.CurrentMatch); - private readonly TriangleButton buttonRedBan; - private readonly TriangleButton buttonBlueBan; - private readonly TriangleButton buttonRedPick; - private readonly TriangleButton buttonBluePick; + ipc.Beatmap.BindValueChanged(beatmapChanged); + } + + private void beatmapChanged(BeatmapInfo beatmap) + { + if (beatmap.OnlineBeatmapID != null) + addForBeatmap(beatmap.OnlineBeatmapID.Value); + } private void setMode(TeamColour colour, ChoiceType choiceType) { @@ -106,17 +123,8 @@ namespace osu.Game.Tournament.Screens.MapPool var map = maps.FirstOrDefault(m => m.ReceivePositionalInputAt(e.ScreenSpaceMousePosition)); if (map != null) { - if (e.Button == MouseButton.Left) - { - currentMatch.Value.PicksBans.Add(new BeatmapChoice - { - Team = pickColour, - Type = pickType, - BeatmapID = map.Beatmap.OnlineBeatmapID ?? -1 - }); - - setNextMode(); - } + if (e.Button == MouseButton.Left && map.Beatmap.OnlineBeatmapID != null) + addForBeatmap(map.Beatmap.OnlineBeatmapID.Value); else { var existing = currentMatch.Value.PicksBans.FirstOrDefault(p => p.BeatmapID == map.Beatmap.OnlineBeatmapID); @@ -133,11 +141,24 @@ namespace osu.Game.Tournament.Screens.MapPool return base.OnMouseDown(e); } - [BackgroundDependencyLoader] - private void load(LadderInfo ladder) + private void addForBeatmap(int beatmapId) { - currentMatch.BindValueChanged(matchChanged); - currentMatch.BindTo(ladder.CurrentMatch); + if (currentMatch.Value.Grouping.Value.Beatmaps.All(b => b.BeatmapInfo.OnlineBeatmapID != beatmapId)) + // don't attempt to add if the beatmap isn't in our pool + return; + + if (currentMatch.Value.PicksBans.Any(p => p.BeatmapID == beatmapId)) + // don't attempt to add if already exists. + return; + + currentMatch.Value.PicksBans.Add(new BeatmapChoice + { + Team = pickColour, + Type = pickType, + BeatmapID = beatmapId + }); + + setNextMode(); } private void matchChanged(MatchPairing match) From bd6d3f147316df900655ddc9a0d816ab11ef1f9e Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 8 Nov 2018 06:47:42 +0900 Subject: [PATCH 096/317] Improve appearance --- .../Components/TournamentBeatmapPanel.cs | 20 ++++++++++++-- .../Screens/MapPool/MapPoolScreen.cs | 26 ++++++++++++++----- 2 files changed, 38 insertions(+), 8 deletions(-) diff --git a/osu.Game.Tournament/Components/TournamentBeatmapPanel.cs b/osu.Game.Tournament/Components/TournamentBeatmapPanel.cs index 7f9494e3c9..b804fc44a7 100644 --- a/osu.Game.Tournament/Components/TournamentBeatmapPanel.cs +++ b/osu.Game.Tournament/Components/TournamentBeatmapPanel.cs @@ -132,19 +132,35 @@ namespace osu.Game.Tournament.Components if (found != null) { + BorderThickness = 6; + switch (found.Team) { case TeamColour.Red: - Colour = Color4.Red; + BorderColour = Color4.Red; break; case TeamColour.Blue: - Colour = Color4.Blue; + BorderColour = Color4.Blue; + break; + } + + switch (found.Type) + { + case ChoiceType.Pick: + Colour = Color4.White; + Alpha = 1; + break; + case ChoiceType.Ban: + Colour = Color4.Gray; + Alpha = 0.5f; break; } } else { Colour = Color4.White; + BorderThickness = 0; + Alpha = 1; } } diff --git a/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs b/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs index fb9bd7b9a5..be56869115 100644 --- a/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs +++ b/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs @@ -15,6 +15,7 @@ using osu.Game.Tournament.Components; using osu.Game.Tournament.IPC; using osu.Game.Tournament.Screens.Ladder.Components; using OpenTK; +using OpenTK.Graphics; using OpenTK.Input; namespace osu.Game.Tournament.Screens.MapPool @@ -75,7 +76,14 @@ namespace osu.Game.Tournament.Screens.MapPool RelativeSizeAxes = Axes.X, Text = "Blue Pick", Action = () => setMode(TeamColour.Blue, ChoiceType.Pick) - } + }, + new ControlPanel.Spacer(), + new TriangleButton + { + RelativeSizeAxes = Axes.X, + Text = "Reset", + Action = reset + }, } } }; @@ -101,12 +109,12 @@ namespace osu.Game.Tournament.Screens.MapPool pickColour = colour; pickType = choiceType; - var enabled = currentMatch.Value.PicksBans.Count == 0; + Color4 setColour(bool active) => active ? Color4.White : Color4.Gray; - buttonRedBan.Enabled.Value = enabled || pickColour == TeamColour.Red && pickType == ChoiceType.Ban; - buttonBlueBan.Enabled.Value = enabled || pickColour == TeamColour.Blue && pickType == ChoiceType.Ban; - buttonRedPick.Enabled.Value = enabled || pickColour == TeamColour.Red && pickType == ChoiceType.Pick; - buttonBluePick.Enabled.Value = enabled || pickColour == TeamColour.Blue && pickType == ChoiceType.Pick; + buttonRedBan.Colour = setColour(pickColour == TeamColour.Red && pickType == ChoiceType.Ban); + buttonBlueBan.Colour = setColour(pickColour == TeamColour.Blue && pickType == ChoiceType.Ban); + buttonRedPick.Colour = setColour(pickColour == TeamColour.Red && pickType == ChoiceType.Pick); + buttonBluePick.Colour = setColour(pickColour == TeamColour.Blue && pickType == ChoiceType.Pick); } private void setNextMode() @@ -141,6 +149,12 @@ namespace osu.Game.Tournament.Screens.MapPool return base.OnMouseDown(e); } + private void reset() + { + currentMatch.Value.PicksBans.Clear(); + setNextMode(); + } + private void addForBeatmap(int beatmapId) { if (currentMatch.Value.Grouping.Value.Beatmaps.All(b => b.BeatmapInfo.OnlineBeatmapID != beatmapId)) From a31507ff0e87443888faeb393d2c5a3266a96856 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 8 Nov 2018 13:08:59 +0900 Subject: [PATCH 097/317] Safety check --- osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs b/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs index be56869115..c7bdf8feee 100644 --- a/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs +++ b/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs @@ -157,6 +157,9 @@ namespace osu.Game.Tournament.Screens.MapPool private void addForBeatmap(int beatmapId) { + if (currentMatch.Value == null) + return; + if (currentMatch.Value.Grouping.Value.Beatmaps.All(b => b.BeatmapInfo.OnlineBeatmapID != beatmapId)) // don't attempt to add if the beatmap isn't in our pool return; From 6ff29c1ea4fbed864489d00be08aa6c03e7a31ba Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 8 Nov 2018 16:55:55 +0900 Subject: [PATCH 098/317] Fix non-unbinding bindable bind --- osu.Game.Tournament/Screens/TeamIntro/TeamIntroScreen.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/osu.Game.Tournament/Screens/TeamIntro/TeamIntroScreen.cs b/osu.Game.Tournament/Screens/TeamIntro/TeamIntroScreen.cs index d515312dd0..7c4f139de7 100644 --- a/osu.Game.Tournament/Screens/TeamIntro/TeamIntroScreen.cs +++ b/osu.Game.Tournament/Screens/TeamIntro/TeamIntroScreen.cs @@ -3,6 +3,7 @@ using System; using osu.Framework.Allocation; +using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Video; @@ -21,11 +22,10 @@ namespace osu.Game.Tournament.Screens.TeamIntro { private Container mainContainer; - [Resolved] - private LadderInfo ladderInfo { get; set; } + private readonly Bindable currentMatch = new Bindable(); [BackgroundDependencyLoader] - private void load(Storage storage) + private void load(LadderInfo ladder, Storage storage) { RelativeSizeAxes = Axes.Both; @@ -42,7 +42,8 @@ namespace osu.Game.Tournament.Screens.TeamIntro } }; - ladderInfo.CurrentMatch.BindValueChanged(matchChanged, true); + currentMatch.BindValueChanged(matchChanged); + currentMatch.BindTo(ladder.CurrentMatch); } private void matchChanged(MatchPairing pairing) From ee6263f3956ab5b96c48b0801d32911502338fc2 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 8 Nov 2018 20:14:50 +0900 Subject: [PATCH 099/317] Fix old maps not getting cleared when switching matches --- .../Screens/MapPool/MapPoolScreen.cs | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs b/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs index c7bdf8feee..e8d6f18fd7 100644 --- a/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs +++ b/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs @@ -180,12 +180,17 @@ namespace osu.Game.Tournament.Screens.MapPool private void matchChanged(MatchPairing match) { - foreach (var b in match.Grouping.Value.Beatmaps) - maps.Add(new TournamentBeatmapPanel(b.BeatmapInfo) - { - Anchor = Anchor.TopCentre, - Origin = Anchor.TopCentre, - }); + maps.Clear(); + + if (match.Grouping.Value != null) + { + foreach (var b in match.Grouping.Value.Beatmaps) + maps.Add(new TournamentBeatmapPanel(b.BeatmapInfo) + { + Anchor = Anchor.TopCentre, + Origin = Anchor.TopCentre, + }); + } } } } From 0003a9310f809ad3a1fa2d3fcdfc2bcf48d50d20 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 8 Nov 2018 20:15:08 +0900 Subject: [PATCH 100/317] Expose LargeTextureStore --- osu.Game/OsuGameBase.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/osu.Game/OsuGameBase.cs b/osu.Game/OsuGameBase.cs index ea1dbfa369..c7f787cff1 100644 --- a/osu.Game/OsuGameBase.cs +++ b/osu.Game/OsuGameBase.cs @@ -110,9 +110,9 @@ namespace osu.Game dependencies.Cache(contextFactory = new DatabaseContextFactory(Host.Storage)); - var largeStore = new LargeTextureStore(new TextureLoaderStore(new NamespacedResourceStore(Resources, @"Textures"))); - largeStore.AddStore(new TextureLoaderStore(new OnlineStore())); - dependencies.Cache(largeStore); + LargeTextureStore = new LargeTextureStore(new TextureLoaderStore(new NamespacedResourceStore(Resources, @"Textures"))); + LargeTextureStore.AddStore(new TextureLoaderStore(new OnlineStore())); + dependencies.Cache(LargeTextureStore); dependencies.CacheAs(this); dependencies.Cache(LocalConfig); @@ -243,6 +243,8 @@ namespace osu.Game private readonly List fileImporters = new List(); + protected LargeTextureStore LargeTextureStore; + public void Import(params string[] paths) { var extension = Path.GetExtension(paths.First())?.ToLowerInvariant(); From 160984719d31ac5ab87829f4921f6f4ab5933432 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 8 Nov 2018 20:15:22 +0900 Subject: [PATCH 101/317] Add team and star displays --- .../Screens/Drawings/DrawingsScreen.cs | 14 -- .../Screens/Gameplay/GameplayScreen.cs | 208 ++++++++++++++++++ osu.Game.Tournament/TournamentGameBase.cs | 4 +- 3 files changed, 211 insertions(+), 15 deletions(-) diff --git a/osu.Game.Tournament/Screens/Drawings/DrawingsScreen.cs b/osu.Game.Tournament/Screens/Drawings/DrawingsScreen.cs index f94c882c85..0e146cb15a 100644 --- a/osu.Game.Tournament/Screens/Drawings/DrawingsScreen.cs +++ b/osu.Game.Tournament/Screens/Drawings/DrawingsScreen.cs @@ -11,7 +11,6 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Textures; -using osu.Framework.IO.Stores; using osu.Framework.Logging; using osu.Framework.Platform; using osu.Game.Graphics; @@ -47,11 +46,6 @@ namespace osu.Game.Tournament.Screens.Drawings public ITeamList TeamList; - private DependencyContainer dependencies; - - protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnlyDependencyContainer parent) => - dependencies = new DependencyContainer(base.CreateChildDependencies(parent)); - [BackgroundDependencyLoader] private void load(TextureStore textures, Storage storage) { @@ -59,14 +53,6 @@ namespace osu.Game.Tournament.Screens.Drawings this.storage = storage; - TextureStore flagStore = new TextureStore(); - // Local flag store - flagStore.AddStore(new TextureLoaderStore(new NamespacedResourceStore(new StorageBackedResourceStore(storage), "Drawings"))); - // Default texture store - flagStore.AddStore(textures); - - dependencies.Cache(flagStore); - if (TeamList == null) TeamList = new StorageBackedTeamList(storage); diff --git a/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs b/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs index 2a9754b066..9f46776a6d 100644 --- a/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs +++ b/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs @@ -1,10 +1,218 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using osu.Framework.Allocation; +using osu.Framework.Configuration; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Shapes; +using osu.Framework.Graphics.Sprites; +using osu.Framework.Graphics.Textures; +using osu.Framework.Logging; +using osu.Game.Graphics.Sprites; +using osu.Game.Graphics.UserInterface; +using osu.Game.Tournament.Components; +using osu.Game.Tournament.Screens.Ladder.Components; +using OpenTK; +using OpenTK.Graphics; + namespace osu.Game.Tournament.Screens.Gameplay { public class GameplayScreen : BeatmapInfoScreen { + [BackgroundDependencyLoader] + private void load(LadderInfo ladder, TextureStore textures) + { + Add(new Container + { + RelativeSizeAxes = Axes.X, + Height = 100, + Children = new Drawable[] + { + new Sprite + { + Y = 5, + Texture = textures.Get("game-screen-logo"), + Anchor = Anchor.TopCentre, + Origin = Anchor.TopCentre, + FillMode = FillMode.Fit, + RelativeSizeAxes = Axes.Both, + Size = Vector2.One + }, + new RoundDisplay + { + Y = 10, + Anchor = Anchor.BottomCentre, + Origin = Anchor.TopCentre, + }, + new TeamScoreDisplay(TeamColour.Red) + { + Anchor = Anchor.TopLeft, + Origin = Anchor.TopLeft, + }, + new TeamScoreDisplay(TeamColour.Blue) + { + Anchor = Anchor.TopRight, + Origin = Anchor.TopRight, + } + }, + }); + } + private class TeamScoreDisplay : CompositeDrawable + { + private readonly TeamColour teamColour; + + private readonly Color4 red = new Color4(129, 68, 65, 255); + private readonly Color4 blue = new Color4(41, 91, 97, 255); + + private readonly Bindable currentMatch = new Bindable(); + private readonly Bindable currentTeam = new Bindable(); + private readonly Bindable currentTeamScore = new Bindable(); + + public TeamScoreDisplay(TeamColour teamColour) + { + this.teamColour = teamColour; + + RelativeSizeAxes = Axes.Y; + Width = 300; + } + + [BackgroundDependencyLoader] + private void load(LadderInfo ladder) + { + currentMatch.BindValueChanged(matchChanged); + currentMatch.BindTo(ladder.CurrentMatch); + } + + private void matchChanged(MatchPairing match) + { + currentTeamScore.UnbindBindings(); + currentTeamScore.BindTo(teamColour == TeamColour.Red ? match.Team1Score : match.Team2Score); + + currentTeam.UnbindBindings(); + currentTeam.BindTo(teamColour == TeamColour.Red ? match.Team1 : match.Team2); + + // team may change to same team, which means score is not in a good state. + // thus we handle this manually. + teamChanged(currentTeam.Value); + } + + private void teamChanged(TournamentTeam team) + { + InternalChildren = new Drawable[] + { + new TeamDisplay(team, teamColour == TeamColour.Red ? red : blue, teamColour != TeamColour.Red), + new ScoreDisplay(currentTeamScore, teamColour != TeamColour.Red, currentMatch.Value.Grouping.Value.BestOf / 2 + 1) + }; + } + } + + private class ScoreDisplay : CompositeDrawable + { + private readonly Bindable currentTeamScore = new Bindable(); + private readonly StarCounter counter; + + public ScoreDisplay(Bindable score, bool flip, int count) + { + var anchor = flip ? Anchor.CentreRight : Anchor.CentreLeft; + + Anchor = anchor; + Origin = anchor; + + InternalChild = counter = new StarCounter(count) + { + Anchor = anchor, + X = (flip ? -1 : 1) * 90, + Y = 5, + Scale = flip ? new Vector2(-1, 1) : Vector2.One, + Colour = new Color4(95, 41, 60, 255), + }; + + currentTeamScore.BindValueChanged(scoreChanged); + currentTeamScore.BindTo(score); + } + + private void scoreChanged(int? score) => counter.CountStars = score ?? 0; + } + + private class TeamDisplay : DrawableTournamentTeam + { + public TeamDisplay(TournamentTeam team, Color4 colour, bool flip) + : base(team) + { + RelativeSizeAxes = Axes.Both; + + var anchor = flip ? Anchor.CentreRight : Anchor.CentreLeft; + + Anchor = Origin = anchor; + + Flag.Anchor = Flag.Origin = anchor; + Flag.RelativeSizeAxes = Axes.None; + Flag.Size = new Vector2(60, 40); + Flag.Margin = new MarginPadding(20); + + InternalChild = new Container + { + RelativeSizeAxes = Axes.Both, + Children = new Drawable[] + { + Flag, + new OsuSpriteText + { + Text = team?.FullName.ToUpper() ?? "???", + X = (flip ? -1 : 1) * 90, + Y = -10, + TextSize = 20, + Colour = colour, + Font = "Aquatico-Regular", + Origin = anchor, + Anchor = anchor, + }, + } + }; + } + } + + private class RoundDisplay : CompositeDrawable + { + private readonly Bindable currentMatch = new Bindable(); + + public RoundDisplay() + { + CornerRadius = 10; + Masking = true; + Width = 200; + Height = 20; + } + + [BackgroundDependencyLoader] + private void load(LadderInfo ladder) + { + currentMatch.BindValueChanged(matchChanged); + currentMatch.BindTo(ladder.CurrentMatch); + } + + private void matchChanged(MatchPairing match) + { + InternalChildren = new Drawable[] + { + new Box + { + Colour = new Color4(95, 41, 60, 255), + RelativeSizeAxes = Axes.Both, + }, + new OsuSpriteText + { + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + Colour = Color4.White, + Text = match.Grouping.Value?.Name.Value ?? "Unknown Grouping", + Font = "Aquatico-Regular", + TextSize = 18, + }, + }; + } + }; } } diff --git a/osu.Game.Tournament/TournamentGameBase.cs b/osu.Game.Tournament/TournamentGameBase.cs index 562b141095..df93c42d98 100644 --- a/osu.Game.Tournament/TournamentGameBase.cs +++ b/osu.Game.Tournament/TournamentGameBase.cs @@ -10,6 +10,7 @@ using Newtonsoft.Json; using osu.Framework.Allocation; using osu.Framework.Configuration; using osu.Framework.Graphics; +using osu.Framework.Graphics.Textures; using osu.Framework.IO.Stores; using osu.Framework.Platform; using osu.Game.Beatmaps; @@ -49,6 +50,8 @@ namespace osu.Game.Tournament Fonts.AddStore(new GlyphStore(Resources, @"Resources/Fonts/Aquatico-Regular")); Fonts.AddStore(new GlyphStore(Resources, @"Resources/Fonts/Aquatico-Light")); + Textures.AddStore(new TextureLoaderStore(new ResourceStore(new StorageBackedResourceStore(storage)))); + this.storage = storage; windowSize = frameworkConfig.GetBindable(FrameworkSetting.WindowedSize); @@ -125,7 +128,6 @@ namespace osu.Game.Tournament addedInfo = true; } - List countries; using (Stream stream = Resources.GetStream("Resources/countries.json")) using (var sr = new StreamReader(stream)) From 0be2f5ac94722fd03eb6e2e63298b1000f03b74e Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 9 Nov 2018 16:10:58 +0900 Subject: [PATCH 102/317] Add non-working warmup toggle button --- .../Screens/Gameplay/GameplayScreen.cs | 79 ++++++++++++------- 1 file changed, 50 insertions(+), 29 deletions(-) diff --git a/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs b/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs index 9f46776a6d..107b8f2736 100644 --- a/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs +++ b/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs @@ -8,7 +8,6 @@ using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Textures; -using osu.Framework.Logging; using osu.Game.Graphics.Sprites; using osu.Game.Graphics.UserInterface; using osu.Game.Tournament.Components; @@ -20,45 +19,67 @@ namespace osu.Game.Tournament.Screens.Gameplay { public class GameplayScreen : BeatmapInfoScreen { + private BindableBool warmup = new BindableBool(); + [BackgroundDependencyLoader] private void load(LadderInfo ladder, TextureStore textures) { - Add(new Container + AddRange(new Drawable[] { - RelativeSizeAxes = Axes.X, - Height = 100, - Children = new Drawable[] + new Container { - new Sprite + RelativeSizeAxes = Axes.X, + Height = 100, + Children = new Drawable[] { - Y = 5, - Texture = textures.Get("game-screen-logo"), - Anchor = Anchor.TopCentre, - Origin = Anchor.TopCentre, - FillMode = FillMode.Fit, - RelativeSizeAxes = Axes.Both, - Size = Vector2.One + new Sprite + { + Y = 5, + Texture = textures.Get("game-screen-logo"), + Anchor = Anchor.TopCentre, + Origin = Anchor.TopCentre, + FillMode = FillMode.Fit, + RelativeSizeAxes = Axes.Both, + Size = Vector2.One + }, + new RoundDisplay + { + Y = 10, + Anchor = Anchor.BottomCentre, + Origin = Anchor.TopCentre, + }, + new TeamScoreDisplay(TeamColour.Red) + { + Anchor = Anchor.TopLeft, + Origin = Anchor.TopLeft, + }, + new TeamScoreDisplay(TeamColour.Blue) + { + Anchor = Anchor.TopRight, + Origin = Anchor.TopRight, + }, }, - new RoundDisplay - { - Y = 10, - Anchor = Anchor.BottomCentre, - Origin = Anchor.TopCentre, - }, - new TeamScoreDisplay(TeamColour.Red) - { - Anchor = Anchor.TopLeft, - Origin = Anchor.TopLeft, - }, - new TeamScoreDisplay(TeamColour.Blue) - { - Anchor = Anchor.TopRight, - Origin = Anchor.TopRight, - } }, + new ControlPanel + { + Children = new Drawable[] + { + new TriangleButton + { + RelativeSizeAxes = Axes.X, + Text = "Toggle warmup", + Action = toggleWarmup + } + } + } }); } + private void toggleWarmup() + { + warmup.Toggle(); + } + private class TeamScoreDisplay : CompositeDrawable { private readonly TeamColour teamColour; From 1c6c59864486c863649b11126ce83ea0fa5c6bdc Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 9 Nov 2018 16:11:12 +0900 Subject: [PATCH 103/317] Fill out username from user ids, rather than user ids from user ids --- osu.Game.Tournament/TournamentGameBase.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Tournament/TournamentGameBase.cs b/osu.Game.Tournament/TournamentGameBase.cs index df93c42d98..416be35456 100644 --- a/osu.Game.Tournament/TournamentGameBase.cs +++ b/osu.Game.Tournament/TournamentGameBase.cs @@ -107,7 +107,7 @@ namespace osu.Game.Tournament // add full player info based on user IDs foreach (var t in Ladder.Teams) foreach (var p in t.Players) - if (p.Id == 1) + if (string.IsNullOrEmpty(p.Username)) { var req = new GetUserRequest(p.Id); req.Success += i => p.Username = i.Username; From 66dc7d6b0285b90184eab24c3bd2eb4ea7ed4901 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 9 Nov 2018 16:26:09 +0900 Subject: [PATCH 104/317] Fix debug tools not working --- osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs | 2 +- osu.Game.Tournament/TournamentGameBase.cs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs b/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs index 107b8f2736..2d3ed89b97 100644 --- a/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs +++ b/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs @@ -19,7 +19,7 @@ namespace osu.Game.Tournament.Screens.Gameplay { public class GameplayScreen : BeatmapInfoScreen { - private BindableBool warmup = new BindableBool(); + private readonly BindableBool warmup = new BindableBool(); [BackgroundDependencyLoader] private void load(LadderInfo ladder, TextureStore textures) diff --git a/osu.Game.Tournament/TournamentGameBase.cs b/osu.Game.Tournament/TournamentGameBase.cs index 416be35456..28136a6394 100644 --- a/osu.Game.Tournament/TournamentGameBase.cs +++ b/osu.Game.Tournament/TournamentGameBase.cs @@ -163,6 +163,7 @@ namespace osu.Game.Tournament protected override void LoadComplete() { MenuCursorContainer.Cursor.Alpha = 0; + base.LoadComplete(); } protected override void Update() From 8a917e4cc7f137cf883b316e16c389507969c7c9 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 9 Nov 2018 16:57:45 +0900 Subject: [PATCH 105/317] Fix context menus (temporarily) --- osu.Game.Tournament/Screens/Ladder/LadderManager.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/osu.Game.Tournament/Screens/Ladder/LadderManager.cs b/osu.Game.Tournament/Screens/Ladder/LadderManager.cs index 805358e231..9e43cffc72 100644 --- a/osu.Game.Tournament/Screens/Ladder/LadderManager.cs +++ b/osu.Game.Tournament/Screens/Ladder/LadderManager.cs @@ -255,6 +255,9 @@ namespace osu.Game.Tournament.Screens.Ladder } } + // todo: remove after ppy/osu-framework#1980 is merged. + public override bool HandlePositionalInput => true; + public void Remove(MatchPairing pairing) => pairingsContainer.FirstOrDefault(p => p.Pairing == pairing)?.Remove(); public void SetCurrent(MatchPairing pairing) From 9064f3fe0f0477affaba7bc378ada4116c6b6dd1 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 9 Nov 2018 17:39:46 +0900 Subject: [PATCH 106/317] Fix ladder manager not saving changes out correctly --- .../TestCaseLadderManager.cs | 16 +--- .../Ladder/Components/LadderEditorInfo.cs | 4 - .../Ladder/Components/LadderEditorSettings.cs | 7 +- .../Screens/Ladder/LadderManager.cs | 84 +++++++++---------- 4 files changed, 46 insertions(+), 65 deletions(-) diff --git a/osu.Game.Tournament.Tests/TestCaseLadderManager.cs b/osu.Game.Tournament.Tests/TestCaseLadderManager.cs index 3ddd52eeac..63c8f5e391 100644 --- a/osu.Game.Tournament.Tests/TestCaseLadderManager.cs +++ b/osu.Game.Tournament.Tests/TestCaseLadderManager.cs @@ -10,28 +10,14 @@ namespace osu.Game.Tournament.Tests { public class TestCaseLadderManager : LadderTestCase { - private LadderManager manager; - [BackgroundDependencyLoader] private void load() { Add(new OsuContextMenuContainer { RelativeSizeAxes = Axes.Both, - Child = manager = new LadderManager() + Child = new LadderManager() }); } - - protected override void Dispose(bool isDisposing) - { - base.Dispose(isDisposing); - - var newInfo = manager.CreateInfo(); - - Ladder.Teams = newInfo.Teams; - Ladder.Groupings = newInfo.Groupings; - Ladder.Pairings = newInfo.Pairings; - Ladder.Progressions = newInfo.Progressions; - } } } diff --git a/osu.Game.Tournament/Screens/Ladder/Components/LadderEditorInfo.cs b/osu.Game.Tournament/Screens/Ladder/Components/LadderEditorInfo.cs index cc91c98188..0ecf387f7c 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/LadderEditorInfo.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/LadderEditorInfo.cs @@ -1,17 +1,13 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using System.Collections.Generic; using osu.Framework.Configuration; -using osu.Game.Tournament.Components; namespace osu.Game.Tournament.Screens.Ladder.Components { public class LadderEditorInfo { public readonly BindableBool EditingEnabled = new BindableBool(); - public List Teams = new List(); - public List Groupings = new List(); public readonly Bindable Selected = new Bindable(); } } diff --git a/osu.Game.Tournament/Screens/Ladder/Components/LadderEditorSettings.cs b/osu.Game.Tournament/Screens/Ladder/Components/LadderEditorSettings.cs index d7b827237a..3fa7fdf7e8 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/LadderEditorSettings.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/LadderEditorSettings.cs @@ -28,12 +28,15 @@ namespace osu.Game.Tournament.Screens.Ladder.Components [Resolved] private LadderEditorInfo editorInfo { get; set; } + [Resolved] + private LadderInfo ladderInfo { get; set; } + [BackgroundDependencyLoader] private void load() { - var teamEntries = editorInfo.Teams; + var teamEntries = ladderInfo.Teams; - var groupingOptions = editorInfo.Groupings.Select(g => new KeyValuePair(g.Name, g)) + var groupingOptions = ladderInfo.Groupings.Select(g => new KeyValuePair(g.Name, g)) .Prepend(new KeyValuePair("None", new TournamentGrouping())); Children = new Drawable[] diff --git a/osu.Game.Tournament/Screens/Ladder/LadderManager.cs b/osu.Game.Tournament/Screens/Ladder/LadderManager.cs index 9e43cffc72..5ef7d047e2 100644 --- a/osu.Game.Tournament/Screens/Ladder/LadderManager.cs +++ b/osu.Game.Tournament/Screens/Ladder/LadderManager.cs @@ -1,7 +1,7 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using System.Collections.Generic; +using System; using System.Linq; using osu.Framework.Allocation; using osu.Framework.Caching; @@ -15,7 +15,6 @@ using osu.Framework.Input.Events; using osu.Framework.Input.States; using osu.Game.Graphics; using osu.Game.Graphics.UserInterface; -using osu.Game.Tournament.Components; using osu.Game.Tournament.Screens.Ladder.Components; using OpenTK; using OpenTK.Graphics; @@ -26,28 +25,24 @@ namespace osu.Game.Tournament.Screens.Ladder [Cached] public class LadderManager : CompositeDrawable, IHasContextMenu { - public List Teams; private Container pairingsContainer; private Container paths; private Container headings; - private LadderInfo info; - private ScrollableContainer scrollContent; [Cached] private LadderEditorInfo editorInfo = new LadderEditorInfo(); + [Resolved] + private LadderInfo ladderInfo { get; set; } + [BackgroundDependencyLoader] - private void load(LadderInfo info, OsuColour colours) + private void load(OsuColour colours) { normalPathColour = colours.BlueDarker.Darken(2); losersPathColour = colours.YellowDarker.Darken(2); - this.info = info; - editorInfo.Teams = Teams = info.Teams; - editorInfo.Groupings = info.Groupings; - RelativeSizeAxes = Axes.Both; InternalChild = new Container @@ -74,32 +69,29 @@ namespace osu.Game.Tournament.Screens.Ladder } }; - foreach (var pairing in info.Pairings) + foreach (var pairing in ladderInfo.Pairings) addPairing(pairing); // todo: fix this Scheduler.AddDelayed(() => layout.Invalidate(), 100, true); } - public LadderInfo CreateInfo() + private void updateInfo() { - var pairings = pairingsContainer.Select(p => p.Pairing).ToList(); + ladderInfo.Pairings = pairingsContainer.Select(p => p.Pairing).ToList(); + foreach (var g in ladderInfo.Groupings) + g.Pairings = ladderInfo.Pairings.Where(p => p.Grouping.Value == g).Select(p => p.ID).ToList(); - foreach (var g in editorInfo.Groupings) - g.Pairings = pairings.Where(p => p.Grouping.Value == g).Select(p => p.ID).ToList(); - - return new LadderInfo - { - Pairings = pairings, - Progressions = pairings.Where(p => p.Progression.Value != null).Select(p => new TournamentProgression(p.ID, p.Progression.Value.ID)).Concat( - pairings.Where(p => p.LosersProgression.Value != null).Select(p => new TournamentProgression(p.ID, p.LosersProgression.Value.ID, true))) - .ToList(), - Teams = editorInfo.Teams, - Groupings = editorInfo.Groupings - }; + ladderInfo.Progressions = ladderInfo.Pairings.Where(p => p.Progression.Value != null).Select(p => new TournamentProgression(p.ID, p.Progression.Value.ID)).Concat( + ladderInfo.Pairings.Where(p => p.LosersProgression.Value != null).Select(p => new TournamentProgression(p.ID, p.LosersProgression.Value.ID, true))) + .ToList(); } - private void addPairing(MatchPairing pairing) => pairingsContainer.Add(new DrawableMatchPairing(pairing)); + private void addPairing(MatchPairing pairing) + { + pairingsContainer.Add(new DrawableMatchPairing(pairing)); + updateInfo(); + } public MenuItem[] ContextMenuItems { @@ -154,7 +146,7 @@ namespace osu.Game.Tournament.Screens.Ladder } } - foreach (var group in editorInfo.Groupings) + foreach (var group in ladderInfo.Groupings) { var topPairing = pairingsContainer.Where(p => !p.Pairing.Losers && p.Pairing.Grouping.Value == group).OrderBy(p => p.Y).FirstOrDefault(); @@ -168,7 +160,7 @@ namespace osu.Game.Tournament.Screens.Ladder }); } - foreach (var group in editorInfo.Groupings) + foreach (var group in ladderInfo.Groupings) { var topPairing = pairingsContainer.Where(p => p.Pairing.Losers && p.Pairing.Grouping.Value == group).OrderBy(p => p.Y).FirstOrDefault(); @@ -183,25 +175,42 @@ namespace osu.Game.Tournament.Screens.Ladder } layout.Validate(); + updateInfo(); } - public void RequestJoin(MatchPairing pairing, bool losers) => scrollContent.Add(new JoinRequestHandler(pairingsContainer, pairing, losers)); + public void RequestJoin(MatchPairing pairing, bool losers) => scrollContent.Add(new JoinRequestHandler(pairingsContainer, pairing, losers, updateInfo)); + + // todo: remove after ppy/osu-framework#1980 is merged. + public override bool HandlePositionalInput => true; + + public void Remove(MatchPairing pairing) => pairingsContainer.FirstOrDefault(p => p.Pairing == pairing)?.Remove(); + + public void SetCurrent(MatchPairing pairing) + { + if (ladderInfo.CurrentMatch.Value != null) + ladderInfo.CurrentMatch.Value.Current.Value = false; + + ladderInfo.CurrentMatch.Value = pairing; + ladderInfo.CurrentMatch.Value.Current.Value = true; + } private class JoinRequestHandler : CompositeDrawable { private readonly Container pairingsContainer; public readonly MatchPairing Source; private readonly bool losers; + private readonly Action complete; private ProgressionPath path; - public JoinRequestHandler(Container pairingsContainer, MatchPairing source, bool losers) + public JoinRequestHandler(Container pairingsContainer, MatchPairing source, bool losers, Action complete) { this.pairingsContainer = pairingsContainer; RelativeSizeAxes = Axes.Both; Source = source; this.losers = losers; + this.complete = complete; if (losers) Source.LosersProgression.Value = null; else @@ -247,6 +256,7 @@ namespace osu.Game.Tournament.Screens.Ladder Source.Progression.Value = found.Pairing; } + complete?.Invoke(); Expire(); return true; } @@ -254,19 +264,5 @@ namespace osu.Game.Tournament.Screens.Ladder return false; } } - - // todo: remove after ppy/osu-framework#1980 is merged. - public override bool HandlePositionalInput => true; - - public void Remove(MatchPairing pairing) => pairingsContainer.FirstOrDefault(p => p.Pairing == pairing)?.Remove(); - - public void SetCurrent(MatchPairing pairing) - { - if (info.CurrentMatch.Value != null) - info.CurrentMatch.Value.Current.Value = false; - - info.CurrentMatch.Value = pairing; - info.CurrentMatch.Value.Current.Value = true; - } } } From e170372932a14153ab2b41973af592038982d638 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 9 Nov 2018 17:54:05 +0900 Subject: [PATCH 107/317] Populate json with enums better --- .../Screens/Ladder/Components/BeatmapChoice.cs | 9 +++++++++ osu.Game.Tournament/TournamentGameBase.cs | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/osu.Game.Tournament/Screens/Ladder/Components/BeatmapChoice.cs b/osu.Game.Tournament/Screens/Ladder/Components/BeatmapChoice.cs index d0b2556603..5b38e539c6 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/BeatmapChoice.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/BeatmapChoice.cs @@ -1,21 +1,30 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; + namespace osu.Game.Tournament.Screens.Ladder.Components { public class BeatmapChoice { + [JsonProperty(DefaultValueHandling = DefaultValueHandling.Populate)] public TeamColour Team; + + [JsonProperty(DefaultValueHandling = DefaultValueHandling.Populate)] public ChoiceType Type; + public int BeatmapID; } + [JsonConverter(typeof(StringEnumConverter))] public enum TeamColour { Red, Blue } + [JsonConverter(typeof(StringEnumConverter))] public enum ChoiceType { Pick, diff --git a/osu.Game.Tournament/TournamentGameBase.cs b/osu.Game.Tournament/TournamentGameBase.cs index 28136a6394..70868d398e 100644 --- a/osu.Game.Tournament/TournamentGameBase.cs +++ b/osu.Game.Tournament/TournamentGameBase.cs @@ -186,7 +186,7 @@ namespace osu.Game.Tournament new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore, - DefaultValueHandling = DefaultValueHandling.Ignore + DefaultValueHandling = DefaultValueHandling.Ignore, })); } } From 1756ef95cbb520557b90991a4ee93684dd53232a Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 10 Nov 2018 07:31:06 +0900 Subject: [PATCH 108/317] Add ability to adjust scores from gameplay screen --- .../Screens/Gameplay/GameplayScreen.cs | 22 ++++++++++++++++++- .../Screens/Ladder/Components/MatchPairing.cs | 2 ++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs b/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs index 2d3ed89b97..5593824e55 100644 --- a/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs +++ b/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs @@ -8,12 +8,14 @@ using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Textures; +using osu.Framework.Input.Events; using osu.Game.Graphics.Sprites; using osu.Game.Graphics.UserInterface; using osu.Game.Tournament.Components; using osu.Game.Tournament.Screens.Ladder.Components; using OpenTK; using OpenTK.Graphics; +using OpenTK.Input; namespace osu.Game.Tournament.Screens.Gameplay { @@ -119,12 +121,30 @@ namespace osu.Game.Tournament.Screens.Gameplay teamChanged(currentTeam.Value); } + + protected override bool OnMouseDown(MouseDownEvent e) + { + switch (e.Button) + { + case MouseButton.Left: + if (currentTeamScore.Value < currentMatch.Value.PointsToWin) + currentTeamScore.Value++; + return true; + case MouseButton.Right: + if (currentTeamScore.Value > 0) + currentTeamScore.Value--; + return true; + } + + return base.OnMouseDown(e); + } + private void teamChanged(TournamentTeam team) { InternalChildren = new Drawable[] { new TeamDisplay(team, teamColour == TeamColour.Red ? red : blue, teamColour != TeamColour.Red), - new ScoreDisplay(currentTeamScore, teamColour != TeamColour.Red, currentMatch.Value.Grouping.Value.BestOf / 2 + 1) + new ScoreDisplay(currentTeamScore, teamColour != TeamColour.Red, currentMatch.Value.PointsToWin) }; } } diff --git a/osu.Game.Tournament/Screens/Ladder/Components/MatchPairing.cs b/osu.Game.Tournament/Screens/Ladder/Components/MatchPairing.cs index 63c96d350d..729249c3d7 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/MatchPairing.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/MatchPairing.cs @@ -74,6 +74,8 @@ namespace osu.Game.Tournament.Screens.Ladder.Components [JsonIgnore] public TournamentTeam Loser => !Completed.Value ? null : Team1Score.Value > Team2Score.Value ? Team2.Value : Team1.Value; + public int PointsToWin => Grouping.Value.BestOf / 2 + 1; + /// /// Remove scores from the match, in case of a false click or false start. /// From 82d53e6f17e7675c5a54a4371a0d338d27b586d8 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 10 Nov 2018 08:37:21 +0900 Subject: [PATCH 109/317] Fix many unnecessary requests being fired --- osu.Game.Tournament/IPC/FileBasedIPC.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/osu.Game.Tournament/IPC/FileBasedIPC.cs b/osu.Game.Tournament/IPC/FileBasedIPC.cs index c42ccc11c2..a6e171b699 100644 --- a/osu.Game.Tournament/IPC/FileBasedIPC.cs +++ b/osu.Game.Tournament/IPC/FileBasedIPC.cs @@ -27,6 +27,8 @@ namespace osu.Game.Tournament.IPC public readonly Bindable Mods = new Bindable(); + private int lastBeatmapId; + [BackgroundDependencyLoader] private void load() { @@ -45,8 +47,9 @@ namespace osu.Game.Tournament.IPC var beatmapId = int.Parse(sr.ReadLine()); var mods = int.Parse(sr.ReadLine()); - if (Beatmap.Value?.OnlineBeatmapID != beatmapId) + if (lastBeatmapId != beatmapId) { + lastBeatmapId = beatmapId; var req = new GetBeatmapRequest(new BeatmapInfo { OnlineBeatmapID = beatmapId }); req.Success += b => Beatmap.Value = b.ToBeatmap(Rulesets); API.Queue(req); From 86aab9c31b480e656c06305639c30ed73a7c59ef Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 10 Nov 2018 08:54:56 +0900 Subject: [PATCH 110/317] Fix chat making needless requests --- osu.Game/Overlays/ChatOverlay.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/osu.Game/Overlays/ChatOverlay.cs b/osu.Game/Overlays/ChatOverlay.cs index ff2ff9af14..65d5371130 100644 --- a/osu.Game/Overlays/ChatOverlay.cs +++ b/osu.Game/Overlays/ChatOverlay.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2018 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; @@ -393,10 +393,10 @@ namespace osu.Game.Overlays api.Queue(req); return; } - } - // let's fetch a small number of messages to bring us up-to-date with the backlog. - fetchInitialMessages(channel); + // let's fetch a small number of messages to bring us up-to-date with the backlog. + fetchInitialMessages(channel); + } if (CurrentChannel == null) CurrentChannel = channel; From 713038bff88c9a24e6c5d13cab6a4d87c2516568 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 10 Nov 2018 17:26:21 +0900 Subject: [PATCH 111/317] Share header area between screens --- .../Screens/Gameplay/GameplayScreen.cs | 224 +---------------- .../Screens/Gameplay/MatchHeader.cs | 234 ++++++++++++++++++ .../Screens/MapPool/MapPoolScreen.cs | 5 +- 3 files changed, 245 insertions(+), 218 deletions(-) create mode 100644 osu.Game.Tournament/Screens/Gameplay/MatchHeader.cs diff --git a/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs b/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs index 5593824e55..8b87d6d581 100644 --- a/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs +++ b/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs @@ -4,18 +4,9 @@ using osu.Framework.Allocation; using osu.Framework.Configuration; using osu.Framework.Graphics; -using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Shapes; -using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Textures; -using osu.Framework.Input.Events; -using osu.Game.Graphics.Sprites; using osu.Game.Graphics.UserInterface; using osu.Game.Tournament.Components; -using osu.Game.Tournament.Screens.Ladder.Components; -using OpenTK; -using OpenTK.Graphics; -using OpenTK.Input; namespace osu.Game.Tournament.Screens.Gameplay { @@ -28,40 +19,13 @@ namespace osu.Game.Tournament.Screens.Gameplay { AddRange(new Drawable[] { - new Container - { - RelativeSizeAxes = Axes.X, - Height = 100, - Children = new Drawable[] - { - new Sprite - { - Y = 5, - Texture = textures.Get("game-screen-logo"), - Anchor = Anchor.TopCentre, - Origin = Anchor.TopCentre, - FillMode = FillMode.Fit, - RelativeSizeAxes = Axes.Both, - Size = Vector2.One - }, - new RoundDisplay - { - Y = 10, - Anchor = Anchor.BottomCentre, - Origin = Anchor.TopCentre, - }, - new TeamScoreDisplay(TeamColour.Red) - { - Anchor = Anchor.TopLeft, - Origin = Anchor.TopLeft, - }, - new TeamScoreDisplay(TeamColour.Blue) - { - Anchor = Anchor.TopRight, - Origin = Anchor.TopRight, - }, - }, - }, + new MatchHeader(), + // new CustomChatOverlay + // { + // Anchor = Anchor.BottomCentre, + // Origin = Anchor.BottomCentre, + // Size = new Vector2(0.4f, 1) + // }, new ControlPanel { Children = new Drawable[] @@ -81,179 +45,5 @@ namespace osu.Game.Tournament.Screens.Gameplay { warmup.Toggle(); } - - private class TeamScoreDisplay : CompositeDrawable - { - private readonly TeamColour teamColour; - - private readonly Color4 red = new Color4(129, 68, 65, 255); - private readonly Color4 blue = new Color4(41, 91, 97, 255); - - private readonly Bindable currentMatch = new Bindable(); - private readonly Bindable currentTeam = new Bindable(); - private readonly Bindable currentTeamScore = new Bindable(); - - public TeamScoreDisplay(TeamColour teamColour) - { - this.teamColour = teamColour; - - RelativeSizeAxes = Axes.Y; - Width = 300; - } - - [BackgroundDependencyLoader] - private void load(LadderInfo ladder) - { - currentMatch.BindValueChanged(matchChanged); - currentMatch.BindTo(ladder.CurrentMatch); - } - - private void matchChanged(MatchPairing match) - { - currentTeamScore.UnbindBindings(); - currentTeamScore.BindTo(teamColour == TeamColour.Red ? match.Team1Score : match.Team2Score); - - currentTeam.UnbindBindings(); - currentTeam.BindTo(teamColour == TeamColour.Red ? match.Team1 : match.Team2); - - // team may change to same team, which means score is not in a good state. - // thus we handle this manually. - teamChanged(currentTeam.Value); - } - - - protected override bool OnMouseDown(MouseDownEvent e) - { - switch (e.Button) - { - case MouseButton.Left: - if (currentTeamScore.Value < currentMatch.Value.PointsToWin) - currentTeamScore.Value++; - return true; - case MouseButton.Right: - if (currentTeamScore.Value > 0) - currentTeamScore.Value--; - return true; - } - - return base.OnMouseDown(e); - } - - private void teamChanged(TournamentTeam team) - { - InternalChildren = new Drawable[] - { - new TeamDisplay(team, teamColour == TeamColour.Red ? red : blue, teamColour != TeamColour.Red), - new ScoreDisplay(currentTeamScore, teamColour != TeamColour.Red, currentMatch.Value.PointsToWin) - }; - } - } - - private class ScoreDisplay : CompositeDrawable - { - private readonly Bindable currentTeamScore = new Bindable(); - private readonly StarCounter counter; - - public ScoreDisplay(Bindable score, bool flip, int count) - { - var anchor = flip ? Anchor.CentreRight : Anchor.CentreLeft; - - Anchor = anchor; - Origin = anchor; - - InternalChild = counter = new StarCounter(count) - { - Anchor = anchor, - X = (flip ? -1 : 1) * 90, - Y = 5, - Scale = flip ? new Vector2(-1, 1) : Vector2.One, - Colour = new Color4(95, 41, 60, 255), - }; - - currentTeamScore.BindValueChanged(scoreChanged); - currentTeamScore.BindTo(score); - } - - private void scoreChanged(int? score) => counter.CountStars = score ?? 0; - } - - private class TeamDisplay : DrawableTournamentTeam - { - public TeamDisplay(TournamentTeam team, Color4 colour, bool flip) - : base(team) - { - RelativeSizeAxes = Axes.Both; - - var anchor = flip ? Anchor.CentreRight : Anchor.CentreLeft; - - Anchor = Origin = anchor; - - Flag.Anchor = Flag.Origin = anchor; - Flag.RelativeSizeAxes = Axes.None; - Flag.Size = new Vector2(60, 40); - Flag.Margin = new MarginPadding(20); - - InternalChild = new Container - { - RelativeSizeAxes = Axes.Both, - Children = new Drawable[] - { - Flag, - new OsuSpriteText - { - Text = team?.FullName.ToUpper() ?? "???", - X = (flip ? -1 : 1) * 90, - Y = -10, - TextSize = 20, - Colour = colour, - Font = "Aquatico-Regular", - Origin = anchor, - Anchor = anchor, - }, - } - }; - } - } - - private class RoundDisplay : CompositeDrawable - { - private readonly Bindable currentMatch = new Bindable(); - - public RoundDisplay() - { - CornerRadius = 10; - Masking = true; - Width = 200; - Height = 20; - } - - [BackgroundDependencyLoader] - private void load(LadderInfo ladder) - { - currentMatch.BindValueChanged(matchChanged); - currentMatch.BindTo(ladder.CurrentMatch); - } - - private void matchChanged(MatchPairing match) - { - InternalChildren = new Drawable[] - { - new Box - { - Colour = new Color4(95, 41, 60, 255), - RelativeSizeAxes = Axes.Both, - }, - new OsuSpriteText - { - Anchor = Anchor.Centre, - Origin = Anchor.Centre, - Colour = Color4.White, - Text = match.Grouping.Value?.Name.Value ?? "Unknown Grouping", - Font = "Aquatico-Regular", - TextSize = 18, - }, - }; - } - }; } } diff --git a/osu.Game.Tournament/Screens/Gameplay/MatchHeader.cs b/osu.Game.Tournament/Screens/Gameplay/MatchHeader.cs new file mode 100644 index 0000000000..2ff5ee7bf6 --- /dev/null +++ b/osu.Game.Tournament/Screens/Gameplay/MatchHeader.cs @@ -0,0 +1,234 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework.Allocation; +using osu.Framework.Configuration; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Shapes; +using osu.Framework.Graphics.Sprites; +using osu.Framework.Graphics.Textures; +using osu.Framework.Input.Events; +using osu.Game.Graphics.Sprites; +using osu.Game.Graphics.UserInterface; +using osu.Game.Tournament.Components; +using osu.Game.Tournament.Screens.Ladder.Components; +using OpenTK; +using OpenTK.Graphics; +using OpenTK.Input; + +namespace osu.Game.Tournament.Screens.Gameplay +{ + public class MatchHeader : Container + { + [BackgroundDependencyLoader] + private void load(LadderInfo ladder, TextureStore textures) + { + RelativeSizeAxes = Axes.X; + Height = 100; + Children = new Drawable[] + { + new Sprite + { + Y = 5, + Texture = textures.Get("game-screen-logo"), + Anchor = Anchor.TopCentre, + Origin = Anchor.TopCentre, + FillMode = FillMode.Fit, + RelativeSizeAxes = Axes.Both, + Size = Vector2.One + }, + new RoundDisplay + { + Y = 10, + Anchor = Anchor.BottomCentre, + Origin = Anchor.TopCentre, + }, + new TeamScoreDisplay(TeamColour.Red) + { + Anchor = Anchor.TopLeft, + Origin = Anchor.TopLeft, + }, + new TeamScoreDisplay(TeamColour.Blue) + { + Anchor = Anchor.TopRight, + Origin = Anchor.TopRight, + }, + }; + } + + private class TeamScoreDisplay : CompositeDrawable + { + private readonly TeamColour teamColour; + + private readonly Color4 red = new Color4(129, 68, 65, 255); + private readonly Color4 blue = new Color4(41, 91, 97, 255); + + private readonly Bindable currentMatch = new Bindable(); + private readonly Bindable currentTeam = new Bindable(); + private readonly Bindable currentTeamScore = new Bindable(); + + public TeamScoreDisplay(TeamColour teamColour) + { + this.teamColour = teamColour; + + RelativeSizeAxes = Axes.Y; + Width = 300; + } + + [BackgroundDependencyLoader] + private void load(LadderInfo ladder) + { + currentMatch.BindValueChanged(matchChanged); + currentMatch.BindTo(ladder.CurrentMatch); + } + + private void matchChanged(MatchPairing match) + { + currentTeamScore.UnbindBindings(); + currentTeamScore.BindTo(teamColour == TeamColour.Red ? match.Team1Score : match.Team2Score); + + currentTeam.UnbindBindings(); + currentTeam.BindTo(teamColour == TeamColour.Red ? match.Team1 : match.Team2); + + // team may change to same team, which means score is not in a good state. + // thus we handle this manually. + teamChanged(currentTeam.Value); + } + + + protected override bool OnMouseDown(MouseDownEvent e) + { + switch (e.Button) + { + case MouseButton.Left: + if (currentTeamScore.Value < currentMatch.Value.PointsToWin) + currentTeamScore.Value++; + return true; + case MouseButton.Right: + if (currentTeamScore.Value > 0) + currentTeamScore.Value--; + return true; + } + + return base.OnMouseDown(e); + } + + private void teamChanged(TournamentTeam team) + { + InternalChildren = new Drawable[] + { + new TeamDisplay(team, teamColour == TeamColour.Red ? red : blue, teamColour != TeamColour.Red), + new ScoreDisplay(currentTeamScore, teamColour != TeamColour.Red, currentMatch.Value.PointsToWin) + }; + } + } + + private class ScoreDisplay : CompositeDrawable + { + private readonly Bindable currentTeamScore = new Bindable(); + private readonly StarCounter counter; + + public ScoreDisplay(Bindable score, bool flip, int count) + { + var anchor = flip ? Anchor.CentreRight : Anchor.CentreLeft; + + Anchor = anchor; + Origin = anchor; + + InternalChild = counter = new StarCounter(count) + { + Anchor = anchor, + X = (flip ? -1 : 1) * 90, + Y = 5, + Scale = flip ? new Vector2(-1, 1) : Vector2.One, + Colour = new Color4(95, 41, 60, 255), + }; + + currentTeamScore.BindValueChanged(scoreChanged); + currentTeamScore.BindTo(score); + } + + private void scoreChanged(int? score) => counter.CountStars = score ?? 0; + } + + private class TeamDisplay : DrawableTournamentTeam + { + public TeamDisplay(TournamentTeam team, Color4 colour, bool flip) + : base(team) + { + RelativeSizeAxes = Axes.Both; + + var anchor = flip ? Anchor.CentreRight : Anchor.CentreLeft; + + Anchor = Origin = anchor; + + Flag.Anchor = Flag.Origin = anchor; + Flag.RelativeSizeAxes = Axes.None; + Flag.Size = new Vector2(60, 40); + Flag.Margin = new MarginPadding(20); + + InternalChild = new Container + { + RelativeSizeAxes = Axes.Both, + Children = new Drawable[] + { + Flag, + new OsuSpriteText + { + Text = team?.FullName.ToUpper() ?? "???", + X = (flip ? -1 : 1) * 90, + Y = -10, + TextSize = 20, + Colour = colour, + Font = "Aquatico-Regular", + Origin = anchor, + Anchor = anchor, + }, + } + }; + } + } + + private class RoundDisplay : CompositeDrawable + { + private readonly Bindable currentMatch = new Bindable(); + + public RoundDisplay() + { + CornerRadius = 10; + Masking = true; + Width = 200; + Height = 20; + } + + [BackgroundDependencyLoader] + private void load(LadderInfo ladder) + { + currentMatch.BindValueChanged(matchChanged); + currentMatch.BindTo(ladder.CurrentMatch); + } + + private void matchChanged(MatchPairing match) + { + InternalChildren = new Drawable[] + { + new Box + { + Colour = new Color4(95, 41, 60, 255), + RelativeSizeAxes = Axes.Both, + }, + new OsuSpriteText + { + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + Colour = Color4.White, + Text = match.Grouping.Value?.Name.Value ?? "Unknown Grouping", + Font = "Aquatico-Regular", + TextSize = 18, + }, + }; + } + } + } +} diff --git a/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs b/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs index e8d6f18fd7..84c9e250c3 100644 --- a/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs +++ b/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs @@ -13,6 +13,7 @@ using osu.Game.Graphics.UserInterface; using osu.Game.Screens; using osu.Game.Tournament.Components; using osu.Game.Tournament.IPC; +using osu.Game.Tournament.Screens.Gameplay; using osu.Game.Tournament.Screens.Ladder.Components; using OpenTK; using OpenTK.Graphics; @@ -38,9 +39,11 @@ namespace osu.Game.Tournament.Screens.MapPool { InternalChildren = new Drawable[] { + new MatchHeader(), maps = new FillFlowContainer { - Spacing = new Vector2(20), + Y = 100, + Spacing = new Vector2(10), Padding = new MarginPadding(50), Direction = FillDirection.Full, RelativeSizeAxes = Axes.Both, From 629657044d4234db4781de304e8d2954d6327f17 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 11 Nov 2018 00:45:48 +0900 Subject: [PATCH 112/317] Add automatic scoring --- osu.Game.Tournament/IPC/FileBasedIPC.cs | 86 ++++++++++++++++--- .../Screens/Gameplay/GameplayScreen.cs | 46 +++++++++- 2 files changed, 116 insertions(+), 16 deletions(-) diff --git a/osu.Game.Tournament/IPC/FileBasedIPC.cs b/osu.Game.Tournament/IPC/FileBasedIPC.cs index a6e171b699..168ff80eb7 100644 --- a/osu.Game.Tournament/IPC/FileBasedIPC.cs +++ b/osu.Game.Tournament/IPC/FileBasedIPC.cs @@ -6,6 +6,7 @@ using System.IO; using osu.Framework.Allocation; using osu.Framework.Configuration; using osu.Framework.Graphics; +using osu.Framework.Logging; using osu.Framework.Platform.Windows; using osu.Game.Beatmaps; using osu.Game.Beatmaps.Legacy; @@ -15,6 +16,15 @@ using osu.Game.Rulesets; namespace osu.Game.Tournament.IPC { + public enum TourneyState + { + Initialising, + Idle, + WaitingForClients, + Playing, + Ranking + } + public class FileBasedIPC : Component { [Resolved] @@ -27,7 +37,11 @@ namespace osu.Game.Tournament.IPC public readonly Bindable Mods = new Bindable(); + public readonly Bindable State = new Bindable(); + private int lastBeatmapId; + public int Score1; + public int Score2; [BackgroundDependencyLoader] private void load() @@ -35,6 +49,8 @@ namespace osu.Game.Tournament.IPC var stable = new StableStorage(); const string file_ipc_filename = "ipc.txt"; + const string file_ipc_state_filename = "ipc-state.txt"; + const string file_ipc_scores_filename = "ipc-scores.txt"; if (stable.Exists(file_ipc_filename)) Scheduler.AddDelayed(delegate @@ -62,6 +78,35 @@ namespace osu.Game.Tournament.IPC { // file might be in use. } + + try + { + using (var stream = stable.GetStream(file_ipc_state_filename)) + using (var sr = new StreamReader(stream)) + { + State.Value = (TourneyState)Enum.Parse(typeof(TourneyState), sr.ReadLine()); + } + } + catch (Exception e) + { + Logger.Log(e.ToString(), LoggingTarget.Runtime); + // file might be in use. + } + + try + { + using (var stream = stable.GetStream(file_ipc_scores_filename)) + using (var sr = new StreamReader(stream)) + { + Score1 = int.Parse(sr.ReadLine()); + Score2 = int.Parse(sr.ReadLine()); + } + } + catch (Exception e) + { + Logger.Log(e.ToString(), LoggingTarget.Runtime); + // file might be in use. + } }, 250, true); } @@ -72,33 +117,46 @@ namespace osu.Game.Tournament.IPC { protected override string LocateBasePath() { + bool checkExists(string p) { - return Directory.Exists(Path.Combine(p, "Songs")); + return File.Exists(Path.Combine(p, "ipc.txt")); } - string stableInstallPath; + string stableInstallPath = string.Empty; try { - stableInstallPath = "E:\\osu!mappool"; + try + { + stableInstallPath = "E:\\osu!tourney"; + if (checkExists(stableInstallPath)) + return stableInstallPath; + + stableInstallPath = "E:\\osu!mappool"; + + if (checkExists(stableInstallPath)) + return stableInstallPath; + } + catch + { + } + + stableInstallPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), @"osu!"); if (checkExists(stableInstallPath)) return stableInstallPath; + + stableInstallPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".osu"); + if (checkExists(stableInstallPath)) + return stableInstallPath; + + return null; } - catch + finally { + Logger.Log($"Stable path for tourney usage: {stableInstallPath}"); } - - stableInstallPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), @"osu!"); - if (checkExists(stableInstallPath)) - return stableInstallPath; - - stableInstallPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".osu"); - if (checkExists(stableInstallPath)) - return stableInstallPath; - - return null; } public StableStorage() diff --git a/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs b/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs index 8b87d6d581..31c5e9f426 100644 --- a/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs +++ b/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs @@ -4,9 +4,13 @@ using osu.Framework.Allocation; using osu.Framework.Configuration; using osu.Framework.Graphics; +using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Textures; using osu.Game.Graphics.UserInterface; using osu.Game.Tournament.Components; +using osu.Game.Tournament.IPC; +using osu.Game.Tournament.Screens.Ladder.Components; +using OpenTK.Graphics; namespace osu.Game.Tournament.Screens.Gameplay { @@ -14,9 +18,16 @@ namespace osu.Game.Tournament.Screens.Gameplay { private readonly BindableBool warmup = new BindableBool(); + private readonly Bindable currentMatch = new Bindable(); + + public readonly Bindable State = new Bindable(); + private TriangleButton warmupButton; + private FileBasedIPC ipc; + [BackgroundDependencyLoader] - private void load(LadderInfo ladder, TextureStore textures) + private void load(LadderInfo ladder, TextureStore textures, FileBasedIPC ipc) { + this.ipc = ipc; AddRange(new Drawable[] { new MatchHeader(), @@ -26,12 +37,21 @@ namespace osu.Game.Tournament.Screens.Gameplay // Origin = Anchor.BottomCentre, // Size = new Vector2(0.4f, 1) // }, + new Box + { + RelativeSizeAxes = Axes.Both, + Height = 720 / 1080f, + Colour = new Color4(0, 255, 0, 255), + Anchor = Anchor.Centre, + Origin= Anchor.Centre, + }, new ControlPanel { Children = new Drawable[] { - new TriangleButton + warmupButton = new TriangleButton { + Colour = Color4.Gray, RelativeSizeAxes = Axes.X, Text = "Toggle warmup", Action = toggleWarmup @@ -39,11 +59,33 @@ namespace osu.Game.Tournament.Screens.Gameplay } } }); + + State.BindValueChanged(stateChanged); + State.BindTo(ipc.State); + + currentMatch.BindTo(ladder.CurrentMatch); + } + + private void stateChanged(TourneyState state) + { + if (state == TourneyState.Ranking) + { + if (warmup.Value) return; + + if (ipc.Score1 > ipc.Score2) + currentMatch.Value.Team1Score.Value++; + else + currentMatch.Value.Team2Score.Value++; + } } private void toggleWarmup() { warmup.Toggle(); + if (warmup.Value) + warmupButton.Colour = Color4.White; + else + warmupButton.Colour = Color4.Gray; } } } From 976180ecc2e5ee6fcba20c01a543130fdd08e8b8 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 11 Nov 2018 00:48:22 +0900 Subject: [PATCH 113/317] Fix incorrect order after bans --- osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs b/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs index 84c9e250c3..5a04640ed7 100644 --- a/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs +++ b/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs @@ -103,6 +103,9 @@ namespace osu.Game.Tournament.Screens.MapPool private void beatmapChanged(BeatmapInfo beatmap) { + if (currentMatch.Value.PicksBans.Count(p => p.Type == ChoiceType.Ban) < 2) + return; + if (beatmap.OnlineBeatmapID != null) addForBeatmap(beatmap.OnlineBeatmapID.Value); } @@ -126,7 +129,10 @@ namespace osu.Game.Tournament.Screens.MapPool var nextColour = (currentMatch.Value.PicksBans.LastOrDefault()?.Team ?? roll_winner) == TeamColour.Red ? TeamColour.Blue : TeamColour.Red; - setMode(nextColour, currentMatch.Value.PicksBans.Count(p => p.Type == ChoiceType.Ban) >= 2 ? ChoiceType.Pick : ChoiceType.Ban); + if (pickType == ChoiceType.Ban && currentMatch.Value.PicksBans.Count(p => p.Type == ChoiceType.Ban) >= 2) + setMode(pickColour, ChoiceType.Pick); + else + setMode(nextColour, currentMatch.Value.PicksBans.Count(p => p.Type == ChoiceType.Ban) >= 2 ? ChoiceType.Pick : ChoiceType.Ban); } protected override bool OnMouseDown(MouseDownEvent e) From 86423dce5fbaffc8a4f1c4555ea2ea889675f291 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 11 Nov 2018 01:29:42 +0900 Subject: [PATCH 114/317] Animate song bar based on game mode --- osu.Game.Tournament/Components/SongBar.cs | 40 +++++++++++++++++-- osu.Game.Tournament/IPC/FileBasedIPC.cs | 6 +-- .../Screens/BeatmapInfoScreen.cs | 4 +- .../Screens/Gameplay/GameplayScreen.cs | 21 ++++++---- 4 files changed, 53 insertions(+), 18 deletions(-) diff --git a/osu.Game.Tournament/Components/SongBar.cs b/osu.Game.Tournament/Components/SongBar.cs index 880b80edf8..6d9dc6025f 100644 --- a/osu.Game.Tournament/Components/SongBar.cs +++ b/osu.Game.Tournament/Components/SongBar.cs @@ -2,6 +2,7 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; +using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; @@ -11,6 +12,7 @@ using osu.Game.Graphics; using osu.Game.Graphics.Sprites; using osu.Game.Screens.Menu; using OpenTK; +using OpenTK.Graphics; namespace osu.Game.Tournament.Components { @@ -44,6 +46,28 @@ namespace osu.Game.Tournament.Components } private Container panelContents; + private Container innerPanel; + private Container outerPanel; + + private const float main_width = 0.97f; + + public bool Expanded + { + set + { + if (value) + { + innerPanel.ResizeWidthTo(0.7f, 800, Easing.OutQuint); + outerPanel.ResizeWidthTo(main_width, 800, Easing.OutQuint); + } + else + { + innerPanel.ResizeWidthTo(1, 800, Easing.OutQuint); + outerPanel.ResizeWidthTo(0.3f, 800, Easing.OutQuint); + } + } + } + [BackgroundDependencyLoader] private void load() @@ -52,12 +76,20 @@ namespace osu.Game.Tournament.Components InternalChildren = new Drawable[] { - new Container + outerPanel = new Container { Masking = true, + EdgeEffect = new EdgeEffectParameters + { + Colour = Color4.Black.Opacity(0.2f), + Type = EdgeEffectType.Shadow, + Radius = 5, + }, RelativeSizeAxes = Axes.X, - Anchor = Anchor.BottomCentre, - Origin = Anchor.BottomCentre, + Anchor = Anchor.BottomRight, + Origin = Anchor.BottomRight, + RelativePositionAxes = Axes.X, + X = -(1 - main_width) / 2, Y = -10, Width = 0.95f, Height = TournamentBeatmapPanel.HEIGHT, @@ -69,7 +101,7 @@ namespace osu.Game.Tournament.Components RelativeSizeAxes = Axes.Both, Colour = OsuColour.Gray(0.93f), }, - new Container + innerPanel = new Container { Masking = true, CornerRadius = TournamentBeatmapPanel.HEIGHT / 2, diff --git a/osu.Game.Tournament/IPC/FileBasedIPC.cs b/osu.Game.Tournament/IPC/FileBasedIPC.cs index 168ff80eb7..2ad30db748 100644 --- a/osu.Game.Tournament/IPC/FileBasedIPC.cs +++ b/osu.Game.Tournament/IPC/FileBasedIPC.cs @@ -87,9 +87,8 @@ namespace osu.Game.Tournament.IPC State.Value = (TourneyState)Enum.Parse(typeof(TourneyState), sr.ReadLine()); } } - catch (Exception e) + catch (Exception) { - Logger.Log(e.ToString(), LoggingTarget.Runtime); // file might be in use. } @@ -102,9 +101,8 @@ namespace osu.Game.Tournament.IPC Score2 = int.Parse(sr.ReadLine()); } } - catch (Exception e) + catch (Exception) { - Logger.Log(e.ToString(), LoggingTarget.Runtime); // file might be in use. } }, 250, true); diff --git a/osu.Game.Tournament/Screens/BeatmapInfoScreen.cs b/osu.Game.Tournament/Screens/BeatmapInfoScreen.cs index 11cbb56b49..4ddd475b6e 100644 --- a/osu.Game.Tournament/Screens/BeatmapInfoScreen.cs +++ b/osu.Game.Tournament/Screens/BeatmapInfoScreen.cs @@ -19,8 +19,8 @@ namespace osu.Game.Tournament.Screens { Add(SongBar = new SongBar { - Anchor = Anchor.BottomCentre, - Origin = Anchor.BottomCentre + Anchor = Anchor.BottomRight, + Origin = Anchor.BottomRight, }); } diff --git a/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs b/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs index 31c5e9f426..a89200f3a5 100644 --- a/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs +++ b/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs @@ -54,7 +54,7 @@ namespace osu.Game.Tournament.Screens.Gameplay Colour = Color4.Gray, RelativeSizeAxes = Axes.X, Text = "Toggle warmup", - Action = toggleWarmup + Action = () => warmup.Toggle() } } } @@ -64,6 +64,8 @@ namespace osu.Game.Tournament.Screens.Gameplay State.BindTo(ipc.State); currentMatch.BindTo(ladder.CurrentMatch); + + warmup.BindValueChanged(w => warmupButton.Colour = !w ? Color4.White : Color4.Gray, true); } private void stateChanged(TourneyState state) @@ -77,15 +79,18 @@ namespace osu.Game.Tournament.Screens.Gameplay else currentMatch.Value.Team2Score.Value++; } - } - private void toggleWarmup() - { - warmup.Toggle(); - if (warmup.Value) - warmupButton.Colour = Color4.White; + if (state == TourneyState.Idle) + { + // show chat + SongBar.Expanded = false; + } else - warmupButton.Colour = Color4.Gray; + { + SongBar.Expanded = true; + } + + } } } From b5c2d94cc4ee8b5b4e3e5ee858098a974dc4d424 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 11 Nov 2018 01:39:02 +0900 Subject: [PATCH 115/317] Avoid rendering more than one video at once --- .../Screens/BeatmapInfoScreen.cs | 3 +-- osu.Game.Tournament/Screens/IProvideVideo.cs | 9 ++++++++ .../Screens/Ladder/LadderManager.cs | 2 +- .../Screens/MapPool/MapPoolScreen.cs | 3 +-- .../Screens/TeamIntro/TeamIntroScreen.cs | 3 +-- .../Screens/TournamentSceneManager.cs | 13 +++++++++--- .../Screens/TournamentScreen.cs | 21 +++++++++++++++++++ 7 files changed, 44 insertions(+), 10 deletions(-) create mode 100644 osu.Game.Tournament/Screens/IProvideVideo.cs create mode 100644 osu.Game.Tournament/Screens/TournamentScreen.cs diff --git a/osu.Game.Tournament/Screens/BeatmapInfoScreen.cs b/osu.Game.Tournament/Screens/BeatmapInfoScreen.cs index 4ddd475b6e..def9f228cf 100644 --- a/osu.Game.Tournament/Screens/BeatmapInfoScreen.cs +++ b/osu.Game.Tournament/Screens/BeatmapInfoScreen.cs @@ -5,13 +5,12 @@ using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Game.Beatmaps; using osu.Game.Beatmaps.Legacy; -using osu.Game.Screens; using osu.Game.Tournament.Components; using osu.Game.Tournament.IPC; namespace osu.Game.Tournament.Screens { - public abstract class BeatmapInfoScreen : OsuScreen + public abstract class BeatmapInfoScreen : TournamentScreen { protected readonly SongBar SongBar; diff --git a/osu.Game.Tournament/Screens/IProvideVideo.cs b/osu.Game.Tournament/Screens/IProvideVideo.cs new file mode 100644 index 0000000000..b5a4e1ad8e --- /dev/null +++ b/osu.Game.Tournament/Screens/IProvideVideo.cs @@ -0,0 +1,9 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +namespace osu.Game.Tournament.Screens +{ + public interface IProvideVideo + { + } +} diff --git a/osu.Game.Tournament/Screens/Ladder/LadderManager.cs b/osu.Game.Tournament/Screens/Ladder/LadderManager.cs index 5ef7d047e2..4c9700462f 100644 --- a/osu.Game.Tournament/Screens/Ladder/LadderManager.cs +++ b/osu.Game.Tournament/Screens/Ladder/LadderManager.cs @@ -23,7 +23,7 @@ using SixLabors.Primitives; namespace osu.Game.Tournament.Screens.Ladder { [Cached] - public class LadderManager : CompositeDrawable, IHasContextMenu + public class LadderManager : TournamentScreen, IHasContextMenu { private Container pairingsContainer; private Container paths; diff --git a/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs b/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs index 5a04640ed7..5a463c6d5e 100644 --- a/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs +++ b/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs @@ -10,7 +10,6 @@ using osu.Framework.Input.Events; using osu.Game.Beatmaps; using osu.Game.Graphics.Sprites; using osu.Game.Graphics.UserInterface; -using osu.Game.Screens; using osu.Game.Tournament.Components; using osu.Game.Tournament.IPC; using osu.Game.Tournament.Screens.Gameplay; @@ -21,7 +20,7 @@ using OpenTK.Input; namespace osu.Game.Tournament.Screens.MapPool { - public class MapPoolScreen : OsuScreen + public class MapPoolScreen : TournamentScreen { private readonly FillFlowContainer maps; diff --git a/osu.Game.Tournament/Screens/TeamIntro/TeamIntroScreen.cs b/osu.Game.Tournament/Screens/TeamIntro/TeamIntroScreen.cs index 7c4f139de7..bb17598c70 100644 --- a/osu.Game.Tournament/Screens/TeamIntro/TeamIntroScreen.cs +++ b/osu.Game.Tournament/Screens/TeamIntro/TeamIntroScreen.cs @@ -10,7 +10,6 @@ using osu.Framework.Graphics.Video; using osu.Framework.Platform; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; -using osu.Game.Screens; using osu.Game.Tournament.Components; using osu.Game.Tournament.Screens.Ladder.Components; using OpenTK; @@ -18,7 +17,7 @@ using OpenTK.Graphics; namespace osu.Game.Tournament.Screens.TeamIntro { - public class TeamIntroScreen : OsuScreen + public class TeamIntroScreen : TournamentScreen, IProvideVideo { private Container mainContainer; diff --git a/osu.Game.Tournament/Screens/TournamentSceneManager.cs b/osu.Game.Tournament/Screens/TournamentSceneManager.cs index 4cd6c681fa..20af4c29be 100644 --- a/osu.Game.Tournament/Screens/TournamentSceneManager.cs +++ b/osu.Game.Tournament/Screens/TournamentSceneManager.cs @@ -29,6 +29,7 @@ namespace osu.Game.Tournament.Screens private DrawingsScreen drawings; private Container screens; private ShowcaseScreen showcase; + private VideoSprite video; [BackgroundDependencyLoader] private void load(LadderInfo ladder, Storage storage) @@ -76,7 +77,7 @@ namespace osu.Game.Tournament.Screens //Masking = true, Children = new Drawable[] { - new VideoSprite(storage.GetStream("BG Logoless - OWC.m4v")) + video = new VideoSprite(storage.GetStream("BG Logoless - OWC.m4v")) { Loop = true, RelativeSizeAxes = Axes.Both, @@ -107,9 +108,15 @@ namespace osu.Game.Tournament.Screens foreach (var s in screens.Children) { if (s == screen) - s.FadeIn(100); + { + s.Show(); + if (s is IProvideVideo) + video.FadeOut(200); + else + video.Show(); + } else - s.FadeOut(100); + s.Hide(); } } } diff --git a/osu.Game.Tournament/Screens/TournamentScreen.cs b/osu.Game.Tournament/Screens/TournamentScreen.cs new file mode 100644 index 0000000000..dcdd7f8ce5 --- /dev/null +++ b/osu.Game.Tournament/Screens/TournamentScreen.cs @@ -0,0 +1,21 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework.Graphics; +using osu.Game.Screens; + +namespace osu.Game.Tournament.Screens +{ + public class TournamentScreen : OsuScreen + { + public override void Hide() + { + this.FadeOut(200); + } + + public override void Show() + { + this.FadeIn(200); + } + } +} From 21bbb6863631ee64d7dd9fad91bbb4015d9a2711 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 11 Nov 2018 01:50:09 +0900 Subject: [PATCH 116/317] Handle delayed contract --- .../Screens/Gameplay/GameplayScreen.cs | 28 ++++++++++++------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs b/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs index a89200f3a5..f164d2d7b0 100644 --- a/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs +++ b/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs @@ -1,11 +1,13 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // 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.Configuration; using osu.Framework.Graphics; using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Textures; +using osu.Framework.Threading; using osu.Game.Graphics.UserInterface; using osu.Game.Tournament.Components; using osu.Game.Tournament.IPC; @@ -68,6 +70,8 @@ namespace osu.Game.Tournament.Screens.Gameplay warmup.BindValueChanged(w => warmupButton.Colour = !w ? Color4.White : Color4.Gray, true); } + private ScheduledDelegate scheduledBarContract; + private void stateChanged(TourneyState state) { if (state == TourneyState.Ranking) @@ -80,17 +84,21 @@ namespace osu.Game.Tournament.Screens.Gameplay currentMatch.Value.Team2Score.Value++; } - if (state == TourneyState.Idle) - { - // show chat - SongBar.Expanded = false; - } - else - { - SongBar.Expanded = true; - } - + scheduledBarContract?.Cancel(); + switch (state) + { + case TourneyState.Idle: + // show chat + SongBar.Expanded = false; + break; + case TourneyState.Ranking: + scheduledBarContract = Scheduler.AddDelayed(() => SongBar.Expanded = false, 15000); + break; + default: + SongBar.Expanded = true; + break; + } } } } From 9c18f7a25afd2ce3ee28ba98bc12b0d22f203e7c Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 11 Nov 2018 09:05:36 +0900 Subject: [PATCH 117/317] Fix date display --- osu.Game.Tournament/Screens/TeamIntro/TeamIntroScreen.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/osu.Game.Tournament/Screens/TeamIntro/TeamIntroScreen.cs b/osu.Game.Tournament/Screens/TeamIntro/TeamIntroScreen.cs index bb17598c70..63ca968aef 100644 --- a/osu.Game.Tournament/Screens/TeamIntro/TeamIntroScreen.cs +++ b/osu.Game.Tournament/Screens/TeamIntro/TeamIntroScreen.cs @@ -71,7 +71,7 @@ namespace osu.Game.Tournament.Screens.TeamIntro Anchor = Anchor.Centre, Origin = Anchor.CentreLeft }, - new RoundDisplay(pairing.Grouping) + new RoundDisplay(pairing) { RelativeSizeAxes = Axes.Both, Height = 0.25f, @@ -83,7 +83,7 @@ namespace osu.Game.Tournament.Screens.TeamIntro private class RoundDisplay : CompositeDrawable { - public RoundDisplay(TournamentGrouping group) + public RoundDisplay(MatchPairing pairing) { var col = OsuColour.Gray(0.33f); @@ -112,7 +112,7 @@ namespace osu.Game.Tournament.Screens.TeamIntro Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, Colour = col, - Text = group?.Name.Value ?? "Unknown Grouping", + Text = pairing.Grouping.Value?.Name.Value ?? "Unknown Grouping", Font = "Aquatico-Light", Spacing = new Vector2(10, 0), TextSize = 50, @@ -123,7 +123,7 @@ namespace osu.Game.Tournament.Screens.TeamIntro Origin = Anchor.TopCentre, Font = "Aquatico-Light", Colour = col, - Text = (group?.StartDate.Value ?? DateTimeOffset.Now).ToString("dd MMMM HH:mm UTC"), + Text = pairing.Date.Value.ToUniversalTime().ToString("dd MMMM HH:mm UTC"), TextSize = 20, }, } From 2683b161d58df6a7eca79af413a5fb0490fa926a Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 11 Nov 2018 09:16:46 +0900 Subject: [PATCH 118/317] Fix missing logo --- .../Screens/Gameplay/MatchHeader.cs | 13 ++------ .../Screens/Showcase/ShowcaseScreen.cs | 8 +++++ .../Screens/Showcase/TournamentLogo.cs | 33 +++++++++++++++++++ .../Screens/TeamIntro/TeamIntroScreen.cs | 6 ++-- 4 files changed, 47 insertions(+), 13 deletions(-) create mode 100644 osu.Game.Tournament/Screens/Showcase/TournamentLogo.cs diff --git a/osu.Game.Tournament/Screens/Gameplay/MatchHeader.cs b/osu.Game.Tournament/Screens/Gameplay/MatchHeader.cs index 2ff5ee7bf6..5765c9cd12 100644 --- a/osu.Game.Tournament/Screens/Gameplay/MatchHeader.cs +++ b/osu.Game.Tournament/Screens/Gameplay/MatchHeader.cs @@ -6,13 +6,13 @@ using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; -using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Textures; using osu.Framework.Input.Events; using osu.Game.Graphics.Sprites; using osu.Game.Graphics.UserInterface; using osu.Game.Tournament.Components; using osu.Game.Tournament.Screens.Ladder.Components; +using osu.Game.Tournament.Screens.Showcase; using OpenTK; using OpenTK.Graphics; using OpenTK.Input; @@ -28,16 +28,7 @@ namespace osu.Game.Tournament.Screens.Gameplay Height = 100; Children = new Drawable[] { - new Sprite - { - Y = 5, - Texture = textures.Get("game-screen-logo"), - Anchor = Anchor.TopCentre, - Origin = Anchor.TopCentre, - FillMode = FillMode.Fit, - RelativeSizeAxes = Axes.Both, - Size = Vector2.One - }, + new TournamentLogo(), new RoundDisplay { Y = 10, diff --git a/osu.Game.Tournament/Screens/Showcase/ShowcaseScreen.cs b/osu.Game.Tournament/Screens/Showcase/ShowcaseScreen.cs index ce458413a5..6950b940fe 100644 --- a/osu.Game.Tournament/Screens/Showcase/ShowcaseScreen.cs +++ b/osu.Game.Tournament/Screens/Showcase/ShowcaseScreen.cs @@ -1,9 +1,17 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using osu.Framework.Allocation; +using osu.Framework.Graphics.Textures; + namespace osu.Game.Tournament.Screens.Showcase { public class ShowcaseScreen : BeatmapInfoScreen { + [BackgroundDependencyLoader] + private void load(TextureStore textures) + { + Add(new TournamentLogo()); + } } } diff --git a/osu.Game.Tournament/Screens/Showcase/TournamentLogo.cs b/osu.Game.Tournament/Screens/Showcase/TournamentLogo.cs new file mode 100644 index 0000000000..135081a641 --- /dev/null +++ b/osu.Game.Tournament/Screens/Showcase/TournamentLogo.cs @@ -0,0 +1,33 @@ +using osu.Framework.Allocation; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Sprites; +using osu.Framework.Graphics.Textures; +using OpenTK; + +namespace osu.Game.Tournament.Screens.Showcase +{ + public class TournamentLogo : CompositeDrawable + { + public TournamentLogo() + { + RelativeSizeAxes = Axes.X; + Height = 100; + Margin = new MarginPadding { Vertical = 5 }; + } + + [BackgroundDependencyLoader] + private void load(TextureStore textures) + { + InternalChild = new Sprite + { + Texture = textures.Get("game-screen-logo"), + Anchor = Anchor.TopCentre, + Origin = Anchor.TopCentre, + FillMode = FillMode.Fit, + RelativeSizeAxes = Axes.Both, + Size = Vector2.One + }; + } + } +} diff --git a/osu.Game.Tournament/Screens/TeamIntro/TeamIntroScreen.cs b/osu.Game.Tournament/Screens/TeamIntro/TeamIntroScreen.cs index 63ca968aef..05746c07d0 100644 --- a/osu.Game.Tournament/Screens/TeamIntro/TeamIntroScreen.cs +++ b/osu.Game.Tournament/Screens/TeamIntro/TeamIntroScreen.cs @@ -1,17 +1,18 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using System; using osu.Framework.Allocation; using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Textures; using osu.Framework.Graphics.Video; using osu.Framework.Platform; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; using osu.Game.Tournament.Components; using osu.Game.Tournament.Screens.Ladder.Components; +using osu.Game.Tournament.Screens.Showcase; using OpenTK; using OpenTK.Graphics; @@ -24,7 +25,7 @@ namespace osu.Game.Tournament.Screens.TeamIntro private readonly Bindable currentMatch = new Bindable(); [BackgroundDependencyLoader] - private void load(LadderInfo ladder, Storage storage) + private void load(TextureStore textures, LadderInfo ladder, Storage storage) { RelativeSizeAxes = Axes.Both; @@ -35,6 +36,7 @@ namespace osu.Game.Tournament.Screens.TeamIntro RelativeSizeAxes = Axes.Both, Loop = true, }, + new TournamentLogo(), mainContainer = new Container { RelativeSizeAxes = Axes.Both, From e3576572a38f24ab1a18e4207cd9be9196fbad0b Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 11 Nov 2018 09:22:57 +0900 Subject: [PATCH 119/317] Fix warmup state, automate more --- .../Screens/Gameplay/GameplayScreen.cs | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs b/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs index f164d2d7b0..c1a4014554 100644 --- a/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs +++ b/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs @@ -1,7 +1,6 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // 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.Configuration; using osu.Framework.Graphics; @@ -33,17 +32,12 @@ namespace osu.Game.Tournament.Screens.Gameplay AddRange(new Drawable[] { new MatchHeader(), - // new CustomChatOverlay - // { - // Anchor = Anchor.BottomCentre, - // Origin = Anchor.BottomCentre, - // Size = new Vector2(0.4f, 1) - // }, new Box { RelativeSizeAxes = Axes.Both, Height = 720 / 1080f, Colour = new Color4(0, 255, 0, 255), + Y = 16, Anchor = Anchor.Centre, Origin= Anchor.Centre, }, @@ -53,7 +47,6 @@ namespace osu.Game.Tournament.Screens.Gameplay { warmupButton = new TriangleButton { - Colour = Color4.Gray, RelativeSizeAxes = Axes.X, Text = "Toggle warmup", Action = () => warmup.Toggle() @@ -65,9 +58,10 @@ namespace osu.Game.Tournament.Screens.Gameplay State.BindValueChanged(stateChanged); State.BindTo(ipc.State); + currentMatch.BindValueChanged(m => warmup.Value = m.Team1Score + m.Team2Score == 0); 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; From 949cf98d1a5316d87c0c51f98b0795e802e325fd Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 11 Nov 2018 09:23:54 +0900 Subject: [PATCH 120/317] Adjust gameplay position ever so slightly --- osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs b/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs index c1a4014554..99d996d138 100644 --- a/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs +++ b/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs @@ -35,9 +35,9 @@ namespace osu.Game.Tournament.Screens.Gameplay new Box { RelativeSizeAxes = Axes.Both, - Height = 720 / 1080f, + Height = 718 / 1080f, Colour = new Color4(0, 255, 0, 255), - Y = 16, + Y = 14, Anchor = Anchor.Centre, Origin= Anchor.Centre, }, From eabcef3e12723631810c0b6c12b42d261fc5f200 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 11 Nov 2018 10:13:17 +0900 Subject: [PATCH 121/317] Add schedule screen --- osu.Game.Tournament.Tests/TestCaseSchedule.cs | 25 +++ .../Ladder/Components/DrawableMatchPairing.cs | 6 +- .../Ladder/Components/DrawableMatchTeam.cs | 17 +- .../Screens/Ladder/LadderManager.cs | 13 +- .../Screens/Schedule/ScheduleScreen.cs | 167 ++++++++++++++++++ .../Screens/TournamentSceneManager.cs | 4 + osu.Game.Tournament/TournamentGameBase.cs | 4 + osu.Game/OsuGameBase.cs | 2 +- 8 files changed, 221 insertions(+), 17 deletions(-) create mode 100644 osu.Game.Tournament.Tests/TestCaseSchedule.cs create mode 100644 osu.Game.Tournament/Screens/Schedule/ScheduleScreen.cs diff --git a/osu.Game.Tournament.Tests/TestCaseSchedule.cs b/osu.Game.Tournament.Tests/TestCaseSchedule.cs new file mode 100644 index 0000000000..a12586cb27 --- /dev/null +++ b/osu.Game.Tournament.Tests/TestCaseSchedule.cs @@ -0,0 +1,25 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System; +using System.Collections.Generic; +using osu.Framework.Allocation; +using osu.Game.Tests.Visual; +using osu.Game.Tournament.Screens.Schedule; + +namespace osu.Game.Tournament.Tests +{ + public class TestCaseSchedule : OsuTestCase + { + public override IReadOnlyList RequiredTypes => new[] + { + typeof(ScheduleScreen) + }; + + [BackgroundDependencyLoader] + private void load() + { + Add(new ScheduleScreen()); + } + } +} diff --git a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs index 5d0837c542..def53ce510 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs @@ -18,7 +18,7 @@ namespace osu.Game.Tournament.Screens.Ladder.Components public class DrawableMatchPairing : CompositeDrawable { public readonly MatchPairing Pairing; - private readonly FillFlowContainer flow; + protected readonly FillFlowContainer Flow; private readonly Drawable selectionBox; private readonly Drawable currentMatchSelectionBox; private Bindable globalSelection; @@ -62,7 +62,7 @@ namespace osu.Game.Tournament.Screens.Ladder.Components Colour = Color4.OrangeRed, Child = new Box { RelativeSizeAxes = Axes.Both } }, - flow = new FillFlowContainer + Flow = new FillFlowContainer { AutoSizeAxes = Axes.Both, Direction = FillDirection.Vertical, @@ -195,7 +195,7 @@ namespace osu.Game.Tournament.Screens.Ladder.Components if (Pairing.Team1.Value == null || Pairing.Team2.Value == null) Pairing.CancelMatchStart(); - flow.Children = new[] + Flow.Children = new[] { new DrawableMatchTeam(Pairing.Team1, Pairing, Pairing.Losers), new DrawableMatchTeam(Pairing.Team2, Pairing, Pairing.Losers) diff --git a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs index 804680ba28..7ff15ef434 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs @@ -36,6 +36,19 @@ namespace osu.Game.Tournament.Screens.Ladder.Components private readonly Func isWinner; private LadderManager manager; + [Resolved] + private LadderInfo ladderInfo { get; set; } + + private void setCurrent() + { + //todo: tournamentgamebase? + if (ladderInfo.CurrentMatch.Value != null) + ladderInfo.CurrentMatch.Value.Current.Value = false; + + ladderInfo.CurrentMatch.Value = pairing; + ladderInfo.CurrentMatch.Value.Current.Value = true; + } + [Resolved(CanBeNull = true)] private LadderEditorInfo editorInfo { get; set; } @@ -132,7 +145,7 @@ namespace osu.Game.Tournament.Screens.Ladder.Components if (!pairing.Current.Value) { - manager.SetCurrent(pairing); + setCurrent(); return true; } @@ -182,7 +195,7 @@ namespace osu.Game.Tournament.Screens.Ladder.Components return new MenuItem[] { - new OsuMenuItem("Set as current", MenuItemType.Standard, () => manager.SetCurrent(pairing)), + new OsuMenuItem("Set as current", MenuItemType.Standard, setCurrent), new OsuMenuItem("Join with", MenuItemType.Standard, () => manager.RequestJoin(pairing, false)), new OsuMenuItem("Join with (loser)", MenuItemType.Standard, () => manager.RequestJoin(pairing, true)), new OsuMenuItem("Remove", MenuItemType.Destructive, () => manager.Remove(pairing)), diff --git a/osu.Game.Tournament/Screens/Ladder/LadderManager.cs b/osu.Game.Tournament/Screens/Ladder/LadderManager.cs index 4c9700462f..2b1a1bad85 100644 --- a/osu.Game.Tournament/Screens/Ladder/LadderManager.cs +++ b/osu.Game.Tournament/Screens/Ladder/LadderManager.cs @@ -31,8 +31,8 @@ namespace osu.Game.Tournament.Screens.Ladder private ScrollableContainer scrollContent; - [Cached] - private LadderEditorInfo editorInfo = new LadderEditorInfo(); + [Resolved] + private LadderEditorInfo editorInfo { get; set;} [Resolved] private LadderInfo ladderInfo { get; set; } @@ -185,15 +185,6 @@ namespace osu.Game.Tournament.Screens.Ladder public void Remove(MatchPairing pairing) => pairingsContainer.FirstOrDefault(p => p.Pairing == pairing)?.Remove(); - public void SetCurrent(MatchPairing pairing) - { - if (ladderInfo.CurrentMatch.Value != null) - ladderInfo.CurrentMatch.Value.Current.Value = false; - - ladderInfo.CurrentMatch.Value = pairing; - ladderInfo.CurrentMatch.Value.Current.Value = true; - } - private class JoinRequestHandler : CompositeDrawable { private readonly Container pairingsContainer; diff --git a/osu.Game.Tournament/Screens/Schedule/ScheduleScreen.cs b/osu.Game.Tournament/Screens/Schedule/ScheduleScreen.cs new file mode 100644 index 0000000000..a0c36cd6c0 --- /dev/null +++ b/osu.Game.Tournament/Screens/Schedule/ScheduleScreen.cs @@ -0,0 +1,167 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System.Linq; +using osu.Framework.Allocation; +using osu.Framework.Configuration; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Shapes; +using osu.Framework.Graphics.Video; +using osu.Framework.Platform; +using osu.Game.Graphics.Sprites; +using osu.Game.Tournament.Screens.Ladder.Components; +using OpenTK; +using OpenTK.Graphics; + +namespace osu.Game.Tournament.Screens.Schedule +{ + public class ScheduleScreen : TournamentScreen, IProvideVideo + { + private readonly Bindable currentMatch = new Bindable(); + private Container mainContainer; + private LadderInfo ladder; + + [BackgroundDependencyLoader] + private void load(LadderInfo ladder, Storage storage) + { + this.ladder = ladder; + + RelativeSizeAxes = Axes.Both; + + InternalChildren = new Drawable[] + { + new VideoSprite(storage.GetStream(@"BG Side Logo - OWC.m4v")) + { + RelativeSizeAxes = Axes.Both, + Loop = true, + }, + mainContainer = new Container + { + RelativeSizeAxes = Axes.Both, + } + }; + + currentMatch.BindValueChanged(matchChanged); + currentMatch.BindTo(ladder.CurrentMatch); + } + + private void matchChanged(MatchPairing pairing) + { + if (pairing == null) + { + mainContainer.Clear(); + return; + } + + mainContainer.Child = new FillFlowContainer + { + RelativeSizeAxes = Axes.Both, + Direction = FillDirection.Vertical, + Children = new Drawable[] + { + new Container + { + RelativeSizeAxes = Axes.Both, + Height = 0.65f, + Child = new FillFlowContainer + { + RelativeSizeAxes = Axes.Both, + Direction = FillDirection.Horizontal, + Children = new Drawable[] + { + new ScheduleContainer("recent matches") + { + RelativeSizeAxes = Axes.Both, + Width = 0.4f, + ChildrenEnumerable = ladder.Pairings + .Where(p => p.Completed.Value) + .OrderByDescending(p => p.Date.Value) + .Take(8) + .Select(p => new SchedulePairing(p)) + }, + new ScheduleContainer("match overview") + { + RelativeSizeAxes = Axes.Both, + Width = 0.6f, + ChildrenEnumerable = ladder.Pairings + .Where(p => !p.Completed.Value) + .OrderBy(p => p.Date.Value) + .Take(8) + .Select(p => new SchedulePairing(p)) + }, + } + } + }, + new ScheduleContainer("current match") + { + RelativeSizeAxes = Axes.Both, + Height = 0.25f, + Children = new Drawable[] + { + new OsuSpriteText + { + Margin = new MarginPadding { Left = -10, Bottom = 10, Top = -5 }, + Spacing = new Vector2(10, 0), + Text = currentMatch.Value.Grouping.Value.Name.Value, + Colour = Color4.Black, + TextSize = 20 + }, + new SchedulePairing(currentMatch), + new OsuSpriteText + { + Text = "Start Time " + pairing.Date.Value.ToUniversalTime().ToString("HH:mm UTC"), + Colour = Color4.Black, + TextSize = 20 + }, + } + } + } + }; + } + + public class SchedulePairing : DrawableMatchPairing + { + public SchedulePairing(MatchPairing pairing) + : base(pairing) + { + Flow.Direction = FillDirection.Horizontal; + } + } + + public class ScheduleContainer : Container + { + protected override Container Content => content; + + private readonly FillFlowContainer content; + + public ScheduleContainer(string title) + { + Padding = new MarginPadding { Left = 30, Top = 30 }; + InternalChildren = new Drawable[] + { + new OsuSpriteText + { + X = 30, + Text = title, + Colour = Color4.Black, + Spacing = new Vector2(10, 0), + TextSize = 30 + }, + content = new FillFlowContainer + { + Direction = FillDirection.Vertical, + RelativeSizeAxes = Axes.Both, + Margin = new MarginPadding(40) + }, + new Circle + { + Colour = new Color4(233, 187, 79, 255), + Width = 5, + RelativeSizeAxes = Axes.Y, + } + }; + } + } + } +} diff --git a/osu.Game.Tournament/Screens/TournamentSceneManager.cs b/osu.Game.Tournament/Screens/TournamentSceneManager.cs index 20af4c29be..c349e48fa2 100644 --- a/osu.Game.Tournament/Screens/TournamentSceneManager.cs +++ b/osu.Game.Tournament/Screens/TournamentSceneManager.cs @@ -13,6 +13,7 @@ using osu.Game.Tournament.Screens.Drawings; using osu.Game.Tournament.Screens.Gameplay; using osu.Game.Tournament.Screens.Ladder; using osu.Game.Tournament.Screens.MapPool; +using osu.Game.Tournament.Screens.Schedule; using osu.Game.Tournament.Screens.Showcase; using osu.Game.Tournament.Screens.TeamIntro; using OpenTK; @@ -22,6 +23,7 @@ namespace osu.Game.Tournament.Screens { public class TournamentSceneManager : OsuScreen { + private ScheduleScreen schedule; private LadderManager bracket; private MapPoolScreen mapPool; private GameplayScreen gameplay; @@ -56,6 +58,7 @@ namespace osu.Game.Tournament.Screens new OsuButton { RelativeSizeAxes = Axes.X, Text = "Drawings", Action = () => setScreen(drawings) }, new OsuButton { RelativeSizeAxes = Axes.X, Text = "Showcase", Action = () => setScreen(showcase) }, new Container { RelativeSizeAxes = Axes.X, Height = 50 }, + new OsuButton { RelativeSizeAxes = Axes.X, Text = "Schedule", Action = () => setScreen(schedule) }, new OsuButton { RelativeSizeAxes = Axes.X, Text = "Bracket", Action = () => setScreen(bracket) }, new Container { RelativeSizeAxes = Axes.X, Height = 50 }, new OsuButton { RelativeSizeAxes = Axes.X, Text = "TeamIntro", Action = () => setScreen(teamIntro) }, @@ -88,6 +91,7 @@ namespace osu.Game.Tournament.Screens RelativeSizeAxes = Axes.Both, Children = new Drawable[] { + schedule = new ScheduleScreen(), bracket = new LadderManager(), showcase = new ShowcaseScreen(), mapPool = new MapPoolScreen(), diff --git a/osu.Game.Tournament/TournamentGameBase.cs b/osu.Game.Tournament/TournamentGameBase.cs index 70868d398e..938d79929d 100644 --- a/osu.Game.Tournament/TournamentGameBase.cs +++ b/osu.Game.Tournament/TournamentGameBase.cs @@ -19,6 +19,7 @@ using osu.Game.Online.API.Requests; using osu.Game.Rulesets; using osu.Game.Tournament.Components; using osu.Game.Tournament.IPC; +using osu.Game.Tournament.Screens.Ladder.Components; namespace osu.Game.Tournament { @@ -34,6 +35,9 @@ namespace osu.Game.Tournament [Cached] private readonly Bindable ruleset = new Bindable(); + [Cached] + private LadderEditorInfo editorInfo = new LadderEditorInfo(); + private Bindable windowSize; private FileBasedIPC ipc; diff --git a/osu.Game/OsuGameBase.cs b/osu.Game/OsuGameBase.cs index c7f787cff1..971bc10ecd 100644 --- a/osu.Game/OsuGameBase.cs +++ b/osu.Game/OsuGameBase.cs @@ -297,7 +297,7 @@ namespace osu.Game } public override bool EnableDrag => true; // allow right-mouse dragging for absolute scroll in scroll containers. - public override bool EnableClick => false; + public override bool EnableClick => true; public override bool ChangeFocusOnClick => false; } } From be3904b647977331ea8a96dcb1321035a0b875be Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 11 Nov 2018 10:39:04 +0900 Subject: [PATCH 122/317] Add win screen --- osu.Game.Tournament.Tests/TeamWinTestCase.cs | 34 +++ .../Screens/TeamWin/TeamWinScreen.cs | 232 ++++++++++++++++++ .../Screens/TournamentSceneManager.cs | 7 +- 3 files changed, 272 insertions(+), 1 deletion(-) create mode 100644 osu.Game.Tournament.Tests/TeamWinTestCase.cs create mode 100644 osu.Game.Tournament/Screens/TeamWin/TeamWinScreen.cs diff --git a/osu.Game.Tournament.Tests/TeamWinTestCase.cs b/osu.Game.Tournament.Tests/TeamWinTestCase.cs new file mode 100644 index 0000000000..48ae9acb91 --- /dev/null +++ b/osu.Game.Tournament.Tests/TeamWinTestCase.cs @@ -0,0 +1,34 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System.Linq; +using osu.Framework.Allocation; +using osu.Framework.Configuration; +using osu.Framework.Graphics; +using osu.Game.Tournament.Screens.Ladder.Components; +using osu.Game.Tournament.Screens.TeamWin; + +namespace osu.Game.Tournament.Tests +{ + public class TestCaseTeamWin : LadderTestCase + { + [Cached] + private readonly Bindable currentMatch = new Bindable(); + + [BackgroundDependencyLoader] + private void load() + { + var pairing = new MatchPairing(); + pairing.Team1.Value = Ladder.Teams.FirstOrDefault(t => t.Acronym == "USA"); + pairing.Team2.Value = Ladder.Teams.FirstOrDefault(t => t.Acronym == "JPN"); + pairing.Grouping.Value = Ladder.Groupings.FirstOrDefault(g => g.Name == "Finals"); + currentMatch.Value = pairing; + + Add(new TeamWinScreen + { + FillMode = FillMode.Fit, + FillAspectRatio = 16 / 9f + }); + } + } +} diff --git a/osu.Game.Tournament/Screens/TeamWin/TeamWinScreen.cs b/osu.Game.Tournament/Screens/TeamWin/TeamWinScreen.cs new file mode 100644 index 0000000000..3c1bcdd1ae --- /dev/null +++ b/osu.Game.Tournament/Screens/TeamWin/TeamWinScreen.cs @@ -0,0 +1,232 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework.Allocation; +using osu.Framework.Configuration; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Textures; +using osu.Framework.Graphics.Video; +using osu.Framework.Platform; +using osu.Game.Graphics; +using osu.Game.Graphics.Sprites; +using osu.Game.Tournament.Components; +using osu.Game.Tournament.Screens.Ladder.Components; +using osu.Game.Tournament.Screens.Showcase; +using OpenTK; +using OpenTK.Graphics; + +namespace osu.Game.Tournament.Screens.TeamWin +{ + public class TeamWinScreen : TournamentScreen, IProvideVideo + { + private Container mainContainer; + + private readonly Bindable currentMatch = new Bindable(); + private readonly Bindable currentCompleted = new Bindable(); + + private VideoSprite blueWinVideo; + private VideoSprite redWinVideo; + + [BackgroundDependencyLoader] + private void load(TextureStore textures, LadderInfo ladder, Storage storage) + { + RelativeSizeAxes = Axes.Both; + + InternalChildren = new Drawable[] + { + blueWinVideo = new VideoSprite(storage.GetStream(@"BG Team - Win Blue.m4v")) + { + Alpha = 1, + RelativeSizeAxes = Axes.Both, + Loop = true, + }, + redWinVideo = new VideoSprite(storage.GetStream(@"BG Team - Win Red.m4v")) + { + Alpha = 0, + RelativeSizeAxes = Axes.Both, + Loop = true, + }, + new TournamentLogo() + { + Y = 40, + }, + mainContainer = new Container + { + RelativeSizeAxes = Axes.Both, + } + }; + + currentMatch.BindValueChanged(matchChanged); + currentMatch.BindTo(ladder.CurrentMatch); + + currentCompleted.BindValueChanged(_ => update()); + } + + private void matchChanged(MatchPairing pairing) + { + currentCompleted.UnbindBindings(); + currentCompleted.BindTo(pairing.Completed); + + update(); + } + + private void update() + { + var pairing = currentMatch.Value; + + if (pairing.Winner == null) + { + mainContainer.Clear(); + return; + } + + bool redWin = pairing.Winner == pairing.Team1.Value; + redWinVideo.Alpha = redWin ? 1 : 0; + blueWinVideo.Alpha = redWin ? 0 : 1; + + mainContainer.Children = new Drawable[] + { + new TeamWithPlayers(pairing.Winner, redWin) + { + RelativeSizeAxes = Axes.Both, + Width = 0.5f, + Height = 0.6f, + Anchor = Anchor.Centre, + Origin = Anchor.Centre + }, + new RoundDisplay(pairing) + { + RelativeSizeAxes = Axes.Both, + Height = 0.25f, + Anchor = Anchor.BottomCentre, + Origin = Anchor.BottomCentre, + } + }; + } + + private class RoundDisplay : CompositeDrawable + { + public RoundDisplay(MatchPairing pairing) + { + var col = OsuColour.Gray(0.33f); + + InternalChildren = new Drawable[] + { + new FillFlowContainer + { + AutoSizeAxes = Axes.Both, + Anchor = Anchor.TopCentre, + Origin = Anchor.TopCentre, + Direction = FillDirection.Vertical, + Spacing = new Vector2(0, 10), + Children = new Drawable[] + { + new OsuSpriteText + { + Anchor = Anchor.TopCentre, + Origin = Anchor.TopCentre, + Colour = col, + Text = "WINNER", + Font = "Aquatico-Regular", + TextSize = 15, + }, + new OsuSpriteText + { + Anchor = Anchor.TopCentre, + Origin = Anchor.TopCentre, + Colour = col, + Text = pairing.Grouping.Value?.Name.Value ?? "Unknown Grouping", + Font = "Aquatico-Light", + Spacing = new Vector2(10, 0), + TextSize = 50, + }, + new OsuSpriteText + { + Anchor = Anchor.TopCentre, + Origin = Anchor.TopCentre, + Font = "Aquatico-Light", + Colour = col, + Text = pairing.Date.Value.ToUniversalTime().ToString("dd MMMM HH:mm UTC"), + TextSize = 20, + }, + } + } + }; + } + } + + private class TeamWithPlayers : CompositeDrawable + { + private readonly Color4 red = new Color4(129, 68, 65, 255); + private readonly Color4 blue = new Color4(41, 91, 97, 255); + + public TeamWithPlayers(TournamentTeam team, bool left = false) + { + FillFlowContainer players; + var colour = left ? red : blue; + InternalChildren = new Drawable[] + { + new TeamDisplay(team, left ? "Team Red" : "Team Blue", colour) + { + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + }, + players = new FillFlowContainer + { + Direction = FillDirection.Vertical, + AutoSizeAxes = Axes.Both, + Spacing = new Vector2(0, 5), + Padding = new MarginPadding(20), + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + RelativePositionAxes = Axes.Both, + }, + }; + } + + private class TeamDisplay : DrawableTournamentTeam + { + public TeamDisplay(TournamentTeam team, string teamName, Color4 colour) + : base(team) + { + AutoSizeAxes = Axes.Both; + + Flag.Anchor = Flag.Origin = Anchor.TopCentre; + Flag.RelativeSizeAxes = Axes.None; + Flag.Size = new Vector2(300, 200); + Flag.Scale = new Vector2(0.4f); + Flag.Margin = new MarginPadding { Bottom = 20 }; + + InternalChild = new FillFlowContainer + { + AutoSizeAxes = Axes.Both, + Direction = FillDirection.Vertical, + Spacing = new Vector2(0, 5), + Children = new Drawable[] + { + Flag, + new OsuSpriteText + { + Text = team?.FullName.ToUpper() ?? "???", + TextSize = 40, + Colour = Color4.Black, + Font = "Aquatico-Light", + Origin = Anchor.TopCentre, + Anchor = Anchor.TopCentre, + }, + new OsuSpriteText + { + Text = teamName.ToUpper(), + TextSize = 20, + Colour = colour, + Origin = Anchor.TopCentre, + Anchor = Anchor.TopCentre, + } + } + }; + } + } + } + } +} diff --git a/osu.Game.Tournament/Screens/TournamentSceneManager.cs b/osu.Game.Tournament/Screens/TournamentSceneManager.cs index c349e48fa2..02492953f2 100644 --- a/osu.Game.Tournament/Screens/TournamentSceneManager.cs +++ b/osu.Game.Tournament/Screens/TournamentSceneManager.cs @@ -16,6 +16,7 @@ using osu.Game.Tournament.Screens.MapPool; using osu.Game.Tournament.Screens.Schedule; using osu.Game.Tournament.Screens.Showcase; using osu.Game.Tournament.Screens.TeamIntro; +using osu.Game.Tournament.Screens.TeamWin; using OpenTK; using OpenTK.Graphics; @@ -27,6 +28,7 @@ namespace osu.Game.Tournament.Screens private LadderManager bracket; private MapPoolScreen mapPool; private GameplayScreen gameplay; + private TeamWinScreen winner; private TeamIntroScreen teamIntro; private DrawingsScreen drawings; private Container screens; @@ -64,6 +66,8 @@ namespace osu.Game.Tournament.Screens new OsuButton { RelativeSizeAxes = Axes.X, Text = "TeamIntro", Action = () => setScreen(teamIntro) }, new OsuButton { RelativeSizeAxes = Axes.X, Text = "MapPool", Action = () => setScreen(mapPool) }, new OsuButton { RelativeSizeAxes = Axes.X, Text = "Gameplay", Action = () => setScreen(gameplay) }, + new Container { RelativeSizeAxes = Axes.X, Height = 50 }, + new OsuButton { RelativeSizeAxes = Axes.X, Text = "Win", Action = () => setScreen(winner) }, } }, }, @@ -97,7 +101,8 @@ namespace osu.Game.Tournament.Screens mapPool = new MapPoolScreen(), teamIntro = new TeamIntroScreen(), drawings = new DrawingsScreen(), - gameplay = new GameplayScreen() + gameplay = new GameplayScreen(), + winner = new TeamWinScreen() } }, } From 123629ba9e94f06e1ff5823ed9507b6f49f04ab0 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 11 Nov 2018 10:48:57 +0900 Subject: [PATCH 123/317] Flash panels on select --- .../Components/TournamentBeatmapPanel.cs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/osu.Game.Tournament/Components/TournamentBeatmapPanel.cs b/osu.Game.Tournament/Components/TournamentBeatmapPanel.cs index b804fc44a7..8df01b636b 100644 --- a/osu.Game.Tournament/Components/TournamentBeatmapPanel.cs +++ b/osu.Game.Tournament/Components/TournamentBeatmapPanel.cs @@ -29,6 +29,7 @@ namespace osu.Game.Tournament.Components public const float HEIGHT = 50; private readonly Bindable currentMatch = new Bindable(); + private Box flash; public TournamentBeatmapPanel(BeatmapInfo beatmap) { @@ -117,6 +118,13 @@ namespace osu.Game.Tournament.Components } }, }, + flash = new Box + { + RelativeSizeAxes = Axes.Both, + Colour = Color4.Gray, + Blending = BlendingMode.Additive, + Alpha = 0, + }, }); } @@ -126,12 +134,20 @@ namespace osu.Game.Tournament.Components updateState(); } + private BeatmapChoice choice; + private void updateState() { var found = currentMatch.Value.PicksBans.FirstOrDefault(p => p.BeatmapID == Beatmap.OnlineBeatmapID); + bool doFlash = found != choice; + choice = found; + if (found != null) { + if (doFlash) + flash.FadeOutFromOne(500).Loop(0, 10); + BorderThickness = 6; switch (found.Team) From 00731560cb1ced2f569c5ba27e0d79d285c12767 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 12 Nov 2018 01:25:22 +0900 Subject: [PATCH 124/317] Add CS display --- osu.Game.Tournament/Components/SongBar.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Tournament/Components/SongBar.cs b/osu.Game.Tournament/Components/SongBar.cs index 6d9dc6025f..c0ae2116c4 100644 --- a/osu.Game.Tournament/Components/SongBar.cs +++ b/osu.Game.Tournament/Components/SongBar.cs @@ -179,7 +179,7 @@ namespace osu.Game.Tournament.Components }, new OsuSpriteText { - Text = $"AR {ar:0.#}{extra}", + Text = $"CS{beatmap.BaseDifficulty.CircleSize:0.#} / AR {ar:0.#}{extra}", Margin = new MarginPadding { Horizontal = 15, Vertical = 5 }, Colour = OsuColour.Gray(0.33f), Anchor = Anchor.TopRight, From d7a086be83cbb9054655b4fe25f9a1754627e7f7 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 12 Nov 2018 01:25:31 +0900 Subject: [PATCH 125/317] Fix regression in song bar display logic --- osu.Game.Tournament/Components/TournamentBeatmapPanel.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Tournament/Components/TournamentBeatmapPanel.cs b/osu.Game.Tournament/Components/TournamentBeatmapPanel.cs index 8df01b636b..d2bc790b16 100644 --- a/osu.Game.Tournament/Components/TournamentBeatmapPanel.cs +++ b/osu.Game.Tournament/Components/TournamentBeatmapPanel.cs @@ -146,7 +146,7 @@ namespace osu.Game.Tournament.Components if (found != null) { if (doFlash) - flash.FadeOutFromOne(500).Loop(0, 10); + flash?.FadeOutFromOne(500).Loop(0, 10); BorderThickness = 6; From 01f814aacee8a79e6d917fb4d49e7eef85f9a4cf Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 15 Nov 2018 14:11:58 +0900 Subject: [PATCH 126/317] Fix song length not being rounded correctly when DT is applied --- osu.Game.Tournament/Components/SongBar.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Tournament/Components/SongBar.cs b/osu.Game.Tournament/Components/SongBar.cs index c0ae2116c4..d145544b76 100644 --- a/osu.Game.Tournament/Components/SongBar.cs +++ b/osu.Game.Tournament/Components/SongBar.cs @@ -163,7 +163,7 @@ namespace osu.Game.Tournament.Components { new OsuSpriteText { - Text = $"Length {length}s", + Text = $"Length {length:0}s", Margin = new MarginPadding { Horizontal = 15, Vertical = 5 }, Colour = OsuColour.Gray(0.33f), Anchor = Anchor.TopLeft, From 8eff21d128d1aac39e2826cc093ef48da582270d Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 15 Nov 2018 14:12:14 +0900 Subject: [PATCH 127/317] Fix star colours being incorrect --- osu.Game.Tournament/Screens/Gameplay/MatchHeader.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/osu.Game.Tournament/Screens/Gameplay/MatchHeader.cs b/osu.Game.Tournament/Screens/Gameplay/MatchHeader.cs index 5765c9cd12..c750694b87 100644 --- a/osu.Game.Tournament/Screens/Gameplay/MatchHeader.cs +++ b/osu.Game.Tournament/Screens/Gameplay/MatchHeader.cs @@ -107,10 +107,16 @@ namespace osu.Game.Tournament.Screens.Gameplay private void teamChanged(TournamentTeam team) { + var colour = teamColour == TeamColour.Red ? red : blue; + var flip = teamColour != TeamColour.Red; + InternalChildren = new Drawable[] { - new TeamDisplay(team, teamColour == TeamColour.Red ? red : blue, teamColour != TeamColour.Red), - new ScoreDisplay(currentTeamScore, teamColour != TeamColour.Red, currentMatch.Value.PointsToWin) + new TeamDisplay(team, colour, flip), + new ScoreDisplay(currentTeamScore, flip, currentMatch.Value.PointsToWin) + { + Colour = colour + } }; } } @@ -133,7 +139,6 @@ namespace osu.Game.Tournament.Screens.Gameplay X = (flip ? -1 : 1) * 90, Y = 5, Scale = flip ? new Vector2(-1, 1) : Vector2.One, - Colour = new Color4(95, 41, 60, 255), }; currentTeamScore.BindValueChanged(scoreChanged); From 604cb4cb9ee4060d3512cc58391c780f372947a6 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 15 Nov 2018 14:12:41 +0900 Subject: [PATCH 128/317] Update to support new dropdown logic --- .../Screens/Ladder/Components/LadderEditorSettings.cs | 8 +++----- .../Screens/Ladder/Components/TournamentGrouping.cs | 2 ++ osu.Game.Tournament/Screens/TeamWin/TeamWinScreen.cs | 5 ++--- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/osu.Game.Tournament/Screens/Ladder/Components/LadderEditorSettings.cs b/osu.Game.Tournament/Screens/Ladder/Components/LadderEditorSettings.cs index 3fa7fdf7e8..afb20a68f0 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/LadderEditorSettings.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/LadderEditorSettings.cs @@ -1,7 +1,6 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using System.Collections.Generic; using System.Linq; using osu.Framework.Allocation; using osu.Framework.Configuration; @@ -36,8 +35,7 @@ namespace osu.Game.Tournament.Screens.Ladder.Components { var teamEntries = ladderInfo.Teams; - var groupingOptions = ladderInfo.Groupings.Select(g => new KeyValuePair(g.Name, g)) - .Prepend(new KeyValuePair("None", new TournamentGrouping())); + var groupingOptions = ladderInfo.Groupings.Prepend(new TournamentGrouping()); Children = new Drawable[] { @@ -80,7 +78,7 @@ namespace osu.Game.Tournament.Screens.Ladder.Components textboxTeam2 = new OsuTextBox { RelativeSizeAxes = Axes.X, Height = 20 }, groupingDropdown = new SettingsDropdown { - Bindable = new Bindable { Default = groupingOptions.First().Value }, + Bindable = new Bindable { Default = groupingOptions.First() }, Items = groupingOptions }, losersCheckbox = new PlayerCheckbox @@ -94,7 +92,7 @@ namespace osu.Game.Tournament.Screens.Ladder.Components { textboxTeam1.Text = selection?.Team1.Value?.Acronym; textboxTeam2.Text = selection?.Team2.Value?.Acronym; - groupingDropdown.Bindable.Value = selection?.Grouping.Value ?? groupingOptions.First().Value; + groupingDropdown.Bindable.Value = selection?.Grouping.Value ?? groupingOptions.First(); losersCheckbox.Current.Value = selection?.Losers.Value ?? false; }; diff --git a/osu.Game.Tournament/Screens/Ladder/Components/TournamentGrouping.cs b/osu.Game.Tournament/Screens/Ladder/Components/TournamentGrouping.cs index 17f76a0143..370f0ea643 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/TournamentGrouping.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/TournamentGrouping.cs @@ -22,5 +22,7 @@ namespace osu.Game.Tournament.Screens.Ladder.Components public readonly Bindable StartDate = new Bindable(); public List Pairings = new List(); + + public override string ToString() => Name.Value ?? "None"; } } diff --git a/osu.Game.Tournament/Screens/TeamWin/TeamWinScreen.cs b/osu.Game.Tournament/Screens/TeamWin/TeamWinScreen.cs index 3c1bcdd1ae..a6f6e7038a 100644 --- a/osu.Game.Tournament/Screens/TeamWin/TeamWinScreen.cs +++ b/osu.Game.Tournament/Screens/TeamWin/TeamWinScreen.cs @@ -47,7 +47,7 @@ namespace osu.Game.Tournament.Screens.TeamWin RelativeSizeAxes = Axes.Both, Loop = true, }, - new TournamentLogo() + new TournamentLogo { Y = 40, }, @@ -163,7 +163,6 @@ namespace osu.Game.Tournament.Screens.TeamWin public TeamWithPlayers(TournamentTeam team, bool left = false) { - FillFlowContainer players; var colour = left ? red : blue; InternalChildren = new Drawable[] { @@ -172,7 +171,7 @@ namespace osu.Game.Tournament.Screens.TeamWin Anchor = Anchor.Centre, Origin = Anchor.Centre, }, - players = new FillFlowContainer + new FillFlowContainer { Direction = FillDirection.Vertical, AutoSizeAxes = Axes.Both, From 54b87e9c9344942410f37ebcd94a3c79be593216 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 15 Nov 2018 14:12:51 +0900 Subject: [PATCH 129/317] Don't crash on unexpected pairing links --- osu.Game.Tournament/TournamentGameBase.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/osu.Game.Tournament/TournamentGameBase.cs b/osu.Game.Tournament/TournamentGameBase.cs index 938d79929d..8a2e6471c1 100644 --- a/osu.Game.Tournament/TournamentGameBase.cs +++ b/osu.Game.Tournament/TournamentGameBase.cs @@ -104,7 +104,10 @@ namespace osu.Game.Tournament // link pairings to groupings foreach (var group in Ladder.Groupings) foreach (var id in group.Pairings) - Ladder.Pairings.Single(p => p.ID == id).Grouping.Value = group; + { + var found = Ladder.Pairings.FirstOrDefault(p => p.ID == id); + if (found != null) found.Grouping.Value = group; + } Ladder.CurrentMatch.Value = Ladder.Pairings.FirstOrDefault(p => p.Current.Value); From 46e163ec5e81c85c1f58a0129cdf144c327560ae Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 15 Nov 2018 21:28:42 +0900 Subject: [PATCH 130/317] Add score display --- .../TestCaseMatchScoreDisplay.cs | 40 +++++ osu.Game.Tournament/IPC/FileBasedIPC.cs | 25 +-- osu.Game.Tournament/IPC/MatchIPCInfo.cs | 19 +++ osu.Game.Tournament/IPC/TourneyState.cs | 14 ++ .../Screens/BeatmapInfoScreen.cs | 2 +- .../Gameplay/{ => Components}/MatchHeader.cs | 8 +- .../Gameplay/Components/MatchScoreDisplay.cs | 144 ++++++++++++++++++ .../Screens/Gameplay/GameplayScreen.cs | 57 ++++++- .../Screens/MapPool/MapPoolScreen.cs | 4 +- osu.Game.Tournament/TournamentGameBase.cs | 2 +- 10 files changed, 277 insertions(+), 38 deletions(-) create mode 100644 osu.Game.Tournament.Tests/TestCaseMatchScoreDisplay.cs create mode 100644 osu.Game.Tournament/IPC/MatchIPCInfo.cs create mode 100644 osu.Game.Tournament/IPC/TourneyState.cs rename osu.Game.Tournament/Screens/Gameplay/{ => Components}/MatchHeader.cs (96%) create mode 100644 osu.Game.Tournament/Screens/Gameplay/Components/MatchScoreDisplay.cs diff --git a/osu.Game.Tournament.Tests/TestCaseMatchScoreDisplay.cs b/osu.Game.Tournament.Tests/TestCaseMatchScoreDisplay.cs new file mode 100644 index 0000000000..62c5ca786b --- /dev/null +++ b/osu.Game.Tournament.Tests/TestCaseMatchScoreDisplay.cs @@ -0,0 +1,40 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework.Allocation; +using osu.Framework.Graphics; +using osu.Framework.MathUtils; +using osu.Game.Tournament.IPC; +using osu.Game.Tournament.Screens.Gameplay.Components; + +namespace osu.Game.Tournament.Tests +{ + public class TestCaseMatchScoreDisplay : LadderTestCase + { + [Cached(Type = typeof(MatchIPCInfo))] + private MatchIPCInfo matchInfo = new MatchIPCInfo(); + + public TestCaseMatchScoreDisplay() + { + Add(new MatchScoreDisplay + { + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + }); + } + + protected override void LoadComplete() + { + base.LoadComplete(); + + Scheduler.AddDelayed(() => + { + int amount = (int)((RNG.NextDouble() - 0.5) * 10000); + if (amount < 0) + matchInfo.Score1.Value -= amount; + else + matchInfo.Score2.Value += amount; + }, 100, true); + } + } +} diff --git a/osu.Game.Tournament/IPC/FileBasedIPC.cs b/osu.Game.Tournament/IPC/FileBasedIPC.cs index 2ad30db748..6759122c16 100644 --- a/osu.Game.Tournament/IPC/FileBasedIPC.cs +++ b/osu.Game.Tournament/IPC/FileBasedIPC.cs @@ -4,8 +4,6 @@ using System; using System.IO; using osu.Framework.Allocation; -using osu.Framework.Configuration; -using osu.Framework.Graphics; using osu.Framework.Logging; using osu.Framework.Platform.Windows; using osu.Game.Beatmaps; @@ -16,16 +14,7 @@ using osu.Game.Rulesets; namespace osu.Game.Tournament.IPC { - public enum TourneyState - { - Initialising, - Idle, - WaitingForClients, - Playing, - Ranking - } - - public class FileBasedIPC : Component + public class FileBasedIPC : MatchIPCInfo { [Resolved] protected APIAccess API { get; private set; } @@ -33,15 +22,7 @@ namespace osu.Game.Tournament.IPC [Resolved] protected RulesetStore Rulesets { get; private set; } - public readonly Bindable Beatmap = new Bindable(); - - public readonly Bindable Mods = new Bindable(); - - public readonly Bindable State = new Bindable(); - private int lastBeatmapId; - public int Score1; - public int Score2; [BackgroundDependencyLoader] private void load() @@ -97,8 +78,8 @@ namespace osu.Game.Tournament.IPC using (var stream = stable.GetStream(file_ipc_scores_filename)) using (var sr = new StreamReader(stream)) { - Score1 = int.Parse(sr.ReadLine()); - Score2 = int.Parse(sr.ReadLine()); + Score1.Value = int.Parse(sr.ReadLine()); + Score2.Value = int.Parse(sr.ReadLine()); } } catch (Exception) diff --git a/osu.Game.Tournament/IPC/MatchIPCInfo.cs b/osu.Game.Tournament/IPC/MatchIPCInfo.cs new file mode 100644 index 0000000000..d40ec35808 --- /dev/null +++ b/osu.Game.Tournament/IPC/MatchIPCInfo.cs @@ -0,0 +1,19 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework.Configuration; +using osu.Framework.Graphics; +using osu.Game.Beatmaps; +using osu.Game.Beatmaps.Legacy; + +namespace osu.Game.Tournament.IPC +{ + public class MatchIPCInfo : Component + { + public Bindable Beatmap { get; } = new Bindable(); + public Bindable Mods { get; } = new Bindable(); + public Bindable State { get; } = new Bindable(); + public BindableInt Score1 { get; } = new BindableInt(); + public BindableInt Score2 { get; } = new BindableInt(); + } +} diff --git a/osu.Game.Tournament/IPC/TourneyState.cs b/osu.Game.Tournament/IPC/TourneyState.cs new file mode 100644 index 0000000000..afa5b400ba --- /dev/null +++ b/osu.Game.Tournament/IPC/TourneyState.cs @@ -0,0 +1,14 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +namespace osu.Game.Tournament.IPC +{ + public enum TourneyState + { + Initialising, + Idle, + WaitingForClients, + Playing, + Ranking + } +} diff --git a/osu.Game.Tournament/Screens/BeatmapInfoScreen.cs b/osu.Game.Tournament/Screens/BeatmapInfoScreen.cs index def9f228cf..b75456c1e9 100644 --- a/osu.Game.Tournament/Screens/BeatmapInfoScreen.cs +++ b/osu.Game.Tournament/Screens/BeatmapInfoScreen.cs @@ -24,7 +24,7 @@ namespace osu.Game.Tournament.Screens } [BackgroundDependencyLoader] - private void load(FileBasedIPC ipc) + private void load(MatchIPCInfo ipc) { ipc.Beatmap.BindValueChanged(beatmapChanged, true); ipc.Mods.BindValueChanged(modsChanged, true); diff --git a/osu.Game.Tournament/Screens/Gameplay/MatchHeader.cs b/osu.Game.Tournament/Screens/Gameplay/Components/MatchHeader.cs similarity index 96% rename from osu.Game.Tournament/Screens/Gameplay/MatchHeader.cs rename to osu.Game.Tournament/Screens/Gameplay/Components/MatchHeader.cs index c750694b87..9925f5ef74 100644 --- a/osu.Game.Tournament/Screens/Gameplay/MatchHeader.cs +++ b/osu.Game.Tournament/Screens/Gameplay/Components/MatchHeader.cs @@ -17,7 +17,7 @@ using OpenTK; using OpenTK.Graphics; using OpenTK.Input; -namespace osu.Game.Tournament.Screens.Gameplay +namespace osu.Game.Tournament.Screens.Gameplay.Components { public class MatchHeader : Container { @@ -113,7 +113,7 @@ namespace osu.Game.Tournament.Screens.Gameplay InternalChildren = new Drawable[] { new TeamDisplay(team, colour, flip), - new ScoreDisplay(currentTeamScore, flip, currentMatch.Value.PointsToWin) + new TeamScore(currentTeamScore, flip, currentMatch.Value.PointsToWin) { Colour = colour } @@ -121,12 +121,12 @@ namespace osu.Game.Tournament.Screens.Gameplay } } - private class ScoreDisplay : CompositeDrawable + private class TeamScore : CompositeDrawable { private readonly Bindable currentTeamScore = new Bindable(); private readonly StarCounter counter; - public ScoreDisplay(Bindable score, bool flip, int count) + public TeamScore(Bindable score, bool flip, int count) { var anchor = flip ? Anchor.CentreRight : Anchor.CentreLeft; diff --git a/osu.Game.Tournament/Screens/Gameplay/Components/MatchScoreDisplay.cs b/osu.Game.Tournament/Screens/Gameplay/Components/MatchScoreDisplay.cs new file mode 100644 index 0000000000..2c00c23d42 --- /dev/null +++ b/osu.Game.Tournament/Screens/Gameplay/Components/MatchScoreDisplay.cs @@ -0,0 +1,144 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System; +using osu.Framework.Allocation; +using osu.Framework.Configuration; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Shapes; +using osu.Game.Graphics.UserInterface; +using osu.Game.Tournament.IPC; +using osu.Game.Tournament.Screens.Ladder.Components; +using OpenTK.Graphics; + +namespace osu.Game.Tournament.Screens.Gameplay.Components +{ + public class MatchScoreDisplay : CompositeDrawable + { + private readonly Color4 red = new Color4(186, 0, 18, 255); + private readonly Color4 blue = new Color4(17, 136, 170, 255); + + private const float bar_height = 20; + + private readonly Bindable currentMatch = new Bindable(); + + private readonly BindableInt score1 = new BindableInt(); + private readonly BindableInt score2 = new BindableInt(); + + private readonly MatchScoreCounter score1Text; + private readonly MatchScoreCounter score2Text; + + private readonly Circle score1Bar; + private readonly Circle score2Bar; + + public MatchScoreDisplay() + { + RelativeSizeAxes = Axes.X; + + InternalChildren = new Drawable[] + { + score1Bar = new Circle + { + Name = "top bar red", + RelativeSizeAxes = Axes.X, + Height = bar_height, + Width = 0, + Colour = red, + Anchor = Anchor.TopCentre, + Origin = Anchor.TopRight + }, + score1Text = new MatchScoreCounter + { + Colour = red, + Anchor = Anchor.TopCentre, + Origin = Anchor.TopCentre + }, + score2Bar = new Circle + { + Name = "top bar blue", + RelativeSizeAxes = Axes.X, + Height = bar_height, + Width = 0, + Colour = blue, + Anchor = Anchor.TopCentre, + Origin = Anchor.TopLeft + }, + score2Text = new MatchScoreCounter + { + Colour = blue, + Anchor = Anchor.TopCentre, + Origin = Anchor.TopCentre + }, + }; + } + + [BackgroundDependencyLoader] + private void load(LadderInfo ladder, MatchIPCInfo ipc) + { + currentMatch.BindTo(ladder.CurrentMatch); + + score1.BindValueChanged(_ => updateScores()); + score1.BindTo(ipc.Score1); + + score2.BindValueChanged(_ => updateScores()); + score2.BindTo(ipc.Score2); + } + + private void updateScores() + { + score1Text.Current.Value = score1.Value; + score2Text.Current.Value = score2.Value; + + var winningText = score1.Value > score2.Value ? score1Text : score2Text; + var losingText = score1.Value <= score2.Value ? score1Text : score2Text; + + winningText.Winning = true; + losingText.Winning = false; + + var winningBar = score1.Value > score2.Value ? score1Bar : score2Bar; + var losingBar = score1.Value <= score2.Value ? score1Bar : score2Bar; + + var diff = Math.Max(score1.Value, score2.Value) - Math.Min(score1.Value, score2.Value); + + losingBar.ResizeWidthTo(0, 400, Easing.OutQuint); + winningBar.ResizeWidthTo((float)Math.Pow(diff / 1000000f, 0.5), 400, Easing.OutQuint); + } + + protected override void UpdateAfterChildren() + { + base.UpdateAfterChildren(); + + score1Text.X = -Math.Max(score1Text.DrawWidth / 2, score1Bar.DrawWidth); + score2Text.X = Math.Max(score2Text.DrawWidth / 2, score2Bar.DrawWidth); + } + + private class MatchScoreCounter : ScoreCounter + { + public MatchScoreCounter() + { + Margin = new MarginPadding { Top = bar_height + 5, Horizontal = 10 }; + Winning = false; + + DisplayedCountSpriteText.FixedWidth = false; + } + + public bool Winning + { + set + { + if (value) + { + DisplayedCountSpriteText.Font = "Aquatico-Regular"; + DisplayedCountSpriteText.TextSize = 60; + } + else + { + DisplayedCountSpriteText.Font = "Aquatico-Light"; + DisplayedCountSpriteText.TextSize = 40; + } + } + } + } + } +} diff --git a/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs b/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs index 99d996d138..a86c47839b 100644 --- a/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs +++ b/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs @@ -4,12 +4,14 @@ using osu.Framework.Allocation; using osu.Framework.Configuration; using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Textures; using osu.Framework.Threading; using osu.Game.Graphics.UserInterface; using osu.Game.Tournament.Components; using osu.Game.Tournament.IPC; +using osu.Game.Tournament.Screens.Gameplay.Components; using osu.Game.Tournament.Screens.Ladder.Components; using OpenTK.Graphics; @@ -23,23 +25,62 @@ namespace osu.Game.Tournament.Screens.Gameplay public readonly Bindable State = new Bindable(); private TriangleButton warmupButton; - private FileBasedIPC ipc; + private MatchIPCInfo ipc; + + private readonly Color4 red = new Color4(186, 0, 18, 255); + private readonly Color4 blue = new Color4(17, 136, 170, 255); [BackgroundDependencyLoader] - private void load(LadderInfo ladder, TextureStore textures, FileBasedIPC ipc) + private void load(LadderInfo ladder, TextureStore textures, MatchIPCInfo ipc) { this.ipc = ipc; AddRange(new Drawable[] { new MatchHeader(), - new Box + new FillFlowContainer { - RelativeSizeAxes = Axes.Both, - Height = 718 / 1080f, - Colour = new Color4(0, 255, 0, 255), - Y = 14, + RelativeSizeAxes = Axes.X, + AutoSizeAxes = Axes.Y, + Direction = FillDirection.Vertical, Anchor = Anchor.Centre, - Origin= Anchor.Centre, + Origin = Anchor.Centre, + Children = new Drawable[] + { + new Container + { + RelativeSizeAxes = Axes.X, + AutoSizeAxes = Axes.Y, + Children = new Drawable[] + { + new Circle + { + Name = "top bar red", + RelativeSizeAxes = Axes.X, + Height = 10, + Width = 0.5f, + Colour = red, + }, + new Circle + { + Name = "top bar blue", + RelativeSizeAxes = Axes.X, + Height = 10, + Width = 0.5f, + Colour = blue, + Anchor = Anchor.TopRight, + Origin = Anchor.TopRight, + }, + } + }, + new Box + { + // chroma key area for stable gameplay + Name = "chroma", + RelativeSizeAxes = Axes.X, + Height = 480, + Colour = new Color4(0, 255, 0, 255), + }, + } }, new ControlPanel { diff --git a/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs b/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs index 5a463c6d5e..c2cefd8c41 100644 --- a/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs +++ b/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs @@ -12,7 +12,7 @@ using osu.Game.Graphics.Sprites; using osu.Game.Graphics.UserInterface; using osu.Game.Tournament.Components; using osu.Game.Tournament.IPC; -using osu.Game.Tournament.Screens.Gameplay; +using osu.Game.Tournament.Screens.Gameplay.Components; using osu.Game.Tournament.Screens.Ladder.Components; using OpenTK; using OpenTK.Graphics; @@ -92,7 +92,7 @@ namespace osu.Game.Tournament.Screens.MapPool } [BackgroundDependencyLoader] - private void load(LadderInfo ladder, FileBasedIPC ipc) + private void load(LadderInfo ladder, MatchIPCInfo ipc) { currentMatch.BindValueChanged(matchChanged); currentMatch.BindTo(ladder.CurrentMatch); diff --git a/osu.Game.Tournament/TournamentGameBase.cs b/osu.Game.Tournament/TournamentGameBase.cs index 8a2e6471c1..31a3c162f5 100644 --- a/osu.Game.Tournament/TournamentGameBase.cs +++ b/osu.Game.Tournament/TournamentGameBase.cs @@ -72,7 +72,7 @@ namespace osu.Game.Tournament dependencies.Cache(Ladder); - dependencies.Cache(ipc = new FileBasedIPC()); + dependencies.CacheAs(ipc = new FileBasedIPC()); Add(ipc); bool addedInfo = false; From e6637532bc8ae9eeca7e672e985488b727f09816 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 16 Nov 2018 12:20:21 +0900 Subject: [PATCH 131/317] Add back padding --- .../Screens/Gameplay/Components/MatchScoreDisplay.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game.Tournament/Screens/Gameplay/Components/MatchScoreDisplay.cs b/osu.Game.Tournament/Screens/Gameplay/Components/MatchScoreDisplay.cs index 2c00c23d42..fe865a1728 100644 --- a/osu.Game.Tournament/Screens/Gameplay/Components/MatchScoreDisplay.cs +++ b/osu.Game.Tournament/Screens/Gameplay/Components/MatchScoreDisplay.cs @@ -109,8 +109,8 @@ namespace osu.Game.Tournament.Screens.Gameplay.Components { base.UpdateAfterChildren(); - score1Text.X = -Math.Max(score1Text.DrawWidth / 2, score1Bar.DrawWidth); - score2Text.X = Math.Max(score2Text.DrawWidth / 2, score2Bar.DrawWidth); + score1Text.X = -Math.Max(5 + score1Text.DrawWidth / 2, score1Bar.DrawWidth); + score2Text.X = Math.Max(5 + score2Text.DrawWidth / 2, score2Bar.DrawWidth); } private class MatchScoreCounter : ScoreCounter From 1ab4713ef63a6764c78cb3063abe9476df3407ae Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 16 Nov 2018 14:22:42 +0900 Subject: [PATCH 132/317] Add tournament chat display --- .../TestCaseMatchChatDisplay.cs | 103 +++++++++++ .../Components/MatchChatDisplay.cs | 167 ++++++++++++++++++ osu.Game/Online/Chat/Message.cs | 4 - 3 files changed, 270 insertions(+), 4 deletions(-) create mode 100644 osu.Game.Tournament.Tests/TestCaseMatchChatDisplay.cs create mode 100644 osu.Game.Tournament/Components/MatchChatDisplay.cs diff --git a/osu.Game.Tournament.Tests/TestCaseMatchChatDisplay.cs b/osu.Game.Tournament.Tests/TestCaseMatchChatDisplay.cs new file mode 100644 index 0000000000..aab56d1714 --- /dev/null +++ b/osu.Game.Tournament.Tests/TestCaseMatchChatDisplay.cs @@ -0,0 +1,103 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System.Collections.Generic; +using osu.Framework.Allocation; +using osu.Framework.Graphics; +using osu.Game.Online.Chat; +using osu.Game.Tests.Visual; +using osu.Game.Tournament.Components; +using osu.Game.Tournament.Screens.Ladder.Components; +using osu.Game.Users; +using OpenTK; + +namespace osu.Game.Tournament.Tests +{ + public class TestCaseMatchChatDisplay : OsuTestCase + { + private readonly Channel testChannel = new Channel(); + + private readonly User admin = new User + { + Username = "HappyStick", + Id = 2, + Colour = "f2ca34" + }; + + private readonly User redUser = new User + { + Username = "BanchoBot", + Id = 3, + }; + + private readonly User blueUser = new User + { + Username = "Zallius", + Id = 4, + }; + + [Cached] + private LadderInfo ladderInfo = new LadderInfo(); + + public TestCaseMatchChatDisplay() + { + MatchChatDisplay chatDisplay; + + Add(chatDisplay = new MatchChatDisplay + { + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + Size = new Vector2(400, 80) + }); + + ladderInfo.CurrentMatch.Value = new MatchPairing + { + Team1 = + { + Value = new TournamentTeam { Players = new List { redUser } } + }, + Team2 = + { + Value = new TournamentTeam { Players = new List { blueUser } } + } + }; + + chatDisplay.Channel.Value = testChannel; + } + + protected override void LoadComplete() + { + base.LoadComplete(); + + AddStep("message from admin", () => testChannel.AddLocalEcho(new LocalEchoMessage + { + Sender = admin, + Content = "I am a wang!" + })); + + AddStep("message from team red", () => testChannel.AddLocalEcho(new LocalEchoMessage + { + Sender = redUser, + Content = "I am team red." + })); + + AddStep("message from team red", () => testChannel.AddLocalEcho(new LocalEchoMessage + { + Sender = redUser, + Content = "I plan to win!" + })); + + AddStep("message from team blue", () => testChannel.AddLocalEcho(new LocalEchoMessage + { + Sender = blueUser, + Content = "Not on my watch. Prepare to eat saaaaaaaaaand. Lots and lots of saaaaaaand." + })); + + AddStep("message from admin", () => testChannel.AddLocalEcho(new LocalEchoMessage + { + Sender = admin, + Content = "Okay okay, calm down guys. Let's do this!" + })); + } + } +} diff --git a/osu.Game.Tournament/Components/MatchChatDisplay.cs b/osu.Game.Tournament/Components/MatchChatDisplay.cs new file mode 100644 index 0000000000..a68507044d --- /dev/null +++ b/osu.Game.Tournament/Components/MatchChatDisplay.cs @@ -0,0 +1,167 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System.Collections.Generic; +using System.Linq; +using osu.Framework.Allocation; +using osu.Framework.Configuration; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Shapes; +using osu.Game.Graphics; +using osu.Game.Graphics.Containers; +using osu.Game.Graphics.Sprites; +using osu.Game.Online.Chat; +using OpenTK; +using OpenTK.Graphics; + +namespace osu.Game.Tournament.Components +{ + public class MatchChatDisplay : CompositeDrawable + { + private Channel lastChannel; + public readonly Bindable Channel = new Bindable(); + private readonly FillFlowContainer messagesFlow; + + public MatchChatDisplay() + { + CornerRadius = 5; + Masking = true; + + InternalChildren = new Drawable[] + { + new Box + { + Colour = Color4.Black, + Alpha = 0.8f, + RelativeSizeAxes = Axes.Both, + }, + messagesFlow = new FillFlowContainer + { + RelativeSizeAxes = Axes.X, + AutoSizeAxes = Axes.Y, + LayoutEasing = Easing.Out, + LayoutDuration = 500, + Anchor = Anchor.BottomLeft, + Origin = Anchor.BottomLeft, + Direction = FillDirection.Vertical, + }, + }; + + Channel.BindValueChanged(channelChanged); + } + + private void channelChanged(Channel channel) + { + if (lastChannel != null) + lastChannel.NewMessagesArrived -= newMessages; + + lastChannel = channel; + + channel.NewMessagesArrived += newMessages; + } + + private void newMessages(IEnumerable messages) + { + var excessChildren = messagesFlow.Children.Count - 10; + if (excessChildren > 0) + { + foreach (var c in messagesFlow.Children.Take(excessChildren)) + c.Expire(); + } + + foreach (var message in messages) + { + var formatted = MessageFormatter.FormatMessage(message); + messagesFlow.Add(new MatchMessage(formatted) { Y = messagesFlow.Height }); + } + } + + private class MatchMessage : CompositeDrawable + { + private readonly Message message; + + public MatchMessage(Message message) + { + this.message = message; + } + + private readonly Color4 red = new Color4(186, 0, 18, 255); + private readonly Color4 blue = new Color4(17, 136, 170, 255); + + [BackgroundDependencyLoader] + private void load(LadderInfo info) + { + Circle colourBox; + + Margin = new MarginPadding(3); + + RelativeSizeAxes = Axes.X; + AutoSizeAxes = Axes.Y; + + OsuSpriteText senderText; + InternalChildren = new Drawable[] + { + new FillFlowContainer + { + RelativeSizeAxes = Axes.X, + AutoSizeAxes = Axes.Y, + Direction = FillDirection.Horizontal, + Children = new Drawable[] + { + new Container + { + RelativeSizeAxes = Axes.X, + Width = 0.2f, + Children = new Drawable[] + { + senderText = new OsuSpriteText + { + Font = @"Exo2.0-Bold", + Anchor = Anchor.TopRight, + Origin = Anchor.TopRight, + Text = message.Sender.ToString() + } + } + }, + new Container + { + Size = new Vector2(8, OsuSpriteText.FONT_SIZE), + Margin = new MarginPadding { Horizontal = 3 }, + Children = new Drawable[] + { + colourBox = new Circle + { + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + Size = new Vector2(8), + }, + } + }, + new OsuTextFlowContainer + { + RelativeSizeAxes = Axes.X, + AutoSizeAxes = Axes.Y, + Width = 0.5f, + Text = message.DisplayContent + } + } + }, + }; + + if (message.Sender.Colour != null) + { + senderText.Colour = colourBox.Colour = OsuColour.FromHex(message.Sender.Colour); + } + else if (info.CurrentMatch.Value.Team1.Value.Players.Any(u => u.Id == message.Sender.Id)) + { + colourBox.Colour = red; + } + else if (info.CurrentMatch.Value.Team2.Value.Players.Any(u => u.Id == message.Sender.Id)) + { + colourBox.Colour = blue; + } + } + } + } +} diff --git a/osu.Game/Online/Chat/Message.cs b/osu.Game/Online/Chat/Message.cs index 3f0f352ac7..2eb3ca70c2 100644 --- a/osu.Game/Online/Chat/Message.cs +++ b/osu.Game/Online/Chat/Message.cs @@ -13,10 +13,6 @@ namespace osu.Game.Online.Chat [JsonProperty(@"message_id")] public readonly long? Id; - //todo: this should be inside sender. - [JsonProperty(@"sender_id")] - public long UserId; - [JsonProperty(@"channel_id")] public long ChannelId; From c9e2ee8f5623c229248b4618022d7024b05b0448 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 16 Nov 2018 18:14:42 +0900 Subject: [PATCH 133/317] Fix masking of song bar --- osu.Game.Tournament/Components/SongBar.cs | 39 ++++++++++++------- .../Components/TournamentBeatmapPanel.cs | 2 +- .../Screens/Gameplay/GameplayScreen.cs | 6 +++ 3 files changed, 32 insertions(+), 15 deletions(-) diff --git a/osu.Game.Tournament/Components/SongBar.cs b/osu.Game.Tournament/Components/SongBar.cs index d145544b76..94848b9130 100644 --- a/osu.Game.Tournament/Components/SongBar.cs +++ b/osu.Game.Tournament/Components/SongBar.cs @@ -48,14 +48,23 @@ namespace osu.Game.Tournament.Components private Container panelContents; private Container innerPanel; private Container outerPanel; + private TournamentBeatmapPanel panel; + + private float panelWidth => expanded ? 0.6f : 1; private const float main_width = 0.97f; + private bool expanded; + public bool Expanded { + get => expanded; set { - if (value) + expanded = value; + panel.ResizeWidthTo(panelWidth, 800, Easing.OutQuint); + + if (expanded) { innerPanel.ResizeWidthTo(0.7f, 800, Easing.OutQuint); outerPanel.ResizeWidthTo(main_width, 800, Easing.OutQuint); @@ -63,7 +72,7 @@ namespace osu.Game.Tournament.Components else { innerPanel.ResizeWidthTo(1, 800, Easing.OutQuint); - outerPanel.ResizeWidthTo(0.3f, 800, Easing.OutQuint); + outerPanel.ResizeWidthTo(0.2f, 800, Easing.OutQuint); } } } @@ -91,7 +100,7 @@ namespace osu.Game.Tournament.Components RelativePositionAxes = Axes.X, X = -(1 - main_width) / 2, Y = -10, - Width = 0.95f, + Width = main_width, Height = TournamentBeatmapPanel.HEIGHT, CornerRadius = TournamentBeatmapPanel.HEIGHT / 2, Children = new Drawable[] @@ -101,6 +110,15 @@ namespace osu.Game.Tournament.Components RelativeSizeAxes = Axes.Both, Colour = OsuColour.Gray(0.93f), }, + new OsuLogo + { + Triangles = false, + Colour = OsuColour.Gray(0.33f), + Scale = new Vector2(0.08f), + Margin = new MarginPadding(50), + Anchor = Anchor.CentreRight, + Origin = Anchor.CentreRight, + }, innerPanel = new Container { Masking = true, @@ -121,15 +139,6 @@ namespace osu.Game.Tournament.Components RelativeSizeAxes = Axes.Both, } } - }, - new OsuLogo - { - Triangles = false, - Colour = OsuColour.Gray(0.33f), - Scale = new Vector2(0.08f), - Margin = new MarginPadding(50), - Anchor = Anchor.CentreRight, - Origin = Anchor.CentreRight, } } } @@ -193,10 +202,12 @@ namespace osu.Game.Tournament.Components Anchor = Anchor.BottomRight, Origin = Anchor.BottomRight }, - new TournamentBeatmapPanel(beatmap) + panel = new TournamentBeatmapPanel(beatmap) { Anchor = Anchor.Centre, - Origin = Anchor.Centre + Origin = Anchor.Centre, + RelativeSizeAxes = Axes.Both, + Size = new Vector2(panelWidth, 1) } }; } diff --git a/osu.Game.Tournament/Components/TournamentBeatmapPanel.cs b/osu.Game.Tournament/Components/TournamentBeatmapPanel.cs index d2bc790b16..4456abb48e 100644 --- a/osu.Game.Tournament/Components/TournamentBeatmapPanel.cs +++ b/osu.Game.Tournament/Components/TournamentBeatmapPanel.cs @@ -44,7 +44,7 @@ namespace osu.Game.Tournament.Components currentMatch.BindValueChanged(matchChanged); currentMatch.BindTo(ladder.CurrentMatch); - CornerRadius = 25; + CornerRadius = HEIGHT / 2; Masking = true; AddRangeInternal(new Drawable[] diff --git a/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs b/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs index a86c47839b..d3fd08bb8b 100644 --- a/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs +++ b/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs @@ -91,6 +91,12 @@ namespace osu.Game.Tournament.Screens.Gameplay RelativeSizeAxes = Axes.X, Text = "Toggle warmup", Action = () => warmup.Toggle() + }, + new TriangleButton + { + RelativeSizeAxes = Axes.X, + Text = "Toggle chat", + Action = () => { State.Value = State.Value == TourneyState.Idle ? TourneyState.Playing : TourneyState.Idle; } } } } From e3e92f430221b2e477632a7eceb1a11684d53383 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 16 Nov 2018 19:43:54 +0900 Subject: [PATCH 134/317] Add chat IPC and gameplay screen integration --- .../Components/MatchChatDisplay.cs | 38 ++++++++++++++++++- osu.Game.Tournament/Components/SongBar.cs | 4 +- osu.Game.Tournament/IPC/FileBasedIPC.cs | 1 + osu.Game.Tournament/IPC/MatchIPCInfo.cs | 1 + .../Screens/Gameplay/GameplayScreen.cs | 23 ++++++++++- osu.Game/Online/Chat/ChannelType.cs | 3 +- 6 files changed, 63 insertions(+), 7 deletions(-) diff --git a/osu.Game.Tournament/Components/MatchChatDisplay.cs b/osu.Game.Tournament/Components/MatchChatDisplay.cs index a68507044d..c44eb88ef8 100644 --- a/osu.Game.Tournament/Components/MatchChatDisplay.cs +++ b/osu.Game.Tournament/Components/MatchChatDisplay.cs @@ -12,6 +12,7 @@ using osu.Game.Graphics; using osu.Game.Graphics.Containers; using osu.Game.Graphics.Sprites; using osu.Game.Online.Chat; +using osu.Game.Tournament.IPC; using OpenTK; using OpenTK.Graphics; @@ -25,7 +26,7 @@ namespace osu.Game.Tournament.Components public MatchChatDisplay() { - CornerRadius = 5; + CornerRadius = 10; Masking = true; InternalChildren = new Drawable[] @@ -51,13 +52,46 @@ namespace osu.Game.Tournament.Components Channel.BindValueChanged(channelChanged); } + private readonly Bindable chatChannel = new Bindable(); + + private ChannelManager manager; + + [BackgroundDependencyLoader(true)] + private void load(MatchIPCInfo ipc) + { + if (ipc != null) + { + AddInternal(manager = new ChannelManager()); + + Channel.BindTo(manager.CurrentChannel); + + chatChannel.BindTo(ipc.ChatChannel); + chatChannel.BindValueChanged(channelString => + { + if (string.IsNullOrWhiteSpace(channelString)) + return; + + int id = int.Parse(channelString); + + var channel = manager.JoinedChannels.FirstOrDefault(ch => ch.Id == id) ?? new Channel + { + Id = id, + Type = ChannelType.Public + }; + + manager.JoinChannel(channel); + manager.CurrentChannel.Value = channel; + + }, true); + } + } + private void channelChanged(Channel channel) { if (lastChannel != null) lastChannel.NewMessagesArrived -= newMessages; lastChannel = channel; - channel.NewMessagesArrived += newMessages; } diff --git a/osu.Game.Tournament/Components/SongBar.cs b/osu.Game.Tournament/Components/SongBar.cs index 94848b9130..53dec8e0a4 100644 --- a/osu.Game.Tournament/Components/SongBar.cs +++ b/osu.Game.Tournament/Components/SongBar.cs @@ -62,7 +62,7 @@ namespace osu.Game.Tournament.Components set { expanded = value; - panel.ResizeWidthTo(panelWidth, 800, Easing.OutQuint); + panel?.ResizeWidthTo(panelWidth, 800, Easing.OutQuint); if (expanded) { @@ -72,7 +72,7 @@ namespace osu.Game.Tournament.Components else { innerPanel.ResizeWidthTo(1, 800, Easing.OutQuint); - outerPanel.ResizeWidthTo(0.2f, 800, Easing.OutQuint); + outerPanel.ResizeWidthTo(0.25f, 800, Easing.OutQuint); } } } diff --git a/osu.Game.Tournament/IPC/FileBasedIPC.cs b/osu.Game.Tournament/IPC/FileBasedIPC.cs index 6759122c16..87c6fb4c83 100644 --- a/osu.Game.Tournament/IPC/FileBasedIPC.cs +++ b/osu.Game.Tournament/IPC/FileBasedIPC.cs @@ -53,6 +53,7 @@ namespace osu.Game.Tournament.IPC } Mods.Value = (LegacyMods)mods; + ChatChannel.Value = sr.ReadLine(); } } catch diff --git a/osu.Game.Tournament/IPC/MatchIPCInfo.cs b/osu.Game.Tournament/IPC/MatchIPCInfo.cs index d40ec35808..be31df8009 100644 --- a/osu.Game.Tournament/IPC/MatchIPCInfo.cs +++ b/osu.Game.Tournament/IPC/MatchIPCInfo.cs @@ -13,6 +13,7 @@ namespace osu.Game.Tournament.IPC public Bindable Beatmap { get; } = new Bindable(); public Bindable Mods { get; } = new Bindable(); public Bindable State { get; } = new Bindable(); + public Bindable ChatChannel { get; } = new Bindable(); public BindableInt Score1 { get; } = new BindableInt(); public BindableInt Score2 { get; } = new BindableInt(); } diff --git a/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs b/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs index d3fd08bb8b..3c6ea39ae7 100644 --- a/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs +++ b/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs @@ -13,6 +13,7 @@ using osu.Game.Tournament.Components; using osu.Game.Tournament.IPC; using osu.Game.Tournament.Screens.Gameplay.Components; using osu.Game.Tournament.Screens.Ladder.Components; +using OpenTK; using OpenTK.Graphics; namespace osu.Game.Tournament.Screens.Gameplay @@ -82,6 +83,14 @@ namespace osu.Game.Tournament.Screens.Gameplay }, } }, + chat = new MatchChatDisplay + { + RelativeSizeAxes = Axes.X, + Size = new Vector2(0.45f, 120), + Margin = new MarginPadding(10), + Anchor = Anchor.BottomCentre, + Origin = Anchor.BottomCentre, + }, new ControlPanel { Children = new Drawable[] @@ -102,8 +111,8 @@ namespace osu.Game.Tournament.Screens.Gameplay } }); - State.BindValueChanged(stateChanged); State.BindTo(ipc.State); + State.BindValueChanged(stateChanged, true); currentMatch.BindValueChanged(m => warmup.Value = m.Team1Score + m.Team2Score == 0); currentMatch.BindTo(ladder.CurrentMatch); @@ -112,6 +121,7 @@ namespace osu.Game.Tournament.Screens.Gameplay } private ScheduledDelegate scheduledBarContract; + private MatchChatDisplay chat; private void stateChanged(TourneyState state) { @@ -132,12 +142,21 @@ namespace osu.Game.Tournament.Screens.Gameplay case TourneyState.Idle: // show chat SongBar.Expanded = false; + using (chat.BeginDelayedSequence(500)) + { + chat.FadeIn(300); + chat.MoveToY(100).MoveToY(0, 500, Easing.OutQuint); + } + break; case TourneyState.Ranking: scheduledBarContract = Scheduler.AddDelayed(() => SongBar.Expanded = false, 15000); break; default: - SongBar.Expanded = true; + chat.FadeOut(200); + chat.MoveToY(100, 500, Easing.In); + using (SongBar.BeginDelayedSequence(300, true)) + SongBar.Expanded = true; break; } } diff --git a/osu.Game/Online/Chat/ChannelType.cs b/osu.Game/Online/Chat/ChannelType.cs index 4ac0a99fc6..2fbc48fb92 100644 --- a/osu.Game/Online/Chat/ChannelType.cs +++ b/osu.Game/Online/Chat/ChannelType.cs @@ -6,6 +6,7 @@ namespace osu.Game.Online.Chat public enum ChannelType { PM, - Public + Public, + Temporary } } From 5801ed7b1ae88d0c2bf8bd0477f893a730121c87 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 16 Nov 2018 19:49:17 +0900 Subject: [PATCH 135/317] Adjust spacing on map pool screen --- osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs b/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs index c2cefd8c41..65f4bfb149 100644 --- a/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs +++ b/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs @@ -42,7 +42,7 @@ namespace osu.Game.Tournament.Screens.MapPool maps = new FillFlowContainer { Y = 100, - Spacing = new Vector2(10), + Spacing = new Vector2(10, 20), Padding = new MarginPadding(50), Direction = FillDirection.Full, RelativeSizeAxes = Axes.Both, From 67bb428aefdaf9625b9334d651a18ab076ea5831 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 16 Nov 2018 20:14:34 +0900 Subject: [PATCH 136/317] Move editing functionality to its own screen --- .../TestCaseLadderManager.cs | 2 +- .../Ladder/Components/DrawableMatchPairing.cs | 18 +- .../Ladder/Components/DrawableMatchTeam.cs | 16 +- .../Ladder/Components/LadderEditorInfo.cs | 1 - .../Ladder/Components/LadderEditorSettings.cs | 15 - .../Screens/Ladder/Components/MatchPairing.cs | 2 +- .../Screens/Ladder/LadderEditorScreen.cs | 166 +++++++++++ .../Screens/Ladder/LadderManager.cs | 259 ------------------ .../Screens/Ladder/LadderScreen.cs | 135 +++++++++ .../Screens/TournamentSceneManager.cs | 8 +- osu.Game.Tournament/TournamentGameBase.cs | 4 - 11 files changed, 328 insertions(+), 298 deletions(-) create mode 100644 osu.Game.Tournament/Screens/Ladder/LadderEditorScreen.cs delete mode 100644 osu.Game.Tournament/Screens/Ladder/LadderManager.cs create mode 100644 osu.Game.Tournament/Screens/Ladder/LadderScreen.cs diff --git a/osu.Game.Tournament.Tests/TestCaseLadderManager.cs b/osu.Game.Tournament.Tests/TestCaseLadderManager.cs index 63c8f5e391..3001f46ed2 100644 --- a/osu.Game.Tournament.Tests/TestCaseLadderManager.cs +++ b/osu.Game.Tournament.Tests/TestCaseLadderManager.cs @@ -16,7 +16,7 @@ namespace osu.Game.Tournament.Tests Add(new OsuContextMenuContainer { RelativeSizeAxes = Axes.Both, - Child = new LadderManager() + Child = new LadderScreen() }); } } diff --git a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs index def53ce510..0e9baf33d2 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs @@ -30,8 +30,6 @@ namespace osu.Game.Tournament.Screens.Ladder.Components { Pairing = pairing; - Position = new Vector2(pairing.Position.X, pairing.Position.Y); - AutoSizeAxes = Axes.Both; Margin = new MarginPadding(5); @@ -69,6 +67,7 @@ namespace osu.Game.Tournament.Screens.Ladder.Components Spacing = new Vector2(2) } }; + pairing.Team1.BindValueChanged(_ => updateTeams()); pairing.Team2.BindValueChanged(_ => updateTeams()); pairing.Team1Score.BindValueChanged(_ => updateWinConditions()); @@ -79,6 +78,11 @@ namespace osu.Game.Tournament.Screens.Ladder.Components pairing.LosersProgression.BindValueChanged(_ => updateProgression()); pairing.Losers.BindValueChanged(_ => updateTeams()); pairing.Current.BindValueChanged(_ => updateCurrentMatch(), true); + pairing.Position.BindValueChanged(pos => + { + if (IsDragged) return; + Position = new Vector2(pos.X, pos.Y); + }, true); updateTeams(); } @@ -205,13 +209,13 @@ namespace osu.Game.Tournament.Screens.Ladder.Components updateWinConditions(); } - protected override bool OnMouseDown(MouseDownEvent e) => e.Button == MouseButton.Left && editorInfo.EditingEnabled; + protected override bool OnMouseDown(MouseDownEvent e) => e.Button == MouseButton.Left && editorInfo != null; - protected override bool OnDragStart(DragStartEvent e) => editorInfo.EditingEnabled; + protected override bool OnDragStart(DragStartEvent e) => editorInfo != null; protected override bool OnKeyDown(KeyDownEvent e) { - if (Selected && editorInfo.EditingEnabled && e.Key == Key.Delete) + if (Selected && editorInfo != null && e.Key == Key.Delete) { Remove(); return true; @@ -222,7 +226,7 @@ namespace osu.Game.Tournament.Screens.Ladder.Components protected override bool OnClick(ClickEvent e) { - if (!editorInfo.EditingEnabled) + if (editorInfo == null) return false; Selected = true; @@ -237,7 +241,7 @@ namespace osu.Game.Tournament.Screens.Ladder.Components this.MoveToOffset(e.Delta); var pos = Position; - Pairing.Position = new Point((int)pos.X, (int)pos.Y); + Pairing.Position.Value = new Point((int)pos.X, (int)pos.Y); return true; } diff --git a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs index 7ff15ef434..be09443684 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs @@ -34,7 +34,7 @@ namespace osu.Game.Tournament.Screens.Ladder.Components private Color4 colourNormal; private readonly Func isWinner; - private LadderManager manager; + private LadderEditorScreen ladderEditor; [Resolved] private LadderInfo ladderInfo { get; set; } @@ -80,9 +80,9 @@ namespace osu.Game.Tournament.Screens.Ladder.Components } [BackgroundDependencyLoader(true)] - private void load(OsuColour colours, LadderManager manager) + private void load(OsuColour colours, LadderEditorScreen ladderEditor) { - this.manager = manager; + this.ladderEditor = ladderEditor; colourWinner = losers ? colours.YellowDarker : colours.BlueDarker; colourNormal = OsuColour.Gray(0.2f); @@ -141,7 +141,7 @@ namespace osu.Game.Tournament.Screens.Ladder.Components //TODO: use OnClick instead once we have per-button clicks. protected override bool OnClick(ClickEvent e) { - if (Team == null || editorInfo.EditingEnabled) return false; + if (Team == null || editorInfo != null) return false; if (!pairing.Current.Value) { @@ -190,15 +190,15 @@ namespace osu.Game.Tournament.Screens.Ladder.Components { get { - if (!editorInfo.EditingEnabled) + if (editorInfo == null) return new MenuItem[0]; return new MenuItem[] { new OsuMenuItem("Set as current", MenuItemType.Standard, setCurrent), - new OsuMenuItem("Join with", MenuItemType.Standard, () => manager.RequestJoin(pairing, false)), - new OsuMenuItem("Join with (loser)", MenuItemType.Standard, () => manager.RequestJoin(pairing, true)), - new OsuMenuItem("Remove", MenuItemType.Destructive, () => manager.Remove(pairing)), + new OsuMenuItem("Join with", MenuItemType.Standard, () => ladderEditor.RequestJoin(pairing, false)), + new OsuMenuItem("Join with (loser)", MenuItemType.Standard, () => ladderEditor.RequestJoin(pairing, true)), + new OsuMenuItem("Remove", MenuItemType.Destructive, () => ladderEditor.Remove(pairing)), }; } } diff --git a/osu.Game.Tournament/Screens/Ladder/Components/LadderEditorInfo.cs b/osu.Game.Tournament/Screens/Ladder/Components/LadderEditorInfo.cs index 0ecf387f7c..1fd9455195 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/LadderEditorInfo.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/LadderEditorInfo.cs @@ -7,7 +7,6 @@ namespace osu.Game.Tournament.Screens.Ladder.Components { public class LadderEditorInfo { - public readonly BindableBool EditingEnabled = new BindableBool(); public readonly Bindable Selected = new Bindable(); } } diff --git a/osu.Game.Tournament/Screens/Ladder/Components/LadderEditorSettings.cs b/osu.Game.Tournament/Screens/Ladder/Components/LadderEditorSettings.cs index afb20a68f0..90f20a3494 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/LadderEditorSettings.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/LadderEditorSettings.cs @@ -39,11 +39,6 @@ namespace osu.Game.Tournament.Screens.Ladder.Components Children = new Drawable[] { - new PlayerCheckbox - { - Bindable = editorInfo.EditingEnabled, - LabelText = "Enable editing" - }, new Container { RelativeSizeAxes = Axes.X, @@ -119,16 +114,6 @@ namespace osu.Game.Tournament.Screens.Ladder.Components if (editorInfo.Selected.Value != null) editorInfo.Selected.Value.Losers.Value = losers; }; - - // sliderBestOf.Bindable.ValueChanged += val => - // { - // if (editorInfo.Selected.Value != null) editorInfo.Selected.Value.BestOf.Value = (int)val; - // }; - - editorInfo.EditingEnabled.ValueChanged += enabled => - { - if (!enabled) editorInfo.Selected.Value = null; - }; } } } diff --git a/osu.Game.Tournament/Screens/Ladder/Components/MatchPairing.cs b/osu.Game.Tournament/Screens/Ladder/Components/MatchPairing.cs index 729249c3d7..003f41cfa9 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/MatchPairing.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/MatchPairing.cs @@ -53,7 +53,7 @@ namespace osu.Game.Tournament.Screens.Ladder.Components public readonly Bindable Date = new Bindable(); - public Point Position; + public readonly Bindable Position = new Bindable(); public MatchPairing() { diff --git a/osu.Game.Tournament/Screens/Ladder/LadderEditorScreen.cs b/osu.Game.Tournament/Screens/Ladder/LadderEditorScreen.cs new file mode 100644 index 0000000000..cebf7bb682 --- /dev/null +++ b/osu.Game.Tournament/Screens/Ladder/LadderEditorScreen.cs @@ -0,0 +1,166 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System; +using System.Linq; +using osu.Framework.Allocation; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Cursor; +using osu.Framework.Graphics.UserInterface; +using osu.Framework.Input.Events; +using osu.Framework.Input.States; +using osu.Game.Graphics.UserInterface; +using osu.Game.Tournament.Screens.Ladder.Components; +using OpenTK; +using OpenTK.Graphics; +using SixLabors.Primitives; + +namespace osu.Game.Tournament.Screens.Ladder +{ + [Cached] + public class LadderEditorScreen : LadderScreen, IHasContextMenu + { + [Cached] + private LadderEditorInfo editorInfo = new LadderEditorInfo(); + + [BackgroundDependencyLoader] + private void load() + { + ((Container)InternalChild).Add(new LadderEditorSettings + { + Anchor = Anchor.TopRight, + Origin = Anchor.TopRight, + Margin = new MarginPadding(5) + }); + } + + private void updateInfo() + { + LadderInfo.Pairings = PairingsContainer.Select(p => p.Pairing).ToList(); + foreach (var g in LadderInfo.Groupings) + g.Pairings = LadderInfo.Pairings.Where(p => p.Grouping.Value == g).Select(p => p.ID).ToList(); + + LadderInfo.Progressions = LadderInfo.Pairings.Where(p => p.Progression.Value != null).Select(p => new TournamentProgression(p.ID, p.Progression.Value.ID)).Concat( + LadderInfo.Pairings.Where(p => p.LosersProgression.Value != null).Select(p => new TournamentProgression(p.ID, p.LosersProgression.Value.ID, true))) + .ToList(); + } + + protected override void AddPairing(MatchPairing pairing) + { + base.AddPairing(pairing); + updateInfo(); + } + + protected override void UpdateLayout() + { + base.UpdateLayout(); + updateInfo(); + } + + public void RequestJoin(MatchPairing pairing, bool losers) + { + ScrollContent.Add(new JoinRequestHandler(PairingsContainer, pairing, losers, updateInfo)); + } + + public MenuItem[] ContextMenuItems + { + get + { + if (editorInfo == null) + return new MenuItem[0]; + + return new MenuItem[] + { + new OsuMenuItem("Create new match", MenuItemType.Highlighted, () => + { + var pos = PairingsContainer.ToLocalSpace(GetContainingInputManager().CurrentState.Mouse.Position); + AddPairing(new MatchPairing { Position = { Value = new Point((int)pos.X, (int)pos.Y) } }); + }), + }; + } + } + + public void Remove(MatchPairing pairing) + { + PairingsContainer.FirstOrDefault(p => p.Pairing == pairing)?.Remove(); + } + + private class JoinRequestHandler : CompositeDrawable + { + private readonly Container pairingsContainer; + public readonly MatchPairing Source; + private readonly bool losers; + private readonly Action complete; + + private ProgressionPath path; + + public JoinRequestHandler(Container pairingsContainer, MatchPairing source, bool losers, Action complete) + { + this.pairingsContainer = pairingsContainer; + RelativeSizeAxes = Axes.Both; + + Source = source; + this.losers = losers; + this.complete = complete; + if (losers) + Source.LosersProgression.Value = null; + else + Source.Progression.Value = null; + } + + private DrawableMatchPairing findTarget(InputState state) + { + return pairingsContainer.FirstOrDefault(d => d.ReceivePositionalInputAt(state.Mouse.Position)); + } + + public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) + { + return true; + } + + protected override bool OnMouseMove(MouseMoveEvent e) + { + var found = findTarget(e.CurrentState); + + if (found == path?.Destination) + return false; + + path?.Expire(); + path = null; + + if (found == null) + return false; + + AddInternal(path = new ProgressionPath(pairingsContainer.First(c => c.Pairing == Source), found) + { + Colour = Color4.Yellow, + }); + + return base.OnMouseMove(e); + } + + protected override bool OnClick(ClickEvent e) + { + var found = findTarget(e.CurrentState); + + if (found != null) + { + if (found.Pairing != Source) + { + if (losers) + Source.LosersProgression.Value = found.Pairing; + else + Source.Progression.Value = found.Pairing; + } + + complete?.Invoke(); + Expire(); + return true; + } + + return false; + } + } + } +} diff --git a/osu.Game.Tournament/Screens/Ladder/LadderManager.cs b/osu.Game.Tournament/Screens/Ladder/LadderManager.cs deleted file mode 100644 index 2b1a1bad85..0000000000 --- a/osu.Game.Tournament/Screens/Ladder/LadderManager.cs +++ /dev/null @@ -1,259 +0,0 @@ -// Copyright (c) 2007-2018 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE - -using System; -using System.Linq; -using osu.Framework.Allocation; -using osu.Framework.Caching; -using osu.Framework.Extensions.Color4Extensions; -using osu.Framework.Graphics; -using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Cursor; -using osu.Framework.Graphics.Lines; -using osu.Framework.Graphics.UserInterface; -using osu.Framework.Input.Events; -using osu.Framework.Input.States; -using osu.Game.Graphics; -using osu.Game.Graphics.UserInterface; -using osu.Game.Tournament.Screens.Ladder.Components; -using OpenTK; -using OpenTK.Graphics; -using SixLabors.Primitives; - -namespace osu.Game.Tournament.Screens.Ladder -{ - [Cached] - public class LadderManager : TournamentScreen, IHasContextMenu - { - private Container pairingsContainer; - private Container paths; - private Container headings; - - private ScrollableContainer scrollContent; - - [Resolved] - private LadderEditorInfo editorInfo { get; set;} - - [Resolved] - private LadderInfo ladderInfo { get; set; } - - [BackgroundDependencyLoader] - private void load(OsuColour colours) - { - normalPathColour = colours.BlueDarker.Darken(2); - losersPathColour = colours.YellowDarker.Darken(2); - - RelativeSizeAxes = Axes.Both; - - InternalChild = new Container - { - RelativeSizeAxes = Axes.Both, - Children = new Drawable[] - { - scrollContent = new ScrollableContainer - { - RelativeSizeAxes = Axes.Both, - Children = new Drawable[] - { - paths = new Container { RelativeSizeAxes = Axes.Both }, - headings = new Container { RelativeSizeAxes = Axes.Both }, - pairingsContainer = new Container { RelativeSizeAxes = Axes.Both }, - } - }, - new LadderEditorSettings - { - Anchor = Anchor.TopRight, - Origin = Anchor.TopRight, - Margin = new MarginPadding(5) - } - } - }; - - foreach (var pairing in ladderInfo.Pairings) - addPairing(pairing); - - // todo: fix this - Scheduler.AddDelayed(() => layout.Invalidate(), 100, true); - } - - private void updateInfo() - { - ladderInfo.Pairings = pairingsContainer.Select(p => p.Pairing).ToList(); - foreach (var g in ladderInfo.Groupings) - g.Pairings = ladderInfo.Pairings.Where(p => p.Grouping.Value == g).Select(p => p.ID).ToList(); - - ladderInfo.Progressions = ladderInfo.Pairings.Where(p => p.Progression.Value != null).Select(p => new TournamentProgression(p.ID, p.Progression.Value.ID)).Concat( - ladderInfo.Pairings.Where(p => p.LosersProgression.Value != null).Select(p => new TournamentProgression(p.ID, p.LosersProgression.Value.ID, true))) - .ToList(); - } - - private void addPairing(MatchPairing pairing) - { - pairingsContainer.Add(new DrawableMatchPairing(pairing)); - updateInfo(); - } - - public MenuItem[] ContextMenuItems - { - get - { - if (!editorInfo.EditingEnabled) - return new MenuItem[0]; - - return new MenuItem[] - { - new OsuMenuItem("Create new match", MenuItemType.Highlighted, () => - { - var pos = pairingsContainer.ToLocalSpace(GetContainingInputManager().CurrentState.Mouse.Position); - addPairing(new MatchPairing { Position = new Point((int)pos.X, (int)pos.Y) }); - }), - }; - } - } - - private Cached layout = new Cached(); - - protected override void Update() - { - base.Update(); - - if (!layout.IsValid) - updateLayout(); - } - - private Color4 normalPathColour; - private Color4 losersPathColour; - - private void updateLayout() - { - paths.Clear(); - headings.Clear(); - - int id = 1; - foreach (var pairing in pairingsContainer.OrderBy(d => d.Y).ThenBy(d => d.X)) - { - pairing.Pairing.ID = id++; - - if (pairing.Pairing.Progression.Value != null) - { - var dest = pairingsContainer.FirstOrDefault(p => p.Pairing == pairing.Pairing.Progression.Value); - - if (dest == null) - // clean up outdated progressions. - pairing.Pairing.Progression.Value = null; - else - paths.Add(new ProgressionPath(pairing, dest) { Colour = pairing.Pairing.Losers ? losersPathColour : normalPathColour }); - } - } - - foreach (var group in ladderInfo.Groupings) - { - var topPairing = pairingsContainer.Where(p => !p.Pairing.Losers && p.Pairing.Grouping.Value == group).OrderBy(p => p.Y).FirstOrDefault(); - - if (topPairing == null) continue; - - headings.Add(new DrawableTournamentGrouping(group) - { - Position = headings.ToLocalSpace((topPairing.ScreenSpaceDrawQuad.TopLeft + topPairing.ScreenSpaceDrawQuad.TopRight) / 2), - Margin = new MarginPadding { Bottom = 10 }, - Origin = Anchor.BottomCentre, - }); - } - - foreach (var group in ladderInfo.Groupings) - { - var topPairing = pairingsContainer.Where(p => p.Pairing.Losers && p.Pairing.Grouping.Value == group).OrderBy(p => p.Y).FirstOrDefault(); - - if (topPairing == null) continue; - - headings.Add(new DrawableTournamentGrouping(group, true) - { - Position = headings.ToLocalSpace((topPairing.ScreenSpaceDrawQuad.TopLeft + topPairing.ScreenSpaceDrawQuad.TopRight) / 2), - Margin = new MarginPadding { Bottom = 10 }, - Origin = Anchor.BottomCentre, - }); - } - - layout.Validate(); - updateInfo(); - } - - public void RequestJoin(MatchPairing pairing, bool losers) => scrollContent.Add(new JoinRequestHandler(pairingsContainer, pairing, losers, updateInfo)); - - // todo: remove after ppy/osu-framework#1980 is merged. - public override bool HandlePositionalInput => true; - - public void Remove(MatchPairing pairing) => pairingsContainer.FirstOrDefault(p => p.Pairing == pairing)?.Remove(); - - private class JoinRequestHandler : CompositeDrawable - { - private readonly Container pairingsContainer; - public readonly MatchPairing Source; - private readonly bool losers; - private readonly Action complete; - - private ProgressionPath path; - - public JoinRequestHandler(Container pairingsContainer, MatchPairing source, bool losers, Action complete) - { - this.pairingsContainer = pairingsContainer; - RelativeSizeAxes = Axes.Both; - - Source = source; - this.losers = losers; - this.complete = complete; - if (losers) - Source.LosersProgression.Value = null; - else - Source.Progression.Value = null; - } - - private DrawableMatchPairing findTarget(InputState state) => pairingsContainer.FirstOrDefault(d => d.ReceivePositionalInputAt(state.Mouse.Position)); - - public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => true; - - protected override bool OnMouseMove(MouseMoveEvent e) - { - var found = findTarget(e.CurrentState); - - if (found == path?.Destination) - return false; - - path?.Expire(); - path = null; - - if (found == null) - return false; - - AddInternal(path = new ProgressionPath(pairingsContainer.First(c => c.Pairing == Source), found) - { - Colour = Color4.Yellow, - }); - - return base.OnMouseMove(e); - } - - protected override bool OnClick(ClickEvent e) - { - var found = findTarget(e.CurrentState); - - if (found != null) - { - if (found.Pairing != Source) - { - if (losers) - Source.LosersProgression.Value = found.Pairing; - else - Source.Progression.Value = found.Pairing; - } - - complete?.Invoke(); - Expire(); - return true; - } - - return false; - } - } - } -} diff --git a/osu.Game.Tournament/Screens/Ladder/LadderScreen.cs b/osu.Game.Tournament/Screens/Ladder/LadderScreen.cs new file mode 100644 index 0000000000..69035c21db --- /dev/null +++ b/osu.Game.Tournament/Screens/Ladder/LadderScreen.cs @@ -0,0 +1,135 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System.Linq; +using osu.Framework.Allocation; +using osu.Framework.Caching; +using osu.Framework.Extensions.Color4Extensions; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Lines; +using osu.Game.Graphics; +using osu.Game.Tournament.Screens.Ladder.Components; +using OpenTK.Graphics; + +namespace osu.Game.Tournament.Screens.Ladder +{ + public class LadderScreen : TournamentScreen + { + protected Container PairingsContainer; + private Container paths; + private Container headings; + + protected ScrollableContainer ScrollContent; + + [Resolved] + protected LadderInfo LadderInfo { get; private set; } + + [BackgroundDependencyLoader] + private void load(OsuColour colours) + { + normalPathColour = colours.BlueDarker.Darken(2); + losersPathColour = colours.YellowDarker.Darken(2); + + RelativeSizeAxes = Axes.Both; + + InternalChild = new Container + { + RelativeSizeAxes = Axes.Both, + Children = new Drawable[] + { + ScrollContent = new ScrollableContainer + { + RelativeSizeAxes = Axes.Both, + Children = new Drawable[] + { + paths = new Container { RelativeSizeAxes = Axes.Both }, + headings = new Container { RelativeSizeAxes = Axes.Both }, + PairingsContainer = new Container { RelativeSizeAxes = Axes.Both }, + } + }, + } + }; + + foreach (var pairing in LadderInfo.Pairings) + AddPairing(pairing); + + // todo: fix this + Scheduler.AddDelayed(() => layout.Invalidate(), 100, true); + } + + protected virtual void AddPairing(MatchPairing pairing) + { + PairingsContainer.Add(new DrawableMatchPairing(pairing)); + } + + private Cached layout = new Cached(); + + protected override void Update() + { + base.Update(); + + if (!layout.IsValid) + UpdateLayout(); + } + + private Color4 normalPathColour; + private Color4 losersPathColour; + + protected virtual void UpdateLayout() + { + paths.Clear(); + headings.Clear(); + + int id = 1; + foreach (var pairing in PairingsContainer.OrderBy(d => d.Y).ThenBy(d => d.X)) + { + pairing.Pairing.ID = id++; + + if (pairing.Pairing.Progression.Value != null) + { + var dest = PairingsContainer.FirstOrDefault(p => p.Pairing == pairing.Pairing.Progression.Value); + + if (dest == null) + // clean up outdated progressions. + pairing.Pairing.Progression.Value = null; + else + paths.Add(new ProgressionPath(pairing, dest) { Colour = pairing.Pairing.Losers ? losersPathColour : normalPathColour }); + } + } + + foreach (var group in LadderInfo.Groupings) + { + var topPairing = PairingsContainer.Where(p => !p.Pairing.Losers && p.Pairing.Grouping.Value == group).OrderBy(p => p.Y).FirstOrDefault(); + + if (topPairing == null) continue; + + headings.Add(new DrawableTournamentGrouping(group) + { + Position = headings.ToLocalSpace((topPairing.ScreenSpaceDrawQuad.TopLeft + topPairing.ScreenSpaceDrawQuad.TopRight) / 2), + Margin = new MarginPadding { Bottom = 10 }, + Origin = Anchor.BottomCentre, + }); + } + + foreach (var group in LadderInfo.Groupings) + { + var topPairing = PairingsContainer.Where(p => p.Pairing.Losers && p.Pairing.Grouping.Value == group).OrderBy(p => p.Y).FirstOrDefault(); + + if (topPairing == null) continue; + + headings.Add(new DrawableTournamentGrouping(group, true) + { + Position = headings.ToLocalSpace((topPairing.ScreenSpaceDrawQuad.TopLeft + topPairing.ScreenSpaceDrawQuad.TopRight) / 2), + Margin = new MarginPadding { Bottom = 10 }, + Origin = Anchor.BottomCentre, + }); + } + + layout.Validate(); + } + + // todo: remove after ppy/osu-framework#1980 is merged. + public override bool HandlePositionalInput => true; + } +} diff --git a/osu.Game.Tournament/Screens/TournamentSceneManager.cs b/osu.Game.Tournament/Screens/TournamentSceneManager.cs index 02492953f2..de9e6ee19d 100644 --- a/osu.Game.Tournament/Screens/TournamentSceneManager.cs +++ b/osu.Game.Tournament/Screens/TournamentSceneManager.cs @@ -25,7 +25,8 @@ namespace osu.Game.Tournament.Screens public class TournamentSceneManager : OsuScreen { private ScheduleScreen schedule; - private LadderManager bracket; + private LadderScreen bracket; + private LadderEditorScreen bracketEditor; private MapPoolScreen mapPool; private GameplayScreen gameplay; private TeamWinScreen winner; @@ -57,6 +58,8 @@ namespace osu.Game.Tournament.Screens Direction = FillDirection.Vertical, Children = new Drawable[] { + new OsuButton { RelativeSizeAxes = Axes.X, Text = "Bracket Editor", Action = () => setScreen(bracketEditor) }, + new Container { RelativeSizeAxes = Axes.X, Height = 50 }, new OsuButton { RelativeSizeAxes = Axes.X, Text = "Drawings", Action = () => setScreen(drawings) }, new OsuButton { RelativeSizeAxes = Axes.X, Text = "Showcase", Action = () => setScreen(showcase) }, new Container { RelativeSizeAxes = Axes.X, Height = 50 }, @@ -96,7 +99,8 @@ namespace osu.Game.Tournament.Screens Children = new Drawable[] { schedule = new ScheduleScreen(), - bracket = new LadderManager(), + bracket = new LadderScreen(), + bracketEditor = new LadderEditorScreen(), showcase = new ShowcaseScreen(), mapPool = new MapPoolScreen(), teamIntro = new TeamIntroScreen(), diff --git a/osu.Game.Tournament/TournamentGameBase.cs b/osu.Game.Tournament/TournamentGameBase.cs index 31a3c162f5..8734b2e64b 100644 --- a/osu.Game.Tournament/TournamentGameBase.cs +++ b/osu.Game.Tournament/TournamentGameBase.cs @@ -19,7 +19,6 @@ using osu.Game.Online.API.Requests; using osu.Game.Rulesets; using osu.Game.Tournament.Components; using osu.Game.Tournament.IPC; -using osu.Game.Tournament.Screens.Ladder.Components; namespace osu.Game.Tournament { @@ -35,9 +34,6 @@ namespace osu.Game.Tournament [Cached] private readonly Bindable ruleset = new Bindable(); - [Cached] - private LadderEditorInfo editorInfo = new LadderEditorInfo(); - private Bindable windowSize; private FileBasedIPC ipc; From cf0976955bb36edf5be7ed9797cb2c8e2a19f1a9 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 16 Nov 2018 20:30:12 +0900 Subject: [PATCH 137/317] Expose groupings editor --- .../TestCaseGroupingsEditorScreen.cs | 15 ++++++++ .../Groupings/GroupingsEditorScreen.cs | 37 +++++++++++++------ .../Ladder/Components/LadderEditorSettings.cs | 11 ++++++ .../Screens/Ladder/LadderScreen.cs | 3 -- .../Screens/TournamentSceneManager.cs | 4 ++ .../Screens/TournamentScreen.cs | 4 ++ 6 files changed, 59 insertions(+), 15 deletions(-) create mode 100644 osu.Game.Tournament.Tests/TestCaseGroupingsEditorScreen.cs rename osu.Game.Tournament.Tests/TestCaseGroupingManager.cs => osu.Game.Tournament/Screens/Groupings/GroupingsEditorScreen.cs (69%) diff --git a/osu.Game.Tournament.Tests/TestCaseGroupingsEditorScreen.cs b/osu.Game.Tournament.Tests/TestCaseGroupingsEditorScreen.cs new file mode 100644 index 0000000000..4e82e27fd9 --- /dev/null +++ b/osu.Game.Tournament.Tests/TestCaseGroupingsEditorScreen.cs @@ -0,0 +1,15 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Game.Tournament.Screens.Groupings; + +namespace osu.Game.Tournament.Tests +{ + public class TestCaseGroupingsEditorScreen : LadderTestCase + { + public TestCaseGroupingsEditorScreen() + { + Add(new GroupingsEditorScreen()); + } + } +} diff --git a/osu.Game.Tournament.Tests/TestCaseGroupingManager.cs b/osu.Game.Tournament/Screens/Groupings/GroupingsEditorScreen.cs similarity index 69% rename from osu.Game.Tournament.Tests/TestCaseGroupingManager.cs rename to osu.Game.Tournament/Screens/Groupings/GroupingsEditorScreen.cs index 531019c28c..1b7e9e6bd1 100644 --- a/osu.Game.Tournament.Tests/TestCaseGroupingManager.cs +++ b/osu.Game.Tournament/Screens/Groupings/GroupingsEditorScreen.cs @@ -1,6 +1,7 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using System; using System.Linq; using osu.Framework.Allocation; using osu.Framework.Graphics; @@ -9,13 +10,13 @@ using osu.Game.Graphics.UserInterface; using osu.Game.Overlays.Settings; using osu.Game.Tournament.Screens.Ladder.Components; -namespace osu.Game.Tournament.Tests +namespace osu.Game.Tournament.Screens.Groupings { - public class TestCaseGroupingManager : LadderTestCase + public class GroupingsEditorScreen : TournamentScreen, IProvideVideo { private readonly FillFlowContainer items; - public TestCaseGroupingManager() + public GroupingsEditorScreen() { Add(new FillFlowContainer { @@ -37,29 +38,37 @@ namespace osu.Game.Tournament.Tests }, } }); - } [BackgroundDependencyLoader] private void load() { - foreach (var g in Ladder.Groupings) - items.Add(new GroupingRow(g)); + foreach (var g in LadderInfo.Groupings) + items.Add(new GroupingRow(g, updateGroupings)); } - protected override void Dispose(bool isDisposing) + protected override void LoadComplete() { - Ladder.Groupings = items.Children.Select(c => c.Grouping).ToList(); - base.Dispose(isDisposing); + base.LoadComplete(); + Scheduler.AddDelayed(() => LadderInfo.Groupings = items.Children.Select(c => c.Grouping).ToList(), 500, true); } - private void addNew() => items.Add(new GroupingRow(new TournamentGrouping())); + private void addNew() + { + items.Add(new GroupingRow(new TournamentGrouping(), updateGroupings)); + updateGroupings(); + } + + private void updateGroupings() + { + LadderInfo.Groupings = items.Children.Select(c => c.Grouping).ToList(); + } public class GroupingRow : CompositeDrawable { public readonly TournamentGrouping Grouping; - public GroupingRow(TournamentGrouping grouping) + public GroupingRow(TournamentGrouping grouping, Action onDelete) { Grouping = grouping; InternalChildren = new Drawable[] @@ -77,7 +86,11 @@ namespace osu.Game.Tournament.Tests { Width = 0.1f, Text = "Delete", - Action = () => Expire() + Action = () => + { + Expire(); + onDelete(); + } }, } } diff --git a/osu.Game.Tournament/Screens/Ladder/Components/LadderEditorSettings.cs b/osu.Game.Tournament/Screens/Ladder/Components/LadderEditorSettings.cs index 90f20a3494..4334f75728 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/LadderEditorSettings.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/LadderEditorSettings.cs @@ -6,6 +6,7 @@ using osu.Framework.Allocation; using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; +using osu.Framework.Input.Events; using osu.Game.Graphics.Sprites; using osu.Game.Graphics.UserInterface; using osu.Game.Overlays.Settings; @@ -115,5 +116,15 @@ namespace osu.Game.Tournament.Screens.Ladder.Components editorInfo.Selected.Value.Losers.Value = losers; }; } + + protected override bool OnHover(HoverEvent e) + { + return false; + } + + protected override void OnHoverLost(HoverLostEvent e) + { + } + } } diff --git a/osu.Game.Tournament/Screens/Ladder/LadderScreen.cs b/osu.Game.Tournament/Screens/Ladder/LadderScreen.cs index 69035c21db..5e0cb13375 100644 --- a/osu.Game.Tournament/Screens/Ladder/LadderScreen.cs +++ b/osu.Game.Tournament/Screens/Ladder/LadderScreen.cs @@ -22,9 +22,6 @@ namespace osu.Game.Tournament.Screens.Ladder protected ScrollableContainer ScrollContent; - [Resolved] - protected LadderInfo LadderInfo { get; private set; } - [BackgroundDependencyLoader] private void load(OsuColour colours) { diff --git a/osu.Game.Tournament/Screens/TournamentSceneManager.cs b/osu.Game.Tournament/Screens/TournamentSceneManager.cs index de9e6ee19d..0205838fc2 100644 --- a/osu.Game.Tournament/Screens/TournamentSceneManager.cs +++ b/osu.Game.Tournament/Screens/TournamentSceneManager.cs @@ -11,6 +11,7 @@ using osu.Game.Graphics.UserInterface; using osu.Game.Screens; using osu.Game.Tournament.Screens.Drawings; using osu.Game.Tournament.Screens.Gameplay; +using osu.Game.Tournament.Screens.Groupings; using osu.Game.Tournament.Screens.Ladder; using osu.Game.Tournament.Screens.MapPool; using osu.Game.Tournament.Screens.Schedule; @@ -27,6 +28,7 @@ namespace osu.Game.Tournament.Screens private ScheduleScreen schedule; private LadderScreen bracket; private LadderEditorScreen bracketEditor; + private GroupingsEditorScreen groupingsEditor; private MapPoolScreen mapPool; private GameplayScreen gameplay; private TeamWinScreen winner; @@ -59,6 +61,7 @@ namespace osu.Game.Tournament.Screens Children = new Drawable[] { new OsuButton { RelativeSizeAxes = Axes.X, Text = "Bracket Editor", Action = () => setScreen(bracketEditor) }, + new OsuButton { RelativeSizeAxes = Axes.X, Text = "Groupings Editor", Action = () => setScreen(groupingsEditor) }, new Container { RelativeSizeAxes = Axes.X, Height = 50 }, new OsuButton { RelativeSizeAxes = Axes.X, Text = "Drawings", Action = () => setScreen(drawings) }, new OsuButton { RelativeSizeAxes = Axes.X, Text = "Showcase", Action = () => setScreen(showcase) }, @@ -101,6 +104,7 @@ namespace osu.Game.Tournament.Screens schedule = new ScheduleScreen(), bracket = new LadderScreen(), bracketEditor = new LadderEditorScreen(), + groupingsEditor = new GroupingsEditorScreen(), showcase = new ShowcaseScreen(), mapPool = new MapPoolScreen(), teamIntro = new TeamIntroScreen(), diff --git a/osu.Game.Tournament/Screens/TournamentScreen.cs b/osu.Game.Tournament/Screens/TournamentScreen.cs index dcdd7f8ce5..b440b8e796 100644 --- a/osu.Game.Tournament/Screens/TournamentScreen.cs +++ b/osu.Game.Tournament/Screens/TournamentScreen.cs @@ -1,6 +1,7 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Game.Screens; @@ -8,6 +9,9 @@ namespace osu.Game.Tournament.Screens { public class TournamentScreen : OsuScreen { + [Resolved] + protected LadderInfo LadderInfo { get; private set; } + public override void Hide() { this.FadeOut(200); From 4b74105ad9a9e7fb001b3fcbbf40875975441dd1 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 16 Nov 2018 20:34:51 +0900 Subject: [PATCH 138/317] Fix code sanity issues --- .../{TeamWinTestCase.cs => TestCaseTeamWin.cs} | 0 osu.Game.Tournament/Screens/Showcase/TournamentLogo.cs | 3 +++ 2 files changed, 3 insertions(+) rename osu.Game.Tournament.Tests/{TeamWinTestCase.cs => TestCaseTeamWin.cs} (100%) diff --git a/osu.Game.Tournament.Tests/TeamWinTestCase.cs b/osu.Game.Tournament.Tests/TestCaseTeamWin.cs similarity index 100% rename from osu.Game.Tournament.Tests/TeamWinTestCase.cs rename to osu.Game.Tournament.Tests/TestCaseTeamWin.cs diff --git a/osu.Game.Tournament/Screens/Showcase/TournamentLogo.cs b/osu.Game.Tournament/Screens/Showcase/TournamentLogo.cs index 135081a641..4225518d53 100644 --- a/osu.Game.Tournament/Screens/Showcase/TournamentLogo.cs +++ b/osu.Game.Tournament/Screens/Showcase/TournamentLogo.cs @@ -1,3 +1,6 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; From c1e3c4d4359555ddf32f4c96ac4037277dca37c0 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 17 Nov 2018 10:40:44 +0900 Subject: [PATCH 139/317] Make chat tests work again, clear old messages --- .../TestCaseMatchChatDisplay.cs | 4 ++++ .../Components/MatchChatDisplay.cs | 22 ++++++++++++++----- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/osu.Game.Tournament.Tests/TestCaseMatchChatDisplay.cs b/osu.Game.Tournament.Tests/TestCaseMatchChatDisplay.cs index aab56d1714..cc053f8a7e 100644 --- a/osu.Game.Tournament.Tests/TestCaseMatchChatDisplay.cs +++ b/osu.Game.Tournament.Tests/TestCaseMatchChatDisplay.cs @@ -7,6 +7,7 @@ using osu.Framework.Graphics; using osu.Game.Online.Chat; using osu.Game.Tests.Visual; using osu.Game.Tournament.Components; +using osu.Game.Tournament.IPC; using osu.Game.Tournament.Screens.Ladder.Components; using osu.Game.Users; using OpenTK; @@ -39,6 +40,9 @@ namespace osu.Game.Tournament.Tests [Cached] private LadderInfo ladderInfo = new LadderInfo(); + [Cached] + private MatchIPCInfo matchInfo = new MatchIPCInfo(); // hide parent + public TestCaseMatchChatDisplay() { MatchChatDisplay chatDisplay; diff --git a/osu.Game.Tournament/Components/MatchChatDisplay.cs b/osu.Game.Tournament/Components/MatchChatDisplay.cs index c44eb88ef8..dc8f28d9bd 100644 --- a/osu.Game.Tournament/Components/MatchChatDisplay.cs +++ b/osu.Game.Tournament/Components/MatchChatDisplay.cs @@ -61,10 +61,6 @@ namespace osu.Game.Tournament.Components { if (ipc != null) { - AddInternal(manager = new ChannelManager()); - - Channel.BindTo(manager.CurrentChannel); - chatChannel.BindTo(ipc.ChatChannel); chatChannel.BindValueChanged(channelString => { @@ -73,7 +69,18 @@ namespace osu.Game.Tournament.Components int id = int.Parse(channelString); - var channel = manager.JoinedChannels.FirstOrDefault(ch => ch.Id == id) ?? new Channel + if (id <= 0) return; + + if (manager == null) + { + AddInternal(manager = new ChannelManager()); + Channel.BindTo(manager.CurrentChannel); + } + + foreach (var ch in manager.JoinedChannels.ToList()) + manager.LeaveChannel(ch); + + var channel = new Channel { Id = id, Type = ChannelType.Public @@ -81,7 +88,6 @@ namespace osu.Game.Tournament.Components manager.JoinChannel(channel); manager.CurrentChannel.Value = channel; - }, true); } } @@ -92,6 +98,10 @@ namespace osu.Game.Tournament.Components lastChannel.NewMessagesArrived -= newMessages; lastChannel = channel; + messagesFlow.Clear(); + + if (channel == null) return; + channel.NewMessagesArrived += newMessages; } From 2ee77670ee7682da1ef522bc666eabd32bd6f757 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 17 Nov 2018 12:04:19 +0900 Subject: [PATCH 140/317] Add date entry for groupings --- .../Groupings/GroupingsEditorScreen.cs | 89 ++++++++++++++----- 1 file changed, 69 insertions(+), 20 deletions(-) diff --git a/osu.Game.Tournament/Screens/Groupings/GroupingsEditorScreen.cs b/osu.Game.Tournament/Screens/Groupings/GroupingsEditorScreen.cs index 1b7e9e6bd1..b0bd17fe83 100644 --- a/osu.Game.Tournament/Screens/Groupings/GroupingsEditorScreen.cs +++ b/osu.Game.Tournament/Screens/Groupings/GroupingsEditorScreen.cs @@ -4,8 +4,11 @@ using System; using System.Linq; using osu.Framework.Allocation; +using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Shapes; +using osu.Game.Graphics; using osu.Game.Graphics.UserInterface; using osu.Game.Overlays.Settings; using osu.Game.Tournament.Screens.Ladder.Components; @@ -18,24 +21,36 @@ namespace osu.Game.Tournament.Screens.Groupings public GroupingsEditorScreen() { - Add(new FillFlowContainer + AddRange(new Drawable[] { - Direction = FillDirection.Vertical, - RelativeSizeAxes = Axes.Both, - Children = new Drawable[] + new Box { - items = new FillFlowContainer + RelativeSizeAxes = Axes.Both, + Colour = OsuColour.Gray(0.2f), + }, + new FillFlowContainer + { + Direction = FillDirection.Vertical, + RelativeSizeAxes = Axes.Both, + Width = 0.9f, + Anchor = Anchor.TopCentre, + Origin = Anchor.TopCentre, + Children = new Drawable[] { - Direction = FillDirection.Vertical, - RelativeSizeAxes = Axes.X, - AutoSizeAxes = Axes.Y, - }, - new TriangleButton - { - Width = 100, - Text = "Add", - Action = addNew - }, + items = new FillFlowContainer + { + Direction = FillDirection.Vertical, + RelativeSizeAxes = Axes.X, + AutoSizeAxes = Axes.Y, + }, + new TriangleButton + { + Margin = new MarginPadding(20), + Width = 100, + Text = "Add", + Action = addNew + }, + } } }); } @@ -55,11 +70,11 @@ namespace osu.Game.Tournament.Screens.Groupings private void addNew() { - items.Add(new GroupingRow(new TournamentGrouping(), updateGroupings)); + items.Add(new GroupingRow(new TournamentGrouping { StartDate = { Value = DateTimeOffset.UtcNow } }, updateGroupings)); updateGroupings(); } - private void updateGroupings() + private void updateGroupings() { LadderInfo.Groupings = items.Children.Select(c => c.Grouping).ToList(); } @@ -75,8 +90,9 @@ namespace osu.Game.Tournament.Screens.Groupings { new FillFlowContainer { - Direction = FillDirection.Horizontal, - RelativeSizeAxes = Axes.Both, + Direction = FillDirection.Full, + RelativeSizeAxes = Axes.X, + AutoSizeAxes = Axes.Y, Children = new Drawable[] { new SettingsTextBox { Width = 0.3f, Bindable = Grouping.Name }, @@ -92,12 +108,45 @@ namespace osu.Game.Tournament.Screens.Groupings onDelete(); } }, + new DateTextBox { Width = 0.3f, Bindable = Grouping.StartDate }, } } }; RelativeSizeAxes = Axes.X; - Height = 40; + AutoSizeAxes = Axes.Y; + } + } + } + + public class DateTextBox : SettingsTextBox + { + public DateTextBox() + { + base.Bindable = new Bindable(); + ((OsuTextBox)Control).OnCommit = (sender, newText) => { + try + { + bindable.Value = DateTimeOffset.Parse(sender.Text); + } + catch + { + bindable.TriggerChange(); + } + }; + } + + // hold a reference to the provided bindable so we don't have to in every settings section. + private Bindable bindable; + + public new Bindable Bindable + { + get { return bindable; } + + set + { + bindable = value; + bindable.BindValueChanged(dto => base.Bindable.Value = dto.ToUniversalTime().ToString(), true); } } } From 87243a72d30f1d0b06368f0e63ac4df2cff1ce1b Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 17 Nov 2018 12:14:15 +0900 Subject: [PATCH 141/317] Add date entry for pairings --- .../Ladder/Components/LadderEditorSettings.cs | 28 ++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/osu.Game.Tournament/Screens/Ladder/Components/LadderEditorSettings.cs b/osu.Game.Tournament/Screens/Ladder/Components/LadderEditorSettings.cs index 4334f75728..34b16ccab3 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/LadderEditorSettings.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/LadderEditorSettings.cs @@ -1,6 +1,7 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using System; using System.Linq; using osu.Framework.Allocation; using osu.Framework.Configuration; @@ -11,6 +12,7 @@ using osu.Game.Graphics.Sprites; using osu.Game.Graphics.UserInterface; using osu.Game.Overlays.Settings; using osu.Game.Screens.Play.PlayerSettings; +using osu.Game.Tournament.Screens.Groupings; namespace osu.Game.Tournament.Screens.Ladder.Components { @@ -24,6 +26,7 @@ namespace osu.Game.Tournament.Screens.Ladder.Components private OsuTextBox textboxTeam2; private SettingsDropdown groupingDropdown; private PlayerCheckbox losersCheckbox; + private DateTextBox dateTimeBox; [Resolved] private LadderEditorInfo editorInfo { get; set; } @@ -81,6 +84,10 @@ namespace osu.Game.Tournament.Screens.Ladder.Components { LabelText = "Losers Bracket", Bindable = new Bindable() + }, + dateTimeBox = new DateTextBox + { + Bindable = new Bindable() } }; @@ -90,6 +97,7 @@ namespace osu.Game.Tournament.Screens.Ladder.Components textboxTeam2.Text = selection?.Team2.Value?.Acronym; groupingDropdown.Bindable.Value = selection?.Grouping.Value ?? groupingOptions.First(); losersCheckbox.Current.Value = selection?.Losers.Value ?? false; + dateTimeBox.Bindable.Value = selection?.Date.Value ?? DateTimeOffset.UtcNow; }; textboxTeam1.OnCommit = (val, newText) => @@ -107,7 +115,14 @@ namespace osu.Game.Tournament.Screens.Ladder.Components groupingDropdown.Bindable.ValueChanged += grouping => { if (editorInfo.Selected.Value != null) + { editorInfo.Selected.Value.Grouping.Value = grouping; + if (editorInfo.Selected.Value.Date.Value < grouping.StartDate.Value) + { + editorInfo.Selected.Value.Date.Value = grouping.StartDate.Value; + editorInfo.Selected.TriggerChange(); + } + } }; losersCheckbox.Current.ValueChanged += losers => @@ -115,6 +130,18 @@ namespace osu.Game.Tournament.Screens.Ladder.Components if (editorInfo.Selected.Value != null) editorInfo.Selected.Value.Losers.Value = losers; }; + + dateTimeBox.Bindable.ValueChanged += date => + { + if (editorInfo.Selected.Value != null) + editorInfo.Selected.Value.Date.Value = date; + }; + } + + protected override void LoadComplete() + { + base.LoadComplete(); + this.FadeIn(); } protected override bool OnHover(HoverEvent e) @@ -125,6 +152,5 @@ namespace osu.Game.Tournament.Screens.Ladder.Components protected override void OnHoverLost(HoverLostEvent e) { } - } } From 7f7d4ef442daab22e6b2c20440b405bf5b4adb83 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 17 Nov 2018 13:36:36 +0900 Subject: [PATCH 142/317] =?UTF-8?q?Don=E2=80=99t=20hard=20fail=20if=20stab?= =?UTF-8?q?le=20install=20is=20missing?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- osu.Game.Tournament/IPC/FileBasedIPC.cs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/osu.Game.Tournament/IPC/FileBasedIPC.cs b/osu.Game.Tournament/IPC/FileBasedIPC.cs index 87c6fb4c83..9cc275e9e0 100644 --- a/osu.Game.Tournament/IPC/FileBasedIPC.cs +++ b/osu.Game.Tournament/IPC/FileBasedIPC.cs @@ -27,7 +27,18 @@ namespace osu.Game.Tournament.IPC [BackgroundDependencyLoader] private void load() { - var stable = new StableStorage(); + + StableStorage stable; + + try + { + stable = new StableStorage(); + } + catch + { + Logger.Log("Stable installation could not be found; disabling file based IPC"); + return; + } const string file_ipc_filename = "ipc.txt"; const string file_ipc_state_filename = "ipc-state.txt"; From c1e1306c976fe0cf99529945647f01ac4737e7ba Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 17 Nov 2018 13:39:55 +0900 Subject: [PATCH 143/317] Show controls above screens --- .../Screens/TournamentSceneManager.cs | 70 +++++++++---------- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/osu.Game.Tournament/Screens/TournamentSceneManager.cs b/osu.Game.Tournament/Screens/TournamentSceneManager.cs index 0205838fc2..f3bc12a6cf 100644 --- a/osu.Game.Tournament/Screens/TournamentSceneManager.cs +++ b/osu.Game.Tournament/Screens/TournamentSceneManager.cs @@ -43,41 +43,6 @@ namespace osu.Game.Tournament.Screens { Children = new Drawable[] { - new Container - { - RelativeSizeAxes = Axes.Y, - Width = 200, - Children = new Drawable[] - { - new Box - { - Colour = Color4.Black, - RelativeSizeAxes = Axes.Both, - }, - new FillFlowContainer - { - RelativeSizeAxes = Axes.Both, - Direction = FillDirection.Vertical, - Children = new Drawable[] - { - new OsuButton { RelativeSizeAxes = Axes.X, Text = "Bracket Editor", Action = () => setScreen(bracketEditor) }, - new OsuButton { RelativeSizeAxes = Axes.X, Text = "Groupings Editor", Action = () => setScreen(groupingsEditor) }, - new Container { RelativeSizeAxes = Axes.X, Height = 50 }, - new OsuButton { RelativeSizeAxes = Axes.X, Text = "Drawings", Action = () => setScreen(drawings) }, - new OsuButton { RelativeSizeAxes = Axes.X, Text = "Showcase", Action = () => setScreen(showcase) }, - new Container { RelativeSizeAxes = Axes.X, Height = 50 }, - new OsuButton { RelativeSizeAxes = Axes.X, Text = "Schedule", Action = () => setScreen(schedule) }, - new OsuButton { RelativeSizeAxes = Axes.X, Text = "Bracket", Action = () => setScreen(bracket) }, - new Container { RelativeSizeAxes = Axes.X, Height = 50 }, - new OsuButton { RelativeSizeAxes = Axes.X, Text = "TeamIntro", Action = () => setScreen(teamIntro) }, - new OsuButton { RelativeSizeAxes = Axes.X, Text = "MapPool", Action = () => setScreen(mapPool) }, - new OsuButton { RelativeSizeAxes = Axes.X, Text = "Gameplay", Action = () => setScreen(gameplay) }, - new Container { RelativeSizeAxes = Axes.X, Height = 50 }, - new OsuButton { RelativeSizeAxes = Axes.X, Text = "Win", Action = () => setScreen(winner) }, - } - }, - }, - }, new Container { RelativeSizeAxes = Axes.Both, @@ -115,6 +80,41 @@ namespace osu.Game.Tournament.Screens }, } }, + new Container + { + RelativeSizeAxes = Axes.Y, + Width = 200, + Children = new Drawable[] + { + new Box + { + Colour = Color4.Black, + RelativeSizeAxes = Axes.Both, + }, + new FillFlowContainer + { + RelativeSizeAxes = Axes.Both, + Direction = FillDirection.Vertical, + Children = new Drawable[] + { + new OsuButton { RelativeSizeAxes = Axes.X, Text = "Bracket Editor", Action = () => setScreen(bracketEditor) }, + new OsuButton { RelativeSizeAxes = Axes.X, Text = "Groupings Editor", Action = () => setScreen(groupingsEditor) }, + new Container { RelativeSizeAxes = Axes.X, Height = 50 }, + new OsuButton { RelativeSizeAxes = Axes.X, Text = "Drawings", Action = () => setScreen(drawings) }, + new OsuButton { RelativeSizeAxes = Axes.X, Text = "Showcase", Action = () => setScreen(showcase) }, + new Container { RelativeSizeAxes = Axes.X, Height = 50 }, + new OsuButton { RelativeSizeAxes = Axes.X, Text = "Schedule", Action = () => setScreen(schedule) }, + new OsuButton { RelativeSizeAxes = Axes.X, Text = "Bracket", Action = () => setScreen(bracket) }, + new Container { RelativeSizeAxes = Axes.X, Height = 50 }, + new OsuButton { RelativeSizeAxes = Axes.X, Text = "TeamIntro", Action = () => setScreen(teamIntro) }, + new OsuButton { RelativeSizeAxes = Axes.X, Text = "MapPool", Action = () => setScreen(mapPool) }, + new OsuButton { RelativeSizeAxes = Axes.X, Text = "Gameplay", Action = () => setScreen(gameplay) }, + new Container { RelativeSizeAxes = Axes.X, Height = 50 }, + new OsuButton { RelativeSizeAxes = Axes.X, Text = "Win", Action = () => setScreen(winner) }, + } + }, + }, + }, }; setScreen(teamIntro); From bed967b456ceeb38b1d46102983e8fc0e05356ae Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 17 Nov 2018 14:05:22 +0900 Subject: [PATCH 144/317] Add better date string formatting --- osu.Game.Tournament/Components/DateTextBox.cs | 44 +++++++++++++++++++ .../Groupings/GroupingsEditorScreen.cs | 36 +-------------- .../Ladder/Components/LadderEditorSettings.cs | 2 +- 3 files changed, 47 insertions(+), 35 deletions(-) create mode 100644 osu.Game.Tournament/Components/DateTextBox.cs diff --git a/osu.Game.Tournament/Components/DateTextBox.cs b/osu.Game.Tournament/Components/DateTextBox.cs new file mode 100644 index 0000000000..171196f348 --- /dev/null +++ b/osu.Game.Tournament/Components/DateTextBox.cs @@ -0,0 +1,44 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System; +using osu.Framework.Configuration; +using osu.Game.Graphics.UserInterface; +using osu.Game.Overlays.Settings; + +namespace osu.Game.Tournament.Components +{ + public class DateTextBox : SettingsTextBox + { + public new Bindable Bindable + { + get { return bindable; } + + set + { + bindable = value; + bindable.BindValueChanged(dto => + base.Bindable.Value = dto.ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ssZ"), true); + } + } + + // hold a reference to the provided bindable so we don't have to in every settings section. + private Bindable bindable; + + public DateTextBox() + { + base.Bindable = new Bindable(); + ((OsuTextBox)Control).OnCommit = (sender, newText) => + { + try + { + bindable.Value = DateTimeOffset.Parse(sender.Text); + } + catch + { + bindable.TriggerChange(); + } + }; + } + } +} diff --git a/osu.Game.Tournament/Screens/Groupings/GroupingsEditorScreen.cs b/osu.Game.Tournament/Screens/Groupings/GroupingsEditorScreen.cs index b0bd17fe83..d5d3d1dbda 100644 --- a/osu.Game.Tournament/Screens/Groupings/GroupingsEditorScreen.cs +++ b/osu.Game.Tournament/Screens/Groupings/GroupingsEditorScreen.cs @@ -4,13 +4,13 @@ using System; using System.Linq; using osu.Framework.Allocation; -using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; using osu.Game.Graphics; using osu.Game.Graphics.UserInterface; using osu.Game.Overlays.Settings; +using osu.Game.Tournament.Components; using osu.Game.Tournament.Screens.Ladder.Components; namespace osu.Game.Tournament.Screens.Groupings @@ -74,7 +74,7 @@ namespace osu.Game.Tournament.Screens.Groupings updateGroupings(); } - private void updateGroupings() + private void updateGroupings() { LadderInfo.Groupings = items.Children.Select(c => c.Grouping).ToList(); } @@ -118,36 +118,4 @@ namespace osu.Game.Tournament.Screens.Groupings } } } - - public class DateTextBox : SettingsTextBox - { - public DateTextBox() - { - base.Bindable = new Bindable(); - ((OsuTextBox)Control).OnCommit = (sender, newText) => { - try - { - bindable.Value = DateTimeOffset.Parse(sender.Text); - } - catch - { - bindable.TriggerChange(); - } - }; - } - - // hold a reference to the provided bindable so we don't have to in every settings section. - private Bindable bindable; - - public new Bindable Bindable - { - get { return bindable; } - - set - { - bindable = value; - bindable.BindValueChanged(dto => base.Bindable.Value = dto.ToUniversalTime().ToString(), true); - } - } - } } diff --git a/osu.Game.Tournament/Screens/Ladder/Components/LadderEditorSettings.cs b/osu.Game.Tournament/Screens/Ladder/Components/LadderEditorSettings.cs index 34b16ccab3..bb80a845e3 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/LadderEditorSettings.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/LadderEditorSettings.cs @@ -12,7 +12,7 @@ using osu.Game.Graphics.Sprites; using osu.Game.Graphics.UserInterface; using osu.Game.Overlays.Settings; using osu.Game.Screens.Play.PlayerSettings; -using osu.Game.Tournament.Screens.Groupings; +using osu.Game.Tournament.Components; namespace osu.Game.Tournament.Screens.Ladder.Components { From 81f39c2f399f7a4e527cda0b70205b4453e62059 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 17 Nov 2018 14:35:40 +0900 Subject: [PATCH 145/317] Don't show matches on schedule which don't have teams set --- osu.Game.Tournament/Screens/Schedule/ScheduleScreen.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game.Tournament/Screens/Schedule/ScheduleScreen.cs b/osu.Game.Tournament/Screens/Schedule/ScheduleScreen.cs index a0c36cd6c0..325a6105cf 100644 --- a/osu.Game.Tournament/Screens/Schedule/ScheduleScreen.cs +++ b/osu.Game.Tournament/Screens/Schedule/ScheduleScreen.cs @@ -75,7 +75,7 @@ namespace osu.Game.Tournament.Screens.Schedule RelativeSizeAxes = Axes.Both, Width = 0.4f, ChildrenEnumerable = ladder.Pairings - .Where(p => p.Completed.Value) + .Where(p => p.Completed.Value && p.Team1.Value != null && p.Team2.Value != null) .OrderByDescending(p => p.Date.Value) .Take(8) .Select(p => new SchedulePairing(p)) @@ -85,7 +85,7 @@ namespace osu.Game.Tournament.Screens.Schedule RelativeSizeAxes = Axes.Both, Width = 0.6f, ChildrenEnumerable = ladder.Pairings - .Where(p => !p.Completed.Value) + .Where(p => !p.Completed.Value && p.Team1.Value != null && p.Team2.Value != null) .OrderBy(p => p.Date.Value) .Take(8) .Select(p => new SchedulePairing(p)) From 71184c602f1d9c1bf3023ce955c004d830328428 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 17 Nov 2018 14:55:27 +0900 Subject: [PATCH 146/317] Show times on schedule --- .../Screens/Schedule/ScheduleScreen.cs | 24 +++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/osu.Game.Tournament/Screens/Schedule/ScheduleScreen.cs b/osu.Game.Tournament/Screens/Schedule/ScheduleScreen.cs index 325a6105cf..4be24a65f7 100644 --- a/osu.Game.Tournament/Screens/Schedule/ScheduleScreen.cs +++ b/osu.Game.Tournament/Screens/Schedule/ScheduleScreen.cs @@ -9,6 +9,7 @@ using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Video; using osu.Framework.Platform; +using osu.Game.Graphics; using osu.Game.Graphics.Sprites; using osu.Game.Tournament.Screens.Ladder.Components; using OpenTK; @@ -107,7 +108,7 @@ namespace osu.Game.Tournament.Screens.Schedule Colour = Color4.Black, TextSize = 20 }, - new SchedulePairing(currentMatch), + new SchedulePairing(currentMatch, false), new OsuSpriteText { Text = "Start Time " + pairing.Date.Value.ToUniversalTime().ToString("HH:mm UTC"), @@ -122,10 +123,29 @@ namespace osu.Game.Tournament.Screens.Schedule public class SchedulePairing : DrawableMatchPairing { - public SchedulePairing(MatchPairing pairing) + public SchedulePairing(MatchPairing pairing, bool showTimestamp = true) : base(pairing) { Flow.Direction = FillDirection.Horizontal; + + if (showTimestamp) + { + AddInternal(new DrawableDate(Pairing.Date.Value) + { + Anchor = Anchor.TopRight, + Origin = Anchor.TopLeft, + Colour = Color4.Black, + Margin = new MarginPadding { Horizontal = 10, Vertical = 5 }, + }); + AddInternal(new OsuSpriteText + { + Anchor = Anchor.BottomRight, + Origin = Anchor.BottomLeft, + Colour = Color4.Black, + Margin = new MarginPadding { Horizontal = 10, Vertical = 5 }, + Text = pairing.Date.Value.ToUniversalTime().ToString("HH:mm UTC") + }); + } } } From 5659ba6ef8d8dba5aef6cb3689394a3cadc59316 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 17 Nov 2018 14:59:37 +0900 Subject: [PATCH 147/317] Add logo to ladder screen --- osu.Game.Tournament/Screens/Ladder/LadderScreen.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/osu.Game.Tournament/Screens/Ladder/LadderScreen.cs b/osu.Game.Tournament/Screens/Ladder/LadderScreen.cs index 5e0cb13375..76f65fd87f 100644 --- a/osu.Game.Tournament/Screens/Ladder/LadderScreen.cs +++ b/osu.Game.Tournament/Screens/Ladder/LadderScreen.cs @@ -8,13 +8,15 @@ using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Lines; +using osu.Framework.Graphics.Video; +using osu.Framework.Platform; using osu.Game.Graphics; using osu.Game.Tournament.Screens.Ladder.Components; using OpenTK.Graphics; namespace osu.Game.Tournament.Screens.Ladder { - public class LadderScreen : TournamentScreen + public class LadderScreen : TournamentScreen, IProvideVideo { protected Container PairingsContainer; private Container paths; @@ -23,7 +25,7 @@ namespace osu.Game.Tournament.Screens.Ladder protected ScrollableContainer ScrollContent; [BackgroundDependencyLoader] - private void load(OsuColour colours) + private void load(OsuColour colours, Storage storage) { normalPathColour = colours.BlueDarker.Darken(2); losersPathColour = colours.YellowDarker.Darken(2); @@ -35,6 +37,11 @@ namespace osu.Game.Tournament.Screens.Ladder RelativeSizeAxes = Axes.Both, Children = new Drawable[] { + new VideoSprite(storage.GetStream(@"BG Side Logo - OWC.m4v")) + { + RelativeSizeAxes = Axes.Both, + Loop = true, + }, ScrollContent = new ScrollableContainer { RelativeSizeAxes = Axes.Both, From aebece3d89c533a9973b1552ac357f6744fab26a Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 17 Nov 2018 15:18:22 +0900 Subject: [PATCH 148/317] Use already populated beatmap values if available --- osu.Game.Tournament/IPC/FileBasedIPC.cs | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/osu.Game.Tournament/IPC/FileBasedIPC.cs b/osu.Game.Tournament/IPC/FileBasedIPC.cs index 9cc275e9e0..4bf2cfee38 100644 --- a/osu.Game.Tournament/IPC/FileBasedIPC.cs +++ b/osu.Game.Tournament/IPC/FileBasedIPC.cs @@ -3,6 +3,7 @@ using System; using System.IO; +using System.Linq; using osu.Framework.Allocation; using osu.Framework.Logging; using osu.Framework.Platform.Windows; @@ -25,9 +26,8 @@ namespace osu.Game.Tournament.IPC private int lastBeatmapId; [BackgroundDependencyLoader] - private void load() + private void load(LadderInfo ladder) { - StableStorage stable; try @@ -58,9 +58,17 @@ namespace osu.Game.Tournament.IPC if (lastBeatmapId != beatmapId) { lastBeatmapId = beatmapId; - var req = new GetBeatmapRequest(new BeatmapInfo { OnlineBeatmapID = beatmapId }); - req.Success += b => Beatmap.Value = b.ToBeatmap(Rulesets); - API.Queue(req); + + var existing = ladder.CurrentMatch.Value?.Grouping.Value?.Beatmaps.FirstOrDefault(b => b.ID == beatmapId && b.BeatmapInfo != null); + + if (existing != null) + Beatmap.Value = existing.BeatmapInfo; + else + { + var req = new GetBeatmapRequest(new BeatmapInfo { OnlineBeatmapID = beatmapId }); + req.Success += b => Beatmap.Value = b.ToBeatmap(Rulesets); + API.Queue(req); + } } Mods.Value = (LegacyMods)mods; From 49e155c2c0ecb6dea2eec2bd2443969e192c9e7f Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 17 Nov 2018 15:31:03 +0900 Subject: [PATCH 149/317] Fix chat not appearing at ranking --- .../Screens/Gameplay/GameplayScreen.cs | 35 ++++++++++++------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs b/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs index 3c6ea39ae7..696abddded 100644 --- a/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs +++ b/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs @@ -86,6 +86,7 @@ namespace osu.Game.Tournament.Screens.Gameplay chat = new MatchChatDisplay { RelativeSizeAxes = Axes.X, + Y = 100, Size = new Vector2(0.45f, 120), Margin = new MarginPadding(10), Anchor = Anchor.BottomCentre, @@ -137,26 +138,34 @@ namespace osu.Game.Tournament.Screens.Gameplay scheduledBarContract?.Cancel(); + void expand() + { + chat.FadeOut(200); + chat.MoveToY(100, 500, Easing.In); + using (SongBar.BeginDelayedSequence(300, true)) + SongBar.Expanded = true; + } + + void contract() + { + SongBar.Expanded = false; + using (chat.BeginDelayedSequence(500)) + { + chat.FadeIn(300); + chat.MoveToY(0, 500, Easing.OutQuint); + } + } + switch (state) { case TourneyState.Idle: - // show chat - SongBar.Expanded = false; - using (chat.BeginDelayedSequence(500)) - { - chat.FadeIn(300); - chat.MoveToY(100).MoveToY(0, 500, Easing.OutQuint); - } - + contract(); break; case TourneyState.Ranking: - scheduledBarContract = Scheduler.AddDelayed(() => SongBar.Expanded = false, 15000); + scheduledBarContract = Scheduler.AddDelayed(contract, 10000); break; default: - chat.FadeOut(200); - chat.MoveToY(100, 500, Easing.In); - using (SongBar.BeginDelayedSequence(300, true)) - SongBar.Expanded = true; + expand(); break; } } From 26286177d3ba6aa4c34e27b1fa0b13f20ec80700 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 17 Nov 2018 15:35:14 +0900 Subject: [PATCH 150/317] Colour chat names --- osu.Game.Tournament/Components/MatchChatDisplay.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game.Tournament/Components/MatchChatDisplay.cs b/osu.Game.Tournament/Components/MatchChatDisplay.cs index dc8f28d9bd..70f04593fa 100644 --- a/osu.Game.Tournament/Components/MatchChatDisplay.cs +++ b/osu.Game.Tournament/Components/MatchChatDisplay.cs @@ -199,11 +199,11 @@ namespace osu.Game.Tournament.Components } else if (info.CurrentMatch.Value.Team1.Value.Players.Any(u => u.Id == message.Sender.Id)) { - colourBox.Colour = red; + senderText.Colour = colourBox.Colour = red; } else if (info.CurrentMatch.Value.Team2.Value.Players.Any(u => u.Id == message.Sender.Id)) { - colourBox.Colour = blue; + senderText.Colour = colourBox.Colour = blue; } } } From 9f519d7002b589aa91fb272eb0c2499daa1784b1 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 17 Nov 2018 15:44:56 +0900 Subject: [PATCH 151/317] Actually add match score display to gameplay screen --- .../Gameplay/Components/MatchScoreDisplay.cs | 7 ++++--- .../Screens/Gameplay/GameplayScreen.cs | 13 ++++++++++++- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/osu.Game.Tournament/Screens/Gameplay/Components/MatchScoreDisplay.cs b/osu.Game.Tournament/Screens/Gameplay/Components/MatchScoreDisplay.cs index fe865a1728..f84fca5e04 100644 --- a/osu.Game.Tournament/Screens/Gameplay/Components/MatchScoreDisplay.cs +++ b/osu.Game.Tournament/Screens/Gameplay/Components/MatchScoreDisplay.cs @@ -35,6 +35,7 @@ namespace osu.Game.Tournament.Screens.Gameplay.Components public MatchScoreDisplay() { RelativeSizeAxes = Axes.X; + AutoSizeAxes = Axes.Y; InternalChildren = new Drawable[] { @@ -102,12 +103,12 @@ namespace osu.Game.Tournament.Screens.Gameplay.Components var diff = Math.Max(score1.Value, score2.Value) - Math.Min(score1.Value, score2.Value); losingBar.ResizeWidthTo(0, 400, Easing.OutQuint); - winningBar.ResizeWidthTo((float)Math.Pow(diff / 1000000f, 0.5), 400, Easing.OutQuint); + winningBar.ResizeWidthTo((float)Math.Pow(diff / 1000000f, 0.5) / 2, 400, Easing.OutQuint); } - protected override void UpdateAfterChildren() + protected override void Update() { - base.UpdateAfterChildren(); + base.Update(); score1Text.X = -Math.Max(5 + score1Text.DrawWidth / 2, score1Bar.DrawWidth); score2Text.X = Math.Max(5 + score2Text.DrawWidth / 2, score2Bar.DrawWidth); diff --git a/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs b/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs index 696abddded..470b7ed479 100644 --- a/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs +++ b/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs @@ -92,6 +92,12 @@ namespace osu.Game.Tournament.Screens.Gameplay Anchor = Anchor.BottomCentre, Origin = Anchor.BottomCentre, }, + scoreDisplay = new MatchScoreDisplay + { + Y = -65, + Anchor = Anchor.BottomCentre, + Origin = Anchor.BottomCentre, + }, new ControlPanel { Children = new Drawable[] @@ -123,6 +129,7 @@ namespace osu.Game.Tournament.Screens.Gameplay private ScheduledDelegate scheduledBarContract; private MatchChatDisplay chat; + private MatchScoreDisplay scoreDisplay; private void stateChanged(TourneyState state) { @@ -142,13 +149,17 @@ namespace osu.Game.Tournament.Screens.Gameplay { chat.FadeOut(200); chat.MoveToY(100, 500, Easing.In); - using (SongBar.BeginDelayedSequence(300, true)) + using (BeginDelayedSequence(300, true)) + { + scoreDisplay.FadeIn(100); SongBar.Expanded = true; + } } void contract() { SongBar.Expanded = false; + scoreDisplay.FadeOut(100); using (chat.BeginDelayedSequence(500)) { chat.FadeIn(300); From 4ae9413ee66b3ce1a026af2ff0d63bb2c6bb418f Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 17 Nov 2018 16:00:12 +0900 Subject: [PATCH 152/317] Add mod icons --- .../Components/TournamentBeatmapPanel.cs | 21 +++++++++++++++++-- .../Screens/MapPool/MapPoolScreen.cs | 2 +- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/osu.Game.Tournament/Components/TournamentBeatmapPanel.cs b/osu.Game.Tournament/Components/TournamentBeatmapPanel.cs index 4456abb48e..aeb9eefd35 100644 --- a/osu.Game.Tournament/Components/TournamentBeatmapPanel.cs +++ b/osu.Game.Tournament/Components/TournamentBeatmapPanel.cs @@ -9,12 +9,17 @@ using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; +using osu.Framework.Graphics.Sprites; +using osu.Framework.Graphics.Textures; +using osu.Framework.IO.Stores; using osu.Framework.Localisation; +using osu.Framework.Platform; using osu.Game.Beatmaps; using osu.Game.Beatmaps.Drawables; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; using osu.Game.Tournament.Screens.Ladder.Components; +using OpenTK; using OpenTK.Graphics; namespace osu.Game.Tournament.Components @@ -22,6 +27,7 @@ namespace osu.Game.Tournament.Components public class TournamentBeatmapPanel : CompositeDrawable { public readonly BeatmapInfo Beatmap; + private readonly string mods; private const float horizontal_padding = 10; private const float vertical_padding = 5; @@ -31,15 +37,16 @@ namespace osu.Game.Tournament.Components private readonly Bindable currentMatch = new Bindable(); private Box flash; - public TournamentBeatmapPanel(BeatmapInfo beatmap) + public TournamentBeatmapPanel(BeatmapInfo beatmap, string mods = null) { Beatmap = beatmap; + this.mods = mods; Width = 400; Height = HEIGHT; } [BackgroundDependencyLoader] - private void load(LadderInfo ladder) + private void load(LadderInfo ladder, Storage storage) { currentMatch.BindValueChanged(matchChanged); currentMatch.BindTo(ladder.CurrentMatch); @@ -126,6 +133,16 @@ namespace osu.Game.Tournament.Components Alpha = 0, }, }); + + if (!string.IsNullOrEmpty(mods)) + AddInternal(new Sprite + { + Texture = new TextureStore(new TextureLoaderStore(new StorageBackedResourceStore(storage))).Get($"mods/{mods}"), + Anchor = Anchor.CentreRight, + Origin = Anchor.CentreRight, + Margin = new MarginPadding(20), + Scale = new Vector2(0.5f) + }); } private void matchChanged(MatchPairing match) diff --git a/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs b/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs index 65f4bfb149..81a140d5c2 100644 --- a/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs +++ b/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs @@ -193,7 +193,7 @@ namespace osu.Game.Tournament.Screens.MapPool if (match.Grouping.Value != null) { foreach (var b in match.Grouping.Value.Beatmaps) - maps.Add(new TournamentBeatmapPanel(b.BeatmapInfo) + maps.Add(new TournamentBeatmapPanel(b.BeatmapInfo, b.Mods) { Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, From 852f0337dd070512e22e6e5a10ee734255a41f86 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 17 Nov 2018 16:06:43 +0900 Subject: [PATCH 153/317] Group map pool by mod type --- .../Screens/MapPool/MapPoolScreen.cs | 32 +++++++++++++++---- 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs b/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs index 81a140d5c2..14dd990ec0 100644 --- a/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs +++ b/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs @@ -22,7 +22,7 @@ namespace osu.Game.Tournament.Screens.MapPool { public class MapPoolScreen : TournamentScreen { - private readonly FillFlowContainer maps; + private readonly FillFlowContainer> mapFlows; private readonly Bindable currentMatch = new Bindable(); @@ -39,12 +39,12 @@ namespace osu.Game.Tournament.Screens.MapPool InternalChildren = new Drawable[] { new MatchHeader(), - maps = new FillFlowContainer + mapFlows = new FillFlowContainer> { Y = 100, Spacing = new Vector2(10, 20), Padding = new MarginPadding(50), - Direction = FillDirection.Full, + Direction = FillDirection.Vertical, RelativeSizeAxes = Axes.Both, }, new ControlPanel @@ -136,7 +136,9 @@ namespace osu.Game.Tournament.Screens.MapPool protected override bool OnMouseDown(MouseDownEvent e) { - var map = maps.FirstOrDefault(m => m.ReceivePositionalInputAt(e.ScreenSpaceMousePosition)); + var maps = mapFlows.Select(f => f.FirstOrDefault(m => m.ReceivePositionalInputAt(e.ScreenSpaceMousePosition))); + var map = maps.FirstOrDefault(m => m != null); + if (map != null) { if (e.Button == MouseButton.Left && map.Beatmap.OnlineBeatmapID != null) @@ -188,16 +190,34 @@ namespace osu.Game.Tournament.Screens.MapPool private void matchChanged(MatchPairing match) { - maps.Clear(); + mapFlows.Clear(); if (match.Grouping.Value != null) { + FillFlowContainer currentFlow = null; + string currentMod = null; + foreach (var b in match.Grouping.Value.Beatmaps) - maps.Add(new TournamentBeatmapPanel(b.BeatmapInfo, b.Mods) + { + if (currentFlow == null || currentMod != b.Mods) + { + mapFlows.Add(currentFlow = new FillFlowContainer + { + Spacing = new Vector2(10, 20), + Direction = FillDirection.Full, + RelativeSizeAxes = Axes.X, + AutoSizeAxes = Axes.Y + }); + + currentMod = b.Mods; + } + + currentFlow.Add(new TournamentBeatmapPanel(b.BeatmapInfo, b.Mods) { Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, }); + } } } } From 8b820f7346f851cc95cecd4db61391493c48d056 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 17 Nov 2018 21:26:56 +0900 Subject: [PATCH 154/317] Move channel reading to new ipc file --- osu.Game.Tournament/IPC/FileBasedIPC.cs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/osu.Game.Tournament/IPC/FileBasedIPC.cs b/osu.Game.Tournament/IPC/FileBasedIPC.cs index 4bf2cfee38..83dbe11ffa 100644 --- a/osu.Game.Tournament/IPC/FileBasedIPC.cs +++ b/osu.Game.Tournament/IPC/FileBasedIPC.cs @@ -43,6 +43,7 @@ namespace osu.Game.Tournament.IPC const string file_ipc_filename = "ipc.txt"; const string file_ipc_state_filename = "ipc-state.txt"; const string file_ipc_scores_filename = "ipc-scores.txt"; + const string file_ipc_channel_filename = "ipc-channel.txt"; if (stable.Exists(file_ipc_filename)) Scheduler.AddDelayed(delegate @@ -72,7 +73,6 @@ namespace osu.Game.Tournament.IPC } Mods.Value = (LegacyMods)mods; - ChatChannel.Value = sr.ReadLine(); } } catch @@ -80,6 +80,19 @@ namespace osu.Game.Tournament.IPC // file might be in use. } + try + { + using (var stream = stable.GetStream(file_ipc_channel_filename)) + using (var sr = new StreamReader(stream)) + { + ChatChannel.Value = sr.ReadLine(); + } + } + catch (Exception) + { + // file might be in use. + } + try { using (var stream = stable.GetStream(file_ipc_state_filename)) From 4b047ad9ccc9048454e871867ad6e05c4bda525f Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 17 Nov 2018 21:27:02 +0900 Subject: [PATCH 155/317] Centralise chat display --- .../Components/MatchChatDisplay.cs | 12 +++++++ .../Screens/Gameplay/GameplayScreen.cs | 24 ++++---------- .../Screens/TournamentSceneManager.cs | 33 ++++++++++++++++++- 3 files changed, 51 insertions(+), 18 deletions(-) diff --git a/osu.Game.Tournament/Components/MatchChatDisplay.cs b/osu.Game.Tournament/Components/MatchChatDisplay.cs index 70f04593fa..2c94e06fc3 100644 --- a/osu.Game.Tournament/Components/MatchChatDisplay.cs +++ b/osu.Game.Tournament/Components/MatchChatDisplay.cs @@ -207,5 +207,17 @@ namespace osu.Game.Tournament.Components } } } + + public void Contract() + { + this.FadeIn(300); + this.MoveToY(0, 500, Easing.OutQuint); + } + + public void Expand() + { + this.FadeOut(200); + this.MoveToY(100, 500, Easing.In); + } } } diff --git a/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs b/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs index 470b7ed479..372087cfcf 100644 --- a/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs +++ b/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs @@ -13,7 +13,6 @@ using osu.Game.Tournament.Components; using osu.Game.Tournament.IPC; using osu.Game.Tournament.Screens.Gameplay.Components; using osu.Game.Tournament.Screens.Ladder.Components; -using OpenTK; using OpenTK.Graphics; namespace osu.Game.Tournament.Screens.Gameplay @@ -32,9 +31,11 @@ namespace osu.Game.Tournament.Screens.Gameplay private readonly Color4 blue = new Color4(17, 136, 170, 255); [BackgroundDependencyLoader] - private void load(LadderInfo ladder, TextureStore textures, MatchIPCInfo ipc) + private void load(LadderInfo ladder, TextureStore textures, MatchIPCInfo ipc, MatchChatDisplay chat) { + this.chat = chat; this.ipc = ipc; + AddRange(new Drawable[] { new MatchHeader(), @@ -83,15 +84,6 @@ namespace osu.Game.Tournament.Screens.Gameplay }, } }, - chat = new MatchChatDisplay - { - RelativeSizeAxes = Axes.X, - Y = 100, - Size = new Vector2(0.45f, 120), - Margin = new MarginPadding(10), - Anchor = Anchor.BottomCentre, - Origin = Anchor.BottomCentre, - }, scoreDisplay = new MatchScoreDisplay { Y = -65, @@ -147,8 +139,8 @@ namespace osu.Game.Tournament.Screens.Gameplay void expand() { - chat.FadeOut(200); - chat.MoveToY(100, 500, Easing.In); + chat.Expand(); + using (BeginDelayedSequence(300, true)) { scoreDisplay.FadeIn(100); @@ -161,10 +153,7 @@ namespace osu.Game.Tournament.Screens.Gameplay SongBar.Expanded = false; scoreDisplay.FadeOut(100); using (chat.BeginDelayedSequence(500)) - { - chat.FadeIn(300); - chat.MoveToY(0, 500, Easing.OutQuint); - } + chat.Contract(); } switch (state) @@ -176,6 +165,7 @@ namespace osu.Game.Tournament.Screens.Gameplay scheduledBarContract = Scheduler.AddDelayed(contract, 10000); break; default: + chat.Expand(); expand(); break; } diff --git a/osu.Game.Tournament/Screens/TournamentSceneManager.cs b/osu.Game.Tournament/Screens/TournamentSceneManager.cs index f3bc12a6cf..7947f94cf9 100644 --- a/osu.Game.Tournament/Screens/TournamentSceneManager.cs +++ b/osu.Game.Tournament/Screens/TournamentSceneManager.cs @@ -9,6 +9,7 @@ using osu.Framework.Graphics.Video; using osu.Framework.Platform; using osu.Game.Graphics.UserInterface; using osu.Game.Screens; +using osu.Game.Tournament.Components; using osu.Game.Tournament.Screens.Drawings; using osu.Game.Tournament.Screens.Gameplay; using osu.Game.Tournament.Screens.Groupings; @@ -38,6 +39,20 @@ namespace osu.Game.Tournament.Screens private ShowcaseScreen showcase; private VideoSprite video; + //todo: make less temporary + [Cached] + private MatchChatDisplay chat = new MatchChatDisplay + { + RelativeSizeAxes = Axes.X, + Y = 100, + Size = new Vector2(0.45f, 120), + Margin = new MarginPadding(10), + Anchor = Anchor.BottomCentre, + Origin = Anchor.BottomCentre, + }; + + private Container chatContainer; + [BackgroundDependencyLoader] private void load(LadderInfo ladder, Storage storage) { @@ -48,7 +63,7 @@ namespace osu.Game.Tournament.Screens RelativeSizeAxes = Axes.Both, X = 200, FillMode = FillMode.Fit, - FillAspectRatio = 16/9f, + FillAspectRatio = 16 / 9f, Anchor = Anchor.TopLeft, Origin = Anchor.TopLeft, Size = new Vector2(0.8f, 1), @@ -78,6 +93,11 @@ namespace osu.Game.Tournament.Screens winner = new TeamWinScreen() } }, + chatContainer = new Container + { + RelativeSizeAxes = Axes.Both, + Child = chat + }, } }, new Container @@ -135,6 +155,17 @@ namespace osu.Game.Tournament.Screens else s.Hide(); } + + switch (screen) + { + case GameplayScreen _: + case MapPoolScreen _: + chatContainer.FadeIn(100); + break; + default: + chatContainer.FadeOut(100); + break; + } } } } From 92bb92e9c0c11502ef9ba2ce017a3919122888c5 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 17 Nov 2018 21:28:33 +0900 Subject: [PATCH 156/317] Use local framework --- osu.Game/osu.Game.csproj | 2 +- osu.sln | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 8c47df654a..3022b66762 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -11,6 +11,7 @@ + @@ -18,7 +19,6 @@ - diff --git a/osu.sln b/osu.sln index f6ed7a5c42..c62fc02dba 100644 --- a/osu.sln +++ b/osu.sln @@ -31,6 +31,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "osu.Game.Tournament", "osu. EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "osu.Game.Tournament.Tests", "osu.Game.Tournament.Tests\osu.Game.Tournament.Tests.csproj", "{5789E78D-38F9-4072-AB7B-978F34B2C17F}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "osu.Framework", "..\osu-framework\osu.Framework\osu.Framework.csproj", "{7A69A230-45A1-4444-8C43-A582E4F48C1E}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -93,6 +95,10 @@ Global {5789E78D-38F9-4072-AB7B-978F34B2C17F}.Debug|Any CPU.Build.0 = Debug|Any CPU {5789E78D-38F9-4072-AB7B-978F34B2C17F}.Release|Any CPU.ActiveCfg = Release|Any CPU {5789E78D-38F9-4072-AB7B-978F34B2C17F}.Release|Any CPU.Build.0 = Release|Any CPU + {7A69A230-45A1-4444-8C43-A582E4F48C1E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7A69A230-45A1-4444-8C43-A582E4F48C1E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7A69A230-45A1-4444-8C43-A582E4F48C1E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7A69A230-45A1-4444-8C43-A582E4F48C1E}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE From 584adaf77db9dff6579312ae1209ba049a9ad5c5 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 18 Nov 2018 07:54:53 +0900 Subject: [PATCH 157/317] Limit horizontal bounds of score display --- .../Screens/Gameplay/Components/MatchScoreDisplay.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Tournament/Screens/Gameplay/Components/MatchScoreDisplay.cs b/osu.Game.Tournament/Screens/Gameplay/Components/MatchScoreDisplay.cs index f84fca5e04..5ec9eef6ca 100644 --- a/osu.Game.Tournament/Screens/Gameplay/Components/MatchScoreDisplay.cs +++ b/osu.Game.Tournament/Screens/Gameplay/Components/MatchScoreDisplay.cs @@ -103,7 +103,7 @@ namespace osu.Game.Tournament.Screens.Gameplay.Components var diff = Math.Max(score1.Value, score2.Value) - Math.Min(score1.Value, score2.Value); losingBar.ResizeWidthTo(0, 400, Easing.OutQuint); - winningBar.ResizeWidthTo((float)Math.Pow(diff / 1000000f, 0.5) / 2, 400, Easing.OutQuint); + winningBar.ResizeWidthTo(Math.Min(0.4f, (float)Math.Pow(diff / 1000000f, 0.5) / 2), 400, Easing.OutQuint); } protected override void Update() From 70739ae5a0dbfc5675e734daa4f0cd8f8f58aeef Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 18 Nov 2018 08:25:23 +0900 Subject: [PATCH 158/317] Reduce rate of scale of score display --- .../Screens/Gameplay/Components/MatchScoreDisplay.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Tournament/Screens/Gameplay/Components/MatchScoreDisplay.cs b/osu.Game.Tournament/Screens/Gameplay/Components/MatchScoreDisplay.cs index 5ec9eef6ca..7bc430e587 100644 --- a/osu.Game.Tournament/Screens/Gameplay/Components/MatchScoreDisplay.cs +++ b/osu.Game.Tournament/Screens/Gameplay/Components/MatchScoreDisplay.cs @@ -103,7 +103,7 @@ namespace osu.Game.Tournament.Screens.Gameplay.Components var diff = Math.Max(score1.Value, score2.Value) - Math.Min(score1.Value, score2.Value); losingBar.ResizeWidthTo(0, 400, Easing.OutQuint); - winningBar.ResizeWidthTo(Math.Min(0.4f, (float)Math.Pow(diff / 1000000f, 0.5) / 2), 400, Easing.OutQuint); + winningBar.ResizeWidthTo(Math.Min(0.4f, (float)Math.Pow(diff / 1500000f, 0.5) / 2), 400, Easing.OutQuint); } protected override void Update() From e6529eac3e1ae04b1fc61214b205c51bc9ef4f31 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 18 Nov 2018 08:30:17 +0900 Subject: [PATCH 159/317] Add automation of map pool and win screen workflows --- .../Screens/Gameplay/GameplayScreen.cs | 24 +++++++- .../Screens/TournamentSceneManager.cs | 60 +++++++++---------- 2 files changed, 49 insertions(+), 35 deletions(-) diff --git a/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs b/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs index 372087cfcf..7517e83160 100644 --- a/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs +++ b/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs @@ -13,6 +13,8 @@ using osu.Game.Tournament.Components; using osu.Game.Tournament.IPC; using osu.Game.Tournament.Screens.Gameplay.Components; using osu.Game.Tournament.Screens.Ladder.Components; +using osu.Game.Tournament.Screens.MapPool; +using osu.Game.Tournament.Screens.TeamWin; using OpenTK.Graphics; namespace osu.Game.Tournament.Screens.Gameplay @@ -30,6 +32,9 @@ namespace osu.Game.Tournament.Screens.Gameplay private readonly Color4 red = new Color4(186, 0, 18, 255); private readonly Color4 blue = new Color4(17, 136, 170, 255); + [Resolved] + private TournamentSceneManager sceneManager { get; set; } + [BackgroundDependencyLoader] private void load(LadderInfo ladder, TextureStore textures, MatchIPCInfo ipc, MatchChatDisplay chat) { @@ -119,10 +124,12 @@ namespace osu.Game.Tournament.Screens.Gameplay warmup.BindValueChanged(w => warmupButton.Alpha = !w ? 0.5f : 1, true); } - private ScheduledDelegate scheduledBarContract; + private ScheduledDelegate scheduledOperation; private MatchChatDisplay chat; private MatchScoreDisplay scoreDisplay; + private TourneyState lastState; + private void stateChanged(TourneyState state) { if (state == TourneyState.Ranking) @@ -135,7 +142,7 @@ namespace osu.Game.Tournament.Screens.Gameplay currentMatch.Value.Team2Score.Value++; } - scheduledBarContract?.Cancel(); + scheduledOperation?.Cancel(); void expand() { @@ -160,15 +167,26 @@ namespace osu.Game.Tournament.Screens.Gameplay { case TourneyState.Idle: contract(); + + if (lastState == TourneyState.Ranking) + { + if (currentMatch.Value?.Completed == true) + scheduledOperation = Scheduler.AddDelayed(() => { sceneManager?.SetScreen(typeof(TeamWinScreen)); }, 4000); + else if (currentMatch.Value?.Completed == false) + scheduledOperation = Scheduler.AddDelayed(() => { sceneManager?.SetScreen(typeof(MapPoolScreen)); }, 4000); + } + break; case TourneyState.Ranking: - scheduledBarContract = Scheduler.AddDelayed(contract, 10000); + scheduledOperation = Scheduler.AddDelayed(contract, 10000); break; default: chat.Expand(); expand(); break; } + + lastState = state; } } } diff --git a/osu.Game.Tournament/Screens/TournamentSceneManager.cs b/osu.Game.Tournament/Screens/TournamentSceneManager.cs index 7947f94cf9..ca3df2627a 100644 --- a/osu.Game.Tournament/Screens/TournamentSceneManager.cs +++ b/osu.Game.Tournament/Screens/TournamentSceneManager.cs @@ -1,6 +1,8 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using System; +using System.Linq; using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; @@ -24,19 +26,10 @@ using OpenTK.Graphics; namespace osu.Game.Tournament.Screens { + [Cached] public class TournamentSceneManager : OsuScreen { - private ScheduleScreen schedule; - private LadderScreen bracket; - private LadderEditorScreen bracketEditor; - private GroupingsEditorScreen groupingsEditor; - private MapPoolScreen mapPool; - private GameplayScreen gameplay; - private TeamWinScreen winner; - private TeamIntroScreen teamIntro; - private DrawingsScreen drawings; private Container screens; - private ShowcaseScreen showcase; private VideoSprite video; //todo: make less temporary @@ -81,16 +74,16 @@ namespace osu.Game.Tournament.Screens RelativeSizeAxes = Axes.Both, Children = new Drawable[] { - schedule = new ScheduleScreen(), - bracket = new LadderScreen(), - bracketEditor = new LadderEditorScreen(), - groupingsEditor = new GroupingsEditorScreen(), - showcase = new ShowcaseScreen(), - mapPool = new MapPoolScreen(), - teamIntro = new TeamIntroScreen(), - drawings = new DrawingsScreen(), - gameplay = new GameplayScreen(), - winner = new TeamWinScreen() + new ScheduleScreen(), + new LadderScreen(), + new LadderEditorScreen(), + new GroupingsEditorScreen(), + new ShowcaseScreen(), + new MapPoolScreen(), + new TeamIntroScreen(), + new DrawingsScreen(), + new GameplayScreen(), + new TeamWinScreen() } }, chatContainer = new Container @@ -117,31 +110,34 @@ namespace osu.Game.Tournament.Screens Direction = FillDirection.Vertical, Children = new Drawable[] { - new OsuButton { RelativeSizeAxes = Axes.X, Text = "Bracket Editor", Action = () => setScreen(bracketEditor) }, - new OsuButton { RelativeSizeAxes = Axes.X, Text = "Groupings Editor", Action = () => setScreen(groupingsEditor) }, + new OsuButton { RelativeSizeAxes = Axes.X, Text = "Bracket Editor", Action = () => SetScreen(typeof(LadderEditorScreen)) }, + new OsuButton { RelativeSizeAxes = Axes.X, Text = "Groupings Editor", Action = () => SetScreen(typeof(GroupingsEditorScreen)) }, new Container { RelativeSizeAxes = Axes.X, Height = 50 }, - new OsuButton { RelativeSizeAxes = Axes.X, Text = "Drawings", Action = () => setScreen(drawings) }, - new OsuButton { RelativeSizeAxes = Axes.X, Text = "Showcase", Action = () => setScreen(showcase) }, + new OsuButton { RelativeSizeAxes = Axes.X, Text = "Drawings", Action = () => SetScreen(typeof(DrawingsScreen)) }, + new OsuButton { RelativeSizeAxes = Axes.X, Text = "Showcase", Action = () => SetScreen(typeof(ShowcaseScreen)) }, new Container { RelativeSizeAxes = Axes.X, Height = 50 }, - new OsuButton { RelativeSizeAxes = Axes.X, Text = "Schedule", Action = () => setScreen(schedule) }, - new OsuButton { RelativeSizeAxes = Axes.X, Text = "Bracket", Action = () => setScreen(bracket) }, + new OsuButton { RelativeSizeAxes = Axes.X, Text = "Schedule", Action = () => SetScreen(typeof(ScheduleScreen)) }, + new OsuButton { RelativeSizeAxes = Axes.X, Text = "Bracket", Action = () => SetScreen(typeof(LadderScreen)) }, new Container { RelativeSizeAxes = Axes.X, Height = 50 }, - new OsuButton { RelativeSizeAxes = Axes.X, Text = "TeamIntro", Action = () => setScreen(teamIntro) }, - new OsuButton { RelativeSizeAxes = Axes.X, Text = "MapPool", Action = () => setScreen(mapPool) }, - new OsuButton { RelativeSizeAxes = Axes.X, Text = "Gameplay", Action = () => setScreen(gameplay) }, + new OsuButton { RelativeSizeAxes = Axes.X, Text = "TeamIntro", Action = () => SetScreen(typeof(TeamIntroScreen)) }, + new OsuButton { RelativeSizeAxes = Axes.X, Text = "MapPool", Action = () => SetScreen(typeof(MapPoolScreen)) }, + new OsuButton { RelativeSizeAxes = Axes.X, Text = "Gameplay", Action = () => SetScreen(typeof(GameplayScreen)) }, new Container { RelativeSizeAxes = Axes.X, Height = 50 }, - new OsuButton { RelativeSizeAxes = Axes.X, Text = "Win", Action = () => setScreen(winner) }, + new OsuButton { RelativeSizeAxes = Axes.X, Text = "Win", Action = () => SetScreen(typeof(TeamWinScreen)) }, } }, }, }, }; - setScreen(teamIntro); + SetScreen(typeof(ScheduleScreen)); } - private void setScreen(Drawable screen) + public void SetScreen(Type screenType) { + var screen = screens.FirstOrDefault(s => s.GetType() == screenType); + if (screen == null) return; + foreach (var s in screens.Children) { if (s == screen) From 06b08cd82dafee45a767b6fe03b884ecbe4ec558 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 18 Nov 2018 09:29:18 +0900 Subject: [PATCH 160/317] Automate return to gameplay after map pool selection --- .../Screens/MapPool/MapPoolScreen.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs b/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs index 14dd990ec0..a0670fcb87 100644 --- a/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs +++ b/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs @@ -7,11 +7,13 @@ using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Input.Events; +using osu.Framework.Threading; using osu.Game.Beatmaps; using osu.Game.Graphics.Sprites; using osu.Game.Graphics.UserInterface; using osu.Game.Tournament.Components; using osu.Game.Tournament.IPC; +using osu.Game.Tournament.Screens.Gameplay; using osu.Game.Tournament.Screens.Gameplay.Components; using osu.Game.Tournament.Screens.Ladder.Components; using OpenTK; @@ -165,6 +167,11 @@ namespace osu.Game.Tournament.Screens.MapPool setNextMode(); } + [Resolved] + private TournamentSceneManager sceneManager { get; set; } + + private ScheduledDelegate scheduledChange; + private void addForBeatmap(int beatmapId) { if (currentMatch.Value == null) @@ -186,6 +193,12 @@ namespace osu.Game.Tournament.Screens.MapPool }); setNextMode(); + + if (pickType == ChoiceType.Pick) + { + scheduledChange?.Cancel(); + scheduledChange = Scheduler.AddDelayed(() => { sceneManager?.SetScreen(typeof(GameplayScreen)); }, 10000); + } } private void matchChanged(MatchPairing match) From 256d11620fd4be3f700d86616ec59ecfe0fd4693 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 18 Nov 2018 12:38:48 +0900 Subject: [PATCH 161/317] Add missing space after "CS" --- osu.Game.Tournament/Components/SongBar.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Tournament/Components/SongBar.cs b/osu.Game.Tournament/Components/SongBar.cs index 53dec8e0a4..8e266aec28 100644 --- a/osu.Game.Tournament/Components/SongBar.cs +++ b/osu.Game.Tournament/Components/SongBar.cs @@ -188,7 +188,7 @@ namespace osu.Game.Tournament.Components }, new OsuSpriteText { - Text = $"CS{beatmap.BaseDifficulty.CircleSize:0.#} / AR {ar:0.#}{extra}", + Text = $"CS {beatmap.BaseDifficulty.CircleSize:0.#} / AR {ar:0.#}{extra}", Margin = new MarginPadding { Horizontal = 15, Vertical = 5 }, Colour = OsuColour.Gray(0.33f), Anchor = Anchor.TopRight, From 925532508cdac1f94066cf18e2d3c54a80550f1f Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 18 Nov 2018 12:39:17 +0900 Subject: [PATCH 162/317] Change precedence of chat colouring --- osu.Game.Tournament/Components/MatchChatDisplay.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/osu.Game.Tournament/Components/MatchChatDisplay.cs b/osu.Game.Tournament/Components/MatchChatDisplay.cs index 2c94e06fc3..f80b73c4f6 100644 --- a/osu.Game.Tournament/Components/MatchChatDisplay.cs +++ b/osu.Game.Tournament/Components/MatchChatDisplay.cs @@ -193,17 +193,17 @@ namespace osu.Game.Tournament.Components }, }; - if (message.Sender.Colour != null) + if (info.CurrentMatch.Value.Team1.Value.Players.Any(u => u.Id == message.Sender.Id)) { - senderText.Colour = colourBox.Colour = OsuColour.FromHex(message.Sender.Colour); - } - else if (info.CurrentMatch.Value.Team1.Value.Players.Any(u => u.Id == message.Sender.Id)) - { - senderText.Colour = colourBox.Colour = red; + colourBox.Colour = red; } else if (info.CurrentMatch.Value.Team2.Value.Players.Any(u => u.Id == message.Sender.Id)) { - senderText.Colour = colourBox.Colour = blue; + colourBox.Colour = blue; + } + else if (message.Sender.Colour != null) + { + senderText.Colour = colourBox.Colour = OsuColour.FromHex(message.Sender.Colour); } } } From 5621101d40208d0a1cd8b426b464117609a83902 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 18 Nov 2018 12:39:25 +0900 Subject: [PATCH 163/317] Adjust gameplay screen size --- .../Screens/Gameplay/GameplayScreen.cs | 13 ++++++++----- .../Screens/TournamentSceneManager.cs | 2 +- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs b/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs index 7517e83160..77dd2fc8d3 100644 --- a/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs +++ b/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs @@ -15,6 +15,7 @@ using osu.Game.Tournament.Screens.Gameplay.Components; using osu.Game.Tournament.Screens.Ladder.Components; using osu.Game.Tournament.Screens.MapPool; using osu.Game.Tournament.Screens.TeamWin; +using OpenTK; using OpenTK.Graphics; namespace osu.Game.Tournament.Screens.Gameplay @@ -48,6 +49,7 @@ namespace osu.Game.Tournament.Screens.Gameplay { RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, + Y = 5, Direction = FillDirection.Vertical, Anchor = Anchor.Centre, Origin = Anchor.Centre, @@ -63,7 +65,7 @@ namespace osu.Game.Tournament.Screens.Gameplay { Name = "top bar red", RelativeSizeAxes = Axes.X, - Height = 10, + Height = 8, Width = 0.5f, Colour = red, }, @@ -71,7 +73,7 @@ namespace osu.Game.Tournament.Screens.Gameplay { Name = "top bar blue", RelativeSizeAxes = Axes.X, - Height = 10, + Height = 9, Width = 0.5f, Colour = blue, Anchor = Anchor.TopRight, @@ -84,14 +86,15 @@ namespace osu.Game.Tournament.Screens.Gameplay // chroma key area for stable gameplay Name = "chroma", RelativeSizeAxes = Axes.X, - Height = 480, + Height = 500, Colour = new Color4(0, 255, 0, 255), }, } }, scoreDisplay = new MatchScoreDisplay { - Y = -65, + Y = -60, + Scale = new Vector2(0.86f), Anchor = Anchor.BottomCentre, Origin = Anchor.BottomCentre, }, @@ -168,7 +171,7 @@ namespace osu.Game.Tournament.Screens.Gameplay case TourneyState.Idle: contract(); - if (lastState == TourneyState.Ranking) + if (lastState == TourneyState.Ranking && !warmup.Value) { if (currentMatch.Value?.Completed == true) scheduledOperation = Scheduler.AddDelayed(() => { sceneManager?.SetScreen(typeof(TeamWinScreen)); }, 4000); diff --git a/osu.Game.Tournament/Screens/TournamentSceneManager.cs b/osu.Game.Tournament/Screens/TournamentSceneManager.cs index ca3df2627a..28066608d1 100644 --- a/osu.Game.Tournament/Screens/TournamentSceneManager.cs +++ b/osu.Game.Tournament/Screens/TournamentSceneManager.cs @@ -38,7 +38,7 @@ namespace osu.Game.Tournament.Screens { RelativeSizeAxes = Axes.X, Y = 100, - Size = new Vector2(0.45f, 120), + Size = new Vector2(0.45f, 112), Margin = new MarginPadding(10), Anchor = Anchor.BottomCentre, Origin = Anchor.BottomCentre, From 8fab241ce3afe8e5aeab24d7c22ce39a74cf3d54 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 18 Nov 2018 21:15:29 +0900 Subject: [PATCH 164/317] Don't show matches on showcase which are more than four days away --- osu.Game.Tournament/Screens/Schedule/ScheduleScreen.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/osu.Game.Tournament/Screens/Schedule/ScheduleScreen.cs b/osu.Game.Tournament/Screens/Schedule/ScheduleScreen.cs index 4be24a65f7..6781bd78e1 100644 --- a/osu.Game.Tournament/Screens/Schedule/ScheduleScreen.cs +++ b/osu.Game.Tournament/Screens/Schedule/ScheduleScreen.cs @@ -1,6 +1,7 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using System; using System.Linq; using osu.Framework.Allocation; using osu.Framework.Configuration; @@ -76,7 +77,7 @@ namespace osu.Game.Tournament.Screens.Schedule RelativeSizeAxes = Axes.Both, Width = 0.4f, ChildrenEnumerable = ladder.Pairings - .Where(p => p.Completed.Value && p.Team1.Value != null && p.Team2.Value != null) + .Where(p => p.Completed.Value && p.Team1.Value != null && p.Team2.Value != null && Math.Abs(p.Date.Value.DayOfYear - DateTimeOffset.UtcNow.DayOfYear) < 4) .OrderByDescending(p => p.Date.Value) .Take(8) .Select(p => new SchedulePairing(p)) @@ -86,7 +87,7 @@ namespace osu.Game.Tournament.Screens.Schedule RelativeSizeAxes = Axes.Both, Width = 0.6f, ChildrenEnumerable = ladder.Pairings - .Where(p => !p.Completed.Value && p.Team1.Value != null && p.Team2.Value != null) + .Where(p => !p.Completed.Value && p.Team1.Value != null && p.Team2.Value != null && Math.Abs(p.Date.Value.DayOfYear - DateTimeOffset.UtcNow.DayOfYear) < 4) .OrderBy(p => p.Date.Value) .Take(8) .Select(p => new SchedulePairing(p)) From 7d3bcdfc1795d46b5758cf0bdc800fa97f1ce8a4 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 22 Nov 2018 13:17:51 +0900 Subject: [PATCH 165/317] Fix stats not displaying on showcase screen --- osu.Game.Tournament/Components/SongBar.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/osu.Game.Tournament/Components/SongBar.cs b/osu.Game.Tournament/Components/SongBar.cs index aee16c72c4..04c4927fc1 100644 --- a/osu.Game.Tournament/Components/SongBar.cs +++ b/osu.Game.Tournament/Components/SongBar.cs @@ -53,6 +53,7 @@ namespace osu.Game.Tournament.Components private float panelWidth => expanded ? 0.6f : 1; private const float main_width = 0.97f; + private const float inner_panel_width = 0.7f; private bool expanded; @@ -66,7 +67,7 @@ namespace osu.Game.Tournament.Components if (expanded) { - innerPanel.ResizeWidthTo(0.7f, 800, Easing.OutQuint); + innerPanel.ResizeWidthTo(inner_panel_width, 800, Easing.OutQuint); outerPanel.ResizeWidthTo(main_width, 800, Easing.OutQuint); } else @@ -126,7 +127,7 @@ namespace osu.Game.Tournament.Components Anchor = Anchor.Centre, Origin = Anchor.Centre, RelativeSizeAxes = Axes.Both, - Width = 0.7f, + Width = inner_panel_width, Children = new Drawable[] { new Box @@ -143,6 +144,8 @@ namespace osu.Game.Tournament.Components } } }; + + Expanded = true; } private void update() From cbf82f892d697be8a11ad77acf7f4a60f8010f2d Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 22 Nov 2018 14:10:33 +0900 Subject: [PATCH 166/317] Add OD display and fix "*" difficuty modifier display --- osu.Game.Tournament/Components/SongBar.cs | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/osu.Game.Tournament/Components/SongBar.cs b/osu.Game.Tournament/Components/SongBar.cs index 04c4927fc1..3d9fe2f5ee 100644 --- a/osu.Game.Tournament/Components/SongBar.cs +++ b/osu.Game.Tournament/Components/SongBar.cs @@ -158,17 +158,22 @@ namespace osu.Game.Tournament.Components var bpm = beatmap.BeatmapSet.OnlineInfo.BPM; var length = beatmap.OnlineInfo.Length; - string extra = ""; + string hardRockExtra = ""; + string srExtra = ""; var ar = beatmap.BaseDifficulty.ApproachRate; - if ((mods & LegacyMods.HardRock) > 0) extra = "*"; + if ((mods & LegacyMods.HardRock) > 0) + { + hardRockExtra = "*"; + srExtra = "*"; + } if ((mods & LegacyMods.DoubleTime) > 0) { //ar *= 1.5f; bpm *= 1.5f; length /= 1.5f; - extra = "*"; + srExtra = "*"; } panelContents.Children = new Drawable[] @@ -191,7 +196,7 @@ namespace osu.Game.Tournament.Components }, new OsuSpriteText { - Text = $"CS {beatmap.BaseDifficulty.CircleSize:0.#} / AR {ar:0.#}{extra}", + Text = $"CS {beatmap.BaseDifficulty.CircleSize:0.#}{hardRockExtra} / AR {ar:0.#}{srExtra} / OD {beatmap.BaseDifficulty.OverallDifficulty:0.#}{hardRockExtra}", Margin = new MarginPadding { Horizontal = 15, Vertical = 5 }, Colour = OsuColour.Gray(0.33f), Anchor = Anchor.TopRight, @@ -199,7 +204,7 @@ namespace osu.Game.Tournament.Components }, new OsuSpriteText { - Text = $"Star Rating {beatmap.StarDifficulty:0.#}{extra}", + Text = $"Star Rating {beatmap.StarDifficulty:0.#}{srExtra}", Margin = new MarginPadding { Horizontal = 15, Vertical = 5 }, Colour = OsuColour.Gray(0.33f), Anchor = Anchor.BottomRight, From 4e8c7a4dc0fa8530700dff7907e9095d15dc49a7 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 22 Nov 2018 15:42:10 +0900 Subject: [PATCH 167/317] Adjust gameplay area to match better Also reduces size of score display to avoid hiding combos. --- .../Gameplay/Components/MatchHeader.cs | 2 +- .../Screens/Gameplay/GameplayScreen.cs | 24 +++++++++---------- .../Screens/Showcase/TournamentLogo.cs | 2 +- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/osu.Game.Tournament/Screens/Gameplay/Components/MatchHeader.cs b/osu.Game.Tournament/Screens/Gameplay/Components/MatchHeader.cs index 1085e7a8c3..210b42a4c8 100644 --- a/osu.Game.Tournament/Screens/Gameplay/Components/MatchHeader.cs +++ b/osu.Game.Tournament/Screens/Gameplay/Components/MatchHeader.cs @@ -25,7 +25,7 @@ namespace osu.Game.Tournament.Screens.Gameplay.Components private void load(LadderInfo ladder, TextureStore textures) { RelativeSizeAxes = Axes.X; - Height = 100; + Height = 95; Children = new Drawable[] { new TournamentLogo(), diff --git a/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs b/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs index 29b1b85e02..8897a98a7e 100644 --- a/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs +++ b/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs @@ -45,20 +45,28 @@ namespace osu.Game.Tournament.Screens.Gameplay AddRange(new Drawable[] { new MatchHeader(), - new FillFlowContainer + new Container { RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, Y = 5, - Direction = FillDirection.Vertical, Anchor = Anchor.Centre, Origin = Anchor.Centre, Children = new Drawable[] { + new Box + { + // chroma key area for stable gameplay + Name = "chroma", + RelativeSizeAxes = Axes.X, + Height = 512, + Colour = new Color4(0, 255, 0, 255), + }, new Container { RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, + Y = -4, Children = new Drawable[] { new Circle @@ -73,7 +81,7 @@ namespace osu.Game.Tournament.Screens.Gameplay { Name = "top bar blue", RelativeSizeAxes = Axes.X, - Height = 9, + Height = 8, Width = 0.5f, Colour = blue, Anchor = Anchor.TopRight, @@ -81,20 +89,12 @@ namespace osu.Game.Tournament.Screens.Gameplay }, } }, - new Box - { - // chroma key area for stable gameplay - Name = "chroma", - RelativeSizeAxes = Axes.X, - Height = 500, - Colour = new Color4(0, 255, 0, 255), - }, } }, scoreDisplay = new MatchScoreDisplay { Y = -60, - Scale = new Vector2(0.86f), + Scale = new Vector2(0.8f), Anchor = Anchor.BottomCentre, Origin = Anchor.BottomCentre, }, diff --git a/osu.Game.Tournament/Screens/Showcase/TournamentLogo.cs b/osu.Game.Tournament/Screens/Showcase/TournamentLogo.cs index 5b0b4b62e2..cd4f646fe7 100644 --- a/osu.Game.Tournament/Screens/Showcase/TournamentLogo.cs +++ b/osu.Game.Tournament/Screens/Showcase/TournamentLogo.cs @@ -15,7 +15,7 @@ namespace osu.Game.Tournament.Screens.Showcase public TournamentLogo() { RelativeSizeAxes = Axes.X; - Height = 100; + Height = 95; Margin = new MarginPadding { Vertical = 5 }; } From fb05ea3de34e18cba986422e948b6e705eff126c Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 22 Nov 2018 16:23:44 +0900 Subject: [PATCH 168/317] Fix alignment and fonts of tem intro screen --- .../Screens/TeamIntro/TeamIntroScreen.cs | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/osu.Game.Tournament/Screens/TeamIntro/TeamIntroScreen.cs b/osu.Game.Tournament/Screens/TeamIntro/TeamIntroScreen.cs index 7567325bfe..55af305045 100644 --- a/osu.Game.Tournament/Screens/TeamIntro/TeamIntroScreen.cs +++ b/osu.Game.Tournament/Screens/TeamIntro/TeamIntroScreen.cs @@ -105,8 +105,9 @@ namespace osu.Game.Tournament.Screens.TeamIntro Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, Colour = col, + Font = "Exo2.0-Black", Text = "COMING UP NEXT", - Font = "Aquatico-Regular", + Spacing = new Vector2(2, 0), TextSize = 15, }, new OsuSpriteText @@ -115,7 +116,7 @@ namespace osu.Game.Tournament.Screens.TeamIntro Origin = Anchor.TopCentre, Colour = col, Text = pairing.Grouping.Value?.Name.Value ?? "Unknown Grouping", - Font = "Aquatico-Light", + Font = "Exo2.0-Light", Spacing = new Vector2(10, 0), TextSize = 50, }, @@ -123,7 +124,6 @@ namespace osu.Game.Tournament.Screens.TeamIntro { Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, - Font = "Aquatico-Light", Colour = col, Text = pairing.Date.Value.ToUniversalTime().ToString("dd MMMM HH:mm UTC"), TextSize = 20, @@ -158,11 +158,10 @@ namespace osu.Game.Tournament.Screens.TeamIntro AutoSizeAxes = Axes.Both, Spacing = new Vector2(0, 5), Padding = new MarginPadding(20), - - - Anchor = !left ? Anchor.CentreRight : Anchor.CentreLeft, - Origin = !left ? Anchor.CentreRight : Anchor.CentreLeft, + Anchor = left ? Anchor.CentreRight : Anchor.CentreLeft, + Origin = left ? Anchor.CentreRight : Anchor.CentreLeft, RelativePositionAxes = Axes.Both, + X = (left ? -1 : 1) * 0.66f, }, }; @@ -172,7 +171,6 @@ namespace osu.Game.Tournament.Screens.TeamIntro players.Add(new OsuSpriteText { Text = p.Username, - Font = "Aquatico-Regular", TextSize = 24, Colour = colour, Anchor = left ? Anchor.CentreRight : Anchor.CentreLeft, @@ -215,6 +213,7 @@ namespace osu.Game.Tournament.Screens.TeamIntro { Text = teamName.ToUpper(), TextSize = 20, + Font = "Aquatico-Regular", Colour = colour, Origin = Anchor.TopCentre, Anchor = Anchor.TopCentre, From 17a81259d4eae8d261caaf0b139a2a85bd8ae1ec Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 22 Nov 2018 17:25:46 +0900 Subject: [PATCH 169/317] Fix spacing and colouring of song bar eleemnts Also uses MM:ss instead of ssss. --- osu.Game.Tournament/Components/SongBar.cs | 73 +++++++++++++++-------- 1 file changed, 48 insertions(+), 25 deletions(-) diff --git a/osu.Game.Tournament/Components/SongBar.cs b/osu.Game.Tournament/Components/SongBar.cs index 3d9fe2f5ee..14a01aebdf 100644 --- a/osu.Game.Tournament/Components/SongBar.cs +++ b/osu.Game.Tournament/Components/SongBar.cs @@ -1,11 +1,13 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using System; using osu.Framework.Allocation; using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; +using osu.Framework.Graphics.Sprites; using osu.Game.Beatmaps; using osu.Game.Beatmaps.Legacy; using osu.Game.Graphics; @@ -178,38 +180,26 @@ namespace osu.Game.Tournament.Components panelContents.Children = new Drawable[] { - new OsuSpriteText + new DiffPiece(("Length", TimeSpan.FromSeconds(length).ToString(@"mm\:ss"))) { - Text = $"Length {length:0}s", - Margin = new MarginPadding { Horizontal = 15, Vertical = 5 }, - Colour = OsuColour.Gray(0.33f), - Anchor = Anchor.TopLeft, - Origin = Anchor.TopLeft, + Anchor = Anchor.CentreLeft, + Origin = Anchor.BottomLeft, }, - new OsuSpriteText + new DiffPiece(("BPM", $"{bpm:0.#}")) { - Text = $"BPM {bpm:0.#}", - Margin = new MarginPadding { Horizontal = 15, Vertical = 5 }, - Colour = OsuColour.Gray(0.33f), - Anchor = Anchor.BottomLeft, - Origin = Anchor.BottomLeft + Anchor = Anchor.CentreLeft, + Origin = Anchor.TopLeft }, - new OsuSpriteText + new DiffPiece(("CS", $"{beatmap.BaseDifficulty.CircleSize:0.#}{hardRockExtra}"), ("AR", $"{ar:0.#}{srExtra}"), ("OD", $"{beatmap.BaseDifficulty.OverallDifficulty:0.#}{hardRockExtra}")) { - Text = $"CS {beatmap.BaseDifficulty.CircleSize:0.#}{hardRockExtra} / AR {ar:0.#}{srExtra} / OD {beatmap.BaseDifficulty.OverallDifficulty:0.#}{hardRockExtra}", - Margin = new MarginPadding { Horizontal = 15, Vertical = 5 }, - Colour = OsuColour.Gray(0.33f), - Anchor = Anchor.TopRight, - Origin = Anchor.TopRight - }, - new OsuSpriteText - { - Text = $"Star Rating {beatmap.StarDifficulty:0.#}{srExtra}", - Margin = new MarginPadding { Horizontal = 15, Vertical = 5 }, - Colour = OsuColour.Gray(0.33f), - Anchor = Anchor.BottomRight, + Anchor = Anchor.CentreRight, Origin = Anchor.BottomRight }, + new DiffPiece(("Star Rating", $"{beatmap.StarDifficulty:0.#}{srExtra}")) + { + Anchor = Anchor.CentreRight, + Origin = Anchor.TopRight + }, panel = new TournamentBeatmapPanel(beatmap) { Anchor = Anchor.Centre, @@ -219,5 +209,38 @@ namespace osu.Game.Tournament.Components } }; } + + public class DiffPiece : TextFlowContainer + { + public DiffPiece(params (string heading, string content)[] tuples) + { + Margin = new MarginPadding { Horizontal = 15, Vertical = 1 }; + AutoSizeAxes = Axes.Both; + + void cp(SpriteText s, Color4 colour) + { + s.Colour = colour; + s.TextSize = 15; + s.Font = @"Exo2.0-Bold"; + } + + bool first = true; + foreach (var t in tuples) + { + if (!first) + AddText(" / ", s => + { + cp(s, OsuColour.Gray(0.33f)); + s.Spacing = new Vector2(-2, 0); + }); + + AddText(new OsuSpriteText { Text = t.heading }, s => cp(s, OsuColour.Gray(0.33f))); + AddText(" ", s => cp(s, OsuColour.Gray(0.33f))); + AddText(new OsuSpriteText { Text = t.content }, s => cp(s, OsuColour.Gray(0.5f))); + first = false; + } + } + } } } + From fdba2bffb9dee193def8d9cf4cb929849c9d11df Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 22 Nov 2018 17:33:48 +0900 Subject: [PATCH 170/317] Ensure last state is set correctly --- .../Screens/Gameplay/GameplayScreen.cs | 103 +++++++++--------- 1 file changed, 54 insertions(+), 49 deletions(-) diff --git a/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs b/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs index 8897a98a7e..05cf4751f4 100644 --- a/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs +++ b/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs @@ -135,61 +135,66 @@ namespace osu.Game.Tournament.Screens.Gameplay private void stateChanged(TourneyState state) { - if (state == TourneyState.Ranking) + try { - if (warmup.Value) return; - - if (ipc.Score1 > ipc.Score2) - currentMatch.Value.Team1Score.Value++; - else - currentMatch.Value.Team2Score.Value++; - } - - scheduledOperation?.Cancel(); - - void expand() - { - chat.Expand(); - - using (BeginDelayedSequence(300, true)) + if (state == TourneyState.Ranking) { - scoreDisplay.FadeIn(100); - SongBar.Expanded = true; + if (warmup.Value) return; + + if (ipc.Score1 > ipc.Score2) + currentMatch.Value.Team1Score.Value++; + else + currentMatch.Value.Team2Score.Value++; + } + + scheduledOperation?.Cancel(); + + void expand() + { + chat.Expand(); + + using (BeginDelayedSequence(300, true)) + { + scoreDisplay.FadeIn(100); + SongBar.Expanded = true; + } + } + + void contract() + { + SongBar.Expanded = false; + scoreDisplay.FadeOut(100); + using (chat.BeginDelayedSequence(500)) + chat.Contract(); + } + + switch (state) + { + case TourneyState.Idle: + contract(); + + if (lastState == TourneyState.Ranking && !warmup.Value) + { + if (currentMatch.Value?.Completed == true) + scheduledOperation = Scheduler.AddDelayed(() => { sceneManager?.SetScreen(typeof(TeamWinScreen)); }, 4000); + else if (currentMatch.Value?.Completed == false) + scheduledOperation = Scheduler.AddDelayed(() => { sceneManager?.SetScreen(typeof(MapPoolScreen)); }, 4000); + } + + break; + case TourneyState.Ranking: + scheduledOperation = Scheduler.AddDelayed(contract, 10000); + break; + default: + chat.Expand(); + expand(); + break; } } - - void contract() + finally { - SongBar.Expanded = false; - scoreDisplay.FadeOut(100); - using (chat.BeginDelayedSequence(500)) - chat.Contract(); + lastState = state; } - - switch (state) - { - case TourneyState.Idle: - contract(); - - if (lastState == TourneyState.Ranking && !warmup.Value) - { - if (currentMatch.Value?.Completed == true) - scheduledOperation = Scheduler.AddDelayed(() => { sceneManager?.SetScreen(typeof(TeamWinScreen)); }, 4000); - else if (currentMatch.Value?.Completed == false) - scheduledOperation = Scheduler.AddDelayed(() => { sceneManager?.SetScreen(typeof(MapPoolScreen)); }, 4000); - } - - break; - case TourneyState.Ranking: - scheduledOperation = Scheduler.AddDelayed(contract, 10000); - break; - default: - chat.Expand(); - expand(); - break; - } - - lastState = state; } } } From 056025c5c2ddc5bca93d5f104372f8b224fe4891 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 1 Dec 2018 09:50:11 +0900 Subject: [PATCH 171/317] Fix handling of API responses --- osu.Game.Tournament/Components/TournamentBeatmapPanel.cs | 3 +++ osu.Game.Tournament/TournamentGameBase.cs | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/osu.Game.Tournament/Components/TournamentBeatmapPanel.cs b/osu.Game.Tournament/Components/TournamentBeatmapPanel.cs index 3165e5a2c4..ae2e2b5160 100644 --- a/osu.Game.Tournament/Components/TournamentBeatmapPanel.cs +++ b/osu.Game.Tournament/Components/TournamentBeatmapPanel.cs @@ -1,6 +1,7 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using System; using System.Collections.ObjectModel; using System.Collections.Specialized; using System.Linq; @@ -39,6 +40,8 @@ namespace osu.Game.Tournament.Components public TournamentBeatmapPanel(BeatmapInfo beatmap, string mods = null) { + if (beatmap == null) throw new ArgumentNullException(nameof(beatmap)); + Beatmap = beatmap; this.mods = mods; Width = 400; diff --git a/osu.Game.Tournament/TournamentGameBase.cs b/osu.Game.Tournament/TournamentGameBase.cs index 8734b2e64b..e37b7cf8d6 100644 --- a/osu.Game.Tournament/TournamentGameBase.cs +++ b/osu.Game.Tournament/TournamentGameBase.cs @@ -113,8 +113,8 @@ namespace osu.Game.Tournament if (string.IsNullOrEmpty(p.Username)) { var req = new GetUserRequest(p.Id); - req.Success += i => p.Username = i.Username; req.Perform(API); + p.Username = req.Result.Username; addedInfo = true; } @@ -125,8 +125,8 @@ namespace osu.Game.Tournament if (b.BeatmapInfo == null) { var req = new GetBeatmapRequest(new BeatmapInfo { OnlineBeatmapID = b.ID }); - req.Success += i => b.BeatmapInfo = i.ToBeatmap(RulesetStore); req.Perform(API); + b.BeatmapInfo = req.Result?.ToBeatmap(RulesetStore); addedInfo = true; } From 61ca79a8b2294eba4cd83be2a7b725912ae00dc6 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 1 Dec 2018 15:32:11 +0900 Subject: [PATCH 172/317] Add conditional match support --- .../Components/ConditionalMatchPairing.cs | 12 +++++++++ .../Ladder/Components/DrawableMatchPairing.cs | 14 ++++++++++- .../Screens/Ladder/Components/MatchPairing.cs | 16 +++++++++++- .../Screens/Schedule/ScheduleScreen.cs | 25 +++++++++++++------ osu.Game.Tournament/TournamentGameBase.cs | 7 ++++++ 5 files changed, 65 insertions(+), 9 deletions(-) create mode 100644 osu.Game.Tournament/Screens/Ladder/Components/ConditionalMatchPairing.cs diff --git a/osu.Game.Tournament/Screens/Ladder/Components/ConditionalMatchPairing.cs b/osu.Game.Tournament/Screens/Ladder/Components/ConditionalMatchPairing.cs new file mode 100644 index 0000000000..bff661bcf4 --- /dev/null +++ b/osu.Game.Tournament/Screens/Ladder/Components/ConditionalMatchPairing.cs @@ -0,0 +1,12 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +namespace osu.Game.Tournament.Screens.Ladder.Components +{ + /// + /// A pairing that may not necessarily occur. + /// + public class ConditionalMatchPairing : MatchPairing + { + } +} diff --git a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs index e727e740f9..db942c6e4c 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs @@ -199,6 +199,18 @@ namespace osu.Game.Tournament.Screens.Ladder.Components if (Pairing.Team1.Value == null || Pairing.Team2.Value == null) Pairing.CancelMatchStart(); + if (Pairing.ConditionalPairings.Count > 0) + { + foreach (var conditional in Pairing.ConditionalPairings) + { + var team1Match = conditional.Acronyms.Contains(Pairing.Team1Acronym); + var team2Match = conditional.Acronyms.Contains(Pairing.Team2Acronym); + + if (team1Match && team2Match) + Pairing.Date.Value = conditional.Date; + } + } + Flow.Children = new[] { new DrawableMatchTeam(Pairing.Team1, Pairing, Pairing.Losers), @@ -226,7 +238,7 @@ namespace osu.Game.Tournament.Screens.Ladder.Components protected override bool OnClick(ClickEvent e) { - if (editorInfo == null) + if (editorInfo == null || Pairing is ConditionalMatchPairing) return false; Selected = true; diff --git a/osu.Game.Tournament/Screens/Ladder/Components/MatchPairing.cs b/osu.Game.Tournament/Screens/Ladder/Components/MatchPairing.cs index 003f41cfa9..8461cf4ae1 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/MatchPairing.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/MatchPairing.cs @@ -2,6 +2,7 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; +using System.Collections.Generic; using System.Collections.ObjectModel; using Newtonsoft.Json; using osu.Framework.Configuration; @@ -17,6 +18,17 @@ namespace osu.Game.Tournament.Screens.Ladder.Components { public int ID; + public List Acronyms + { + get + { + List acronyms = new List(); + if (Team1Acronym != null) acronyms.Add(Team1Acronym); + if (Team2Acronym != null) acronyms.Add(Team2Acronym); + return acronyms; + } + } + [JsonIgnore] public readonly Bindable Team1 = new Bindable(); @@ -53,6 +65,8 @@ namespace osu.Game.Tournament.Screens.Ladder.Components public readonly Bindable Date = new Bindable(); + public readonly BindableCollection ConditionalPairings = new BindableCollection(); + public readonly Bindable Position = new Bindable(); public MatchPairing() @@ -74,7 +88,7 @@ namespace osu.Game.Tournament.Screens.Ladder.Components [JsonIgnore] public TournamentTeam Loser => !Completed.Value ? null : Team1Score.Value > Team2Score.Value ? Team2.Value : Team1.Value; - public int PointsToWin => Grouping.Value.BestOf / 2 + 1; + public int PointsToWin => Grouping.Value == null ? 0 : Grouping.Value.BestOf / 2 + 1; /// /// Remove scores from the match, in case of a false click or false start. diff --git a/osu.Game.Tournament/Screens/Schedule/ScheduleScreen.cs b/osu.Game.Tournament/Screens/Schedule/ScheduleScreen.cs index 37577ec3b0..f3f3667db1 100644 --- a/osu.Game.Tournament/Screens/Schedule/ScheduleScreen.cs +++ b/osu.Game.Tournament/Screens/Schedule/ScheduleScreen.cs @@ -56,6 +56,13 @@ namespace osu.Game.Tournament.Screens.Schedule return; } + var upcoming = ladder.Pairings.Where(p => !p.Completed.Value && p.Team1.Value != null && p.Team2.Value != null && Math.Abs(p.Date.Value.DayOfYear - DateTimeOffset.UtcNow.DayOfYear) < 4); + var conditionals = ladder.Pairings.Where(p => !p.Completed.Value && (p.Team1.Value == null || p.Team2.Value == null) && Math.Abs(p.Date.Value.DayOfYear - DateTimeOffset.UtcNow.DayOfYear) < 4) + .SelectMany(m => m.ConditionalPairings.Where(cp => m.Acronyms.TrueForAll(a => cp.Acronyms.Contains(a)))); + + upcoming = upcoming.Concat(conditionals); + upcoming = upcoming.OrderBy(p => p.Date.Value).Take(12); + mainContainer.Child = new FillFlowContainer { RelativeSizeAxes = Axes.Both, @@ -77,7 +84,8 @@ namespace osu.Game.Tournament.Screens.Schedule RelativeSizeAxes = Axes.Both, Width = 0.4f, ChildrenEnumerable = ladder.Pairings - .Where(p => p.Completed.Value && p.Team1.Value != null && p.Team2.Value != null && Math.Abs(p.Date.Value.DayOfYear - DateTimeOffset.UtcNow.DayOfYear) < 4) + .Where(p => p.Completed.Value && p.Team1.Value != null && p.Team2.Value != null + && Math.Abs(p.Date.Value.DayOfYear - DateTimeOffset.UtcNow.DayOfYear) < 4) .OrderByDescending(p => p.Date.Value) .Take(8) .Select(p => new SchedulePairing(p)) @@ -86,11 +94,7 @@ namespace osu.Game.Tournament.Screens.Schedule { RelativeSizeAxes = Axes.Both, Width = 0.6f, - ChildrenEnumerable = ladder.Pairings - .Where(p => !p.Completed.Value && p.Team1.Value != null && p.Team2.Value != null && Math.Abs(p.Date.Value.DayOfYear - DateTimeOffset.UtcNow.DayOfYear) < 4) - .OrderBy(p => p.Date.Value) - .Take(8) - .Select(p => new SchedulePairing(p)) + ChildrenEnumerable = upcoming.Select(p => new SchedulePairing(p)) }, } } @@ -129,6 +133,11 @@ namespace osu.Game.Tournament.Screens.Schedule { Flow.Direction = FillDirection.Horizontal; + bool conditional = pairing is ConditionalMatchPairing; + + if (conditional) + Colour = OsuColour.Gray(0.5f); + if (showTimestamp) { AddInternal(new DrawableDate(Pairing.Date.Value) @@ -136,6 +145,7 @@ namespace osu.Game.Tournament.Screens.Schedule Anchor = Anchor.TopRight, Origin = Anchor.TopLeft, Colour = Color4.Black, + Alpha = conditional ? 0.6f : 1, Margin = new MarginPadding { Horizontal = 10, Vertical = 5 }, }); AddInternal(new OsuSpriteText @@ -143,8 +153,9 @@ namespace osu.Game.Tournament.Screens.Schedule Anchor = Anchor.BottomRight, Origin = Anchor.BottomLeft, Colour = Color4.Black, + Alpha = conditional ? 0.6f : 1, Margin = new MarginPadding { Horizontal = 10, Vertical = 5 }, - Text = pairing.Date.Value.ToUniversalTime().ToString("HH:mm UTC") + Text = pairing.Date.Value.ToUniversalTime().ToString("HH:mm UTC") + (conditional ? " (conditional)" : "") }); } } diff --git a/osu.Game.Tournament/TournamentGameBase.cs b/osu.Game.Tournament/TournamentGameBase.cs index e37b7cf8d6..4938533a9e 100644 --- a/osu.Game.Tournament/TournamentGameBase.cs +++ b/osu.Game.Tournament/TournamentGameBase.cs @@ -78,6 +78,13 @@ namespace osu.Game.Tournament { pairing.Team1.Value = Ladder.Teams.FirstOrDefault(t => t.Acronym == pairing.Team1Acronym); pairing.Team2.Value = Ladder.Teams.FirstOrDefault(t => t.Acronym == pairing.Team2Acronym); + + foreach (var conditional in pairing.ConditionalPairings) + { + conditional.Team1.Value = Ladder.Teams.FirstOrDefault(t => t.Acronym == conditional.Team1Acronym); + conditional.Team2.Value = Ladder.Teams.FirstOrDefault(t => t.Acronym == conditional.Team2Acronym); + conditional.Grouping.Value = pairing.Grouping.Value; + } } // assign progressions From f083b186638c2859eded8173903cfa30424536a0 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 14 Dec 2018 17:59:42 +0900 Subject: [PATCH 173/317] Update in line with framework changes --- osu.Game/Online/Chat/DrawableLinkCompiler.cs | 11 +++++------ osu.Game/OsuGame.cs | 4 ++-- osu.Game/Overlays/Music/PlaylistItem.cs | 5 ++--- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/osu.Game/Online/Chat/DrawableLinkCompiler.cs b/osu.Game/Online/Chat/DrawableLinkCompiler.cs index de017baf35..2b0a49cb6c 100644 --- a/osu.Game/Online/Chat/DrawableLinkCompiler.cs +++ b/osu.Game/Online/Chat/DrawableLinkCompiler.cs @@ -6,7 +6,6 @@ using System.Collections.Generic; using System.Linq; using osu.Framework.Allocation; using osu.Framework.Graphics; -using osu.Framework.Graphics.Sprites; using osu.Game.Graphics; using osu.Game.Graphics.Containers; using osu.Game.Graphics.UserInterface; @@ -15,20 +14,20 @@ using osuTK; namespace osu.Game.Online.Chat { /// - /// An invisible drawable that brings multiple pieces together to form a consumable clickable link. + /// An invisible drawable that brings multiple pieces together to form a consumable clickable link. /// public class DrawableLinkCompiler : OsuHoverContainer, IHasTooltip { /// /// Each word part of a chat link (split for word-wrap support). /// - public List Parts; + public List Parts; public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => Parts.Any(d => d.ReceivePositionalInputAt(screenSpacePos)); protected override HoverClickSounds CreateHoverClickSounds(HoverSampleSet sampleSet) => new LinkHoverSounds(sampleSet, Parts); - public DrawableLinkCompiler(IEnumerable parts) + public DrawableLinkCompiler(IEnumerable parts) { Parts = parts.ToList(); } @@ -45,9 +44,9 @@ namespace osu.Game.Online.Chat private class LinkHoverSounds : HoverClickSounds { - private readonly List parts; + private readonly List parts; - public LinkHoverSounds(HoverSampleSet sampleSet, List parts) + public LinkHoverSounds(HoverSampleSet sampleSet, List parts) : base(sampleSet) { this.parts = parts; diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index cd40d4793a..73ecbafb9e 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -553,9 +553,9 @@ namespace osu.Game try { - Logger.Log($"Loading {d}...", LoggingTarget.Debug); + Logger.Log($"Loading {d}...", level: LogLevel.Debug); await LoadComponentAsync(d, add); - Logger.Log($"Loaded {d}!", LoggingTarget.Debug); + Logger.Log($"Loaded {d}!", level: LogLevel.Debug); } catch (OperationCanceledException) { diff --git a/osu.Game/Overlays/Music/PlaylistItem.cs b/osu.Game/Overlays/Music/PlaylistItem.cs index 5d89e53081..40a395535d 100644 --- a/osu.Game/Overlays/Music/PlaylistItem.cs +++ b/osu.Game/Overlays/Music/PlaylistItem.cs @@ -7,7 +7,6 @@ using osuTK.Graphics; using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Sprites; using osu.Framework.Input.Events; using osu.Framework.Localisation; using osu.Game.Beatmaps; @@ -26,7 +25,7 @@ namespace osu.Game.Overlays.Music private SpriteIcon handle; private TextFlowContainer text; - private IEnumerable titleSprites; + private IEnumerable titleSprites; private ILocalisedBindableString titleBind; private ILocalisedBindableString artistBind; @@ -58,7 +57,7 @@ namespace osu.Game.Overlays.Music selected = value; FinishTransforms(true); - foreach (SpriteText s in titleSprites) + foreach (Drawable s in titleSprites) s.FadeColour(Selected ? hoverColour : Color4.White, fade_duration); } } From 8907ce3f6300d558ad5490eadf7ee53e0e0df719 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 14 Dec 2018 18:11:04 +0900 Subject: [PATCH 174/317] Automatically fix invalid pairing dates on load (based on contained groupings) --- osu.Game.Tournament/TournamentGameBase.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/osu.Game.Tournament/TournamentGameBase.cs b/osu.Game.Tournament/TournamentGameBase.cs index 4938533a9e..5c9bee560e 100644 --- a/osu.Game.Tournament/TournamentGameBase.cs +++ b/osu.Game.Tournament/TournamentGameBase.cs @@ -109,7 +109,12 @@ namespace osu.Game.Tournament foreach (var id in group.Pairings) { var found = Ladder.Pairings.FirstOrDefault(p => p.ID == id); - if (found != null) found.Grouping.Value = group; + if (found != null) + { + found.Grouping.Value = group; + if (group.StartDate.Value > found.Date.Value) + found.Date.Value = group.StartDate.Value; + } } Ladder.CurrentMatch.Value = Ladder.Pairings.FirstOrDefault(p => p.Current.Value); From a7c82c97416a5f8777299e57715e4a8b7bdcb207 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 20 Dec 2018 16:50:38 +0900 Subject: [PATCH 175/317] Split out chat component into reusable piece --- .../Components/MatchChatDisplay.cs | 168 ++---------------- 1 file changed, 13 insertions(+), 155 deletions(-) diff --git a/osu.Game.Tournament/Components/MatchChatDisplay.cs b/osu.Game.Tournament/Components/MatchChatDisplay.cs index 41efd0833b..8eedded0f1 100644 --- a/osu.Game.Tournament/Components/MatchChatDisplay.cs +++ b/osu.Game.Tournament/Components/MatchChatDisplay.cs @@ -1,59 +1,23 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using System.Collections.Generic; using System.Linq; using osu.Framework.Allocation; using osu.Framework.Configuration; using osu.Framework.Graphics; -using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Shapes; using osu.Game.Graphics; -using osu.Game.Graphics.Containers; -using osu.Game.Graphics.Sprites; using osu.Game.Online.Chat; using osu.Game.Tournament.IPC; -using osuTK; using osuTK.Graphics; namespace osu.Game.Tournament.Components { - public class MatchChatDisplay : CompositeDrawable + public class MatchChatDisplay : StandAloneChatDisplay { - private Channel lastChannel; - public readonly Bindable Channel = new Bindable(); - private readonly FillFlowContainer messagesFlow; - - public MatchChatDisplay() - { - CornerRadius = 10; - Masking = true; - - InternalChildren = new Drawable[] - { - new Box - { - Colour = Color4.Black, - Alpha = 0.8f, - RelativeSizeAxes = Axes.Both, - }, - messagesFlow = new FillFlowContainer - { - RelativeSizeAxes = Axes.X, - AutoSizeAxes = Axes.Y, - LayoutEasing = Easing.Out, - LayoutDuration = 500, - Anchor = Anchor.BottomLeft, - Origin = Anchor.BottomLeft, - Direction = FillDirection.Vertical, - }, - }; - - Channel.BindValueChanged(channelChanged); - } - private readonly Bindable chatChannel = new Bindable(); + protected override Drawable CreateMessage(Message message) => new MatchMessage(message); + private ChannelManager manager; [BackgroundDependencyLoader(true)] @@ -92,132 +56,26 @@ namespace osu.Game.Tournament.Components } } - private void channelChanged(Channel channel) + protected class MatchMessage : StandAloneMessage { - if (lastChannel != null) - lastChannel.NewMessagesArrived -= newMessages; - - lastChannel = channel; - messagesFlow.Clear(); - - if (channel == null) return; - - channel.NewMessagesArrived += newMessages; - } - - private void newMessages(IEnumerable messages) - { - var excessChildren = messagesFlow.Children.Count - 10; - if (excessChildren > 0) - { - foreach (var c in messagesFlow.Children.Take(excessChildren)) - c.Expire(); - } - - foreach (var message in messages) - { - var formatted = MessageFormatter.FormatMessage(message); - messagesFlow.Add(new MatchMessage(formatted) { Y = messagesFlow.Height }); - } - } - - private class MatchMessage : CompositeDrawable - { - private readonly Message message; - public MatchMessage(Message message) + : base(message) { - this.message = message; } - private readonly Color4 red = new Color4(186, 0, 18, 255); - private readonly Color4 blue = new Color4(17, 136, 170, 255); - [BackgroundDependencyLoader] private void load(LadderInfo info) { - Circle colourBox; - - Margin = new MarginPadding(3); - - RelativeSizeAxes = Axes.X; - AutoSizeAxes = Axes.Y; - - OsuSpriteText senderText; - InternalChildren = new Drawable[] - { - new FillFlowContainer - { - RelativeSizeAxes = Axes.X, - AutoSizeAxes = Axes.Y, - Direction = FillDirection.Horizontal, - Children = new Drawable[] - { - new Container - { - RelativeSizeAxes = Axes.X, - Width = 0.2f, - Children = new Drawable[] - { - senderText = new OsuSpriteText - { - Font = @"Exo2.0-Bold", - Anchor = Anchor.TopRight, - Origin = Anchor.TopRight, - Text = message.Sender.ToString() - } - } - }, - new Container - { - Size = new Vector2(8, OsuSpriteText.FONT_SIZE), - Margin = new MarginPadding { Horizontal = 3 }, - Children = new Drawable[] - { - colourBox = new Circle - { - Anchor = Anchor.Centre, - Origin = Anchor.Centre, - Size = new Vector2(8), - }, - } - }, - new OsuTextFlowContainer - { - RelativeSizeAxes = Axes.X, - AutoSizeAxes = Axes.Y, - Width = 0.5f, - Text = message.DisplayContent - } - } - }, - }; - - if (info.CurrentMatch.Value.Team1.Value.Players.Any(u => u.Id == message.Sender.Id)) - { - colourBox.Colour = red; - } - else if (info.CurrentMatch.Value.Team2.Value.Players.Any(u => u.Id == message.Sender.Id)) - { - colourBox.Colour = blue; - } - else if (message.Sender.Colour != null) - { - senderText.Colour = colourBox.Colour = OsuColour.FromHex(message.Sender.Colour); - } + if (info.CurrentMatch.Value.Team1.Value.Players.Any(u => u.Id == Message.Sender.Id)) + ColourBox.Colour = red; + else if (info.CurrentMatch.Value.Team2.Value.Players.Any(u => u.Id == Message.Sender.Id)) + ColourBox.Colour = blue; + else if (Message.Sender.Colour != null) + SenderText.Colour = ColourBox.Colour = OsuColour.FromHex(Message.Sender.Colour); } - } - public void Contract() - { - this.FadeIn(300); - this.MoveToY(0, 500, Easing.OutQuint); - } - - public void Expand() - { - this.FadeOut(200); - this.MoveToY(100, 500, Easing.In); + private readonly Color4 red = new Color4(186, 0, 18, 255); + private readonly Color4 blue = new Color4(17, 136, 170, 255); } } } From cb23918512a1c8e7d2d65aa5170336a3567381e1 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 3 Feb 2019 11:24:43 +0900 Subject: [PATCH 176/317] Changes for mania world cup --- osu.Game.Tournament/Components/SongBar.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/osu.Game.Tournament/Components/SongBar.cs b/osu.Game.Tournament/Components/SongBar.cs index 14a01aebdf..fc75bd59a4 100644 --- a/osu.Game.Tournament/Components/SongBar.cs +++ b/osu.Game.Tournament/Components/SongBar.cs @@ -190,7 +190,12 @@ namespace osu.Game.Tournament.Components Anchor = Anchor.CentreLeft, Origin = Anchor.TopLeft }, - new DiffPiece(("CS", $"{beatmap.BaseDifficulty.CircleSize:0.#}{hardRockExtra}"), ("AR", $"{ar:0.#}{srExtra}"), ("OD", $"{beatmap.BaseDifficulty.OverallDifficulty:0.#}{hardRockExtra}")) + new DiffPiece( + //("CS", $"{beatmap.BaseDifficulty.CircleSize:0.#}{hardRockExtra}"), + //("AR", $"{ar:0.#}{srExtra}"), + ("OD", $"{beatmap.BaseDifficulty.OverallDifficulty:0.#}{hardRockExtra}"), + ("HP", $"{beatmap.BaseDifficulty.DrainRate:0.#}{hardRockExtra}") + ) { Anchor = Anchor.CentreRight, Origin = Anchor.BottomRight From 5048f425d4b5fa37881fea1ae0c648ef441ca8ee Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 6 Feb 2019 18:36:15 +0900 Subject: [PATCH 177/317] Add ability to reset bracket --- .../Screens/Ladder/Components/MatchPairing.cs | 9 +++++++++ osu.Game.Tournament/Screens/Ladder/LadderEditorScreen.cs | 5 +++++ 2 files changed, 14 insertions(+) diff --git a/osu.Game.Tournament/Screens/Ladder/Components/MatchPairing.cs b/osu.Game.Tournament/Screens/Ladder/Components/MatchPairing.cs index b3adc3b49b..7d6acc5bd2 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/MatchPairing.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/MatchPairing.cs @@ -110,5 +110,14 @@ namespace osu.Game.Tournament.Screens.Ladder.Components Team1Score.Value = 0; Team2Score.Value = 0; } + + public void Reset() + { + CancelMatchStart(); + Team1.Value = null; + Team2.Value = null; + Completed.Value = false; + PicksBans.Clear(); + } } } diff --git a/osu.Game.Tournament/Screens/Ladder/LadderEditorScreen.cs b/osu.Game.Tournament/Screens/Ladder/LadderEditorScreen.cs index adc880e524..e3cb1473be 100644 --- a/osu.Game.Tournament/Screens/Ladder/LadderEditorScreen.cs +++ b/osu.Game.Tournament/Screens/Ladder/LadderEditorScreen.cs @@ -77,6 +77,11 @@ namespace osu.Game.Tournament.Screens.Ladder var pos = PairingsContainer.ToLocalSpace(GetContainingInputManager().CurrentState.Mouse.Position); AddPairing(new MatchPairing { Position = { Value = new Point((int)pos.X, (int)pos.Y) } }); }), + new OsuMenuItem("Reset teams", MenuItemType.Destructive, () => + { + foreach (var p in PairingsContainer) + p.Pairing.Reset(); + }) }; } } From 2a9da602cb388028dbed0973b35c952093ea8567 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 8 Feb 2019 13:07:57 +0900 Subject: [PATCH 178/317] Use nuget packages again --- osu.Game/osu.Game.csproj | 4 +--- osu.sln | 12 ------------ 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 3b1b276130..fd79f65989 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -15,13 +15,11 @@ + - - - diff --git a/osu.sln b/osu.sln index 59b85c8936..688339fab5 100644 --- a/osu.sln +++ b/osu.sln @@ -29,10 +29,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "osu.Game.Tournament", "osu. EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "osu.Game.Tournament.Tests", "osu.Game.Tournament.Tests\osu.Game.Tournament.Tests.csproj", "{5789E78D-38F9-4072-AB7B-978F34B2C17F}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "osu.Framework", "..\osu-framework\osu.Framework\osu.Framework.csproj", "{7A69A230-45A1-4444-8C43-A582E4F48C1E}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "osu.Framework.NativeLibs", "..\osu-framework\osu.Framework.NativeLibs\osu.Framework.NativeLibs.csproj", "{C3ECD150-D109-453F-9625-518B282CF745}" -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -91,14 +87,6 @@ Global {5789E78D-38F9-4072-AB7B-978F34B2C17F}.Debug|Any CPU.Build.0 = Debug|Any CPU {5789E78D-38F9-4072-AB7B-978F34B2C17F}.Release|Any CPU.ActiveCfg = Release|Any CPU {5789E78D-38F9-4072-AB7B-978F34B2C17F}.Release|Any CPU.Build.0 = Release|Any CPU - {7A69A230-45A1-4444-8C43-A582E4F48C1E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7A69A230-45A1-4444-8C43-A582E4F48C1E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7A69A230-45A1-4444-8C43-A582E4F48C1E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7A69A230-45A1-4444-8C43-A582E4F48C1E}.Release|Any CPU.Build.0 = Release|Any CPU - {C3ECD150-D109-453F-9625-518B282CF745}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C3ECD150-D109-453F-9625-518B282CF745}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C3ECD150-D109-453F-9625-518B282CF745}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C3ECD150-D109-453F-9625-518B282CF745}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE From 61e6285f7a601bbf5d292216ca04d640b8a6bc4f Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 8 Feb 2019 15:20:22 +0900 Subject: [PATCH 179/317] Update paths --- osu.Game.Tournament/IPC/FileBasedIPC.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game.Tournament/IPC/FileBasedIPC.cs b/osu.Game.Tournament/IPC/FileBasedIPC.cs index 83dbe11ffa..7f8ed0cb3d 100644 --- a/osu.Game.Tournament/IPC/FileBasedIPC.cs +++ b/osu.Game.Tournament/IPC/FileBasedIPC.cs @@ -141,12 +141,12 @@ namespace osu.Game.Tournament.IPC { try { - stableInstallPath = "E:\\osu!tourney"; + stableInstallPath = "G:\\My Drive\\Main\\osu!tourney"; if (checkExists(stableInstallPath)) return stableInstallPath; - stableInstallPath = "E:\\osu!mappool"; + stableInstallPath = "G:\\My Drive\\Main\\osu!mappool"; if (checkExists(stableInstallPath)) return stableInstallPath; From fcab21908bd02a73effc030849e9df6f75ad8dbe Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 17 Feb 2019 18:20:03 +0900 Subject: [PATCH 180/317] Update in line with screen changes --- osu.Game.Tournament/Screens/Drawings/DrawingsScreen.cs | 9 +-------- osu.Game.Tournament/Screens/TournamentScreen.cs | 9 +++++++-- osu.Game.Tournament/TournamentGame.cs | 3 ++- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/osu.Game.Tournament/Screens/Drawings/DrawingsScreen.cs b/osu.Game.Tournament/Screens/Drawings/DrawingsScreen.cs index 66e539af25..f68adabb4c 100644 --- a/osu.Game.Tournament/Screens/Drawings/DrawingsScreen.cs +++ b/osu.Game.Tournament/Screens/Drawings/DrawingsScreen.cs @@ -13,11 +13,9 @@ using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Textures; using osu.Framework.Logging; using osu.Framework.Platform; -using osu.Framework.Screens; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; using osu.Game.Graphics.UserInterface; -using osu.Game.Screens; using osu.Game.Tournament.Components; using osu.Game.Tournament.Screens.Drawings.Components; using osuTK; @@ -25,14 +23,10 @@ using osuTK.Graphics; namespace osu.Game.Tournament.Screens.Drawings { - public class DrawingsScreen : OsuScreen + public class DrawingsScreen : CompositeDrawable { private const string results_filename = "drawings_results.txt"; - public override bool HideOverlaysOnEnter => true; - - protected override BackgroundScreen CreateBackground() => null; - private ScrollingTeamContainer teamsContainer; private GroupContainer groupsContainer; private OsuSpriteText fullTeamNameText; @@ -59,7 +53,6 @@ namespace osu.Game.Tournament.Screens.Drawings if (!TeamList.Teams.Any()) { - this.Exit(); return; } diff --git a/osu.Game.Tournament/Screens/TournamentScreen.cs b/osu.Game.Tournament/Screens/TournamentScreen.cs index b440b8e796..e830509db9 100644 --- a/osu.Game.Tournament/Screens/TournamentScreen.cs +++ b/osu.Game.Tournament/Screens/TournamentScreen.cs @@ -3,15 +3,20 @@ using osu.Framework.Allocation; using osu.Framework.Graphics; -using osu.Game.Screens; +using osu.Framework.Graphics.Containers; namespace osu.Game.Tournament.Screens { - public class TournamentScreen : OsuScreen + public class TournamentScreen : CompositeDrawable { [Resolved] protected LadderInfo LadderInfo { get; private set; } + public TournamentScreen() + { + RelativeSizeAxes = Axes.Both; + } + public override void Hide() { this.FadeOut(200); diff --git a/osu.Game.Tournament/TournamentGame.cs b/osu.Game.Tournament/TournamentGame.cs index f970700fc5..711ecc5ae9 100644 --- a/osu.Game.Tournament/TournamentGame.cs +++ b/osu.Game.Tournament/TournamentGame.cs @@ -2,6 +2,7 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Graphics; +using osu.Framework.Screens; using osu.Game.Graphics.Cursor; using osu.Game.Tournament.Screens; @@ -16,7 +17,7 @@ namespace osu.Game.Tournament Add(new OsuContextMenuContainer { RelativeSizeAxes = Axes.Both, - Child = new TournamentSceneManager() + Child = new ScreenStack(new TournamentSceneManager()) { RelativeSizeAxes = Axes.Both } }); MenuCursorContainer.Cursor.Alpha = 0; From 6ea1ed8d04addf7e04044fa6de531f773dd455bf Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 17 Feb 2019 19:48:54 +0900 Subject: [PATCH 181/317] Fix unnecessary texture atlas generation --- .../Components/TournamentBeatmapPanel.cs | 2 +- .../Screens/Gameplay/Components/MatchHeader.cs | 3 +-- .../Screens/Gameplay/GameplayScreen.cs | 3 +-- .../Ladder/Components/DrawableMatchPairing.cs | 13 +++++++++++-- .../Screens/Showcase/ShowcaseScreen.cs | 3 +-- .../Screens/TeamIntro/TeamIntroScreen.cs | 3 +-- .../Screens/TeamWin/TeamWinScreen.cs | 3 +-- 7 files changed, 17 insertions(+), 13 deletions(-) diff --git a/osu.Game.Tournament/Components/TournamentBeatmapPanel.cs b/osu.Game.Tournament/Components/TournamentBeatmapPanel.cs index ae2e2b5160..748f9fbdce 100644 --- a/osu.Game.Tournament/Components/TournamentBeatmapPanel.cs +++ b/osu.Game.Tournament/Components/TournamentBeatmapPanel.cs @@ -140,7 +140,7 @@ namespace osu.Game.Tournament.Components if (!string.IsNullOrEmpty(mods)) AddInternal(new Sprite { - Texture = new TextureStore(new TextureLoaderStore(new StorageBackedResourceStore(storage))).Get($"mods/{mods}"), + Texture = new LargeTextureStore(new TextureLoaderStore(new StorageBackedResourceStore(storage))).Get($"mods/{mods}"), Anchor = Anchor.CentreRight, Origin = Anchor.CentreRight, Margin = new MarginPadding(20), diff --git a/osu.Game.Tournament/Screens/Gameplay/Components/MatchHeader.cs b/osu.Game.Tournament/Screens/Gameplay/Components/MatchHeader.cs index 210b42a4c8..25f7be1739 100644 --- a/osu.Game.Tournament/Screens/Gameplay/Components/MatchHeader.cs +++ b/osu.Game.Tournament/Screens/Gameplay/Components/MatchHeader.cs @@ -6,7 +6,6 @@ using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; -using osu.Framework.Graphics.Textures; using osu.Framework.Input.Events; using osu.Game.Graphics.Sprites; using osu.Game.Graphics.UserInterface; @@ -22,7 +21,7 @@ namespace osu.Game.Tournament.Screens.Gameplay.Components public class MatchHeader : Container { [BackgroundDependencyLoader] - private void load(LadderInfo ladder, TextureStore textures) + private void load(LadderInfo ladder) { RelativeSizeAxes = Axes.X; Height = 95; diff --git a/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs b/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs index 277d2aad6d..ad0ef0f521 100644 --- a/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs +++ b/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs @@ -6,7 +6,6 @@ using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; -using osu.Framework.Graphics.Textures; using osu.Framework.Threading; using osu.Game.Graphics.UserInterface; using osu.Game.Tournament.Components; @@ -37,7 +36,7 @@ namespace osu.Game.Tournament.Screens.Gameplay private TournamentSceneManager sceneManager { get; set; } [BackgroundDependencyLoader] - private void load(LadderInfo ladder, TextureStore textures, MatchIPCInfo ipc, MatchChatDisplay chat) + private void load(LadderInfo ladder, MatchIPCInfo ipc, MatchChatDisplay chat) { this.chat = chat; this.ipc = ipc; diff --git a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs index db942c6e4c..58eab5bc0a 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs @@ -18,6 +18,7 @@ namespace osu.Game.Tournament.Screens.Ladder.Components public class DrawableMatchPairing : CompositeDrawable { public readonly MatchPairing Pairing; + private readonly bool editor; protected readonly FillFlowContainer Flow; private readonly Drawable selectionBox; private readonly Drawable currentMatchSelectionBox; @@ -26,9 +27,14 @@ namespace osu.Game.Tournament.Screens.Ladder.Components [Resolved(CanBeNull = true)] private LadderEditorInfo editorInfo { get; set; } - public DrawableMatchPairing(MatchPairing pairing) + [Resolved(CanBeNull = true)] + private LadderInfo ladderInfo { get; set; } + + + public DrawableMatchPairing(MatchPairing pairing, bool editor = false) { Pairing = pairing; + this.editor = editor; AutoSizeAxes = Axes.Both; @@ -109,7 +115,10 @@ namespace osu.Game.Tournament.Screens.Ladder.Components if (selected) { selectionBox.Show(); - editorInfo.Selected.Value = Pairing; + if (editor) + editorInfo.Selected.Value = Pairing; + else + ladderInfo.CurrentMatch.Value = Pairing; } else selectionBox.Hide(); diff --git a/osu.Game.Tournament/Screens/Showcase/ShowcaseScreen.cs b/osu.Game.Tournament/Screens/Showcase/ShowcaseScreen.cs index 7690ff4b97..65369fa6da 100644 --- a/osu.Game.Tournament/Screens/Showcase/ShowcaseScreen.cs +++ b/osu.Game.Tournament/Screens/Showcase/ShowcaseScreen.cs @@ -2,14 +2,13 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; -using osu.Framework.Graphics.Textures; namespace osu.Game.Tournament.Screens.Showcase { public class ShowcaseScreen : BeatmapInfoScreen { [BackgroundDependencyLoader] - private void load(TextureStore textures) + private void load() { AddInternal(new TournamentLogo()); } diff --git a/osu.Game.Tournament/Screens/TeamIntro/TeamIntroScreen.cs b/osu.Game.Tournament/Screens/TeamIntro/TeamIntroScreen.cs index 55af305045..dc79d4aab0 100644 --- a/osu.Game.Tournament/Screens/TeamIntro/TeamIntroScreen.cs +++ b/osu.Game.Tournament/Screens/TeamIntro/TeamIntroScreen.cs @@ -5,7 +5,6 @@ using osu.Framework.Allocation; using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Textures; using osu.Framework.Graphics.Video; using osu.Framework.Platform; using osu.Game.Graphics; @@ -25,7 +24,7 @@ namespace osu.Game.Tournament.Screens.TeamIntro private readonly Bindable currentMatch = new Bindable(); [BackgroundDependencyLoader] - private void load(TextureStore textures, LadderInfo ladder, Storage storage) + private void load(LadderInfo ladder, Storage storage) { RelativeSizeAxes = Axes.Both; diff --git a/osu.Game.Tournament/Screens/TeamWin/TeamWinScreen.cs b/osu.Game.Tournament/Screens/TeamWin/TeamWinScreen.cs index fbb622e16f..2e2c8e5020 100644 --- a/osu.Game.Tournament/Screens/TeamWin/TeamWinScreen.cs +++ b/osu.Game.Tournament/Screens/TeamWin/TeamWinScreen.cs @@ -5,7 +5,6 @@ using osu.Framework.Allocation; using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Textures; using osu.Framework.Graphics.Video; using osu.Framework.Platform; using osu.Game.Graphics; @@ -29,7 +28,7 @@ namespace osu.Game.Tournament.Screens.TeamWin private VideoSprite redWinVideo; [BackgroundDependencyLoader] - private void load(TextureStore textures, LadderInfo ladder, Storage storage) + private void load(LadderInfo ladder, Storage storage) { RelativeSizeAxes = Axes.Both; From ef321b41035e38dbfba2087c830f2b7d9ef97ded Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 17 Feb 2019 19:48:58 +0900 Subject: [PATCH 182/317] Fix regressed test --- osu.Game.Tournament.Tests/TestCaseDrawings.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Tournament.Tests/TestCaseDrawings.cs b/osu.Game.Tournament.Tests/TestCaseDrawings.cs index d957c792f7..f5f5615bf6 100644 --- a/osu.Game.Tournament.Tests/TestCaseDrawings.cs +++ b/osu.Game.Tournament.Tests/TestCaseDrawings.cs @@ -13,7 +13,7 @@ namespace osu.Game.Tournament.Tests { public TestCaseDrawings() { - LoadScreen(new DrawingsScreen + Add(new DrawingsScreen { TeamList = new TestTeamList(), }); From e7668a749bce0cbcbf8b49c3f8f720f0b1847a5d Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 17 Feb 2019 19:49:10 +0900 Subject: [PATCH 183/317] Bind to correct target (hacky) --- osu.Game.Tournament/Screens/Ladder/LadderScreen.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Tournament/Screens/Ladder/LadderScreen.cs b/osu.Game.Tournament/Screens/Ladder/LadderScreen.cs index 549f12f769..36baaf0b39 100644 --- a/osu.Game.Tournament/Screens/Ladder/LadderScreen.cs +++ b/osu.Game.Tournament/Screens/Ladder/LadderScreen.cs @@ -64,7 +64,7 @@ namespace osu.Game.Tournament.Screens.Ladder protected virtual void AddPairing(MatchPairing pairing) { - PairingsContainer.Add(new DrawableMatchPairing(pairing)); + PairingsContainer.Add(new DrawableMatchPairing(pairing, this is LadderEditorScreen)); } private Cached layout = new Cached(); From 389632d9325dc078605e2dfefcec03b4def93fcd Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 2 Mar 2019 13:40:43 +0900 Subject: [PATCH 184/317] Fix bindable changes --- osu.Game.Tournament/Components/DateTextBox.cs | 7 +++--- .../Components/MatchChatDisplay.cs | 8 +++---- .../Components/TournamentBeatmapPanel.cs | 6 ++--- osu.Game.Tournament/IPC/MatchIPCInfo.cs | 2 +- osu.Game.Tournament/LadderInfo.cs | 2 +- .../Screens/BeatmapInfoScreen.cs | 9 ++++---- .../Gameplay/Components/MatchHeader.cs | 14 ++++++------ .../Gameplay/Components/MatchScoreDisplay.cs | 2 +- .../Screens/Gameplay/GameplayScreen.cs | 20 ++++++++--------- .../Ladder/Components/DrawableMatchPairing.cs | 21 +++++++++--------- .../Ladder/Components/DrawableMatchTeam.cs | 16 +++++++------- .../Ladder/Components/LadderEditorInfo.cs | 2 +- .../Ladder/Components/LadderEditorSettings.cs | 22 +++++++++---------- .../Screens/Ladder/Components/MatchPairing.cs | 8 +++---- .../Ladder/Components/TournamentGrouping.cs | 2 +- .../Screens/Ladder/LadderScreen.cs | 6 ++--- .../Screens/MapPool/MapPoolScreen.cs | 14 ++++++------ .../Screens/Schedule/ScheduleScreen.cs | 10 ++++----- .../Screens/TeamIntro/TeamIntroScreen.cs | 12 +++++----- .../Screens/TeamWin/TeamWinScreen.cs | 6 ++--- osu.Game.Tournament/TournamentGameBase.cs | 1 + 21 files changed, 96 insertions(+), 94 deletions(-) diff --git a/osu.Game.Tournament/Components/DateTextBox.cs b/osu.Game.Tournament/Components/DateTextBox.cs index 171196f348..0a2485e4f3 100644 --- a/osu.Game.Tournament/Components/DateTextBox.cs +++ b/osu.Game.Tournament/Components/DateTextBox.cs @@ -2,7 +2,7 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; -using osu.Framework.Configuration; +using osu.Framework.Bindables; using osu.Game.Graphics.UserInterface; using osu.Game.Overlays.Settings; @@ -12,13 +12,12 @@ namespace osu.Game.Tournament.Components { public new Bindable Bindable { - get { return bindable; } - + get => bindable; set { bindable = value; bindable.BindValueChanged(dto => - base.Bindable.Value = dto.ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ssZ"), true); + base.Bindable.Value = dto.NewValue.ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ssZ"), true); } } diff --git a/osu.Game.Tournament/Components/MatchChatDisplay.cs b/osu.Game.Tournament/Components/MatchChatDisplay.cs index f96db186ea..33c544f83d 100644 --- a/osu.Game.Tournament/Components/MatchChatDisplay.cs +++ b/osu.Game.Tournament/Components/MatchChatDisplay.cs @@ -3,7 +3,7 @@ using System.Linq; using osu.Framework.Allocation; -using osu.Framework.Configuration; +using osu.Framework.Bindables; using osu.Game.Online.Chat; using osu.Game.Overlays.Chat; using osu.Game.Tournament.IPC; @@ -25,12 +25,12 @@ namespace osu.Game.Tournament.Components if (ipc != null) { chatChannel.BindTo(ipc.ChatChannel); - chatChannel.BindValueChanged(channelString => + chatChannel.BindValueChanged(c => { - if (string.IsNullOrWhiteSpace(channelString)) + if (string.IsNullOrWhiteSpace(c.NewValue)) return; - int id = int.Parse(channelString); + int id = int.Parse(c.NewValue); if (id <= 0) return; diff --git a/osu.Game.Tournament/Components/TournamentBeatmapPanel.cs b/osu.Game.Tournament/Components/TournamentBeatmapPanel.cs index 748f9fbdce..94aa86d5cb 100644 --- a/osu.Game.Tournament/Components/TournamentBeatmapPanel.cs +++ b/osu.Game.Tournament/Components/TournamentBeatmapPanel.cs @@ -6,7 +6,7 @@ using System.Collections.ObjectModel; using System.Collections.Specialized; using System.Linq; using osu.Framework.Allocation; -using osu.Framework.Configuration; +using osu.Framework.Bindables; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; @@ -148,9 +148,9 @@ namespace osu.Game.Tournament.Components }); } - private void matchChanged(MatchPairing match) + private void matchChanged(ValueChangedEvent pairing) { - match.PicksBans.CollectionChanged += picksBansOnCollectionChanged; + pairing.NewValue.PicksBans.CollectionChanged += picksBansOnCollectionChanged; updateState(); } diff --git a/osu.Game.Tournament/IPC/MatchIPCInfo.cs b/osu.Game.Tournament/IPC/MatchIPCInfo.cs index be31df8009..cd57756f60 100644 --- a/osu.Game.Tournament/IPC/MatchIPCInfo.cs +++ b/osu.Game.Tournament/IPC/MatchIPCInfo.cs @@ -1,7 +1,7 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using osu.Framework.Configuration; +using osu.Framework.Bindables; using osu.Framework.Graphics; using osu.Game.Beatmaps; using osu.Game.Beatmaps.Legacy; diff --git a/osu.Game.Tournament/LadderInfo.cs b/osu.Game.Tournament/LadderInfo.cs index c433987491..83d0f76020 100644 --- a/osu.Game.Tournament/LadderInfo.cs +++ b/osu.Game.Tournament/LadderInfo.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using Newtonsoft.Json; -using osu.Framework.Configuration; +using osu.Framework.Bindables; using osu.Game.Tournament.Components; using osu.Game.Tournament.Screens.Ladder.Components; diff --git a/osu.Game.Tournament/Screens/BeatmapInfoScreen.cs b/osu.Game.Tournament/Screens/BeatmapInfoScreen.cs index 0b37e2fab1..b0aadc7e9e 100644 --- a/osu.Game.Tournament/Screens/BeatmapInfoScreen.cs +++ b/osu.Game.Tournament/Screens/BeatmapInfoScreen.cs @@ -2,6 +2,7 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; +using osu.Framework.Bindables; using osu.Framework.Graphics; using osu.Game.Beatmaps; using osu.Game.Beatmaps.Legacy; @@ -30,15 +31,15 @@ namespace osu.Game.Tournament.Screens ipc.Mods.BindValueChanged(modsChanged, true); } - private void modsChanged(LegacyMods mods) + private void modsChanged(ValueChangedEvent mods) { - SongBar.Mods = mods; + SongBar.Mods = mods.NewValue; } - private void beatmapChanged(BeatmapInfo beatmap) + private void beatmapChanged(ValueChangedEvent beatmap) { SongBar.FadeInFromZero(300, Easing.OutQuint); - SongBar.Beatmap = beatmap; + SongBar.Beatmap = beatmap.NewValue; } } } diff --git a/osu.Game.Tournament/Screens/Gameplay/Components/MatchHeader.cs b/osu.Game.Tournament/Screens/Gameplay/Components/MatchHeader.cs index 25f7be1739..364d437619 100644 --- a/osu.Game.Tournament/Screens/Gameplay/Components/MatchHeader.cs +++ b/osu.Game.Tournament/Screens/Gameplay/Components/MatchHeader.cs @@ -2,7 +2,7 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; -using osu.Framework.Configuration; +using osu.Framework.Bindables; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; @@ -73,13 +73,13 @@ namespace osu.Game.Tournament.Screens.Gameplay.Components currentMatch.BindTo(ladder.CurrentMatch); } - private void matchChanged(MatchPairing match) + private void matchChanged(ValueChangedEvent match) { currentTeamScore.UnbindBindings(); - currentTeamScore.BindTo(teamColour == TeamColour.Red ? match.Team1Score : match.Team2Score); + currentTeamScore.BindTo(teamColour == TeamColour.Red ? match.NewValue.Team1Score : match.NewValue.Team2Score); currentTeam.UnbindBindings(); - currentTeam.BindTo(teamColour == TeamColour.Red ? match.Team1 : match.Team2); + currentTeam.BindTo(teamColour == TeamColour.Red ? match.NewValue.Team1 : match.NewValue.Team2); // team may change to same team, which means score is not in a good state. // thus we handle this manually. @@ -144,7 +144,7 @@ namespace osu.Game.Tournament.Screens.Gameplay.Components currentTeamScore.BindTo(score); } - private void scoreChanged(int? score) => counter.CountStars = score ?? 0; + private void scoreChanged(ValueChangedEvent score) => counter.CountStars = score.NewValue ?? 0; } private class TeamDisplay : DrawableTournamentTeam @@ -204,7 +204,7 @@ namespace osu.Game.Tournament.Screens.Gameplay.Components currentMatch.BindTo(ladder.CurrentMatch); } - private void matchChanged(MatchPairing match) + private void matchChanged(ValueChangedEvent match) { InternalChildren = new Drawable[] { @@ -218,7 +218,7 @@ namespace osu.Game.Tournament.Screens.Gameplay.Components Anchor = Anchor.Centre, Origin = Anchor.Centre, Colour = Color4.White, - Text = match.Grouping.Value?.Name.Value ?? "Unknown Grouping", + Text = match.NewValue.Grouping.Value?.Name.Value ?? "Unknown Grouping", Font = "Aquatico-Regular", TextSize = 18, }, diff --git a/osu.Game.Tournament/Screens/Gameplay/Components/MatchScoreDisplay.cs b/osu.Game.Tournament/Screens/Gameplay/Components/MatchScoreDisplay.cs index b4eb9ef239..30cd2b2e85 100644 --- a/osu.Game.Tournament/Screens/Gameplay/Components/MatchScoreDisplay.cs +++ b/osu.Game.Tournament/Screens/Gameplay/Components/MatchScoreDisplay.cs @@ -3,7 +3,7 @@ using System; using osu.Framework.Allocation; -using osu.Framework.Configuration; +using osu.Framework.Bindables; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; diff --git a/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs b/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs index ad0ef0f521..eb33c2fbdb 100644 --- a/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs +++ b/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs @@ -2,7 +2,7 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; -using osu.Framework.Configuration; +using osu.Framework.Bindables; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; @@ -120,10 +120,10 @@ namespace osu.Game.Tournament.Screens.Gameplay State.BindTo(ipc.State); State.BindValueChanged(stateChanged, true); - currentMatch.BindValueChanged(m => warmup.Value = m.Team1Score + m.Team2Score == 0); + currentMatch.BindValueChanged(m => warmup.Value = m.NewValue.Team1Score.Value + m.NewValue.Team2Score.Value == 0); currentMatch.BindTo(ladder.CurrentMatch); - warmup.BindValueChanged(w => warmupButton.Alpha = !w ? 0.5f : 1, true); + warmup.BindValueChanged(w => warmupButton.Alpha = !w.NewValue ? 0.5f : 1, true); } private ScheduledDelegate scheduledOperation; @@ -132,15 +132,15 @@ namespace osu.Game.Tournament.Screens.Gameplay private TourneyState lastState; - private void stateChanged(TourneyState state) + private void stateChanged(ValueChangedEvent state) { try { - if (state == TourneyState.Ranking) + if (state.NewValue == TourneyState.Ranking) { if (warmup.Value) return; - if (ipc.Score1 > ipc.Score2) + if (ipc.Score1.Value > ipc.Score2.Value) currentMatch.Value.Team1Score.Value++; else currentMatch.Value.Team2Score.Value++; @@ -167,16 +167,16 @@ namespace osu.Game.Tournament.Screens.Gameplay chat.Contract(); } - switch (state) + switch (state.NewValue) { case TourneyState.Idle: contract(); if (lastState == TourneyState.Ranking && !warmup.Value) { - if (currentMatch.Value?.Completed == true) + if (currentMatch.Value?.Completed.Value == true) scheduledOperation = Scheduler.AddDelayed(() => { sceneManager?.SetScreen(typeof(TeamWinScreen)); }, 4000); - else if (currentMatch.Value?.Completed == false) + else if (currentMatch.Value?.Completed.Value == false) scheduledOperation = Scheduler.AddDelayed(() => { sceneManager?.SetScreen(typeof(MapPoolScreen)); }, 4000); } @@ -192,7 +192,7 @@ namespace osu.Game.Tournament.Screens.Gameplay } finally { - lastState = state; + lastState = state.NewValue; } } } diff --git a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs index 58eab5bc0a..d993fbda20 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs @@ -2,7 +2,7 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; -using osu.Framework.Configuration; +using osu.Framework.Bindables; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; @@ -87,7 +87,8 @@ namespace osu.Game.Tournament.Screens.Ladder.Components pairing.Position.BindValueChanged(pos => { if (IsDragged) return; - Position = new Vector2(pos.X, pos.Y); + + Position = new Vector2(pos.NewValue.X, pos.NewValue.Y); }, true); updateTeams(); @@ -127,7 +128,7 @@ namespace osu.Game.Tournament.Screens.Ladder.Components private void updateProgression() { - if (!Pairing.Completed) + if (!Pairing.Completed.Value) { // ensure we clear any of our teams from our progression. // this is not pretty logic but should suffice for now. @@ -177,10 +178,10 @@ namespace osu.Game.Tournament.Screens.Ladder.Components { if (Pairing.Grouping.Value == null) return; - var instaWinAmount = Pairing.Grouping.Value.BestOf / 2; + var instaWinAmount = Pairing.Grouping.Value.BestOf.Value / 2; - Pairing.Completed.Value = Pairing.Grouping.Value.BestOf > 0 - && (Pairing.Team1Score + Pairing.Team2Score >= Pairing.Grouping.Value.BestOf || Pairing.Team1Score > instaWinAmount || Pairing.Team2Score > instaWinAmount); + Pairing.Completed.Value = Pairing.Grouping.Value.BestOf.Value > 0 + && (Pairing.Team1Score.Value + Pairing.Team2Score.Value >= Pairing.Grouping.Value.BestOf.Value || Pairing.Team1Score.Value > instaWinAmount || Pairing.Team2Score.Value > instaWinAmount); } protected override void LoadComplete() @@ -193,7 +194,7 @@ namespace osu.Game.Tournament.Screens.Ladder.Components globalSelection = editorInfo.Selected.GetBoundCopy(); globalSelection.BindValueChanged(s => { - if (s != Pairing) Selected = false; + if (s.NewValue != Pairing) Selected = false; }); } } @@ -216,14 +217,14 @@ namespace osu.Game.Tournament.Screens.Ladder.Components var team2Match = conditional.Acronyms.Contains(Pairing.Team2Acronym); if (team1Match && team2Match) - Pairing.Date.Value = conditional.Date; + Pairing.Date.Value = conditional.Date.Value; } } Flow.Children = new[] { - new DrawableMatchTeam(Pairing.Team1, Pairing, Pairing.Losers), - new DrawableMatchTeam(Pairing.Team2, Pairing, Pairing.Losers) + new DrawableMatchTeam(Pairing.Team1.Value, Pairing, Pairing.Losers.Value), + new DrawableMatchTeam(Pairing.Team2.Value, Pairing, Pairing.Losers.Value) }; SchedulerAfterChildren.Add(() => Scheduler.Add(updateProgression)); diff --git a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs index 461283ffed..63d15781ca 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs @@ -3,7 +3,7 @@ using System; using osu.Framework.Allocation; -using osu.Framework.Configuration; +using osu.Framework.Bindables; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Cursor; @@ -52,7 +52,7 @@ namespace osu.Game.Tournament.Screens.Ladder.Components [Resolved(CanBeNull = true)] private LadderEditorInfo editorInfo { get; set; } - public DrawableMatchTeam(Bindable team, MatchPairing pairing, bool losers) + public DrawableMatchTeam(TournamentTeam team, MatchPairing pairing, bool losers) : base(team) { this.pairing = pairing; @@ -74,8 +74,8 @@ namespace osu.Game.Tournament.Screens.Ladder.Components isWinner = () => pairing.Winner == Team; completed.BindTo(pairing.Completed); - if (team.Value != null) - score.BindTo(team.Value == pairing.Team1.Value ? pairing.Team1Score : pairing.Team2Score); + if (team != null) + score.BindTo(team == pairing.Team1.Value ? pairing.Team1Score : pairing.Team2Score); } } @@ -133,7 +133,7 @@ namespace osu.Game.Tournament.Screens.Ladder.Components score.BindValueChanged(val => { - scoreText.Text = val?.ToString() ?? string.Empty; + scoreText.Text = val.NewValue?.ToString() ?? string.Empty; updateWinStyle(); }, true); } @@ -155,7 +155,7 @@ namespace osu.Game.Tournament.Screens.Ladder.Components { pairing.StartMatch(); } - else if (!pairing.Completed) + else if (!pairing.Completed.Value) score.Value++; } else @@ -164,7 +164,7 @@ namespace osu.Game.Tournament.Screens.Ladder.Components // don't allow changing scores if the match has a progression. can cause large data loss return false; - if (pairing.Completed && pairing.Winner != Team) + if (pairing.Completed.Value && pairing.Winner != Team) // don't allow changing scores from the non-winner return false; @@ -179,7 +179,7 @@ namespace osu.Game.Tournament.Screens.Ladder.Components private void updateWinStyle() { - bool winner = completed && isWinner?.Invoke() == true; + bool winner = completed.Value && isWinner?.Invoke() == true; background.FadeColour(winner ? colourWinner : colourNormal, winner ? 500 : 0, Easing.OutQuint); diff --git a/osu.Game.Tournament/Screens/Ladder/Components/LadderEditorInfo.cs b/osu.Game.Tournament/Screens/Ladder/Components/LadderEditorInfo.cs index 1fd9455195..6979aae295 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/LadderEditorInfo.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/LadderEditorInfo.cs @@ -1,7 +1,7 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using osu.Framework.Configuration; +using osu.Framework.Bindables; namespace osu.Game.Tournament.Screens.Ladder.Components { diff --git a/osu.Game.Tournament/Screens/Ladder/Components/LadderEditorSettings.cs b/osu.Game.Tournament/Screens/Ladder/Components/LadderEditorSettings.cs index bb80a845e3..f0559e0266 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/LadderEditorSettings.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/LadderEditorSettings.cs @@ -4,7 +4,7 @@ using System; using System.Linq; using osu.Framework.Allocation; -using osu.Framework.Configuration; +using osu.Framework.Bindables; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Input.Events; @@ -93,11 +93,11 @@ namespace osu.Game.Tournament.Screens.Ladder.Components editorInfo.Selected.ValueChanged += selection => { - textboxTeam1.Text = selection?.Team1.Value?.Acronym; - textboxTeam2.Text = selection?.Team2.Value?.Acronym; - groupingDropdown.Bindable.Value = selection?.Grouping.Value ?? groupingOptions.First(); - losersCheckbox.Current.Value = selection?.Losers.Value ?? false; - dateTimeBox.Bindable.Value = selection?.Date.Value ?? DateTimeOffset.UtcNow; + textboxTeam1.Text = selection.NewValue?.Team1.Value?.Acronym; + textboxTeam2.Text = selection.NewValue?.Team2.Value?.Acronym; + groupingDropdown.Bindable.Value = selection.NewValue?.Grouping.Value ?? groupingOptions.First(); + losersCheckbox.Current.Value = selection.NewValue?.Losers.Value ?? false; + dateTimeBox.Bindable.Value = selection.NewValue?.Date.Value ?? DateTimeOffset.UtcNow; }; textboxTeam1.OnCommit = (val, newText) => @@ -116,10 +116,10 @@ namespace osu.Game.Tournament.Screens.Ladder.Components { if (editorInfo.Selected.Value != null) { - editorInfo.Selected.Value.Grouping.Value = grouping; - if (editorInfo.Selected.Value.Date.Value < grouping.StartDate.Value) + editorInfo.Selected.Value.Grouping.Value = grouping.NewValue; + if (editorInfo.Selected.Value.Date.Value < grouping.NewValue.StartDate.Value) { - editorInfo.Selected.Value.Date.Value = grouping.StartDate.Value; + editorInfo.Selected.Value.Date.Value = grouping.NewValue.StartDate.Value; editorInfo.Selected.TriggerChange(); } } @@ -128,13 +128,13 @@ namespace osu.Game.Tournament.Screens.Ladder.Components losersCheckbox.Current.ValueChanged += losers => { if (editorInfo.Selected.Value != null) - editorInfo.Selected.Value.Losers.Value = losers; + editorInfo.Selected.Value.Losers.Value = losers.NewValue; }; dateTimeBox.Bindable.ValueChanged += date => { if (editorInfo.Selected.Value != null) - editorInfo.Selected.Value.Date.Value = date; + editorInfo.Selected.Value.Date.Value = date.NewValue; }; } diff --git a/osu.Game.Tournament/Screens/Ladder/Components/MatchPairing.cs b/osu.Game.Tournament/Screens/Ladder/Components/MatchPairing.cs index 7d6acc5bd2..760f6d42f4 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/MatchPairing.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/MatchPairing.cs @@ -5,7 +5,7 @@ using System; using System.Collections.Generic; using System.Collections.ObjectModel; using Newtonsoft.Json; -using osu.Framework.Configuration; +using osu.Framework.Bindables; using osu.Game.Tournament.Components; using SixLabors.Primitives; @@ -71,8 +71,8 @@ namespace osu.Game.Tournament.Screens.Ladder.Components public MatchPairing() { - Team1.BindValueChanged(t => Team1Acronym = t?.Acronym, true); - Team2.BindValueChanged(t => Team2Acronym = t?.Acronym, true); + Team1.BindValueChanged(t => Team1Acronym = t.NewValue?.Acronym, true); + Team2.BindValueChanged(t => Team2Acronym = t.NewValue?.Acronym, true); } public MatchPairing(TournamentTeam team1 = null, TournamentTeam team2 = null) @@ -88,7 +88,7 @@ namespace osu.Game.Tournament.Screens.Ladder.Components [JsonIgnore] public TournamentTeam Loser => !Completed.Value ? null : Team1Score.Value > Team2Score.Value ? Team2.Value : Team1.Value; - public int PointsToWin => Grouping.Value == null ? 0 : Grouping.Value.BestOf / 2 + 1; + public int PointsToWin => Grouping.Value?.BestOf.Value / 2 + 1 ?? 0; /// /// Remove scores from the match, in case of a false click or false start. diff --git a/osu.Game.Tournament/Screens/Ladder/Components/TournamentGrouping.cs b/osu.Game.Tournament/Screens/Ladder/Components/TournamentGrouping.cs index 370f0ea643..3555e4db11 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/TournamentGrouping.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/TournamentGrouping.cs @@ -4,7 +4,7 @@ using System; using System.Collections.Generic; using Newtonsoft.Json; -using osu.Framework.Configuration; +using osu.Framework.Bindables; namespace osu.Game.Tournament.Screens.Ladder.Components { diff --git a/osu.Game.Tournament/Screens/Ladder/LadderScreen.cs b/osu.Game.Tournament/Screens/Ladder/LadderScreen.cs index 36baaf0b39..7c6aabbe53 100644 --- a/osu.Game.Tournament/Screens/Ladder/LadderScreen.cs +++ b/osu.Game.Tournament/Screens/Ladder/LadderScreen.cs @@ -98,13 +98,13 @@ namespace osu.Game.Tournament.Screens.Ladder // clean up outdated progressions. pairing.Pairing.Progression.Value = null; else - paths.Add(new ProgressionPath(pairing, dest) { Colour = pairing.Pairing.Losers ? losersPathColour : normalPathColour }); + paths.Add(new ProgressionPath(pairing, dest) { Colour = pairing.Pairing.Losers.Value ? losersPathColour : normalPathColour }); } } foreach (var group in LadderInfo.Groupings) { - var topPairing = PairingsContainer.Where(p => !p.Pairing.Losers && p.Pairing.Grouping.Value == group).OrderBy(p => p.Y).FirstOrDefault(); + var topPairing = PairingsContainer.Where(p => !p.Pairing.Losers.Value && p.Pairing.Grouping.Value == group).OrderBy(p => p.Y).FirstOrDefault(); if (topPairing == null) continue; @@ -118,7 +118,7 @@ namespace osu.Game.Tournament.Screens.Ladder foreach (var group in LadderInfo.Groupings) { - var topPairing = PairingsContainer.Where(p => p.Pairing.Losers && p.Pairing.Grouping.Value == group).OrderBy(p => p.Y).FirstOrDefault(); + var topPairing = PairingsContainer.Where(p => p.Pairing.Losers.Value && p.Pairing.Grouping.Value == group).OrderBy(p => p.Y).FirstOrDefault(); if (topPairing == null) continue; diff --git a/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs b/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs index bed2c35b76..41368eb96e 100644 --- a/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs +++ b/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs @@ -3,7 +3,7 @@ using System.Linq; using osu.Framework.Allocation; -using osu.Framework.Configuration; +using osu.Framework.Bindables; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Input.Events; @@ -102,13 +102,13 @@ namespace osu.Game.Tournament.Screens.MapPool ipc.Beatmap.BindValueChanged(beatmapChanged); } - private void beatmapChanged(BeatmapInfo beatmap) + private void beatmapChanged(ValueChangedEvent beatmap) { if (currentMatch.Value.PicksBans.Count(p => p.Type == ChoiceType.Ban) < 2) return; - if (beatmap.OnlineBeatmapID != null) - addForBeatmap(beatmap.OnlineBeatmapID.Value); + if (beatmap.NewValue.OnlineBeatmapID != null) + addForBeatmap(beatmap.NewValue.OnlineBeatmapID.Value); } private void setMode(TeamColour colour, ChoiceType choiceType) @@ -201,16 +201,16 @@ namespace osu.Game.Tournament.Screens.MapPool } } - private void matchChanged(MatchPairing match) + private void matchChanged(ValueChangedEvent match) { mapFlows.Clear(); - if (match.Grouping.Value != null) + if (match.NewValue.Grouping.Value != null) { FillFlowContainer currentFlow = null; string currentMod = null; - foreach (var b in match.Grouping.Value.Beatmaps) + foreach (var b in match.NewValue.Grouping.Value.Beatmaps) { if (currentFlow == null || currentMod != b.Mods) { diff --git a/osu.Game.Tournament/Screens/Schedule/ScheduleScreen.cs b/osu.Game.Tournament/Screens/Schedule/ScheduleScreen.cs index f3f3667db1..def2161ea0 100644 --- a/osu.Game.Tournament/Screens/Schedule/ScheduleScreen.cs +++ b/osu.Game.Tournament/Screens/Schedule/ScheduleScreen.cs @@ -4,7 +4,7 @@ using System; using System.Linq; using osu.Framework.Allocation; -using osu.Framework.Configuration; +using osu.Framework.Bindables; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; @@ -48,9 +48,9 @@ namespace osu.Game.Tournament.Screens.Schedule currentMatch.BindTo(ladder.CurrentMatch); } - private void matchChanged(MatchPairing pairing) + private void matchChanged(ValueChangedEvent pairing) { - if (pairing == null) + if (pairing.NewValue == null) { mainContainer.Clear(); return; @@ -113,10 +113,10 @@ namespace osu.Game.Tournament.Screens.Schedule Colour = Color4.Black, TextSize = 20 }, - new SchedulePairing(currentMatch, false), + new SchedulePairing(currentMatch.Value, false), new OsuSpriteText { - Text = "Start Time " + pairing.Date.Value.ToUniversalTime().ToString("HH:mm UTC"), + Text = "Start Time " + pairing.NewValue.Date.Value.ToUniversalTime().ToString("HH:mm UTC"), Colour = Color4.Black, TextSize = 20 }, diff --git a/osu.Game.Tournament/Screens/TeamIntro/TeamIntroScreen.cs b/osu.Game.Tournament/Screens/TeamIntro/TeamIntroScreen.cs index dc79d4aab0..a42c7775e6 100644 --- a/osu.Game.Tournament/Screens/TeamIntro/TeamIntroScreen.cs +++ b/osu.Game.Tournament/Screens/TeamIntro/TeamIntroScreen.cs @@ -2,7 +2,7 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; -using osu.Framework.Configuration; +using osu.Framework.Bindables; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Video; @@ -46,9 +46,9 @@ namespace osu.Game.Tournament.Screens.TeamIntro currentMatch.BindTo(ladder.CurrentMatch); } - private void matchChanged(MatchPairing pairing) + private void matchChanged(ValueChangedEvent pairing) { - if (pairing == null) + if (pairing.NewValue == null) { mainContainer.Clear(); return; @@ -56,7 +56,7 @@ namespace osu.Game.Tournament.Screens.TeamIntro mainContainer.Children = new Drawable[] { - new TeamWithPlayers(pairing.Team1, true) + new TeamWithPlayers(pairing.NewValue.Team1.Value, true) { RelativeSizeAxes = Axes.Both, Width = 0.5f, @@ -64,7 +64,7 @@ namespace osu.Game.Tournament.Screens.TeamIntro Anchor = Anchor.Centre, Origin = Anchor.CentreRight }, - new TeamWithPlayers(pairing.Team2) + new TeamWithPlayers(pairing.NewValue.Team2.Value) { RelativeSizeAxes = Axes.Both, Width = 0.5f, @@ -72,7 +72,7 @@ namespace osu.Game.Tournament.Screens.TeamIntro Anchor = Anchor.Centre, Origin = Anchor.CentreLeft }, - new RoundDisplay(pairing) + new RoundDisplay(pairing.NewValue) { RelativeSizeAxes = Axes.Both, Height = 0.25f, diff --git a/osu.Game.Tournament/Screens/TeamWin/TeamWinScreen.cs b/osu.Game.Tournament/Screens/TeamWin/TeamWinScreen.cs index 2e2c8e5020..f0f46f2dc8 100644 --- a/osu.Game.Tournament/Screens/TeamWin/TeamWinScreen.cs +++ b/osu.Game.Tournament/Screens/TeamWin/TeamWinScreen.cs @@ -2,7 +2,7 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; -using osu.Framework.Configuration; +using osu.Framework.Bindables; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Video; @@ -62,10 +62,10 @@ namespace osu.Game.Tournament.Screens.TeamWin currentCompleted.BindValueChanged(_ => update()); } - private void matchChanged(MatchPairing pairing) + private void matchChanged(ValueChangedEvent pairing) { currentCompleted.UnbindBindings(); - currentCompleted.BindTo(pairing.Completed); + currentCompleted.BindTo(pairing.NewValue.Completed); update(); } diff --git a/osu.Game.Tournament/TournamentGameBase.cs b/osu.Game.Tournament/TournamentGameBase.cs index 5c9bee560e..bf6c02d064 100644 --- a/osu.Game.Tournament/TournamentGameBase.cs +++ b/osu.Game.Tournament/TournamentGameBase.cs @@ -8,6 +8,7 @@ using System.IO; using System.Linq; using Newtonsoft.Json; using osu.Framework.Allocation; +using osu.Framework.Bindables; using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Framework.Graphics.Textures; From f1832103622d5e7816c570b73f6ebf371aa9ffa2 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 2 Mar 2019 13:50:43 +0900 Subject: [PATCH 185/317] Fix test bindables --- osu.Game.Tournament.Tests/TestCaseTeamIntro.cs | 4 ++-- osu.Game.Tournament.Tests/TestCaseTeamWin.cs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/osu.Game.Tournament.Tests/TestCaseTeamIntro.cs b/osu.Game.Tournament.Tests/TestCaseTeamIntro.cs index 004009f269..d8d5007238 100644 --- a/osu.Game.Tournament.Tests/TestCaseTeamIntro.cs +++ b/osu.Game.Tournament.Tests/TestCaseTeamIntro.cs @@ -3,7 +3,7 @@ using System.Linq; using osu.Framework.Allocation; -using osu.Framework.Configuration; +using osu.Framework.Bindables; using osu.Framework.Graphics; using osu.Game.Tournament.Screens.Ladder.Components; using osu.Game.Tournament.Screens.TeamIntro; @@ -21,7 +21,7 @@ namespace osu.Game.Tournament.Tests var pairing = new MatchPairing(); pairing.Team1.Value = Ladder.Teams.FirstOrDefault(t => t.Acronym == "USA"); pairing.Team2.Value = Ladder.Teams.FirstOrDefault(t => t.Acronym == "JPN"); - pairing.Grouping.Value = Ladder.Groupings.FirstOrDefault(g => g.Name == "Finals"); + pairing.Grouping.Value = Ladder.Groupings.FirstOrDefault(g => g.Name.Value == "Finals"); currentMatch.Value = pairing; Add(new TeamIntroScreen diff --git a/osu.Game.Tournament.Tests/TestCaseTeamWin.cs b/osu.Game.Tournament.Tests/TestCaseTeamWin.cs index 48ae9acb91..fb798d3587 100644 --- a/osu.Game.Tournament.Tests/TestCaseTeamWin.cs +++ b/osu.Game.Tournament.Tests/TestCaseTeamWin.cs @@ -3,7 +3,7 @@ using System.Linq; using osu.Framework.Allocation; -using osu.Framework.Configuration; +using osu.Framework.Bindables; using osu.Framework.Graphics; using osu.Game.Tournament.Screens.Ladder.Components; using osu.Game.Tournament.Screens.TeamWin; @@ -21,7 +21,7 @@ namespace osu.Game.Tournament.Tests var pairing = new MatchPairing(); pairing.Team1.Value = Ladder.Teams.FirstOrDefault(t => t.Acronym == "USA"); pairing.Team2.Value = Ladder.Teams.FirstOrDefault(t => t.Acronym == "JPN"); - pairing.Grouping.Value = Ladder.Groupings.FirstOrDefault(g => g.Name == "Finals"); + pairing.Grouping.Value = Ladder.Groupings.FirstOrDefault(g => g.Name.Value == "Finals"); currentMatch.Value = pairing; Add(new TeamWinScreen From 4c66ebb501187edc9b6a5cc2ebe8927f4a3e600e Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 2 Mar 2019 13:52:56 +0900 Subject: [PATCH 186/317] Fix formatting issues --- osu.Game.Tournament/Components/TournamentTeam.cs | 8 ++++---- osu.Game.Tournament/IPC/FileBasedIPC.cs | 1 - osu.Game.Tournament/Screens/Drawings/Components/Group.cs | 3 ++- .../Screens/Ladder/Components/DrawableMatchPairing.cs | 1 + osu.Game.Tournament/Screens/Schedule/ScheduleScreen.cs | 9 +++++---- 5 files changed, 12 insertions(+), 10 deletions(-) diff --git a/osu.Game.Tournament/Components/TournamentTeam.cs b/osu.Game.Tournament/Components/TournamentTeam.cs index 62dc703fee..73c24282c4 100644 --- a/osu.Game.Tournament/Components/TournamentTeam.cs +++ b/osu.Game.Tournament/Components/TournamentTeam.cs @@ -23,8 +23,8 @@ namespace osu.Game.Tournament.Components /// public string FlagName { - get { return flagName ?? Acronym?.Substring(0, 2); } - set { flagName = value; } + get => flagName ?? Acronym?.Substring(0, 2); + set => flagName = value; } private string acronym; @@ -34,8 +34,8 @@ namespace osu.Game.Tournament.Components /// public string Acronym { - get { return acronym ?? FullName?.Substring(0, 3); } - set { acronym = value; } + get => acronym ?? FullName?.Substring(0, 3); + set => acronym = value; } [JsonProperty] diff --git a/osu.Game.Tournament/IPC/FileBasedIPC.cs b/osu.Game.Tournament/IPC/FileBasedIPC.cs index 7f8ed0cb3d..da66460acb 100644 --- a/osu.Game.Tournament/IPC/FileBasedIPC.cs +++ b/osu.Game.Tournament/IPC/FileBasedIPC.cs @@ -129,7 +129,6 @@ namespace osu.Game.Tournament.IPC { protected override string LocateBasePath() { - bool checkExists(string p) { return File.Exists(Path.Combine(p, "ipc.txt")); diff --git a/osu.Game.Tournament/Screens/Drawings/Components/Group.cs b/osu.Game.Tournament/Screens/Drawings/Components/Group.cs index a701731d1e..ca092cdf02 100644 --- a/osu.Game.Tournament/Screens/Drawings/Components/Group.cs +++ b/osu.Game.Tournament/Screens/Drawings/Components/Group.cs @@ -121,7 +121,8 @@ namespace osu.Game.Tournament.Screens.Drawings.Components { private readonly FillFlowContainer innerContainer; - public GroupTeam(TournamentTeam team) : base(team) + public GroupTeam(TournamentTeam team) + : base(team) { Width = 36; AutoSizeAxes = Axes.Y; diff --git a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs index d993fbda20..9d3af60427 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs @@ -111,6 +111,7 @@ namespace osu.Game.Tournament.Screens.Ladder.Components set { if (value == selected) return; + selected = value; if (selected) diff --git a/osu.Game.Tournament/Screens/Schedule/ScheduleScreen.cs b/osu.Game.Tournament/Screens/Schedule/ScheduleScreen.cs index def2161ea0..05343117bf 100644 --- a/osu.Game.Tournament/Screens/Schedule/ScheduleScreen.cs +++ b/osu.Game.Tournament/Screens/Schedule/ScheduleScreen.cs @@ -57,8 +57,9 @@ namespace osu.Game.Tournament.Screens.Schedule } var upcoming = ladder.Pairings.Where(p => !p.Completed.Value && p.Team1.Value != null && p.Team2.Value != null && Math.Abs(p.Date.Value.DayOfYear - DateTimeOffset.UtcNow.DayOfYear) < 4); - var conditionals = ladder.Pairings.Where(p => !p.Completed.Value && (p.Team1.Value == null || p.Team2.Value == null) && Math.Abs(p.Date.Value.DayOfYear - DateTimeOffset.UtcNow.DayOfYear) < 4) - .SelectMany(m => m.ConditionalPairings.Where(cp => m.Acronyms.TrueForAll(a => cp.Acronyms.Contains(a)))); + var conditionals = ladder + .Pairings.Where(p => !p.Completed.Value && (p.Team1.Value == null || p.Team2.Value == null) && Math.Abs(p.Date.Value.DayOfYear - DateTimeOffset.UtcNow.DayOfYear) < 4) + .SelectMany(m => m.ConditionalPairings.Where(cp => m.Acronyms.TrueForAll(a => cp.Acronyms.Contains(a)))); upcoming = upcoming.Concat(conditionals); upcoming = upcoming.OrderBy(p => p.Date.Value).Take(12); @@ -145,7 +146,7 @@ namespace osu.Game.Tournament.Screens.Schedule Anchor = Anchor.TopRight, Origin = Anchor.TopLeft, Colour = Color4.Black, - Alpha = conditional ? 0.6f : 1, + Alpha = conditional ? 0.6f : 1, Margin = new MarginPadding { Horizontal = 10, Vertical = 5 }, }); AddInternal(new OsuSpriteText @@ -153,7 +154,7 @@ namespace osu.Game.Tournament.Screens.Schedule Anchor = Anchor.BottomRight, Origin = Anchor.BottomLeft, Colour = Color4.Black, - Alpha = conditional ? 0.6f : 1, + Alpha = conditional ? 0.6f : 1, Margin = new MarginPadding { Horizontal = 10, Vertical = 5 }, Text = pairing.Date.Value.ToUniversalTime().ToString("HH:mm UTC") + (conditional ? " (conditional)" : "") }); From 73d266fe1041f7c56571f241a558de29ade43b53 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 2 Mar 2019 16:32:11 +0900 Subject: [PATCH 187/317] Fix win screen being incorrectly displayed after switching matches --- .../Screens/Gameplay/GameplayScreen.cs | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs b/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs index eb33c2fbdb..2b6d16505a 100644 --- a/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs +++ b/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs @@ -120,7 +120,12 @@ namespace osu.Game.Tournament.Screens.Gameplay State.BindTo(ipc.State); State.BindValueChanged(stateChanged, true); - currentMatch.BindValueChanged(m => warmup.Value = m.NewValue.Team1Score.Value + m.NewValue.Team2Score.Value == 0); + currentMatch.BindValueChanged(m => + { + warmup.Value = m.NewValue.Team1Score.Value + m.NewValue.Team2Score.Value == 0; + scheduledOperation?.Cancel(); + }); + currentMatch.BindTo(ladder.CurrentMatch); warmup.BindValueChanged(w => warmupButton.Alpha = !w.NewValue ? 0.5f : 1, true); @@ -172,12 +177,16 @@ namespace osu.Game.Tournament.Screens.Gameplay case TourneyState.Idle: contract(); + const float delay_before_progression = 4000; + + // if we've returned to idle and the last screen was ranking + // we should automatically proceed after a short delay if (lastState == TourneyState.Ranking && !warmup.Value) { if (currentMatch.Value?.Completed.Value == true) - scheduledOperation = Scheduler.AddDelayed(() => { sceneManager?.SetScreen(typeof(TeamWinScreen)); }, 4000); + scheduledOperation = Scheduler.AddDelayed(() => { sceneManager?.SetScreen(typeof(TeamWinScreen)); }, delay_before_progression); else if (currentMatch.Value?.Completed.Value == false) - scheduledOperation = Scheduler.AddDelayed(() => { sceneManager?.SetScreen(typeof(MapPoolScreen)); }, 4000); + scheduledOperation = Scheduler.AddDelayed(() => { sceneManager?.SetScreen(typeof(MapPoolScreen)); }, delay_before_progression); } break; From 132ce541f3eca72d9a119aca7b4dbd64f0e895f5 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 4 Mar 2019 12:06:41 +0900 Subject: [PATCH 188/317] Fix obsolete font usages --- .../Components/ControlPanel.cs | 4 ++-- osu.Game.Tournament/Components/SongBar.cs | 5 ++--- .../Components/TournamentBeatmapPanel.cs | 12 ++++------- .../Screens/Drawings/Components/Group.cs | 7 +++---- .../Screens/Drawings/DrawingsScreen.cs | 3 +-- .../Gameplay/Components/MatchHeader.cs | 7 +++---- .../Gameplay/Components/MatchScoreDisplay.cs | 20 +++++-------------- .../Ladder/Components/DrawableMatchTeam.cs | 4 ++-- .../Screens/Schedule/ScheduleScreen.cs | 6 +++--- .../Screens/TeamIntro/TeamIntroScreen.cs | 16 ++++++--------- .../Screens/TeamWin/TeamWinScreen.cs | 14 +++++-------- osu.Game/Graphics/OsuFont.cs | 3 +++ 12 files changed, 39 insertions(+), 62 deletions(-) diff --git a/osu.Game.Tournament/Components/ControlPanel.cs b/osu.Game.Tournament/Components/ControlPanel.cs index 5f777fbf43..dee6cfbe0e 100644 --- a/osu.Game.Tournament/Components/ControlPanel.cs +++ b/osu.Game.Tournament/Components/ControlPanel.cs @@ -4,6 +4,7 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; +using osu.Game.Graphics; using osu.Game.Graphics.Sprites; using osuTK; using osuTK.Graphics; @@ -40,8 +41,7 @@ namespace osu.Game.Tournament.Components Origin = Anchor.TopCentre, Text = "Control Panel", - TextSize = 22f, - Font = "Exo2.0-Bold" + Font = OsuFont.GetFont(weight: FontWeight.Bold, size: 22) }, buttons = new FillFlowContainer { diff --git a/osu.Game.Tournament/Components/SongBar.cs b/osu.Game.Tournament/Components/SongBar.cs index fc75bd59a4..a138dfaa1e 100644 --- a/osu.Game.Tournament/Components/SongBar.cs +++ b/osu.Game.Tournament/Components/SongBar.cs @@ -163,7 +163,7 @@ namespace osu.Game.Tournament.Components string hardRockExtra = ""; string srExtra = ""; - var ar = beatmap.BaseDifficulty.ApproachRate; + //var ar = beatmap.BaseDifficulty.ApproachRate; if ((mods & LegacyMods.HardRock) > 0) { hardRockExtra = "*"; @@ -225,8 +225,7 @@ namespace osu.Game.Tournament.Components void cp(SpriteText s, Color4 colour) { s.Colour = colour; - s.TextSize = 15; - s.Font = @"Exo2.0-Bold"; + s.Font = OsuFont.GetFont(weight: FontWeight.Bold, size: 15); } bool first = true; diff --git a/osu.Game.Tournament/Components/TournamentBeatmapPanel.cs b/osu.Game.Tournament/Components/TournamentBeatmapPanel.cs index 94aa86d5cb..6b80094990 100644 --- a/osu.Game.Tournament/Components/TournamentBeatmapPanel.cs +++ b/osu.Game.Tournament/Components/TournamentBeatmapPanel.cs @@ -100,29 +100,25 @@ namespace osu.Game.Tournament.Components new OsuSpriteText { Text = "mapper", - Font = @"Exo2.0-RegularItalic", Padding = new MarginPadding { Right = 5 }, - TextSize = 14 + Font = OsuFont.GetFont(italics: true, weight: FontWeight.Regular, size: 14) }, new OsuSpriteText { Text = Beatmap.Metadata.AuthorString, - Font = @"Exo2.0-BoldItalic", Padding = new MarginPadding { Right = 20 }, - TextSize = 14 + Font = OsuFont.GetFont(italics: true, weight: FontWeight.Bold, size: 14) }, new OsuSpriteText { Text = "difficulty", - Font = @"Exo2.0-RegularItalic", Padding = new MarginPadding { Right = 5 }, - TextSize = 14 + Font = OsuFont.GetFont(italics: true, weight: FontWeight.Regular, size: 14) }, new OsuSpriteText { Text = Beatmap.Version, - Font = @"Exo2.0-BoldItalic", - TextSize = 14 + Font = OsuFont.GetFont(italics: true, weight: FontWeight.Bold, size: 14) }, } } diff --git a/osu.Game.Tournament/Screens/Drawings/Components/Group.cs b/osu.Game.Tournament/Screens/Drawings/Components/Group.cs index ca092cdf02..36ab7482a0 100644 --- a/osu.Game.Tournament/Screens/Drawings/Components/Group.cs +++ b/osu.Game.Tournament/Screens/Drawings/Components/Group.cs @@ -7,6 +7,7 @@ using System.Text; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; +using osu.Game.Graphics; using osu.Game.Graphics.Sprites; using osu.Game.Tournament.Components; using osuTK; @@ -49,8 +50,7 @@ namespace osu.Game.Tournament.Screens.Drawings.Components Position = new Vector2(0, 7f), Text = $"GROUP {name.ToUpperInvariant()}", - TextSize = 8f, - Font = @"Exo2.0-Bold", + Font = OsuFont.GetFont(weight: FontWeight.Bold, size: 8), Colour = new Color4(255, 204, 34, 255), }, teams = new FillFlowContainer @@ -134,8 +134,7 @@ namespace osu.Game.Tournament.Screens.Drawings.Components AcronymText.Anchor = Anchor.TopCentre; AcronymText.Origin = Anchor.TopCentre; AcronymText.Text = team.Acronym.ToUpperInvariant(); - AcronymText.TextSize = 10f; - AcronymText.Font = @"Exo2.0-Bold"; + AcronymText.Font = OsuFont.GetFont(weight: FontWeight.Bold, size: 10); InternalChildren = new Drawable[] { diff --git a/osu.Game.Tournament/Screens/Drawings/DrawingsScreen.cs b/osu.Game.Tournament/Screens/Drawings/DrawingsScreen.cs index f68adabb4c..c30caa5a00 100644 --- a/osu.Game.Tournament/Screens/Drawings/DrawingsScreen.cs +++ b/osu.Game.Tournament/Screens/Drawings/DrawingsScreen.cs @@ -120,8 +120,7 @@ namespace osu.Game.Tournament.Screens.Drawings Alpha = 0, - Font = "Exo2.0-Light", - TextSize = 42f + Font = OsuFont.GetFont(weight: FontWeight.Light, size: 42), } } }, diff --git a/osu.Game.Tournament/Screens/Gameplay/Components/MatchHeader.cs b/osu.Game.Tournament/Screens/Gameplay/Components/MatchHeader.cs index 364d437619..5bbdbe104f 100644 --- a/osu.Game.Tournament/Screens/Gameplay/Components/MatchHeader.cs +++ b/osu.Game.Tournament/Screens/Gameplay/Components/MatchHeader.cs @@ -7,6 +7,7 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; using osu.Framework.Input.Events; +using osu.Game.Graphics; using osu.Game.Graphics.Sprites; using osu.Game.Graphics.UserInterface; using osu.Game.Tournament.Components; @@ -174,9 +175,8 @@ namespace osu.Game.Tournament.Screens.Gameplay.Components Text = team?.FullName.ToUpper() ?? "???", X = (flip ? -1 : 1) * 90, Y = -10, - TextSize = 20, Colour = colour, - Font = "Aquatico-Regular", + Font = OsuFont.GetFont(typeface: Typeface.Aquatico, weight: FontWeight.Regular, size: 20), Origin = anchor, Anchor = anchor, }, @@ -219,8 +219,7 @@ namespace osu.Game.Tournament.Screens.Gameplay.Components Origin = Anchor.Centre, Colour = Color4.White, Text = match.NewValue.Grouping.Value?.Name.Value ?? "Unknown Grouping", - Font = "Aquatico-Regular", - TextSize = 18, + Font = OsuFont.GetFont(typeface: Typeface.Aquatico, weight: FontWeight.Regular, size: 18), }, }; } diff --git a/osu.Game.Tournament/Screens/Gameplay/Components/MatchScoreDisplay.cs b/osu.Game.Tournament/Screens/Gameplay/Components/MatchScoreDisplay.cs index 30cd2b2e85..a648072d04 100644 --- a/osu.Game.Tournament/Screens/Gameplay/Components/MatchScoreDisplay.cs +++ b/osu.Game.Tournament/Screens/Gameplay/Components/MatchScoreDisplay.cs @@ -7,6 +7,7 @@ using osu.Framework.Bindables; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; +using osu.Game.Graphics; using osu.Game.Graphics.UserInterface; using osu.Game.Tournament.IPC; using osu.Game.Tournament.Screens.Ladder.Components; @@ -119,26 +120,15 @@ namespace osu.Game.Tournament.Screens.Gameplay.Components public MatchScoreCounter() { Margin = new MarginPadding { Top = bar_height + 5, Horizontal = 10 }; - Winning = false; - DisplayedCountSpriteText.FixedWidth = false; + Winning = false; } public bool Winning { - set - { - if (value) - { - DisplayedCountSpriteText.Font = "Aquatico-Regular"; - DisplayedCountSpriteText.TextSize = 60; - } - else - { - DisplayedCountSpriteText.Font = "Aquatico-Light"; - DisplayedCountSpriteText.TextSize = 40; - } - } + set => DisplayedCountSpriteText.Font = value + ? OsuFont.GetFont(typeface: Typeface.Aquatico, weight: FontWeight.Regular, size: 60) + : OsuFont.GetFont(typeface: Typeface.Aquatico, weight: FontWeight.Light, size: 40); } } } diff --git a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs index 63d15781ca..c4097848d7 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs @@ -67,7 +67,7 @@ namespace osu.Game.Tournament.Screens.Ladder.Components AcronymText.Anchor = AcronymText.Origin = Anchor.CentreLeft; AcronymText.Padding = new MarginPadding { Left = 50 }; - AcronymText.TextSize = 24; + AcronymText.Font = OsuFont.GetFont(size: 24); if (pairing != null) { @@ -121,7 +121,7 @@ namespace osu.Game.Tournament.Screens.Ladder.Components { Anchor = Anchor.Centre, Origin = Anchor.Centre, - TextSize = 20, + Font = OsuFont.GetFont(size: 20), } } } diff --git a/osu.Game.Tournament/Screens/Schedule/ScheduleScreen.cs b/osu.Game.Tournament/Screens/Schedule/ScheduleScreen.cs index 05343117bf..384f2f7ab2 100644 --- a/osu.Game.Tournament/Screens/Schedule/ScheduleScreen.cs +++ b/osu.Game.Tournament/Screens/Schedule/ScheduleScreen.cs @@ -112,14 +112,14 @@ namespace osu.Game.Tournament.Screens.Schedule Spacing = new Vector2(10, 0), Text = currentMatch.Value.Grouping.Value.Name.Value, Colour = Color4.Black, - TextSize = 20 + Font = OsuFont.GetFont(size: 20) }, new SchedulePairing(currentMatch.Value, false), new OsuSpriteText { Text = "Start Time " + pairing.NewValue.Date.Value.ToUniversalTime().ToString("HH:mm UTC"), Colour = Color4.Black, - TextSize = 20 + Font = OsuFont.GetFont(size: 20) }, } } @@ -179,7 +179,7 @@ namespace osu.Game.Tournament.Screens.Schedule Text = title, Colour = Color4.Black, Spacing = new Vector2(10, 0), - TextSize = 30 + Font = OsuFont.GetFont(size: 30) }, content = new FillFlowContainer { diff --git a/osu.Game.Tournament/Screens/TeamIntro/TeamIntroScreen.cs b/osu.Game.Tournament/Screens/TeamIntro/TeamIntroScreen.cs index a42c7775e6..94130cb383 100644 --- a/osu.Game.Tournament/Screens/TeamIntro/TeamIntroScreen.cs +++ b/osu.Game.Tournament/Screens/TeamIntro/TeamIntroScreen.cs @@ -104,10 +104,9 @@ namespace osu.Game.Tournament.Screens.TeamIntro Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, Colour = col, - Font = "Exo2.0-Black", Text = "COMING UP NEXT", Spacing = new Vector2(2, 0), - TextSize = 15, + Font = OsuFont.GetFont(size: 15, weight: FontWeight.Black) }, new OsuSpriteText { @@ -115,9 +114,8 @@ namespace osu.Game.Tournament.Screens.TeamIntro Origin = Anchor.TopCentre, Colour = col, Text = pairing.Grouping.Value?.Name.Value ?? "Unknown Grouping", - Font = "Exo2.0-Light", Spacing = new Vector2(10, 0), - TextSize = 50, + Font = OsuFont.GetFont(size: 50, weight: FontWeight.Light) }, new OsuSpriteText { @@ -125,7 +123,7 @@ namespace osu.Game.Tournament.Screens.TeamIntro Origin = Anchor.TopCentre, Colour = col, Text = pairing.Date.Value.ToUniversalTime().ToString("dd MMMM HH:mm UTC"), - TextSize = 20, + Font = OsuFont.GetFont(size: 20) }, } } @@ -170,7 +168,7 @@ namespace osu.Game.Tournament.Screens.TeamIntro players.Add(new OsuSpriteText { Text = p.Username, - TextSize = 24, + Font = OsuFont.GetFont(size: 24), Colour = colour, Anchor = left ? Anchor.CentreRight : Anchor.CentreLeft, Origin = left ? Anchor.CentreRight : Anchor.CentreLeft, @@ -202,17 +200,15 @@ namespace osu.Game.Tournament.Screens.TeamIntro new OsuSpriteText { Text = team?.FullName.ToUpper() ?? "???", - TextSize = 40, + Font = OsuFont.GetFont(Typeface.Aquatico, 40, FontWeight.Light), Colour = Color4.Black, - Font = "Aquatico-Light", Origin = Anchor.TopCentre, Anchor = Anchor.TopCentre, }, new OsuSpriteText { Text = teamName.ToUpper(), - TextSize = 20, - Font = "Aquatico-Regular", + Font = OsuFont.GetFont(Typeface.Aquatico, 20, FontWeight.Regular), Colour = colour, Origin = Anchor.TopCentre, Anchor = Anchor.TopCentre, diff --git a/osu.Game.Tournament/Screens/TeamWin/TeamWinScreen.cs b/osu.Game.Tournament/Screens/TeamWin/TeamWinScreen.cs index f0f46f2dc8..1de9b6ae5c 100644 --- a/osu.Game.Tournament/Screens/TeamWin/TeamWinScreen.cs +++ b/osu.Game.Tournament/Screens/TeamWin/TeamWinScreen.cs @@ -127,8 +127,7 @@ namespace osu.Game.Tournament.Screens.TeamWin Origin = Anchor.TopCentre, Colour = col, Text = "WINNER", - Font = "Aquatico-Regular", - TextSize = 15, + Font = OsuFont.GetFont(Typeface.Aquatico, 15, FontWeight.Regular), }, new OsuSpriteText { @@ -136,18 +135,16 @@ namespace osu.Game.Tournament.Screens.TeamWin Origin = Anchor.TopCentre, Colour = col, Text = pairing.Grouping.Value?.Name.Value ?? "Unknown Grouping", - Font = "Aquatico-Light", + Font = OsuFont.GetFont(Typeface.Aquatico, 50, FontWeight.Light), Spacing = new Vector2(10, 0), - TextSize = 50, }, new OsuSpriteText { Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, - Font = "Aquatico-Light", Colour = col, Text = pairing.Date.Value.ToUniversalTime().ToString("dd MMMM HH:mm UTC"), - TextSize = 20, + Font = OsuFont.GetFont(Typeface.Aquatico, 20, FontWeight.Light), }, } } @@ -207,16 +204,15 @@ namespace osu.Game.Tournament.Screens.TeamWin new OsuSpriteText { Text = team?.FullName.ToUpper() ?? "???", - TextSize = 40, + Font = OsuFont.GetFont(Typeface.Aquatico, 40, FontWeight.Light), Colour = Color4.Black, - Font = "Aquatico-Light", Origin = Anchor.TopCentre, Anchor = Anchor.TopCentre, }, new OsuSpriteText { Text = teamName.ToUpper(), - TextSize = 20, + Font = OsuFont.GetFont(size: 20), Colour = colour, Origin = Anchor.TopCentre, Anchor = Anchor.TopCentre, diff --git a/osu.Game/Graphics/OsuFont.cs b/osu.Game/Graphics/OsuFont.cs index dc660fd159..22937333d7 100644 --- a/osu.Game/Graphics/OsuFont.cs +++ b/osu.Game/Graphics/OsuFont.cs @@ -46,6 +46,8 @@ namespace osu.Game.Graphics return "FontAwesome"; case Typeface.Venera: return "Venera"; + case Typeface.Aquatico: + return "Aquatico"; } return null; @@ -103,6 +105,7 @@ namespace osu.Game.Graphics Exo, FontAwesome, Venera, + Aquatico // tournament use only } public enum FontWeight From 5c8cbd43c8fab1e0d14e0cc85fb939bcd58dbace Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 4 Mar 2019 13:02:43 +0900 Subject: [PATCH 189/317] Enforce max consecutive blank lines --- osu.sln.DotSettings | 2 ++ 1 file changed, 2 insertions(+) diff --git a/osu.sln.DotSettings b/osu.sln.DotSettings index 5363d6dddf..3c6a6dd2a9 100644 --- a/osu.sln.DotSettings +++ b/osu.sln.DotSettings @@ -230,6 +230,8 @@ True NEXT_LINE NEXT_LINE + 1 + 1 True NEVER NEVER From 5b81de7663cb0ebcbce195df7dd2177f147a9f7f Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 4 Mar 2019 13:04:07 +0900 Subject: [PATCH 190/317] Apply codefactor fixes --- osu.Game.Tournament/Components/SongBar.cs | 2 -- osu.Game.Tournament/Screens/Drawings/Components/Group.cs | 1 - osu.Game.Tournament/Screens/Gameplay/Components/MatchHeader.cs | 1 - .../Screens/Ladder/Components/DrawableMatchPairing.cs | 1 - 4 files changed, 5 deletions(-) diff --git a/osu.Game.Tournament/Components/SongBar.cs b/osu.Game.Tournament/Components/SongBar.cs index a138dfaa1e..452565d7d8 100644 --- a/osu.Game.Tournament/Components/SongBar.cs +++ b/osu.Game.Tournament/Components/SongBar.cs @@ -80,7 +80,6 @@ namespace osu.Game.Tournament.Components } } - [BackgroundDependencyLoader] private void load() { @@ -247,4 +246,3 @@ namespace osu.Game.Tournament.Components } } } - diff --git a/osu.Game.Tournament/Screens/Drawings/Components/Group.cs b/osu.Game.Tournament/Screens/Drawings/Components/Group.cs index 36ab7482a0..50e413afea 100644 --- a/osu.Game.Tournament/Screens/Drawings/Components/Group.cs +++ b/osu.Game.Tournament/Screens/Drawings/Components/Group.cs @@ -127,7 +127,6 @@ namespace osu.Game.Tournament.Screens.Drawings.Components Width = 36; AutoSizeAxes = Axes.Y; - Flag.Anchor = Anchor.TopCentre; Flag.Origin = Anchor.TopCentre; diff --git a/osu.Game.Tournament/Screens/Gameplay/Components/MatchHeader.cs b/osu.Game.Tournament/Screens/Gameplay/Components/MatchHeader.cs index 5bbdbe104f..89168aa8bb 100644 --- a/osu.Game.Tournament/Screens/Gameplay/Components/MatchHeader.cs +++ b/osu.Game.Tournament/Screens/Gameplay/Components/MatchHeader.cs @@ -87,7 +87,6 @@ namespace osu.Game.Tournament.Screens.Gameplay.Components teamChanged(currentTeam.Value); } - protected override bool OnMouseDown(MouseDownEvent e) { switch (e.Button) diff --git a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs index 9d3af60427..0244403bff 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs @@ -30,7 +30,6 @@ namespace osu.Game.Tournament.Screens.Ladder.Components [Resolved(CanBeNull = true)] private LadderInfo ladderInfo { get; set; } - public DrawableMatchPairing(MatchPairing pairing, bool editor = false) { Pairing = pairing; From 8bf49830d5e994eb1a6100779947da9da8b97802 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 4 Mar 2019 13:13:31 +0900 Subject: [PATCH 191/317] Simplify and extract complex method --- osu.Game.Tournament/TournamentGameBase.cs | 144 ++++++++++++++-------- 1 file changed, 93 insertions(+), 51 deletions(-) diff --git a/osu.Game.Tournament/TournamentGameBase.cs b/osu.Game.Tournament/TournamentGameBase.cs index bf6c02d064..e3996bc572 100644 --- a/osu.Game.Tournament/TournamentGameBase.cs +++ b/osu.Game.Tournament/TournamentGameBase.cs @@ -27,7 +27,8 @@ namespace osu.Game.Tournament { private const string bracket_filename = "bracket.json"; - protected LadderInfo Ladder; + private LadderInfo ladder; + private Storage storage; private DependencyContainer dependencies; @@ -57,42 +58,61 @@ namespace osu.Game.Tournament windowSize = frameworkConfig.GetBindable(FrameworkSetting.WindowedSize); - string content = null; - if (storage.Exists(bracket_filename)) - using (Stream stream = storage.GetStream(bracket_filename, FileAccess.Read, FileMode.Open)) - using (var sr = new StreamReader(stream)) - { - content = sr.ReadToEnd(); - } + readBracket(); - Ladder = content != null ? JsonConvert.DeserializeObject(content) : new LadderInfo(); - - dependencies.Cache(Ladder); + ladder.CurrentMatch.Value = ladder.Pairings.FirstOrDefault(p => p.Current.Value); dependencies.CacheAs(ipc = new FileBasedIPC()); Add(ipc); + Add(new OsuButton + { + Text = "Save Changes", + Width = 140, + Height = 50, + Anchor = Anchor.BottomRight, + Origin = Anchor.BottomRight, + Padding = new MarginPadding(10), + Action = SaveChanges, + }); + } + + private void readBracket() + { + if (storage.Exists(bracket_filename)) + { + using (Stream stream = storage.GetStream(bracket_filename, FileAccess.Read, FileMode.Open)) + using (var sr = new StreamReader(stream)) + ladder = JsonConvert.DeserializeObject(sr.ReadToEnd()); + } + else + { + ladder = new LadderInfo(); + } + + dependencies.Cache(ladder); + bool addedInfo = false; // assign teams - foreach (var pairing in Ladder.Pairings) + foreach (var pairing in ladder.Pairings) { - pairing.Team1.Value = Ladder.Teams.FirstOrDefault(t => t.Acronym == pairing.Team1Acronym); - pairing.Team2.Value = Ladder.Teams.FirstOrDefault(t => t.Acronym == pairing.Team2Acronym); + pairing.Team1.Value = ladder.Teams.FirstOrDefault(t => t.Acronym == pairing.Team1Acronym); + pairing.Team2.Value = ladder.Teams.FirstOrDefault(t => t.Acronym == pairing.Team2Acronym); foreach (var conditional in pairing.ConditionalPairings) { - conditional.Team1.Value = Ladder.Teams.FirstOrDefault(t => t.Acronym == conditional.Team1Acronym); - conditional.Team2.Value = Ladder.Teams.FirstOrDefault(t => t.Acronym == conditional.Team2Acronym); + conditional.Team1.Value = ladder.Teams.FirstOrDefault(t => t.Acronym == conditional.Team1Acronym); + conditional.Team2.Value = ladder.Teams.FirstOrDefault(t => t.Acronym == conditional.Team2Acronym); conditional.Grouping.Value = pairing.Grouping.Value; } } // assign progressions - foreach (var pair in Ladder.Progressions) + foreach (var pair in ladder.Progressions) { - var src = Ladder.Pairings.FirstOrDefault(p => p.ID == pair.Item1); - var dest = Ladder.Pairings.FirstOrDefault(p => p.ID == pair.Item2); + var src = ladder.Pairings.FirstOrDefault(p => p.ID == pair.Item1); + var dest = ladder.Pairings.FirstOrDefault(p => p.ID == pair.Item2); if (src == null) throw new InvalidOperationException(); @@ -106,10 +126,10 @@ namespace osu.Game.Tournament } // link pairings to groupings - foreach (var group in Ladder.Groupings) + foreach (var group in ladder.Groupings) foreach (var id in group.Pairings) { - var found = Ladder.Pairings.FirstOrDefault(p => p.ID == id); + var found = ladder.Pairings.FirstOrDefault(p => p.ID == id); if (found != null) { found.Grouping.Value = group; @@ -118,10 +138,23 @@ namespace osu.Game.Tournament } } - Ladder.CurrentMatch.Value = Ladder.Pairings.FirstOrDefault(p => p.Current.Value); + addedInfo |= addPlayers(); + addedInfo |= addBeatmaps(); + addedInfo |= addCountries(); - // add full player info based on user IDs - foreach (var t in Ladder.Teams) + if (addedInfo) + SaveChanges(); + } + + /// + /// Add missing player info based on user IDs. + /// + /// + private bool addPlayers() + { + bool addedInfo = false; + + foreach (var t in ladder.Teams) foreach (var p in t.Players) if (string.IsNullOrEmpty(p.Username)) { @@ -132,8 +165,16 @@ namespace osu.Game.Tournament addedInfo = true; } - // add full beatmap info based on beatmap IDs - foreach (var g in Ladder.Groupings) + return addedInfo; + } + + /// + /// Add missing beatmap info based on beatmap IDs + /// + private bool addBeatmaps() + { + bool addedInfo = false; + foreach (var g in ladder.Groupings) foreach (var b in g.Beatmaps) if (b.BeatmapInfo == null) { @@ -144,36 +185,37 @@ namespace osu.Game.Tournament addedInfo = true; } + return addedInfo; + } + + /// + /// Add missing country info based on acronyms. + /// + private bool addCountries() + { + bool addedInfo = false; + List countries; using (Stream stream = Resources.GetStream("Resources/countries.json")) using (var sr = new StreamReader(stream)) countries = JsonConvert.DeserializeObject>(sr.ReadToEnd()); - foreach (var t in Ladder.Teams) - if (string.IsNullOrEmpty(t.FullName)) - { - var result = countries.FirstOrDefault(c => c.Acronym == t.Acronym); - if (result != null) - { - t.Acronym = result.Acronym; - t.FlagName = result.FlagName; - t.FullName = result.FullName; - } - } - - if (addedInfo) - SaveChanges(); - - Add(new OsuButton + foreach (var t in ladder.Teams) { - Text = "Save Changes", - Width = 140, - Height = 50, - Anchor = Anchor.BottomRight, - Origin = Anchor.BottomRight, - Padding = new MarginPadding(10), - Action = SaveChanges, - }); + if (!string.IsNullOrEmpty(t.FullName)) + continue; + + var result = countries.FirstOrDefault(c => c.Acronym == t.Acronym); + + if (result == null) continue; + + t.Acronym = result.Acronym; + t.FlagName = result.FlagName; + t.FullName = result.FullName; + addedInfo = true; + } + + return addedInfo; } protected override void LoadComplete() @@ -198,7 +240,7 @@ namespace osu.Game.Tournament using (var stream = storage.GetStream(bracket_filename, FileAccess.Write, FileMode.Create)) using (var sw = new StreamWriter(stream)) { - sw.Write(JsonConvert.SerializeObject(Ladder, + sw.Write(JsonConvert.SerializeObject(ladder, new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore, From cf63ee4948a812edf153274112cbf83100fa18ef Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 4 Mar 2019 13:24:19 +0900 Subject: [PATCH 192/317] Update licence headers --- osu.Game.Tournament.Tests/LadderTestCase.cs | 4 ++-- osu.Game.Tournament.Tests/TestCaseBeatmapPanel.cs | 4 ++-- osu.Game.Tournament.Tests/TestCaseGameplay.cs | 4 ++-- osu.Game.Tournament.Tests/TestCaseGroupingsEditorScreen.cs | 4 ++-- osu.Game.Tournament.Tests/TestCaseLadderManager.cs | 4 ++-- osu.Game.Tournament.Tests/TestCaseMapPool.cs | 4 ++-- osu.Game.Tournament.Tests/TestCaseMatchChatDisplay.cs | 4 ++-- osu.Game.Tournament.Tests/TestCaseMatchPairings.cs | 4 ++-- osu.Game.Tournament.Tests/TestCaseMatchScoreDisplay.cs | 4 ++-- osu.Game.Tournament.Tests/TestCaseSceneManager.cs | 4 ++-- osu.Game.Tournament.Tests/TestCaseSchedule.cs | 4 ++-- osu.Game.Tournament.Tests/TestCaseShowcase.cs | 4 ++-- osu.Game.Tournament.Tests/TestCaseTeamIntro.cs | 4 ++-- osu.Game.Tournament.Tests/TestCaseTeamWin.cs | 4 ++-- osu.Game.Tournament.Tests/TournamentTestBrowser.cs | 4 ++-- osu.Game.Tournament.Tests/TournamentTestRunner.cs | 4 ++-- osu.Game.Tournament/Components/ControlPanel.cs | 4 ++-- osu.Game.Tournament/Components/DateTextBox.cs | 4 ++-- osu.Game.Tournament/Components/DrawableTournamentTeam.cs | 4 ++-- osu.Game.Tournament/Components/MatchChatDisplay.cs | 4 ++-- osu.Game.Tournament/Components/SongBar.cs | 4 ++-- osu.Game.Tournament/Components/TournamentBeatmapPanel.cs | 4 ++-- osu.Game.Tournament/Components/TournamentTeam.cs | 4 ++-- osu.Game.Tournament/IPC/FileBasedIPC.cs | 4 ++-- osu.Game.Tournament/IPC/MatchIPCInfo.cs | 4 ++-- osu.Game.Tournament/IPC/TourneyState.cs | 4 ++-- osu.Game.Tournament/LadderInfo.cs | 4 ++-- osu.Game.Tournament/Properties/AssemblyInfo.cs | 4 ++-- osu.Game.Tournament/Screens/BeatmapInfoScreen.cs | 4 ++-- osu.Game.Tournament/Screens/Drawings/DrawingsScreen.cs | 4 ++-- .../Screens/Gameplay/Components/MatchHeader.cs | 4 ++-- .../Screens/Gameplay/Components/MatchScoreDisplay.cs | 4 ++-- osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs | 4 ++-- .../Screens/Groupings/GroupingsEditorScreen.cs | 4 ++-- osu.Game.Tournament/Screens/IProvideVideo.cs | 4 ++-- .../Screens/Ladder/Components/BeatmapChoice.cs | 4 ++-- .../Screens/Ladder/Components/ConditionalMatchPairing.cs | 4 ++-- .../Screens/Ladder/Components/DrawableMatchPairing.cs | 4 ++-- .../Screens/Ladder/Components/DrawableMatchTeam.cs | 4 ++-- .../Screens/Ladder/Components/DrawableTournamentGrouping.cs | 4 ++-- .../Screens/Ladder/Components/GroupingBeatmap.cs | 4 ++-- .../Screens/Ladder/Components/LadderEditorInfo.cs | 4 ++-- .../Screens/Ladder/Components/LadderEditorSettings.cs | 4 ++-- osu.Game.Tournament/Screens/Ladder/Components/MatchPairing.cs | 4 ++-- .../Screens/Ladder/Components/ProgressionPath.cs | 4 ++-- .../Screens/Ladder/Components/TournamentGrouping.cs | 4 ++-- .../Screens/Ladder/Components/TournamentProgression.cs | 4 ++-- osu.Game.Tournament/Screens/Ladder/LadderEditorScreen.cs | 4 ++-- osu.Game.Tournament/Screens/Ladder/LadderScreen.cs | 4 ++-- osu.Game.Tournament/Screens/Ladder/ScrollableContainer.cs | 4 ++-- osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs | 4 ++-- osu.Game.Tournament/Screens/Schedule/ScheduleScreen.cs | 4 ++-- osu.Game.Tournament/Screens/Showcase/ShowcaseScreen.cs | 4 ++-- osu.Game.Tournament/Screens/Showcase/TournamentLogo.cs | 4 ++-- osu.Game.Tournament/Screens/TeamIntro/TeamIntroScreen.cs | 4 ++-- osu.Game.Tournament/Screens/TeamWin/TeamWinScreen.cs | 4 ++-- osu.Game.Tournament/Screens/TournamentSceneManager.cs | 4 ++-- osu.Game.Tournament/Screens/TournamentScreen.cs | 4 ++-- osu.Game.Tournament/TournamentGame.cs | 4 ++-- osu.Game.Tournament/TournamentGameBase.cs | 4 ++-- 60 files changed, 120 insertions(+), 120 deletions(-) diff --git a/osu.Game.Tournament.Tests/LadderTestCase.cs b/osu.Game.Tournament.Tests/LadderTestCase.cs index acc96930ee..fc827150bd 100644 --- a/osu.Game.Tournament.Tests/LadderTestCase.cs +++ b/osu.Game.Tournament.Tests/LadderTestCase.cs @@ -1,5 +1,5 @@ -// Copyright (c) 2007-2018 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. using osu.Framework.Allocation; using osu.Game.Tests.Visual; diff --git a/osu.Game.Tournament.Tests/TestCaseBeatmapPanel.cs b/osu.Game.Tournament.Tests/TestCaseBeatmapPanel.cs index de80d36067..8bcc34bd7a 100644 --- a/osu.Game.Tournament.Tests/TestCaseBeatmapPanel.cs +++ b/osu.Game.Tournament.Tests/TestCaseBeatmapPanel.cs @@ -1,5 +1,5 @@ -// Copyright (c) 2007-2018 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. using System; using System.Collections.Generic; diff --git a/osu.Game.Tournament.Tests/TestCaseGameplay.cs b/osu.Game.Tournament.Tests/TestCaseGameplay.cs index eefcd79661..8e435de5e6 100644 --- a/osu.Game.Tournament.Tests/TestCaseGameplay.cs +++ b/osu.Game.Tournament.Tests/TestCaseGameplay.cs @@ -1,5 +1,5 @@ -// Copyright (c) 2007-2018 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. using System; using System.Collections.Generic; diff --git a/osu.Game.Tournament.Tests/TestCaseGroupingsEditorScreen.cs b/osu.Game.Tournament.Tests/TestCaseGroupingsEditorScreen.cs index 4e82e27fd9..d3ef011535 100644 --- a/osu.Game.Tournament.Tests/TestCaseGroupingsEditorScreen.cs +++ b/osu.Game.Tournament.Tests/TestCaseGroupingsEditorScreen.cs @@ -1,5 +1,5 @@ -// Copyright (c) 2007-2018 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. using osu.Game.Tournament.Screens.Groupings; diff --git a/osu.Game.Tournament.Tests/TestCaseLadderManager.cs b/osu.Game.Tournament.Tests/TestCaseLadderManager.cs index 3001f46ed2..8704c3aec5 100644 --- a/osu.Game.Tournament.Tests/TestCaseLadderManager.cs +++ b/osu.Game.Tournament.Tests/TestCaseLadderManager.cs @@ -1,5 +1,5 @@ -// Copyright (c) 2007-2018 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. using osu.Framework.Allocation; using osu.Framework.Graphics; diff --git a/osu.Game.Tournament.Tests/TestCaseMapPool.cs b/osu.Game.Tournament.Tests/TestCaseMapPool.cs index d953dbc5d3..6d2f64e7a7 100644 --- a/osu.Game.Tournament.Tests/TestCaseMapPool.cs +++ b/osu.Game.Tournament.Tests/TestCaseMapPool.cs @@ -1,5 +1,5 @@ -// Copyright (c) 2007-2018 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. using System; using System.Collections.Generic; diff --git a/osu.Game.Tournament.Tests/TestCaseMatchChatDisplay.cs b/osu.Game.Tournament.Tests/TestCaseMatchChatDisplay.cs index d71e4b8006..0c3c189cf5 100644 --- a/osu.Game.Tournament.Tests/TestCaseMatchChatDisplay.cs +++ b/osu.Game.Tournament.Tests/TestCaseMatchChatDisplay.cs @@ -1,5 +1,5 @@ -// Copyright (c) 2007-2018 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. using System.Collections.Generic; using osu.Framework.Allocation; diff --git a/osu.Game.Tournament.Tests/TestCaseMatchPairings.cs b/osu.Game.Tournament.Tests/TestCaseMatchPairings.cs index b4a754e439..2dce0c6017 100644 --- a/osu.Game.Tournament.Tests/TestCaseMatchPairings.cs +++ b/osu.Game.Tournament.Tests/TestCaseMatchPairings.cs @@ -1,5 +1,5 @@ -// Copyright (c) 2007-2018 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. using System; using System.Collections.Generic; diff --git a/osu.Game.Tournament.Tests/TestCaseMatchScoreDisplay.cs b/osu.Game.Tournament.Tests/TestCaseMatchScoreDisplay.cs index 62c5ca786b..c7de5cf8ce 100644 --- a/osu.Game.Tournament.Tests/TestCaseMatchScoreDisplay.cs +++ b/osu.Game.Tournament.Tests/TestCaseMatchScoreDisplay.cs @@ -1,5 +1,5 @@ -// Copyright (c) 2007-2018 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. using osu.Framework.Allocation; using osu.Framework.Graphics; diff --git a/osu.Game.Tournament.Tests/TestCaseSceneManager.cs b/osu.Game.Tournament.Tests/TestCaseSceneManager.cs index a19c933d8b..97d2018e3d 100644 --- a/osu.Game.Tournament.Tests/TestCaseSceneManager.cs +++ b/osu.Game.Tournament.Tests/TestCaseSceneManager.cs @@ -1,5 +1,5 @@ -// Copyright (c) 2007-2018 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. using osu.Framework.Allocation; using osu.Framework.Platform; diff --git a/osu.Game.Tournament.Tests/TestCaseSchedule.cs b/osu.Game.Tournament.Tests/TestCaseSchedule.cs index a12586cb27..f9dc447077 100644 --- a/osu.Game.Tournament.Tests/TestCaseSchedule.cs +++ b/osu.Game.Tournament.Tests/TestCaseSchedule.cs @@ -1,5 +1,5 @@ -// Copyright (c) 2007-2018 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. using System; using System.Collections.Generic; diff --git a/osu.Game.Tournament.Tests/TestCaseShowcase.cs b/osu.Game.Tournament.Tests/TestCaseShowcase.cs index dcd4b6aec7..51877cdfb6 100644 --- a/osu.Game.Tournament.Tests/TestCaseShowcase.cs +++ b/osu.Game.Tournament.Tests/TestCaseShowcase.cs @@ -1,5 +1,5 @@ -// Copyright (c) 2007-2018 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. using System; using System.Collections.Generic; diff --git a/osu.Game.Tournament.Tests/TestCaseTeamIntro.cs b/osu.Game.Tournament.Tests/TestCaseTeamIntro.cs index d8d5007238..78614518ce 100644 --- a/osu.Game.Tournament.Tests/TestCaseTeamIntro.cs +++ b/osu.Game.Tournament.Tests/TestCaseTeamIntro.cs @@ -1,5 +1,5 @@ -// Copyright (c) 2007-2018 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. using System.Linq; using osu.Framework.Allocation; diff --git a/osu.Game.Tournament.Tests/TestCaseTeamWin.cs b/osu.Game.Tournament.Tests/TestCaseTeamWin.cs index fb798d3587..df24877f09 100644 --- a/osu.Game.Tournament.Tests/TestCaseTeamWin.cs +++ b/osu.Game.Tournament.Tests/TestCaseTeamWin.cs @@ -1,5 +1,5 @@ -// Copyright (c) 2007-2018 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. using System.Linq; using osu.Framework.Allocation; diff --git a/osu.Game.Tournament.Tests/TournamentTestBrowser.cs b/osu.Game.Tournament.Tests/TournamentTestBrowser.cs index 429adb2c0d..6d4063ec4f 100644 --- a/osu.Game.Tournament.Tests/TournamentTestBrowser.cs +++ b/osu.Game.Tournament.Tests/TournamentTestBrowser.cs @@ -1,5 +1,5 @@ -// Copyright (c) 2007-2018 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. using osu.Framework.Testing; using osu.Game.Graphics; diff --git a/osu.Game.Tournament.Tests/TournamentTestRunner.cs b/osu.Game.Tournament.Tests/TournamentTestRunner.cs index 51c2c65cb4..1f63f7c545 100644 --- a/osu.Game.Tournament.Tests/TournamentTestRunner.cs +++ b/osu.Game.Tournament.Tests/TournamentTestRunner.cs @@ -1,5 +1,5 @@ -// Copyright (c) 2007-2018 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. using System; using osu.Framework; diff --git a/osu.Game.Tournament/Components/ControlPanel.cs b/osu.Game.Tournament/Components/ControlPanel.cs index dee6cfbe0e..0d228fb3b4 100644 --- a/osu.Game.Tournament/Components/ControlPanel.cs +++ b/osu.Game.Tournament/Components/ControlPanel.cs @@ -1,5 +1,5 @@ -// Copyright (c) 2007-2018 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; diff --git a/osu.Game.Tournament/Components/DateTextBox.cs b/osu.Game.Tournament/Components/DateTextBox.cs index 0a2485e4f3..f25c4b6e78 100644 --- a/osu.Game.Tournament/Components/DateTextBox.cs +++ b/osu.Game.Tournament/Components/DateTextBox.cs @@ -1,5 +1,5 @@ -// Copyright (c) 2007-2018 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. using System; using osu.Framework.Bindables; diff --git a/osu.Game.Tournament/Components/DrawableTournamentTeam.cs b/osu.Game.Tournament/Components/DrawableTournamentTeam.cs index 016db57773..a0c0856e7f 100644 --- a/osu.Game.Tournament/Components/DrawableTournamentTeam.cs +++ b/osu.Game.Tournament/Components/DrawableTournamentTeam.cs @@ -1,5 +1,5 @@ -// Copyright (c) 2007-2018 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. using osu.Framework.Allocation; using osu.Framework.Graphics; diff --git a/osu.Game.Tournament/Components/MatchChatDisplay.cs b/osu.Game.Tournament/Components/MatchChatDisplay.cs index 33c544f83d..dd567ed290 100644 --- a/osu.Game.Tournament/Components/MatchChatDisplay.cs +++ b/osu.Game.Tournament/Components/MatchChatDisplay.cs @@ -1,5 +1,5 @@ -// Copyright (c) 2007-2018 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. using System.Linq; using osu.Framework.Allocation; diff --git a/osu.Game.Tournament/Components/SongBar.cs b/osu.Game.Tournament/Components/SongBar.cs index 452565d7d8..4844074372 100644 --- a/osu.Game.Tournament/Components/SongBar.cs +++ b/osu.Game.Tournament/Components/SongBar.cs @@ -1,5 +1,5 @@ -// Copyright (c) 2007-2018 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. using System; using osu.Framework.Allocation; diff --git a/osu.Game.Tournament/Components/TournamentBeatmapPanel.cs b/osu.Game.Tournament/Components/TournamentBeatmapPanel.cs index 6b80094990..dd3ba1af47 100644 --- a/osu.Game.Tournament/Components/TournamentBeatmapPanel.cs +++ b/osu.Game.Tournament/Components/TournamentBeatmapPanel.cs @@ -1,5 +1,5 @@ -// Copyright (c) 2007-2018 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. using System; using System.Collections.ObjectModel; diff --git a/osu.Game.Tournament/Components/TournamentTeam.cs b/osu.Game.Tournament/Components/TournamentTeam.cs index 73c24282c4..167f77c229 100644 --- a/osu.Game.Tournament/Components/TournamentTeam.cs +++ b/osu.Game.Tournament/Components/TournamentTeam.cs @@ -1,5 +1,5 @@ -// Copyright (c) 2007-2018 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. using System; using System.Collections.Generic; diff --git a/osu.Game.Tournament/IPC/FileBasedIPC.cs b/osu.Game.Tournament/IPC/FileBasedIPC.cs index da66460acb..8cdd06003f 100644 --- a/osu.Game.Tournament/IPC/FileBasedIPC.cs +++ b/osu.Game.Tournament/IPC/FileBasedIPC.cs @@ -1,5 +1,5 @@ -// Copyright (c) 2007-2018 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. using System; using System.IO; diff --git a/osu.Game.Tournament/IPC/MatchIPCInfo.cs b/osu.Game.Tournament/IPC/MatchIPCInfo.cs index cd57756f60..701258c6c7 100644 --- a/osu.Game.Tournament/IPC/MatchIPCInfo.cs +++ b/osu.Game.Tournament/IPC/MatchIPCInfo.cs @@ -1,5 +1,5 @@ -// Copyright (c) 2007-2018 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. using osu.Framework.Bindables; using osu.Framework.Graphics; diff --git a/osu.Game.Tournament/IPC/TourneyState.cs b/osu.Game.Tournament/IPC/TourneyState.cs index afa5b400ba..ef1c612a53 100644 --- a/osu.Game.Tournament/IPC/TourneyState.cs +++ b/osu.Game.Tournament/IPC/TourneyState.cs @@ -1,5 +1,5 @@ -// Copyright (c) 2007-2018 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. namespace osu.Game.Tournament.IPC { diff --git a/osu.Game.Tournament/LadderInfo.cs b/osu.Game.Tournament/LadderInfo.cs index 83d0f76020..9ddca460e2 100644 --- a/osu.Game.Tournament/LadderInfo.cs +++ b/osu.Game.Tournament/LadderInfo.cs @@ -1,5 +1,5 @@ -// Copyright (c) 2007-2018 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. using System.Collections.Generic; using Newtonsoft.Json; diff --git a/osu.Game.Tournament/Properties/AssemblyInfo.cs b/osu.Game.Tournament/Properties/AssemblyInfo.cs index 4955391097..70e42bcafb 100644 --- a/osu.Game.Tournament/Properties/AssemblyInfo.cs +++ b/osu.Game.Tournament/Properties/AssemblyInfo.cs @@ -1,5 +1,5 @@ -// Copyright (c) 2007-2018 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. using System.Runtime.CompilerServices; diff --git a/osu.Game.Tournament/Screens/BeatmapInfoScreen.cs b/osu.Game.Tournament/Screens/BeatmapInfoScreen.cs index b0aadc7e9e..fccd35ca9e 100644 --- a/osu.Game.Tournament/Screens/BeatmapInfoScreen.cs +++ b/osu.Game.Tournament/Screens/BeatmapInfoScreen.cs @@ -1,5 +1,5 @@ -// Copyright (c) 2007-2018 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. using osu.Framework.Allocation; using osu.Framework.Bindables; diff --git a/osu.Game.Tournament/Screens/Drawings/DrawingsScreen.cs b/osu.Game.Tournament/Screens/Drawings/DrawingsScreen.cs index c30caa5a00..d902defe94 100644 --- a/osu.Game.Tournament/Screens/Drawings/DrawingsScreen.cs +++ b/osu.Game.Tournament/Screens/Drawings/DrawingsScreen.cs @@ -1,5 +1,5 @@ -// Copyright (c) 2007-2018 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. using System; using System.Collections.Generic; diff --git a/osu.Game.Tournament/Screens/Gameplay/Components/MatchHeader.cs b/osu.Game.Tournament/Screens/Gameplay/Components/MatchHeader.cs index 89168aa8bb..dd12581046 100644 --- a/osu.Game.Tournament/Screens/Gameplay/Components/MatchHeader.cs +++ b/osu.Game.Tournament/Screens/Gameplay/Components/MatchHeader.cs @@ -1,5 +1,5 @@ -// Copyright (c) 2007-2018 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. using osu.Framework.Allocation; using osu.Framework.Bindables; diff --git a/osu.Game.Tournament/Screens/Gameplay/Components/MatchScoreDisplay.cs b/osu.Game.Tournament/Screens/Gameplay/Components/MatchScoreDisplay.cs index a648072d04..f8b887b952 100644 --- a/osu.Game.Tournament/Screens/Gameplay/Components/MatchScoreDisplay.cs +++ b/osu.Game.Tournament/Screens/Gameplay/Components/MatchScoreDisplay.cs @@ -1,5 +1,5 @@ -// Copyright (c) 2007-2018 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. using System; using osu.Framework.Allocation; diff --git a/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs b/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs index 2b6d16505a..444f080b6c 100644 --- a/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs +++ b/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs @@ -1,5 +1,5 @@ -// Copyright (c) 2007-2018 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. using osu.Framework.Allocation; using osu.Framework.Bindables; diff --git a/osu.Game.Tournament/Screens/Groupings/GroupingsEditorScreen.cs b/osu.Game.Tournament/Screens/Groupings/GroupingsEditorScreen.cs index 238de0d5bc..9c35ff21d4 100644 --- a/osu.Game.Tournament/Screens/Groupings/GroupingsEditorScreen.cs +++ b/osu.Game.Tournament/Screens/Groupings/GroupingsEditorScreen.cs @@ -1,5 +1,5 @@ -// Copyright (c) 2007-2018 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. using System; using System.Linq; diff --git a/osu.Game.Tournament/Screens/IProvideVideo.cs b/osu.Game.Tournament/Screens/IProvideVideo.cs index b5a4e1ad8e..c11c921412 100644 --- a/osu.Game.Tournament/Screens/IProvideVideo.cs +++ b/osu.Game.Tournament/Screens/IProvideVideo.cs @@ -1,5 +1,5 @@ -// Copyright (c) 2007-2018 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. namespace osu.Game.Tournament.Screens { diff --git a/osu.Game.Tournament/Screens/Ladder/Components/BeatmapChoice.cs b/osu.Game.Tournament/Screens/Ladder/Components/BeatmapChoice.cs index 5b38e539c6..bb9ed39b82 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/BeatmapChoice.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/BeatmapChoice.cs @@ -1,5 +1,5 @@ -// Copyright (c) 2007-2018 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. using Newtonsoft.Json; using Newtonsoft.Json.Converters; diff --git a/osu.Game.Tournament/Screens/Ladder/Components/ConditionalMatchPairing.cs b/osu.Game.Tournament/Screens/Ladder/Components/ConditionalMatchPairing.cs index bff661bcf4..7831cac84d 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/ConditionalMatchPairing.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/ConditionalMatchPairing.cs @@ -1,5 +1,5 @@ -// Copyright (c) 2007-2018 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. namespace osu.Game.Tournament.Screens.Ladder.Components { diff --git a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs index 0244403bff..cf9fe3f2be 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs @@ -1,5 +1,5 @@ -// Copyright (c) 2007-2018 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. using osu.Framework.Allocation; using osu.Framework.Bindables; diff --git a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs index c4097848d7..3078b58c45 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs @@ -1,5 +1,5 @@ -// Copyright (c) 2007-2018 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. using System; using osu.Framework.Allocation; diff --git a/osu.Game.Tournament/Screens/Ladder/Components/DrawableTournamentGrouping.cs b/osu.Game.Tournament/Screens/Ladder/Components/DrawableTournamentGrouping.cs index 3abeca3d81..175910d9d6 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/DrawableTournamentGrouping.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/DrawableTournamentGrouping.cs @@ -1,5 +1,5 @@ -// Copyright (c) 2007-2018 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; diff --git a/osu.Game.Tournament/Screens/Ladder/Components/GroupingBeatmap.cs b/osu.Game.Tournament/Screens/Ladder/Components/GroupingBeatmap.cs index 416f960404..b16ba13f65 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/GroupingBeatmap.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/GroupingBeatmap.cs @@ -1,5 +1,5 @@ -// Copyright (c) 2007-2018 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. using osu.Game.Beatmaps; diff --git a/osu.Game.Tournament/Screens/Ladder/Components/LadderEditorInfo.cs b/osu.Game.Tournament/Screens/Ladder/Components/LadderEditorInfo.cs index 6979aae295..d6b5d172de 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/LadderEditorInfo.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/LadderEditorInfo.cs @@ -1,5 +1,5 @@ -// Copyright (c) 2007-2018 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. using osu.Framework.Bindables; diff --git a/osu.Game.Tournament/Screens/Ladder/Components/LadderEditorSettings.cs b/osu.Game.Tournament/Screens/Ladder/Components/LadderEditorSettings.cs index f0559e0266..d43a410a8f 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/LadderEditorSettings.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/LadderEditorSettings.cs @@ -1,5 +1,5 @@ -// Copyright (c) 2007-2018 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. using System; using System.Linq; diff --git a/osu.Game.Tournament/Screens/Ladder/Components/MatchPairing.cs b/osu.Game.Tournament/Screens/Ladder/Components/MatchPairing.cs index 760f6d42f4..f788737add 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/MatchPairing.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/MatchPairing.cs @@ -1,5 +1,5 @@ -// Copyright (c) 2007-2018 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. using System; using System.Collections.Generic; diff --git a/osu.Game.Tournament/Screens/Ladder/Components/ProgressionPath.cs b/osu.Game.Tournament/Screens/Ladder/Components/ProgressionPath.cs index 578ec79321..4ed46223c8 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/ProgressionPath.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/ProgressionPath.cs @@ -1,5 +1,5 @@ -// Copyright (c) 2007-2018 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. using System.Linq; using osu.Framework.Graphics; diff --git a/osu.Game.Tournament/Screens/Ladder/Components/TournamentGrouping.cs b/osu.Game.Tournament/Screens/Ladder/Components/TournamentGrouping.cs index 3555e4db11..e38b684c28 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/TournamentGrouping.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/TournamentGrouping.cs @@ -1,5 +1,5 @@ -// Copyright (c) 2007-2018 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. using System; using System.Collections.Generic; diff --git a/osu.Game.Tournament/Screens/Ladder/Components/TournamentProgression.cs b/osu.Game.Tournament/Screens/Ladder/Components/TournamentProgression.cs index 9f2d2c4045..241e1d1d0b 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/TournamentProgression.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/TournamentProgression.cs @@ -1,5 +1,5 @@ -// Copyright (c) 2007-2018 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. namespace osu.Game.Tournament.Screens.Ladder.Components { diff --git a/osu.Game.Tournament/Screens/Ladder/LadderEditorScreen.cs b/osu.Game.Tournament/Screens/Ladder/LadderEditorScreen.cs index e3cb1473be..e605de9a7c 100644 --- a/osu.Game.Tournament/Screens/Ladder/LadderEditorScreen.cs +++ b/osu.Game.Tournament/Screens/Ladder/LadderEditorScreen.cs @@ -1,5 +1,5 @@ -// Copyright (c) 2007-2018 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. using System; using System.Linq; diff --git a/osu.Game.Tournament/Screens/Ladder/LadderScreen.cs b/osu.Game.Tournament/Screens/Ladder/LadderScreen.cs index 7c6aabbe53..351eee0433 100644 --- a/osu.Game.Tournament/Screens/Ladder/LadderScreen.cs +++ b/osu.Game.Tournament/Screens/Ladder/LadderScreen.cs @@ -1,5 +1,5 @@ -// Copyright (c) 2007-2018 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. using System.Linq; using osu.Framework.Allocation; diff --git a/osu.Game.Tournament/Screens/Ladder/ScrollableContainer.cs b/osu.Game.Tournament/Screens/Ladder/ScrollableContainer.cs index 125d358638..832e218b74 100644 --- a/osu.Game.Tournament/Screens/Ladder/ScrollableContainer.cs +++ b/osu.Game.Tournament/Screens/Ladder/ScrollableContainer.cs @@ -1,5 +1,5 @@ -// Copyright (c) 2007-2018 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; diff --git a/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs b/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs index 41368eb96e..3116a1361c 100644 --- a/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs +++ b/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs @@ -1,5 +1,5 @@ -// Copyright (c) 2007-2018 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. using System.Linq; using osu.Framework.Allocation; diff --git a/osu.Game.Tournament/Screens/Schedule/ScheduleScreen.cs b/osu.Game.Tournament/Screens/Schedule/ScheduleScreen.cs index 384f2f7ab2..093a1ba2d9 100644 --- a/osu.Game.Tournament/Screens/Schedule/ScheduleScreen.cs +++ b/osu.Game.Tournament/Screens/Schedule/ScheduleScreen.cs @@ -1,5 +1,5 @@ -// Copyright (c) 2007-2018 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. using System; using System.Linq; diff --git a/osu.Game.Tournament/Screens/Showcase/ShowcaseScreen.cs b/osu.Game.Tournament/Screens/Showcase/ShowcaseScreen.cs index 65369fa6da..d809dfc994 100644 --- a/osu.Game.Tournament/Screens/Showcase/ShowcaseScreen.cs +++ b/osu.Game.Tournament/Screens/Showcase/ShowcaseScreen.cs @@ -1,5 +1,5 @@ -// Copyright (c) 2007-2018 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. using osu.Framework.Allocation; diff --git a/osu.Game.Tournament/Screens/Showcase/TournamentLogo.cs b/osu.Game.Tournament/Screens/Showcase/TournamentLogo.cs index cd4f646fe7..0db3348e5d 100644 --- a/osu.Game.Tournament/Screens/Showcase/TournamentLogo.cs +++ b/osu.Game.Tournament/Screens/Showcase/TournamentLogo.cs @@ -1,5 +1,5 @@ -// Copyright (c) 2007-2018 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. using osu.Framework.Allocation; using osu.Framework.Graphics; diff --git a/osu.Game.Tournament/Screens/TeamIntro/TeamIntroScreen.cs b/osu.Game.Tournament/Screens/TeamIntro/TeamIntroScreen.cs index 94130cb383..d2ff632da0 100644 --- a/osu.Game.Tournament/Screens/TeamIntro/TeamIntroScreen.cs +++ b/osu.Game.Tournament/Screens/TeamIntro/TeamIntroScreen.cs @@ -1,5 +1,5 @@ -// Copyright (c) 2007-2018 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. using osu.Framework.Allocation; using osu.Framework.Bindables; diff --git a/osu.Game.Tournament/Screens/TeamWin/TeamWinScreen.cs b/osu.Game.Tournament/Screens/TeamWin/TeamWinScreen.cs index 1de9b6ae5c..69c088efbc 100644 --- a/osu.Game.Tournament/Screens/TeamWin/TeamWinScreen.cs +++ b/osu.Game.Tournament/Screens/TeamWin/TeamWinScreen.cs @@ -1,5 +1,5 @@ -// Copyright (c) 2007-2018 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. using osu.Framework.Allocation; using osu.Framework.Bindables; diff --git a/osu.Game.Tournament/Screens/TournamentSceneManager.cs b/osu.Game.Tournament/Screens/TournamentSceneManager.cs index ec103f2444..cb9737d13f 100644 --- a/osu.Game.Tournament/Screens/TournamentSceneManager.cs +++ b/osu.Game.Tournament/Screens/TournamentSceneManager.cs @@ -1,5 +1,5 @@ -// Copyright (c) 2007-2018 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. using System; using System.Linq; diff --git a/osu.Game.Tournament/Screens/TournamentScreen.cs b/osu.Game.Tournament/Screens/TournamentScreen.cs index e830509db9..7f6c5f8e18 100644 --- a/osu.Game.Tournament/Screens/TournamentScreen.cs +++ b/osu.Game.Tournament/Screens/TournamentScreen.cs @@ -1,5 +1,5 @@ -// Copyright (c) 2007-2018 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. using osu.Framework.Allocation; using osu.Framework.Graphics; diff --git a/osu.Game.Tournament/TournamentGame.cs b/osu.Game.Tournament/TournamentGame.cs index 711ecc5ae9..bb5682bb42 100644 --- a/osu.Game.Tournament/TournamentGame.cs +++ b/osu.Game.Tournament/TournamentGame.cs @@ -1,5 +1,5 @@ -// Copyright (c) 2007-2018 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. using osu.Framework.Graphics; using osu.Framework.Screens; diff --git a/osu.Game.Tournament/TournamentGameBase.cs b/osu.Game.Tournament/TournamentGameBase.cs index e3996bc572..a90f17ac68 100644 --- a/osu.Game.Tournament/TournamentGameBase.cs +++ b/osu.Game.Tournament/TournamentGameBase.cs @@ -1,5 +1,5 @@ -// Copyright (c) 2007-2018 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. using System; using System.Collections.Generic; From b0971ef0fda240df52b3ff4d729f7705646b6662 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 4 Mar 2019 14:18:04 +0900 Subject: [PATCH 193/317] Fix remaining inspections --- osu.Game.Tournament/Screens/Ladder/Components/MatchPairing.cs | 2 ++ osu.Game/Graphics/UserInterface/RollingCounter.cs | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/osu.Game.Tournament/Screens/Ladder/Components/MatchPairing.cs b/osu.Game.Tournament/Screens/Ladder/Components/MatchPairing.cs index f788737add..043ade4285 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/MatchPairing.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/MatchPairing.cs @@ -14,6 +14,7 @@ namespace osu.Game.Tournament.Screens.Ladder.Components /// /// A collection of two teams competing in a head-to-head match. /// + [Serializable] public class MatchPairing { public int ID; @@ -65,6 +66,7 @@ namespace osu.Game.Tournament.Screens.Ladder.Components public readonly Bindable Date = new Bindable(); + [JsonProperty] public readonly BindableList ConditionalPairings = new BindableList(); public readonly Bindable Position = new Bindable(); diff --git a/osu.Game/Graphics/UserInterface/RollingCounter.cs b/osu.Game/Graphics/UserInterface/RollingCounter.cs index 47e12f5f15..cd244ed7e6 100644 --- a/osu.Game/Graphics/UserInterface/RollingCounter.cs +++ b/osu.Game/Graphics/UserInterface/RollingCounter.cs @@ -59,7 +59,6 @@ namespace osu.Game.Graphics.UserInterface public abstract void Increment(T amount); - public float TextSize { get => DisplayedCountSpriteText.Font.Size; From 530032cafee5b39c18b702e1abc6f7336abffb14 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 15 May 2019 13:10:58 +0900 Subject: [PATCH 194/317] Update obsoleted font usages --- osu.Game.Tournament/Components/DrawableTournamentTeam.cs | 3 ++- osu.Game.Tournament/Components/TournamentBeatmapPanel.cs | 2 +- .../Screens/Ladder/Components/DrawableMatchTeam.cs | 2 +- .../Screens/Ladder/Components/DrawableTournamentGrouping.cs | 3 ++- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/osu.Game.Tournament/Components/DrawableTournamentTeam.cs b/osu.Game.Tournament/Components/DrawableTournamentTeam.cs index a0c0856e7f..8662eeba2d 100644 --- a/osu.Game.Tournament/Components/DrawableTournamentTeam.cs +++ b/osu.Game.Tournament/Components/DrawableTournamentTeam.cs @@ -6,6 +6,7 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Textures; +using osu.Game.Graphics; using osu.Game.Graphics.Sprites; namespace osu.Game.Tournament.Components @@ -30,7 +31,7 @@ namespace osu.Game.Tournament.Components AcronymText = new OsuSpriteText { Text = team?.Acronym?.ToUpperInvariant() ?? string.Empty, - Font = @"Exo2.0-Regular" + Font = OsuFont.GetFont(weight: FontWeight.Regular), }; } diff --git a/osu.Game.Tournament/Components/TournamentBeatmapPanel.cs b/osu.Game.Tournament/Components/TournamentBeatmapPanel.cs index df4c15a221..8ab0dc2459 100644 --- a/osu.Game.Tournament/Components/TournamentBeatmapPanel.cs +++ b/osu.Game.Tournament/Components/TournamentBeatmapPanel.cs @@ -86,7 +86,7 @@ namespace osu.Game.Tournament.Components Text = new LocalisedString(( $"{Beatmap.Metadata.ArtistUnicode} - {Beatmap.Metadata.TitleUnicode}", $"{Beatmap.Metadata.Artist} - {Beatmap.Metadata.Title}")), - Font = @"Exo2.0-BoldItalic", + Font = OsuFont.GetFont(weight: FontWeight.Bold, italics: true), }, new FillFlowContainer { diff --git a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs index 3078b58c45..35b6dfb606 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs @@ -183,7 +183,7 @@ namespace osu.Game.Tournament.Screens.Ladder.Components background.FadeColour(winner ? colourWinner : colourNormal, winner ? 500 : 0, Easing.OutQuint); - scoreText.Font = AcronymText.Font = winner ? "Exo2.0-Bold" : "Exo2.0-Regular"; + scoreText.Font = AcronymText.Font = OsuFont.GetFont(weight: winner ? FontWeight.Bold : FontWeight.Regular); } public MenuItem[] ContextMenuItems diff --git a/osu.Game.Tournament/Screens/Ladder/Components/DrawableTournamentGrouping.cs b/osu.Game.Tournament/Screens/Ladder/Components/DrawableTournamentGrouping.cs index 175910d9d6..40adc24dc4 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/DrawableTournamentGrouping.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/DrawableTournamentGrouping.cs @@ -3,6 +3,7 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; +using osu.Game.Graphics; using osu.Game.Graphics.Sprites; using osuTK.Graphics; @@ -29,7 +30,7 @@ namespace osu.Game.Tournament.Screens.Ladder.Components new OsuSpriteText { Text = ((losers ? "Losers " : "") + grouping.Name).ToUpper(), - Font = "Exo2.0-Bold", + Font = OsuFont.GetFont(weight: FontWeight.Bold), Colour = Color4.Black, Origin = Anchor.TopCentre, Anchor = Anchor.TopCentre From bc462532993d2abd5e7c071c1d8ba98d50061231 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 18 May 2019 20:18:07 +0900 Subject: [PATCH 195/317] Update test case naming --- osu.Game.Tournament.Tests/LadderTestCase.cs | 2 +- osu.Game.Tournament.Tests/TestCaseBeatmapPanel.cs | 2 +- osu.Game.Tournament.Tests/TestCaseGameplay.cs | 2 +- osu.Game.Tournament.Tests/TestCaseMatchChatDisplay.cs | 2 +- osu.Game.Tournament.Tests/TestCaseMatchPairings.cs | 2 +- osu.Game.Tournament.Tests/TestCaseSceneManager.cs | 2 +- osu.Game.Tournament.Tests/TestCaseSchedule.cs | 2 +- osu.Game.Tournament.Tests/TestCaseShowcase.cs | 2 +- osu.Game.Tournament.Tests/osu.Game.Tournament.Tests.csproj | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/osu.Game.Tournament.Tests/LadderTestCase.cs b/osu.Game.Tournament.Tests/LadderTestCase.cs index fc827150bd..450626fd43 100644 --- a/osu.Game.Tournament.Tests/LadderTestCase.cs +++ b/osu.Game.Tournament.Tests/LadderTestCase.cs @@ -6,7 +6,7 @@ using osu.Game.Tests.Visual; namespace osu.Game.Tournament.Tests { - public class LadderTestCase : OsuTestCase + public class LadderTestCase : OsuTestScene { [Resolved] protected LadderInfo Ladder { get; private set; } diff --git a/osu.Game.Tournament.Tests/TestCaseBeatmapPanel.cs b/osu.Game.Tournament.Tests/TestCaseBeatmapPanel.cs index 0a23b1e82f..6ebdcc511b 100644 --- a/osu.Game.Tournament.Tests/TestCaseBeatmapPanel.cs +++ b/osu.Game.Tournament.Tests/TestCaseBeatmapPanel.cs @@ -15,7 +15,7 @@ using osu.Game.Tournament.Components; namespace osu.Game.Tournament.Tests { - public class TestCaseBeatmapPanel : OsuTestCase + public class TestCaseBeatmapPanel : OsuTestScene { [Resolved] private IAPIProvider api { get; set; } diff --git a/osu.Game.Tournament.Tests/TestCaseGameplay.cs b/osu.Game.Tournament.Tests/TestCaseGameplay.cs index 8e435de5e6..c881f09cb9 100644 --- a/osu.Game.Tournament.Tests/TestCaseGameplay.cs +++ b/osu.Game.Tournament.Tests/TestCaseGameplay.cs @@ -9,7 +9,7 @@ using osu.Game.Tournament.Screens.Gameplay; namespace osu.Game.Tournament.Tests { - public class TestCaseGameplay : OsuTestCase + public class TestCaseGameplay : OsuTestScene { public override IReadOnlyList RequiredTypes => new[] { diff --git a/osu.Game.Tournament.Tests/TestCaseMatchChatDisplay.cs b/osu.Game.Tournament.Tests/TestCaseMatchChatDisplay.cs index 0c3c189cf5..cec6095598 100644 --- a/osu.Game.Tournament.Tests/TestCaseMatchChatDisplay.cs +++ b/osu.Game.Tournament.Tests/TestCaseMatchChatDisplay.cs @@ -14,7 +14,7 @@ using osuTK; namespace osu.Game.Tournament.Tests { - public class TestCaseMatchChatDisplay : OsuTestCase + public class TestCaseMatchChatDisplay : OsuTestScene { private readonly Channel testChannel = new Channel(); diff --git a/osu.Game.Tournament.Tests/TestCaseMatchPairings.cs b/osu.Game.Tournament.Tests/TestCaseMatchPairings.cs index 2dce0c6017..e7a329d35f 100644 --- a/osu.Game.Tournament.Tests/TestCaseMatchPairings.cs +++ b/osu.Game.Tournament.Tests/TestCaseMatchPairings.cs @@ -11,7 +11,7 @@ using osu.Game.Tournament.Screens.Ladder.Components; namespace osu.Game.Tournament.Tests { - public class TestCaseMatchPairings : OsuTestCase + public class TestCaseMatchPairings : OsuTestScene { public override IReadOnlyList RequiredTypes => new[] { diff --git a/osu.Game.Tournament.Tests/TestCaseSceneManager.cs b/osu.Game.Tournament.Tests/TestCaseSceneManager.cs index 97d2018e3d..7c1b794e16 100644 --- a/osu.Game.Tournament.Tests/TestCaseSceneManager.cs +++ b/osu.Game.Tournament.Tests/TestCaseSceneManager.cs @@ -8,7 +8,7 @@ using osu.Game.Tournament.Screens; namespace osu.Game.Tournament.Tests { - public class TestCaseSceneManager : OsuTestCase + public class TestCaseSceneManager : OsuTestScene { [BackgroundDependencyLoader] private void load(Storage storage) diff --git a/osu.Game.Tournament.Tests/TestCaseSchedule.cs b/osu.Game.Tournament.Tests/TestCaseSchedule.cs index f9dc447077..b5a80d7bee 100644 --- a/osu.Game.Tournament.Tests/TestCaseSchedule.cs +++ b/osu.Game.Tournament.Tests/TestCaseSchedule.cs @@ -9,7 +9,7 @@ using osu.Game.Tournament.Screens.Schedule; namespace osu.Game.Tournament.Tests { - public class TestCaseSchedule : OsuTestCase + public class TestCaseSchedule : OsuTestScene { public override IReadOnlyList RequiredTypes => new[] { diff --git a/osu.Game.Tournament.Tests/TestCaseShowcase.cs b/osu.Game.Tournament.Tests/TestCaseShowcase.cs index 51877cdfb6..c0816e3594 100644 --- a/osu.Game.Tournament.Tests/TestCaseShowcase.cs +++ b/osu.Game.Tournament.Tests/TestCaseShowcase.cs @@ -9,7 +9,7 @@ using osu.Game.Tournament.Screens.Showcase; namespace osu.Game.Tournament.Tests { - public class TestCaseShowcase : OsuTestCase + public class TestCaseShowcase : OsuTestScene { public override IReadOnlyList RequiredTypes => new[] { diff --git a/osu.Game.Tournament.Tests/osu.Game.Tournament.Tests.csproj b/osu.Game.Tournament.Tests/osu.Game.Tournament.Tests.csproj index 4a65846d68..b76fc261f0 100644 --- a/osu.Game.Tournament.Tests/osu.Game.Tournament.Tests.csproj +++ b/osu.Game.Tournament.Tests/osu.Game.Tournament.Tests.csproj @@ -6,7 +6,7 @@ - + From 30e36627cf37f1e8784764df7857dccce129533d Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 18 May 2019 21:37:46 +0900 Subject: [PATCH 196/317] Remove redundant code --- .../Screens/Gameplay/Components/MatchHeader.cs | 2 +- .../Screens/Gameplay/Components/MatchScoreDisplay.cs | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/osu.Game.Tournament/Screens/Gameplay/Components/MatchHeader.cs b/osu.Game.Tournament/Screens/Gameplay/Components/MatchHeader.cs index 51467842eb..10c1c006cf 100644 --- a/osu.Game.Tournament/Screens/Gameplay/Components/MatchHeader.cs +++ b/osu.Game.Tournament/Screens/Gameplay/Components/MatchHeader.cs @@ -22,7 +22,7 @@ namespace osu.Game.Tournament.Screens.Gameplay.Components public class MatchHeader : Container { [BackgroundDependencyLoader] - private void load(LadderInfo ladder) + private void load() { RelativeSizeAxes = Axes.X; Height = 95; diff --git a/osu.Game.Tournament/Screens/Gameplay/Components/MatchScoreDisplay.cs b/osu.Game.Tournament/Screens/Gameplay/Components/MatchScoreDisplay.cs index f8b887b952..62a785398f 100644 --- a/osu.Game.Tournament/Screens/Gameplay/Components/MatchScoreDisplay.cs +++ b/osu.Game.Tournament/Screens/Gameplay/Components/MatchScoreDisplay.cs @@ -10,7 +10,6 @@ using osu.Framework.Graphics.Shapes; using osu.Game.Graphics; using osu.Game.Graphics.UserInterface; using osu.Game.Tournament.IPC; -using osu.Game.Tournament.Screens.Ladder.Components; using osuTK.Graphics; namespace osu.Game.Tournament.Screens.Gameplay.Components @@ -22,8 +21,6 @@ namespace osu.Game.Tournament.Screens.Gameplay.Components private const float bar_height = 20; - private readonly Bindable currentMatch = new Bindable(); - private readonly BindableInt score1 = new BindableInt(); private readonly BindableInt score2 = new BindableInt(); @@ -78,8 +75,6 @@ namespace osu.Game.Tournament.Screens.Gameplay.Components [BackgroundDependencyLoader] private void load(LadderInfo ladder, MatchIPCInfo ipc) { - currentMatch.BindTo(ladder.CurrentMatch); - score1.BindValueChanged(_ => updateScores()); score1.BindTo(ipc.Score1); From 069245e7ab31685389cb3e591c4319136aaa2d58 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 18 May 2019 21:40:02 +0900 Subject: [PATCH 197/317] Update header colour to match TWC --- osu.Game.Tournament/Screens/Gameplay/Components/MatchHeader.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Tournament/Screens/Gameplay/Components/MatchHeader.cs b/osu.Game.Tournament/Screens/Gameplay/Components/MatchHeader.cs index 10c1c006cf..22aa6995cf 100644 --- a/osu.Game.Tournament/Screens/Gameplay/Components/MatchHeader.cs +++ b/osu.Game.Tournament/Screens/Gameplay/Components/MatchHeader.cs @@ -210,7 +210,7 @@ namespace osu.Game.Tournament.Screens.Gameplay.Components { new Box { - Colour = new Color4(95, 41, 60, 255), + Colour = new Color4(47, 71, 67, 255), RelativeSizeAxes = Axes.Both, }, new OsuSpriteText From f81c66db63ce5081b545da7e7f6bbbf53beb82b9 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 18 May 2019 21:46:03 +0900 Subject: [PATCH 198/317] Hotfix to fix chat scrolling to end --- osu.Game/Overlays/Chat/DrawableChannel.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Overlays/Chat/DrawableChannel.cs b/osu.Game/Overlays/Chat/DrawableChannel.cs index aec78b962f..6c30b8cc36 100644 --- a/osu.Game/Overlays/Chat/DrawableChannel.cs +++ b/osu.Game/Overlays/Chat/DrawableChannel.cs @@ -81,7 +81,7 @@ namespace osu.Game.Overlays.Chat ChatLineFlow.AddRange(displayMessages.Select(CreateChatLine)); - if (scroll.IsScrolledToEnd(10) || !ChatLineFlow.Children.Any() || newMessages.Any(m => m is LocalMessage)) + //if (scroll.IsScrolledToEnd(10) || !ChatLineFlow.Children.Any() || newMessages.Any(m => m is LocalMessage)) scrollToEnd(); var staleMessages = ChatLineFlow.Children.Where(c => c.LifetimeEnd == double.MaxValue).ToArray(); From d8ed402779e20483c2d32efed137f1ae20d68aed Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 20 May 2019 14:47:46 +0900 Subject: [PATCH 199/317] Make use of ValueChanged.OldValue --- .../Components/TournamentBeatmapPanel.cs | 20 +++++-------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/osu.Game.Tournament/Components/TournamentBeatmapPanel.cs b/osu.Game.Tournament/Components/TournamentBeatmapPanel.cs index 8ab0dc2459..818d25d559 100644 --- a/osu.Game.Tournament/Components/TournamentBeatmapPanel.cs +++ b/osu.Game.Tournament/Components/TournamentBeatmapPanel.cs @@ -2,7 +2,6 @@ // See the LICENCE file in the repository root for full licence text. using System; -using System.Collections.ObjectModel; using System.Collections.Specialized; using System.Linq; using osu.Framework.Allocation; @@ -146,10 +145,15 @@ namespace osu.Game.Tournament.Components private void matchChanged(ValueChangedEvent pairing) { + if (pairing.OldValue != null) + pairing.OldValue.PicksBans.CollectionChanged -= picksBansOnCollectionChanged; pairing.NewValue.PicksBans.CollectionChanged += picksBansOnCollectionChanged; updateState(); } + private void picksBansOnCollectionChanged(object sender, NotifyCollectionChangedEventArgs e) + => updateState(); + private BeatmapChoice choice; private void updateState() @@ -197,19 +201,5 @@ namespace osu.Game.Tournament.Components Alpha = 1; } } - - private void picksBansOnCollectionChanged(object sender, NotifyCollectionChangedEventArgs e) - { - var list = (ObservableCollection)sender; - - if (sender != currentMatch.Value.PicksBans) - { - // todo: we need a last attribute in bindable valuechanged events badly. - list.CollectionChanged -= picksBansOnCollectionChanged; - return; - } - - updateState(); - } } } From 084c2252cbb34ff9f5793d3717eb066d3ea9376c Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 20 May 2019 14:48:33 +0900 Subject: [PATCH 200/317] Use less DI where we already have access to LadderInfo --- osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs | 4 ++-- osu.Game.Tournament/Screens/TeamIntro/TeamIntroScreen.cs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs b/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs index 7e91ded848..0e3a9b0dfd 100644 --- a/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs +++ b/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs @@ -94,10 +94,10 @@ namespace osu.Game.Tournament.Screens.MapPool } [BackgroundDependencyLoader] - private void load(LadderInfo ladder, MatchIPCInfo ipc) + private void load(MatchIPCInfo ipc) { currentMatch.BindValueChanged(matchChanged); - currentMatch.BindTo(ladder.CurrentMatch); + currentMatch.BindTo(LadderInfo.CurrentMatch); ipc.Beatmap.BindValueChanged(beatmapChanged); } diff --git a/osu.Game.Tournament/Screens/TeamIntro/TeamIntroScreen.cs b/osu.Game.Tournament/Screens/TeamIntro/TeamIntroScreen.cs index d2ff632da0..7000d776f0 100644 --- a/osu.Game.Tournament/Screens/TeamIntro/TeamIntroScreen.cs +++ b/osu.Game.Tournament/Screens/TeamIntro/TeamIntroScreen.cs @@ -24,7 +24,7 @@ namespace osu.Game.Tournament.Screens.TeamIntro private readonly Bindable currentMatch = new Bindable(); [BackgroundDependencyLoader] - private void load(LadderInfo ladder, Storage storage) + private void load(Storage storage) { RelativeSizeAxes = Axes.Both; @@ -43,7 +43,7 @@ namespace osu.Game.Tournament.Screens.TeamIntro }; currentMatch.BindValueChanged(matchChanged); - currentMatch.BindTo(ladder.CurrentMatch); + currentMatch.BindTo(LadderInfo.CurrentMatch); } private void matchChanged(ValueChangedEvent pairing) From b9f6372c3fa240bec91c25ded502e4f3e9c484fb Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 25 May 2019 22:11:11 +0900 Subject: [PATCH 201/317] Fix Aquatico font lookups --- osu.Game/Graphics/OsuFont.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Graphics/OsuFont.cs b/osu.Game/Graphics/OsuFont.cs index 86a14a720e..6c4b46c3ad 100644 --- a/osu.Game/Graphics/OsuFont.cs +++ b/osu.Game/Graphics/OsuFont.cs @@ -73,7 +73,7 @@ namespace osu.Game.Graphics string weightString = weight.ToString(); // Only exo has an explicit "regular" weight, other fonts do not - if (family != GetFamilyString(Typeface.Exo) && weight == FontWeight.Regular) + if (weight == FontWeight.Regular && family != GetFamilyString(Typeface.Exo) && family != GetFamilyString(Typeface.Aquatico)) weightString = string.Empty; return weightString; From 5d77ae4a1e54a548548449b20da3d77fbdb86d9a Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 26 May 2019 10:25:17 +0900 Subject: [PATCH 202/317] Fix regression in FileBasedIPC implementation --- osu.Game.Tournament/IPC/FileBasedIPC.cs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/osu.Game.Tournament/IPC/FileBasedIPC.cs b/osu.Game.Tournament/IPC/FileBasedIPC.cs index 1086991eb4..8be10e2089 100644 --- a/osu.Game.Tournament/IPC/FileBasedIPC.cs +++ b/osu.Game.Tournament/IPC/FileBasedIPC.cs @@ -6,6 +6,7 @@ using System.IO; using System.Linq; using osu.Framework.Allocation; using osu.Framework.Logging; +using osu.Framework.Platform; using osu.Framework.Platform.Windows; using osu.Game.Beatmaps; using osu.Game.Beatmaps.Legacy; @@ -26,17 +27,17 @@ namespace osu.Game.Tournament.IPC private int lastBeatmapId; [BackgroundDependencyLoader] - private void load(LadderInfo ladder) + private void load(LadderInfo ladder, GameHost host) { StableStorage stable; try { - stable = new StableStorage(); + stable = new StableStorage(host as DesktopGameHost); } - catch + catch (Exception e) { - Logger.Log("Stable installation could not be found; disabling file based IPC"); + Logger.Error(e, "Stable installation could not be found; disabling file based IPC"); return; } @@ -170,8 +171,8 @@ namespace osu.Game.Tournament.IPC } } - public StableStorage() - : base(string.Empty, null) + public StableStorage(DesktopGameHost host) + : base(string.Empty, host) { } } From 1f2454188335222c8825365f7801eb62728892d7 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 13 Jun 2019 15:43:03 +0900 Subject: [PATCH 203/317] Re-expose OsuButton --- osu.Game/Graphics/UserInterface/OsuButton.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Graphics/UserInterface/OsuButton.cs b/osu.Game/Graphics/UserInterface/OsuButton.cs index 494d4e4262..7a27f825f6 100644 --- a/osu.Game/Graphics/UserInterface/OsuButton.cs +++ b/osu.Game/Graphics/UserInterface/OsuButton.cs @@ -17,11 +17,11 @@ namespace osu.Game.Graphics.UserInterface /// /// A button with added default sound effects. /// - public abstract class OsuButton : Button + public class OsuButton : Button { private Box hover; - protected OsuButton() + public OsuButton() { Height = 40; From a0503fcbe30bfa59dd9ea0d2f5820d62a3ca4fdf Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 13 Jun 2019 16:05:34 +0900 Subject: [PATCH 204/317] Reduce update rate of paths --- osu.Game.Tournament/Screens/Ladder/LadderScreen.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Tournament/Screens/Ladder/LadderScreen.cs b/osu.Game.Tournament/Screens/Ladder/LadderScreen.cs index 86b1884579..ffdc20c9e7 100644 --- a/osu.Game.Tournament/Screens/Ladder/LadderScreen.cs +++ b/osu.Game.Tournament/Screens/Ladder/LadderScreen.cs @@ -59,7 +59,7 @@ namespace osu.Game.Tournament.Screens.Ladder AddPairing(pairing); // todo: fix this - Scheduler.AddDelayed(() => layout.Invalidate(), 100, true); + Scheduler.AddDelayed(() => layout.Invalidate(), 1000, true); } protected virtual void AddPairing(MatchPairing pairing) From 4af16262e3b88bf53673e3d2c8f243b30f2c7c7f Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 13 Jun 2019 16:11:15 +0900 Subject: [PATCH 205/317] Limit zoom range of bracket display --- ...{ScrollableContainer.cs => LadderDragContainer.cs} | 11 +++++++---- osu.Game.Tournament/Screens/Ladder/LadderScreen.cs | 7 ++----- 2 files changed, 9 insertions(+), 9 deletions(-) rename osu.Game.Tournament/Screens/Ladder/{ScrollableContainer.cs => LadderDragContainer.cs} (74%) diff --git a/osu.Game.Tournament/Screens/Ladder/ScrollableContainer.cs b/osu.Game.Tournament/Screens/Ladder/LadderDragContainer.cs similarity index 74% rename from osu.Game.Tournament/Screens/Ladder/ScrollableContainer.cs rename to osu.Game.Tournament/Screens/Ladder/LadderDragContainer.cs index 832e218b74..6687ca13f9 100644 --- a/osu.Game.Tournament/Screens/Ladder/ScrollableContainer.cs +++ b/osu.Game.Tournament/Screens/Ladder/LadderDragContainer.cs @@ -8,7 +8,7 @@ using osuTK; namespace osu.Game.Tournament.Screens.Ladder { - public class ScrollableContainer : Container + public class LadderDragContainer : Container { protected override bool OnDragStart(DragStartEvent e) => true; @@ -24,12 +24,15 @@ namespace osu.Game.Tournament.Screens.Ladder return true; } + private const float min_scale = 0.6f; + private const float max_scale = 1.4f; + protected override bool OnScroll(ScrollEvent e) { - var newScale = scale + e.ScrollDelta.Y / 15 * scale; - this.MoveTo(target = target - e.MousePosition * (newScale - scale), 1000, Easing.OutQuint); + var newScale = MathHelper.Clamp(scale + e.ScrollDelta.Y / 15 * scale, min_scale, max_scale); - this.ScaleTo(scale = newScale, 1000, Easing.OutQuint); + this.MoveTo(target = target - e.MousePosition * (newScale - scale), 2000, Easing.OutQuint); + this.ScaleTo(scale = newScale, 2000, Easing.OutQuint); return true; } diff --git a/osu.Game.Tournament/Screens/Ladder/LadderScreen.cs b/osu.Game.Tournament/Screens/Ladder/LadderScreen.cs index ffdc20c9e7..e54bcffe2e 100644 --- a/osu.Game.Tournament/Screens/Ladder/LadderScreen.cs +++ b/osu.Game.Tournament/Screens/Ladder/LadderScreen.cs @@ -22,7 +22,7 @@ namespace osu.Game.Tournament.Screens.Ladder private Container paths; private Container headings; - protected ScrollableContainer ScrollContent; + protected LadderDragContainer ScrollContent; [BackgroundDependencyLoader] private void load(OsuColour colours, Storage storage) @@ -42,7 +42,7 @@ namespace osu.Game.Tournament.Screens.Ladder RelativeSizeAxes = Axes.Both, Loop = true, }, - ScrollContent = new ScrollableContainer + ScrollContent = new LadderDragContainer { RelativeSizeAxes = Axes.Both, Children = new Drawable[] @@ -133,8 +133,5 @@ namespace osu.Game.Tournament.Screens.Ladder layout.Validate(); } - - // todo: remove after ppy/osu-framework#1980 is merged. - public override bool HandlePositionalInput => true; } } From ba475ef6c878bff4c5eb870aad62d669ac786f19 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 13 Jun 2019 16:38:45 +0900 Subject: [PATCH 206/317] Remove unnecessary invalidation --- osu.Game.Tournament/Screens/Ladder/LadderDragContainer.cs | 6 ------ 1 file changed, 6 deletions(-) diff --git a/osu.Game.Tournament/Screens/Ladder/LadderDragContainer.cs b/osu.Game.Tournament/Screens/Ladder/LadderDragContainer.cs index 6687ca13f9..3aa06185cb 100644 --- a/osu.Game.Tournament/Screens/Ladder/LadderDragContainer.cs +++ b/osu.Game.Tournament/Screens/Ladder/LadderDragContainer.cs @@ -36,11 +36,5 @@ namespace osu.Game.Tournament.Screens.Ladder return true; } - - protected override void Update() - { - base.Update(); - Invalidate(); - } } } From eb0f0aefba7bdd76a66ed5c25c50c3f1d8622f48 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 13 Jun 2019 17:04:57 +0900 Subject: [PATCH 207/317] Apply review changes --- .../Components/ControlPanel.cs | 4 ---- osu.Game.Tournament/Components/DateTextBox.cs | 3 ++- .../Components/MatchChatDisplay.cs | 4 ++-- osu.Game.Tournament/Components/SongBar.cs | 15 ++++++------- .../Components/TournamentBeatmapPanel.cs | 6 ++---- .../Ladder/Components/DrawableMatchTeam.cs | 5 ++--- .../Components/TournamentProgression.cs | 21 ++++++++++++++----- .../Screens/Ladder/LadderEditorScreen.cs | 10 ++++----- .../Screens/Ladder/LadderScreen.cs | 4 +++- osu.Game.Tournament/TournamentGameBase.cs | 4 ++-- 10 files changed, 42 insertions(+), 34 deletions(-) diff --git a/osu.Game.Tournament/Components/ControlPanel.cs b/osu.Game.Tournament/Components/ControlPanel.cs index 0d228fb3b4..a9bb1bf42f 100644 --- a/osu.Game.Tournament/Components/ControlPanel.cs +++ b/osu.Game.Tournament/Components/ControlPanel.cs @@ -39,7 +39,6 @@ namespace osu.Game.Tournament.Components { Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, - Text = "Control Panel", Font = OsuFont.GetFont(weight: FontWeight.Bold, size: 22) }, @@ -47,13 +46,10 @@ namespace osu.Game.Tournament.Components { Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, - RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, Width = 0.75f, - Position = new Vector2(0, 35f), - Direction = FillDirection.Vertical, Spacing = new Vector2(0, 5f), }, diff --git a/osu.Game.Tournament/Components/DateTextBox.cs b/osu.Game.Tournament/Components/DateTextBox.cs index f25c4b6e78..ee7e350970 100644 --- a/osu.Game.Tournament/Components/DateTextBox.cs +++ b/osu.Game.Tournament/Components/DateTextBox.cs @@ -15,7 +15,7 @@ namespace osu.Game.Tournament.Components get => bindable; set { - bindable = value; + bindable = value.GetBoundCopy(); bindable.BindValueChanged(dto => base.Bindable.Value = dto.NewValue.ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ssZ"), true); } @@ -35,6 +35,7 @@ namespace osu.Game.Tournament.Components } catch { + // reset textbox content to its last valid state on a parse failure. bindable.TriggerChange(); } }; diff --git a/osu.Game.Tournament/Components/MatchChatDisplay.cs b/osu.Game.Tournament/Components/MatchChatDisplay.cs index dd567ed290..174b215732 100644 --- a/osu.Game.Tournament/Components/MatchChatDisplay.cs +++ b/osu.Game.Tournament/Components/MatchChatDisplay.cs @@ -15,8 +15,6 @@ namespace osu.Game.Tournament.Components { private readonly Bindable chatChannel = new Bindable(); - protected override ChatLine CreateMessage(Message message) => new MatchMessage(message); - private ChannelManager manager; [BackgroundDependencyLoader(true)] @@ -55,6 +53,8 @@ namespace osu.Game.Tournament.Components } } + protected override ChatLine CreateMessage(Message message) => new MatchMessage(message); + protected class MatchMessage : StandAloneMessage { public MatchMessage(Message message) diff --git a/osu.Game.Tournament/Components/SongBar.cs b/osu.Game.Tournament/Components/SongBar.cs index a08333571b..c07882ddd0 100644 --- a/osu.Game.Tournament/Components/SongBar.cs +++ b/osu.Game.Tournament/Components/SongBar.cs @@ -228,21 +228,22 @@ namespace osu.Game.Tournament.Components s.Font = OsuFont.GetFont(weight: FontWeight.Bold, size: 15); } - bool first = true; - - foreach (var t in tuples) + for (var i = 0; i < tuples.Length; i++) { - if (!first) + var tuple = tuples[i]; + + if (i > 0) + { AddText(" / ", s => { cp(s, OsuColour.Gray(0.33f)); s.Spacing = new Vector2(-2, 0); }); + } - AddText(new OsuSpriteText { Text = t.heading }, s => cp(s, OsuColour.Gray(0.33f))); + AddText(new OsuSpriteText { Text = tuple.heading }, s => cp(s, OsuColour.Gray(0.33f))); AddText(" ", s => cp(s, OsuColour.Gray(0.33f))); - AddText(new OsuSpriteText { Text = t.content }, s => cp(s, OsuColour.Gray(0.5f))); - first = false; + AddText(new OsuSpriteText { Text = tuple.content }, s => cp(s, OsuColour.Gray(0.5f))); } } } diff --git a/osu.Game.Tournament/Components/TournamentBeatmapPanel.cs b/osu.Game.Tournament/Components/TournamentBeatmapPanel.cs index 818d25d559..cf826ee2c7 100644 --- a/osu.Game.Tournament/Components/TournamentBeatmapPanel.cs +++ b/osu.Game.Tournament/Components/TournamentBeatmapPanel.cs @@ -11,9 +11,7 @@ using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Textures; -using osu.Framework.IO.Stores; using osu.Framework.Localisation; -using osu.Framework.Platform; using osu.Game.Beatmaps; using osu.Game.Beatmaps.Drawables; using osu.Game.Graphics; @@ -48,7 +46,7 @@ namespace osu.Game.Tournament.Components } [BackgroundDependencyLoader] - private void load(LadderInfo ladder, Storage storage) + private void load(LadderInfo ladder, TextureStore textures) { currentMatch.BindValueChanged(matchChanged); currentMatch.BindTo(ladder.CurrentMatch); @@ -135,7 +133,7 @@ namespace osu.Game.Tournament.Components if (!string.IsNullOrEmpty(mods)) AddInternal(new Sprite { - Texture = new LargeTextureStore(new TextureLoaderStore(new StorageBackedResourceStore(storage))).Get($"mods/{mods}"), + Texture = textures.Get($"mods/{mods}"), Anchor = Anchor.CentreRight, Origin = Anchor.CentreRight, Margin = new MarginPadding(20), diff --git a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs index 35b6dfb606..6d5ac74267 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs @@ -138,7 +138,6 @@ namespace osu.Game.Tournament.Screens.Ladder.Components }, true); } - //TODO: use OnClick instead once we have per-button clicks. protected override bool OnClick(ClickEvent e) { if (Team == null || editorInfo != null) return false; @@ -196,8 +195,8 @@ namespace osu.Game.Tournament.Screens.Ladder.Components return new MenuItem[] { new OsuMenuItem("Set as current", MenuItemType.Standard, setCurrent), - new OsuMenuItem("Join with", MenuItemType.Standard, () => ladderEditor.RequestJoin(pairing, false)), - new OsuMenuItem("Join with (loser)", MenuItemType.Standard, () => ladderEditor.RequestJoin(pairing, true)), + new OsuMenuItem("Join with", MenuItemType.Standard, () => ladderEditor.BeginJoin(pairing, false)), + new OsuMenuItem("Join with (loser)", MenuItemType.Standard, () => ladderEditor.BeginJoin(pairing, true)), new OsuMenuItem("Remove", MenuItemType.Destructive, () => ladderEditor.Remove(pairing)), }; } diff --git a/osu.Game.Tournament/Screens/Ladder/Components/TournamentProgression.cs b/osu.Game.Tournament/Screens/Ladder/Components/TournamentProgression.cs index 241e1d1d0b..0019dc8d79 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/TournamentProgression.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/TournamentProgression.cs @@ -5,15 +5,26 @@ namespace osu.Game.Tournament.Screens.Ladder.Components { public class TournamentProgression { - public int Item1; - public int Item2; + public int SourceID; + public int TargetID; + + // migration + public int Item1 + { + set => SourceID = value; + } + + public int Item2 + { + set => TargetID = value; + } public bool Losers; - public TournamentProgression(int item1, int item2, bool losers = false) + public TournamentProgression(int sourceID, int targetID, bool losers = false) { - Item1 = item1; - Item2 = item2; + SourceID = sourceID; + TargetID = targetID; Losers = losers; } } diff --git a/osu.Game.Tournament/Screens/Ladder/LadderEditorScreen.cs b/osu.Game.Tournament/Screens/Ladder/LadderEditorScreen.cs index e605de9a7c..4a35f1ad30 100644 --- a/osu.Game.Tournament/Screens/Ladder/LadderEditorScreen.cs +++ b/osu.Game.Tournament/Screens/Ladder/LadderEditorScreen.cs @@ -27,7 +27,7 @@ namespace osu.Game.Tournament.Screens.Ladder [BackgroundDependencyLoader] private void load() { - ((Container)InternalChild).Add(new LadderEditorSettings + Content.Add(new LadderEditorSettings { Anchor = Anchor.TopRight, Origin = Anchor.TopRight, @@ -58,9 +58,9 @@ namespace osu.Game.Tournament.Screens.Ladder updateInfo(); } - public void RequestJoin(MatchPairing pairing, bool losers) + public void BeginJoin(MatchPairing pairing, bool losers) { - ScrollContent.Add(new JoinRequestHandler(PairingsContainer, pairing, losers, updateInfo)); + ScrollContent.Add(new JoinVisualiser(PairingsContainer, pairing, losers, updateInfo)); } public MenuItem[] ContextMenuItems @@ -91,7 +91,7 @@ namespace osu.Game.Tournament.Screens.Ladder PairingsContainer.FirstOrDefault(p => p.Pairing == pairing)?.Remove(); } - private class JoinRequestHandler : CompositeDrawable + private class JoinVisualiser : CompositeDrawable { private readonly Container pairingsContainer; public readonly MatchPairing Source; @@ -100,7 +100,7 @@ namespace osu.Game.Tournament.Screens.Ladder private ProgressionPath path; - public JoinRequestHandler(Container pairingsContainer, MatchPairing source, bool losers, Action complete) + public JoinVisualiser(Container pairingsContainer, MatchPairing source, bool losers, Action complete) { this.pairingsContainer = pairingsContainer; RelativeSizeAxes = Axes.Both; diff --git a/osu.Game.Tournament/Screens/Ladder/LadderScreen.cs b/osu.Game.Tournament/Screens/Ladder/LadderScreen.cs index e54bcffe2e..f2d4ebbb71 100644 --- a/osu.Game.Tournament/Screens/Ladder/LadderScreen.cs +++ b/osu.Game.Tournament/Screens/Ladder/LadderScreen.cs @@ -24,6 +24,8 @@ namespace osu.Game.Tournament.Screens.Ladder protected LadderDragContainer ScrollContent; + protected Container Content; + [BackgroundDependencyLoader] private void load(OsuColour colours, Storage storage) { @@ -32,7 +34,7 @@ namespace osu.Game.Tournament.Screens.Ladder RelativeSizeAxes = Axes.Both; - InternalChild = new Container + InternalChild = Content = new Container { RelativeSizeAxes = Axes.Both, Children = new Drawable[] diff --git a/osu.Game.Tournament/TournamentGameBase.cs b/osu.Game.Tournament/TournamentGameBase.cs index 4f54da2723..739fabca9d 100644 --- a/osu.Game.Tournament/TournamentGameBase.cs +++ b/osu.Game.Tournament/TournamentGameBase.cs @@ -110,8 +110,8 @@ namespace osu.Game.Tournament // assign progressions foreach (var pair in ladder.Progressions) { - var src = ladder.Pairings.FirstOrDefault(p => p.ID == pair.Item1); - var dest = ladder.Pairings.FirstOrDefault(p => p.ID == pair.Item2); + var src = ladder.Pairings.FirstOrDefault(p => p.ID == pair.SourceID); + var dest = ladder.Pairings.FirstOrDefault(p => p.ID == pair.TargetID); if (src == null) throw new InvalidOperationException(); From 89c68c78d1b74a65e4295a0a54fdb34c9bc079b5 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 13 Jun 2019 18:06:24 +0900 Subject: [PATCH 208/317] Reduce size of paths --- .../Screens/Ladder/Components/ProgressionPath.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/osu.Game.Tournament/Screens/Ladder/Components/ProgressionPath.cs b/osu.Game.Tournament/Screens/Ladder/Components/ProgressionPath.cs index ddf41b0117..5468844f66 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/ProgressionPath.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/ProgressionPath.cs @@ -25,6 +25,7 @@ namespace osu.Game.Tournament.Screens.Ladder.Components protected override void LoadComplete() { base.LoadComplete(); + Vector2 getCenteredVector(Vector2 top, Vector2 bottom) => new Vector2(top.X, top.Y + (bottom.Y - top.Y) / 2); var q1 = Source.ScreenSpaceDrawQuad; @@ -56,7 +57,15 @@ namespace osu.Game.Tournament.Screens.Ladder.Components var p3 = new Vector2(p2.X, c2.Y); var p4 = new Vector2(c2.X, p3.Y); - Vertices = new[] { p1, p2, p3, p4 }.Select(ToLocalSpace).ToList(); + var points = new[] { p1, p2, p3, p4 }; + + float minX = points.Min(p => p.X); + float minY = points.Min(p => p.Y); + + var topLeft = new Vector2(minX, minY); + + Position = Parent.ToLocalSpace(topLeft); + Vertices = points.Select(p => Parent.ToLocalSpace(p) - Parent.ToLocalSpace(topLeft)).ToList(); } } } From d744c900c240f0eb174b3aa604548109a06ba84e Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 13 Jun 2019 19:04:59 +0900 Subject: [PATCH 209/317] Fix incorrect unbind logic --- osu.Game/Overlays/Settings/SettingsItem.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/osu.Game/Overlays/Settings/SettingsItem.cs b/osu.Game/Overlays/Settings/SettingsItem.cs index 4b992d6179..ae840c8c00 100644 --- a/osu.Game/Overlays/Settings/SettingsItem.cs +++ b/osu.Game/Overlays/Settings/SettingsItem.cs @@ -63,7 +63,9 @@ namespace osu.Game.Overlays.Settings set { - controlWithCurrent?.Current.UnbindBindings(); + if (bindable != null) + controlWithCurrent?.Current.UnbindFrom(bindable); + bindable = value; controlWithCurrent?.Current.BindTo(bindable); From ee9d82f0fef6573d8ba29bc96e0e27047151bd5c Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 13 Jun 2019 19:10:57 +0900 Subject: [PATCH 210/317] Revert right click handling for now --- osu.Game.Tournament/TournamentGameBase.cs | 30 +++++++++++++++++++++++ osu.Game/OsuGameBase.cs | 2 +- 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/osu.Game.Tournament/TournamentGameBase.cs b/osu.Game.Tournament/TournamentGameBase.cs index 739fabca9d..fd7a20ecb9 100644 --- a/osu.Game.Tournament/TournamentGameBase.cs +++ b/osu.Game.Tournament/TournamentGameBase.cs @@ -12,6 +12,7 @@ using osu.Framework.Bindables; using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Framework.Graphics.Textures; +using osu.Framework.Input; using osu.Framework.IO.Stores; using osu.Framework.Platform; using osu.Game.Beatmaps; @@ -20,6 +21,7 @@ using osu.Game.Online.API.Requests; using osu.Game.Rulesets; using osu.Game.Tournament.Components; using osu.Game.Tournament.IPC; +using osuTK.Input; namespace osu.Game.Tournament { @@ -250,5 +252,33 @@ namespace osu.Game.Tournament })); } } + + protected override UserInputManager CreateUserInputManager() => new TournamentInputManager(); + + private class TournamentInputManager : UserInputManager + { + protected override MouseButtonEventManager CreateButtonManagerFor(MouseButton button) + { + switch (button) + { + case MouseButton.Right: + return new RightMouseManager(button); + } + + return base.CreateButtonManagerFor(button); + } + + private class RightMouseManager : MouseButtonEventManager + { + public RightMouseManager(MouseButton button) + : base(button) + { + } + + public override bool EnableDrag => true; // allow right-mouse dragging for absolute scroll in scroll containers. + public override bool EnableClick => true; + public override bool ChangeFocusOnClick => false; + } + } } } diff --git a/osu.Game/OsuGameBase.cs b/osu.Game/OsuGameBase.cs index 4c1266c3a6..637708a0e5 100644 --- a/osu.Game/OsuGameBase.cs +++ b/osu.Game/OsuGameBase.cs @@ -311,7 +311,7 @@ namespace osu.Game } public override bool EnableDrag => true; // allow right-mouse dragging for absolute scroll in scroll containers. - public override bool EnableClick => true; + public override bool EnableClick => false; public override bool ChangeFocusOnClick => false; } } From 9e4f2c7eb9ce3f600f910bf544edfdaa591b4dad Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 13 Jun 2019 19:41:01 +0900 Subject: [PATCH 211/317] Move font local --- .../Gameplay/Components/MatchHeader.cs | 4 +- .../Gameplay/Components/MatchScoreDisplay.cs | 4 +- .../Screens/TeamIntro/TeamIntroScreen.cs | 4 +- .../Screens/TeamWin/TeamWinScreen.cs | 8 +-- osu.Game.Tournament/TournamentFont.cs | 70 +++++++++++++++++++ osu.Game.Tournament/TournamentGame.cs | 28 ++++++++ osu.Game/Graphics/OsuFont.cs | 6 +- 7 files changed, 109 insertions(+), 15 deletions(-) create mode 100644 osu.Game.Tournament/TournamentFont.cs diff --git a/osu.Game.Tournament/Screens/Gameplay/Components/MatchHeader.cs b/osu.Game.Tournament/Screens/Gameplay/Components/MatchHeader.cs index 22aa6995cf..f9ec16c357 100644 --- a/osu.Game.Tournament/Screens/Gameplay/Components/MatchHeader.cs +++ b/osu.Game.Tournament/Screens/Gameplay/Components/MatchHeader.cs @@ -176,7 +176,7 @@ namespace osu.Game.Tournament.Screens.Gameplay.Components X = (flip ? -1 : 1) * 90, Y = -10, Colour = colour, - Font = OsuFont.GetFont(typeface: Typeface.Aquatico, weight: FontWeight.Regular, size: 20), + Font = TournamentFont.GetFont(typeface: TournamentTypeface.Aquatico, weight: FontWeight.Regular, size: 20), Origin = anchor, Anchor = anchor, }, @@ -219,7 +219,7 @@ namespace osu.Game.Tournament.Screens.Gameplay.Components Origin = Anchor.Centre, Colour = Color4.White, Text = match.NewValue.Grouping.Value?.Name.Value ?? "Unknown Grouping", - Font = OsuFont.GetFont(typeface: Typeface.Aquatico, weight: FontWeight.Regular, size: 18), + Font = TournamentFont.GetFont(typeface: TournamentTypeface.Aquatico, weight: FontWeight.Regular, size: 18), }, }; } diff --git a/osu.Game.Tournament/Screens/Gameplay/Components/MatchScoreDisplay.cs b/osu.Game.Tournament/Screens/Gameplay/Components/MatchScoreDisplay.cs index 62a785398f..fc28ddccfd 100644 --- a/osu.Game.Tournament/Screens/Gameplay/Components/MatchScoreDisplay.cs +++ b/osu.Game.Tournament/Screens/Gameplay/Components/MatchScoreDisplay.cs @@ -122,8 +122,8 @@ namespace osu.Game.Tournament.Screens.Gameplay.Components public bool Winning { set => DisplayedCountSpriteText.Font = value - ? OsuFont.GetFont(typeface: Typeface.Aquatico, weight: FontWeight.Regular, size: 60) - : OsuFont.GetFont(typeface: Typeface.Aquatico, weight: FontWeight.Light, size: 40); + ? TournamentFont.GetFont(typeface: TournamentTypeface.Aquatico, weight: FontWeight.Regular, size: 60) + : TournamentFont.GetFont(typeface: TournamentTypeface.Aquatico, weight: FontWeight.Light, size: 40); } } } diff --git a/osu.Game.Tournament/Screens/TeamIntro/TeamIntroScreen.cs b/osu.Game.Tournament/Screens/TeamIntro/TeamIntroScreen.cs index 7000d776f0..1efe667eaa 100644 --- a/osu.Game.Tournament/Screens/TeamIntro/TeamIntroScreen.cs +++ b/osu.Game.Tournament/Screens/TeamIntro/TeamIntroScreen.cs @@ -200,7 +200,7 @@ namespace osu.Game.Tournament.Screens.TeamIntro new OsuSpriteText { Text = team?.FullName.ToUpper() ?? "???", - Font = OsuFont.GetFont(Typeface.Aquatico, 40, FontWeight.Light), + Font = TournamentFont.GetFont(TournamentTypeface.Aquatico, 40, FontWeight.Light), Colour = Color4.Black, Origin = Anchor.TopCentre, Anchor = Anchor.TopCentre, @@ -208,7 +208,7 @@ namespace osu.Game.Tournament.Screens.TeamIntro new OsuSpriteText { Text = teamName.ToUpper(), - Font = OsuFont.GetFont(Typeface.Aquatico, 20, FontWeight.Regular), + Font = TournamentFont.GetFont(TournamentTypeface.Aquatico, 20, FontWeight.Regular), Colour = colour, Origin = Anchor.TopCentre, Anchor = Anchor.TopCentre, diff --git a/osu.Game.Tournament/Screens/TeamWin/TeamWinScreen.cs b/osu.Game.Tournament/Screens/TeamWin/TeamWinScreen.cs index 69c088efbc..6d5f7e7ad5 100644 --- a/osu.Game.Tournament/Screens/TeamWin/TeamWinScreen.cs +++ b/osu.Game.Tournament/Screens/TeamWin/TeamWinScreen.cs @@ -127,7 +127,7 @@ namespace osu.Game.Tournament.Screens.TeamWin Origin = Anchor.TopCentre, Colour = col, Text = "WINNER", - Font = OsuFont.GetFont(Typeface.Aquatico, 15, FontWeight.Regular), + Font = TournamentFont.GetFont(TournamentTypeface.Aquatico, 15, FontWeight.Regular), }, new OsuSpriteText { @@ -135,7 +135,7 @@ namespace osu.Game.Tournament.Screens.TeamWin Origin = Anchor.TopCentre, Colour = col, Text = pairing.Grouping.Value?.Name.Value ?? "Unknown Grouping", - Font = OsuFont.GetFont(Typeface.Aquatico, 50, FontWeight.Light), + Font = TournamentFont.GetFont(TournamentTypeface.Aquatico, 50, FontWeight.Light), Spacing = new Vector2(10, 0), }, new OsuSpriteText @@ -144,7 +144,7 @@ namespace osu.Game.Tournament.Screens.TeamWin Origin = Anchor.TopCentre, Colour = col, Text = pairing.Date.Value.ToUniversalTime().ToString("dd MMMM HH:mm UTC"), - Font = OsuFont.GetFont(Typeface.Aquatico, 20, FontWeight.Light), + Font = TournamentFont.GetFont(TournamentTypeface.Aquatico, 20, FontWeight.Light), }, } } @@ -204,7 +204,7 @@ namespace osu.Game.Tournament.Screens.TeamWin new OsuSpriteText { Text = team?.FullName.ToUpper() ?? "???", - Font = OsuFont.GetFont(Typeface.Aquatico, 40, FontWeight.Light), + Font = TournamentFont.GetFont(TournamentTypeface.Aquatico, 40, FontWeight.Light), Colour = Color4.Black, Origin = Anchor.TopCentre, Anchor = Anchor.TopCentre, diff --git a/osu.Game.Tournament/TournamentFont.cs b/osu.Game.Tournament/TournamentFont.cs new file mode 100644 index 0000000000..d2925d7632 --- /dev/null +++ b/osu.Game.Tournament/TournamentFont.cs @@ -0,0 +1,70 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +using osu.Framework.Graphics.Sprites; +using osu.Game.Graphics; + +namespace osu.Game.Tournament +{ + public static class TournamentFont + { + /// + /// The default font size. + /// + public const float DEFAULT_FONT_SIZE = 16; + + /// + /// Retrieves a . + /// + /// The font typeface. + /// The size of the text in local space. For a value of 16, a single line will have a height of 16px. + /// The font weight. + /// Whether the font is italic. + /// Whether all characters should be spaced the same distance apart. + /// The . + public static FontUsage GetFont(TournamentTypeface typeface = TournamentTypeface.Aquatico, float size = DEFAULT_FONT_SIZE, FontWeight weight = FontWeight.Medium, bool italics = false, bool fixedWidth = false) + => new FontUsage(GetFamilyString(typeface), size, GetWeightString(typeface, weight), italics, fixedWidth); + + /// + /// Retrieves the string representation of a . + /// + /// The . + /// The string representation. + public static string GetFamilyString(TournamentTypeface typeface) + { + switch (typeface) + { + case TournamentTypeface.Aquatico: + return "Aquatico"; + } + + return null; + } + + /// + /// Retrieves the string representation of a . + /// + /// The . + /// The . + /// The string representation of in the specified . + public static string GetWeightString(TournamentTypeface typeface, FontWeight weight) + => GetWeightString(GetFamilyString(typeface), weight); + + /// + /// Retrieves the string representation of a . + /// + /// The family string. + /// The . + /// The string representation of in the specified . + public static string GetWeightString(string family, FontWeight weight) + { + string weightString = weight.ToString(); + + // Only exo has an explicit "regular" weight, other fonts do not + if (weight == FontWeight.Regular && family != GetFamilyString(TournamentTypeface.Aquatico) && family != GetFamilyString(TournamentTypeface.Aquatico)) + weightString = string.Empty; + + return weightString; + } + } +} diff --git a/osu.Game.Tournament/TournamentGame.cs b/osu.Game.Tournament/TournamentGame.cs index bb5682bb42..0f142e4d74 100644 --- a/osu.Game.Tournament/TournamentGame.cs +++ b/osu.Game.Tournament/TournamentGame.cs @@ -2,7 +2,9 @@ // See the LICENCE file in the repository root for full licence text. using osu.Framework.Graphics; +using osu.Framework.Graphics.Sprites; using osu.Framework.Screens; +using osu.Game.Graphics; using osu.Game.Graphics.Cursor; using osu.Game.Tournament.Screens; @@ -23,4 +25,30 @@ namespace osu.Game.Tournament MenuCursorContainer.Cursor.Alpha = 0; } } + + public static class TournamentFontExtensions + { + /// + /// Creates a new by applying adjustments to this . + /// + /// The base . + /// The font typeface. If null, the value is copied from this . + /// The text size. If null, the value is copied from this . + /// The font weight. If null, the value is copied from this . + /// Whether the font is italic. If null, the value is copied from this . + /// Whether all characters should be spaced apart the same distance. If null, the value is copied from this . + /// The resulting . + public static FontUsage With(this FontUsage usage, TournamentTypeface? typeface = null, float? size = null, FontWeight? weight = null, bool? italics = null, bool? fixedWidth = null) + { + string familyString = typeface != null ? TournamentFont.GetFamilyString(typeface.Value) : usage.Family; + string weightString = weight != null ? TournamentFont.GetWeightString(familyString, weight.Value) : usage.Weight; + + return usage.With(familyString, size, weightString, italics, fixedWidth); + } + } + + public enum TournamentTypeface + { + Aquatico + } } diff --git a/osu.Game/Graphics/OsuFont.cs b/osu.Game/Graphics/OsuFont.cs index 6c4b46c3ad..2c2f075563 100644 --- a/osu.Game/Graphics/OsuFont.cs +++ b/osu.Game/Graphics/OsuFont.cs @@ -45,9 +45,6 @@ namespace osu.Game.Graphics case Typeface.Venera: return "Venera"; - - case Typeface.Aquatico: - return "Aquatico"; } return null; @@ -73,7 +70,7 @@ namespace osu.Game.Graphics string weightString = weight.ToString(); // Only exo has an explicit "regular" weight, other fonts do not - if (weight == FontWeight.Regular && family != GetFamilyString(Typeface.Exo) && family != GetFamilyString(Typeface.Aquatico)) + if (weight == FontWeight.Regular && family != GetFamilyString(Typeface.Exo)) weightString = string.Empty; return weightString; @@ -105,7 +102,6 @@ namespace osu.Game.Graphics { Exo, Venera, - Aquatico // tournament use only } public enum FontWeight From 4f0aff3d9c2ad06df4c0197644f51cf6ec63df0c Mon Sep 17 00:00:00 2001 From: andy840119 Date: Fri, 14 Jun 2019 01:12:56 +0900 Subject: [PATCH 212/317] hide label when mod is empty --- osu.Game/Overlays/Mods/ModSection.cs | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/osu.Game/Overlays/Mods/ModSection.cs b/osu.Game/Overlays/Mods/ModSection.cs index 50400e254f..9d9bb2ba6e 100644 --- a/osu.Game/Overlays/Mods/ModSection.cs +++ b/osu.Game/Overlays/Mods/ModSection.cs @@ -50,6 +50,34 @@ namespace osu.Game.Overlays.Mods ButtonsContainer.Children = modContainers; buttons = modContainers.OfType().ToArray(); + + Expanded = value.Any(); + } + } + + private bool expanded = true; + + public bool Expanded + { + set + { + if (expanded == value) return; + + expanded = value; + + this.ClearTransforms(); + + if (expanded) + { + this.AutoSizeAxes = Axes.Y; + this.headerLabel.FadeIn(200); + } + else + { + this.AutoSizeAxes = Axes.None; + this.headerLabel.FadeOut(200); + this.ResizeHeightTo(0, 200, Easing.OutQuint); + } } } From 3a14794c431a1fb13a09b5e3ec5eb77e586006ef Mon Sep 17 00:00:00 2001 From: andy840119 Date: Fri, 14 Jun 2019 01:43:20 +0900 Subject: [PATCH 213/317] use show/hide instead because FillFlowContainer's spacing --- osu.Game/Overlays/Mods/ModSection.cs | 19 +++---------------- osu.Game/Overlays/Mods/ModSelectOverlay.cs | 2 ++ 2 files changed, 5 insertions(+), 16 deletions(-) diff --git a/osu.Game/Overlays/Mods/ModSection.cs b/osu.Game/Overlays/Mods/ModSection.cs index 9d9bb2ba6e..7b032f1fcf 100644 --- a/osu.Game/Overlays/Mods/ModSection.cs +++ b/osu.Game/Overlays/Mods/ModSection.cs @@ -51,32 +51,19 @@ namespace osu.Game.Overlays.Mods ButtonsContainer.Children = modContainers; buttons = modContainers.OfType().ToArray(); - Expanded = value.Any(); - } - } - - private bool expanded = true; - - public bool Expanded - { - set - { - if (expanded == value) return; - - expanded = value; - - this.ClearTransforms(); + var expanded = value.Any(); if (expanded) { this.AutoSizeAxes = Axes.Y; this.headerLabel.FadeIn(200); + Show(); } else { this.AutoSizeAxes = Axes.None; this.headerLabel.FadeOut(200); - this.ResizeHeightTo(0, 200, Easing.OutQuint); + this.ResizeHeightTo(0, 200, Easing.OutQuint).OnComplete((c) => Hide()); } } } diff --git a/osu.Game/Overlays/Mods/ModSelectOverlay.cs b/osu.Game/Overlays/Mods/ModSelectOverlay.cs index 8e5c9588ce..9ff320841a 100644 --- a/osu.Game/Overlays/Mods/ModSelectOverlay.cs +++ b/osu.Game/Overlays/Mods/ModSelectOverlay.cs @@ -172,6 +172,8 @@ namespace osu.Game.Overlays.Mods AutoSizeAxes = Axes.Y, Spacing = new Vector2(0f, 10f), Width = content_width, + LayoutDuration = 200, + LayoutEasing = Easing.OutQuint, Children = new ModSection[] { new DifficultyReductionSection { Action = modButtonPressed }, From c30e4677179f426e066175f62b84cc6b49fd86c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=82=BA=E4=BB=80=E9=BA=BC?= Date: Fri, 14 Jun 2019 11:12:30 +0800 Subject: [PATCH 214/317] oops --- osu.Game/Overlays/Mods/ModSection.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/osu.Game/Overlays/Mods/ModSection.cs b/osu.Game/Overlays/Mods/ModSection.cs index 7b032f1fcf..07b1c53b3b 100644 --- a/osu.Game/Overlays/Mods/ModSection.cs +++ b/osu.Game/Overlays/Mods/ModSection.cs @@ -55,15 +55,15 @@ namespace osu.Game.Overlays.Mods if (expanded) { - this.AutoSizeAxes = Axes.Y; - this.headerLabel.FadeIn(200); + AutoSizeAxes = Axes.Y; + headerLabel.FadeIn(200); Show(); } else { - this.AutoSizeAxes = Axes.None; - this.headerLabel.FadeOut(200); - this.ResizeHeightTo(0, 200, Easing.OutQuint).OnComplete((c) => Hide()); + AutoSizeAxes = Axes.None; + headerLabel.FadeOut(200); + this.ResizeHeightTo(0, 200, Easing.OutQuint).OnComplete(c => Hide()); } } } From 0db9816321c893c5cdb073e763819f83c1ed0a56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=82=BA=E4=BB=80=E9=BA=BC?= Date: Fri, 14 Jun 2019 11:23:41 +0800 Subject: [PATCH 215/317] expanded -> expand --- osu.Game/Overlays/Mods/ModSection.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Overlays/Mods/ModSection.cs b/osu.Game/Overlays/Mods/ModSection.cs index 07b1c53b3b..34dede62de 100644 --- a/osu.Game/Overlays/Mods/ModSection.cs +++ b/osu.Game/Overlays/Mods/ModSection.cs @@ -51,9 +51,9 @@ namespace osu.Game.Overlays.Mods ButtonsContainer.Children = modContainers; buttons = modContainers.OfType().ToArray(); - var expanded = value.Any(); + var expand = value.Any(); - if (expanded) + if (expand) { AutoSizeAxes = Axes.Y; headerLabel.FadeIn(200); From 9114c8dee7ee96f1a6bb81fcc3312350f8c54e14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=82=BA=E4=BB=80=E9=BA=BC?= Date: Fri, 14 Jun 2019 11:44:03 +0800 Subject: [PATCH 216/317] remve unnecessary effect. --- osu.Game/Overlays/Mods/ModSection.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/osu.Game/Overlays/Mods/ModSection.cs b/osu.Game/Overlays/Mods/ModSection.cs index 34dede62de..c110f58b7a 100644 --- a/osu.Game/Overlays/Mods/ModSection.cs +++ b/osu.Game/Overlays/Mods/ModSection.cs @@ -55,15 +55,13 @@ namespace osu.Game.Overlays.Mods if (expand) { - AutoSizeAxes = Axes.Y; headerLabel.FadeIn(200); Show(); } else { - AutoSizeAxes = Axes.None; headerLabel.FadeOut(200); - this.ResizeHeightTo(0, 200, Easing.OutQuint).OnComplete(c => Hide()); + Hide(); } } } From 831686d20b5288fe7c5ef8f968d0e7d4f5bfee23 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 14 Jun 2019 16:23:38 +0900 Subject: [PATCH 217/317] Fix crash when starting with an empty bracket --- osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs b/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs index 0e3a9b0dfd..fb7a7a8983 100644 --- a/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs +++ b/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs @@ -104,9 +104,10 @@ namespace osu.Game.Tournament.Screens.MapPool private void beatmapChanged(ValueChangedEvent beatmap) { - if (currentMatch.Value.PicksBans.Count(p => p.Type == ChoiceType.Ban) < 2) + if (currentMatch.Value == null || currentMatch.Value.PicksBans.Count(p => p.Type == ChoiceType.Ban) < 2) return; + // if bans have already been placed, beatmap changes result in a selection being made autoamtically if (beatmap.NewValue.OnlineBeatmapID != null) addForBeatmap(beatmap.NewValue.OnlineBeatmapID.Value); } From 2b4384bb30d44aa482b4ea13cb765189a6001bdb Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 14 Jun 2019 16:23:53 +0900 Subject: [PATCH 218/317] Fix crash when setting a match as current which doesn't have a grouping --- osu.Game.Tournament/Screens/Schedule/ScheduleScreen.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/osu.Game.Tournament/Screens/Schedule/ScheduleScreen.cs b/osu.Game.Tournament/Screens/Schedule/ScheduleScreen.cs index 093a1ba2d9..0e17936079 100644 --- a/osu.Game.Tournament/Screens/Schedule/ScheduleScreen.cs +++ b/osu.Game.Tournament/Screens/Schedule/ScheduleScreen.cs @@ -48,9 +48,9 @@ namespace osu.Game.Tournament.Screens.Schedule currentMatch.BindTo(ladder.CurrentMatch); } - private void matchChanged(ValueChangedEvent pairing) + private void matchChanged(ValueChangedEvent match) { - if (pairing.NewValue == null) + if (match.NewValue == null) { mainContainer.Clear(); return; @@ -110,14 +110,14 @@ namespace osu.Game.Tournament.Screens.Schedule { Margin = new MarginPadding { Left = -10, Bottom = 10, Top = -5 }, Spacing = new Vector2(10, 0), - Text = currentMatch.Value.Grouping.Value.Name.Value, + Text = match.NewValue.Grouping.Value?.Name.Value, Colour = Color4.Black, Font = OsuFont.GetFont(size: 20) }, - new SchedulePairing(currentMatch.Value, false), + new SchedulePairing(match.NewValue, false), new OsuSpriteText { - Text = "Start Time " + pairing.NewValue.Date.Value.ToUniversalTime().ToString("HH:mm UTC"), + Text = "Start Time " + match.NewValue.Date.Value.ToUniversalTime().ToString("HH:mm UTC"), Colour = Color4.Black, Font = OsuFont.GetFont(size: 20) }, From d4808ded0b824768a6ff9a52b2b90200bbba49f0 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 14 Jun 2019 16:28:59 +0900 Subject: [PATCH 219/317] Fix tooltips not showing at correct location --- osu.Game.Tournament/TournamentGameBase.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/osu.Game.Tournament/TournamentGameBase.cs b/osu.Game.Tournament/TournamentGameBase.cs index fd7a20ecb9..c773844cec 100644 --- a/osu.Game.Tournament/TournamentGameBase.cs +++ b/osu.Game.Tournament/TournamentGameBase.cs @@ -223,7 +223,9 @@ namespace osu.Game.Tournament protected override void LoadComplete() { + MenuCursorContainer.Cursor.AlwaysPresent = true; // required for tooltip display MenuCursorContainer.Cursor.Alpha = 0; + base.LoadComplete(); } From 1eb15c39f96098681eeceea20cc2acfd6b10a464 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 14 Jun 2019 16:38:29 +0900 Subject: [PATCH 220/317] Fix tests not working --- osu.Game.Tournament.Tests/TournamentTestBrowser.cs | 4 ++-- osu.Game.Tournament.Tests/osu.Game.Tournament.Tests.csproj | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/osu.Game.Tournament.Tests/TournamentTestBrowser.cs b/osu.Game.Tournament.Tests/TournamentTestBrowser.cs index 6d4063ec4f..f7ad757926 100644 --- a/osu.Game.Tournament.Tests/TournamentTestBrowser.cs +++ b/osu.Game.Tournament.Tests/TournamentTestBrowser.cs @@ -3,7 +3,7 @@ using osu.Framework.Testing; using osu.Game.Graphics; -using osu.Game.Screens.Backgrounds; +using osu.Game.Graphics.Backgrounds; namespace osu.Game.Tournament.Tests { @@ -13,7 +13,7 @@ namespace osu.Game.Tournament.Tests { base.LoadComplete(); - LoadComponentAsync(new BackgroundScreenDefault + LoadComponentAsync(new Background("Menu/menu-background-0") { Colour = OsuColour.Gray(0.5f), Depth = 10 diff --git a/osu.Game.Tournament.Tests/osu.Game.Tournament.Tests.csproj b/osu.Game.Tournament.Tests/osu.Game.Tournament.Tests.csproj index b76fc261f0..cf0752f764 100644 --- a/osu.Game.Tournament.Tests/osu.Game.Tournament.Tests.csproj +++ b/osu.Game.Tournament.Tests/osu.Game.Tournament.Tests.csproj @@ -14,6 +14,10 @@ netcoreapp2.1 + + + + \ No newline at end of file From 4cd6955a96c46da40e77c8d2f0820556c293dd0b Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 14 Jun 2019 16:57:29 +0900 Subject: [PATCH 221/317] Fix GameplayScreen test not working --- ...tCaseGameplay.cs => TestCaseGameplayScreen.cs} | 12 +++++------- .../Components/MatchChatDisplay.cs | 12 ++++++++++++ .../Screens/Gameplay/GameplayScreen.cs | 15 ++++++++------- .../Screens/TournamentSceneManager.cs | 11 +---------- 4 files changed, 26 insertions(+), 24 deletions(-) rename osu.Game.Tournament.Tests/{TestCaseGameplay.cs => TestCaseGameplayScreen.cs} (66%) diff --git a/osu.Game.Tournament.Tests/TestCaseGameplay.cs b/osu.Game.Tournament.Tests/TestCaseGameplayScreen.cs similarity index 66% rename from osu.Game.Tournament.Tests/TestCaseGameplay.cs rename to osu.Game.Tournament.Tests/TestCaseGameplayScreen.cs index c881f09cb9..b44cb11ec4 100644 --- a/osu.Game.Tournament.Tests/TestCaseGameplay.cs +++ b/osu.Game.Tournament.Tests/TestCaseGameplayScreen.cs @@ -1,25 +1,23 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. -using System; -using System.Collections.Generic; using osu.Framework.Allocation; using osu.Game.Tests.Visual; +using osu.Game.Tournament.Components; using osu.Game.Tournament.Screens.Gameplay; namespace osu.Game.Tournament.Tests { - public class TestCaseGameplay : OsuTestScene + public class TestCaseGameplayScreen : OsuTestScene { - public override IReadOnlyList RequiredTypes => new[] - { - typeof(GameplayScreen) - }; + [Cached] + private MatchChatDisplay chat = new MatchChatDisplay(); [BackgroundDependencyLoader] private void load() { Add(new GameplayScreen()); + Add(chat); } } } diff --git a/osu.Game.Tournament/Components/MatchChatDisplay.cs b/osu.Game.Tournament/Components/MatchChatDisplay.cs index 174b215732..fbf6949540 100644 --- a/osu.Game.Tournament/Components/MatchChatDisplay.cs +++ b/osu.Game.Tournament/Components/MatchChatDisplay.cs @@ -4,9 +4,11 @@ using System.Linq; using osu.Framework.Allocation; using osu.Framework.Bindables; +using osu.Framework.Graphics; using osu.Game.Online.Chat; using osu.Game.Overlays.Chat; using osu.Game.Tournament.IPC; +using osuTK; using osuTK.Graphics; namespace osu.Game.Tournament.Components @@ -17,6 +19,16 @@ namespace osu.Game.Tournament.Components private ChannelManager manager; + public MatchChatDisplay() + { + RelativeSizeAxes = Axes.X; + Y = 100; + Size = new Vector2(0.45f, 112); + Margin = new MarginPadding(10); + Anchor = Anchor.BottomCentre; + Origin = Anchor.BottomCentre; + } + [BackgroundDependencyLoader(true)] private void load(MatchIPCInfo ipc) { diff --git a/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs b/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs index 9883f03581..ca7d017bf3 100644 --- a/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs +++ b/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs @@ -32,13 +32,15 @@ namespace osu.Game.Tournament.Screens.Gameplay private readonly Color4 red = new Color4(186, 0, 18, 255); private readonly Color4 blue = new Color4(17, 136, 170, 255); - [Resolved] + [Resolved(canBeNull: true)] private TournamentSceneManager sceneManager { get; set; } + [Resolved] + private MatchChatDisplay chat { get; set; } + [BackgroundDependencyLoader] - private void load(LadderInfo ladder, MatchIPCInfo ipc, MatchChatDisplay chat) + private void load(LadderInfo ladder, MatchIPCInfo ipc) { - this.chat = chat; this.ipc = ipc; AddRangeInternal(new Drawable[] @@ -132,7 +134,6 @@ namespace osu.Game.Tournament.Screens.Gameplay } private ScheduledDelegate scheduledOperation; - private MatchChatDisplay chat; private MatchScoreDisplay scoreDisplay; private TourneyState lastState; @@ -155,7 +156,7 @@ namespace osu.Game.Tournament.Screens.Gameplay void expand() { - chat.Expand(); + chat?.Expand(); using (BeginDelayedSequence(300, true)) { @@ -168,8 +169,8 @@ namespace osu.Game.Tournament.Screens.Gameplay { SongBar.Expanded = false; scoreDisplay.FadeOut(100); - using (chat.BeginDelayedSequence(500)) - chat.Contract(); + using (chat?.BeginDelayedSequence(500)) + chat?.Contract(); } switch (state.NewValue) diff --git a/osu.Game.Tournament/Screens/TournamentSceneManager.cs b/osu.Game.Tournament/Screens/TournamentSceneManager.cs index 6bc624dca0..cec4f52751 100644 --- a/osu.Game.Tournament/Screens/TournamentSceneManager.cs +++ b/osu.Game.Tournament/Screens/TournamentSceneManager.cs @@ -32,17 +32,8 @@ namespace osu.Game.Tournament.Screens private Container screens; private VideoSprite video; - //todo: make less temporary [Cached] - private MatchChatDisplay chat = new MatchChatDisplay - { - RelativeSizeAxes = Axes.X, - Y = 100, - Size = new Vector2(0.45f, 112), - Margin = new MarginPadding(10), - Anchor = Anchor.BottomCentre, - Origin = Anchor.BottomCentre, - }; + private MatchChatDisplay chat = new MatchChatDisplay(); private Container chatContainer; From 0db013b7825c50366ce45bcfed54631eca243b34 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 14 Jun 2019 17:08:26 +0900 Subject: [PATCH 222/317] Fix save button not being topmost --- osu.Game.Tournament/TournamentGameBase.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/osu.Game.Tournament/TournamentGameBase.cs b/osu.Game.Tournament/TournamentGameBase.cs index c773844cec..2d7e4cd83a 100644 --- a/osu.Game.Tournament/TournamentGameBase.cs +++ b/osu.Game.Tournament/TournamentGameBase.cs @@ -71,6 +71,7 @@ namespace osu.Game.Tournament Text = "Save Changes", Width = 140, Height = 50, + Depth = float.MinValue, Anchor = Anchor.BottomRight, Origin = Anchor.BottomRight, Padding = new MarginPadding(10), From 8da448fca793b2b4b4336f179a95ea2a9f7ac1a1 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 14 Jun 2019 17:08:44 +0900 Subject: [PATCH 223/317] Improve usability of grouping editor screen --- .../Groupings/GroupingsEditorScreen.cs | 90 ++++++++++++++----- 1 file changed, 66 insertions(+), 24 deletions(-) diff --git a/osu.Game.Tournament/Screens/Groupings/GroupingsEditorScreen.cs b/osu.Game.Tournament/Screens/Groupings/GroupingsEditorScreen.cs index 9c35ff21d4..1641b4205a 100644 --- a/osu.Game.Tournament/Screens/Groupings/GroupingsEditorScreen.cs +++ b/osu.Game.Tournament/Screens/Groupings/GroupingsEditorScreen.cs @@ -8,10 +8,12 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; using osu.Game.Graphics; +using osu.Game.Graphics.Containers; using osu.Game.Graphics.UserInterface; using osu.Game.Overlays.Settings; using osu.Game.Tournament.Components; using osu.Game.Tournament.Screens.Ladder.Components; +using osuTK; namespace osu.Game.Tournament.Screens.Groupings { @@ -28,26 +30,27 @@ namespace osu.Game.Tournament.Screens.Groupings RelativeSizeAxes = Axes.Both, Colour = OsuColour.Gray(0.2f), }, - new FillFlowContainer + new OsuScrollContainer { - Direction = FillDirection.Vertical, RelativeSizeAxes = Axes.Both, Width = 0.9f, Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, + Child = items = new FillFlowContainer + { + Direction = FillDirection.Vertical, + RelativeSizeAxes = Axes.X, + AutoSizeAxes = Axes.Y, + }, + }, + new ControlPanel + { Children = new Drawable[] { - items = new FillFlowContainer - { - Direction = FillDirection.Vertical, - RelativeSizeAxes = Axes.X, - AutoSizeAxes = Axes.Y, - }, new TriangleButton { - Margin = new MarginPadding(20), - Width = 100, - Text = "Add", + RelativeSizeAxes = Axes.X, + Text = "Add new", Action = addNew }, } @@ -70,7 +73,13 @@ namespace osu.Game.Tournament.Screens.Groupings private void addNew() { - items.Add(new GroupingRow(new TournamentGrouping { StartDate = { Value = DateTimeOffset.UtcNow } }, updateGroupings)); + items.Add(new GroupingRow(new TournamentGrouping + { + StartDate = + { + Value = DateTimeOffset.UtcNow + } + }, updateGroupings)); updateGroupings(); } @@ -85,31 +94,64 @@ namespace osu.Game.Tournament.Screens.Groupings public GroupingRow(TournamentGrouping grouping, Action onDelete) { + Margin = new MarginPadding(10); + Grouping = grouping; InternalChildren = new Drawable[] { + new Box + { + Colour = OsuColour.Gray(0.1f), + RelativeSizeAxes = Axes.Both, + }, new FillFlowContainer { + Margin = new MarginPadding(5), + Padding = new MarginPadding { Right = 160 }, + Spacing = new Vector2(5), Direction = FillDirection.Full, RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, Children = new Drawable[] { - new SettingsTextBox { Width = 0.3f, Bindable = Grouping.Name }, - new SettingsTextBox { Width = 0.3f, Bindable = Grouping.Description }, - new SettingsSlider { LabelText = "Best of", Width = 0.3f, Bindable = Grouping.BestOf }, - new DangerousSettingsButton + new SettingsTextBox { - Width = 0.1f, - Text = "Delete", - Action = () => - { - Expire(); - onDelete(); - } + LabelText = "Name", + Width = 0.33f, + Bindable = Grouping.Name + }, + new SettingsTextBox + { + LabelText = "Description", + Width = 0.33f, + Bindable = Grouping.Description + }, + new DateTextBox + { + LabelText = "Start Time", + Width = 0.33f, + Bindable = Grouping.StartDate + }, + new SettingsSlider + { + LabelText = "Best of", + Width = 0.33f, + Bindable = Grouping.BestOf }, - new DateTextBox { Width = 0.3f, Bindable = Grouping.StartDate }, } + }, + new DangerousSettingsButton + { + Anchor = Anchor.CentreRight, + Origin = Anchor.CentreRight, + RelativeSizeAxes = Axes.None, + Width = 150, + Text = "Delete", + Action = () => + { + Expire(); + onDelete(); + }, } }; From a7fcec8d9775faa43b80b336b085aca3f04aeac9 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 14 Jun 2019 17:17:47 +0900 Subject: [PATCH 224/317] Fix TournamentSceneManager test --- osu.Game.Tournament/Screens/TournamentSceneManager.cs | 8 ++++++-- osu.Game.Tournament/TournamentGame.cs | 3 +-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/osu.Game.Tournament/Screens/TournamentSceneManager.cs b/osu.Game.Tournament/Screens/TournamentSceneManager.cs index cec4f52751..083f26240b 100644 --- a/osu.Game.Tournament/Screens/TournamentSceneManager.cs +++ b/osu.Game.Tournament/Screens/TournamentSceneManager.cs @@ -10,7 +10,6 @@ using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Video; using osu.Framework.Platform; using osu.Game.Graphics.UserInterface; -using osu.Game.Screens; using osu.Game.Tournament.Components; using osu.Game.Tournament.Screens.Drawings; using osu.Game.Tournament.Screens.Gameplay; @@ -27,7 +26,7 @@ using osuTK.Graphics; namespace osu.Game.Tournament.Screens { [Cached] - public class TournamentSceneManager : OsuScreen + public class TournamentSceneManager : CompositeDrawable { private Container screens; private VideoSprite video; @@ -37,6 +36,11 @@ namespace osu.Game.Tournament.Screens private Container chatContainer; + public TournamentSceneManager() + { + RelativeSizeAxes = Axes.Both; + } + [BackgroundDependencyLoader] private void load(LadderInfo ladder, Storage storage) { diff --git a/osu.Game.Tournament/TournamentGame.cs b/osu.Game.Tournament/TournamentGame.cs index 0f142e4d74..c8c462a458 100644 --- a/osu.Game.Tournament/TournamentGame.cs +++ b/osu.Game.Tournament/TournamentGame.cs @@ -3,7 +3,6 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Sprites; -using osu.Framework.Screens; using osu.Game.Graphics; using osu.Game.Graphics.Cursor; using osu.Game.Tournament.Screens; @@ -19,7 +18,7 @@ namespace osu.Game.Tournament Add(new OsuContextMenuContainer { RelativeSizeAxes = Axes.Both, - Child = new ScreenStack(new TournamentSceneManager()) { RelativeSizeAxes = Axes.Both } + Child = new TournamentSceneManager() }); MenuCursorContainer.Cursor.Alpha = 0; From 9818637b8de5255cc44aa46734baf04d45cb2bed Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 14 Jun 2019 17:20:15 +0900 Subject: [PATCH 225/317] Fix MapPoolScreen test --- osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs b/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs index fb7a7a8983..47d5a36a4b 100644 --- a/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs +++ b/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs @@ -28,6 +28,9 @@ namespace osu.Game.Tournament.Screens.MapPool private readonly Bindable currentMatch = new Bindable(); + [Resolved(canBeNull: true)] + private TournamentSceneManager sceneManager { get; set; } + private TeamColour pickColour; private ChoiceType pickType; @@ -169,9 +172,6 @@ namespace osu.Game.Tournament.Screens.MapPool setNextMode(); } - [Resolved] - private TournamentSceneManager sceneManager { get; set; } - private ScheduledDelegate scheduledChange; private void addForBeatmap(int beatmapId) From d4ff9dc833dcbeed8060f7d4e253f4ca8f42412c Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 14 Jun 2019 17:25:07 +0900 Subject: [PATCH 226/317] TestCase -> TestScene --- .../{LadderTestCase.cs => LadderTestScene.cs} | 2 +- .../{TestCaseBeatmapPanel.cs => TestSceneBeatmapPanel.cs} | 2 +- .../{TestCaseGameplayScreen.cs => TestSceneGameplayScreen.cs} | 2 +- ...pingsEditorScreen.cs => TestSceneGroupingsEditorScreen.cs} | 4 ++-- .../{TestCaseLadderManager.cs => TestSceneLadderManager.cs} | 2 +- .../{TestCaseMapPool.cs => TestSceneMapPool.cs} | 2 +- ...stCaseMatchChatDisplay.cs => TestSceneMatchChatDisplay.cs} | 4 ++-- .../{TestCaseMatchPairings.cs => TestSceneMatchPairings.cs} | 4 ++-- ...CaseMatchScoreDisplay.cs => TestSceneMatchScoreDisplay.cs} | 4 ++-- .../{TestCaseSceneManager.cs => TestSceneSceneManager.cs} | 2 +- .../{TestCaseSchedule.cs => TestSceneSchedule.cs} | 2 +- .../{TestCaseShowcase.cs => TestSceneShowcase.cs} | 2 +- .../{TestCaseTeamIntro.cs => TestSceneTeamIntro.cs} | 2 +- .../{TestCaseTeamWin.cs => TestSceneTeamWin.cs} | 2 +- 14 files changed, 18 insertions(+), 18 deletions(-) rename osu.Game.Tournament.Tests/{LadderTestCase.cs => LadderTestScene.cs} (87%) rename osu.Game.Tournament.Tests/{TestCaseBeatmapPanel.cs => TestSceneBeatmapPanel.cs} (96%) rename osu.Game.Tournament.Tests/{TestCaseGameplayScreen.cs => TestSceneGameplayScreen.cs} (91%) rename osu.Game.Tournament.Tests/{TestCaseGroupingsEditorScreen.cs => TestSceneGroupingsEditorScreen.cs} (73%) rename osu.Game.Tournament.Tests/{TestCaseLadderManager.cs => TestSceneLadderManager.cs} (91%) rename osu.Game.Tournament.Tests/{TestCaseMapPool.cs => TestSceneMapPool.cs} (91%) rename osu.Game.Tournament.Tests/{TestCaseMatchChatDisplay.cs => TestSceneMatchChatDisplay.cs} (96%) rename osu.Game.Tournament.Tests/{TestCaseMatchPairings.cs => TestSceneMatchPairings.cs} (97%) rename osu.Game.Tournament.Tests/{TestCaseMatchScoreDisplay.cs => TestSceneMatchScoreDisplay.cs} (90%) rename osu.Game.Tournament.Tests/{TestCaseSceneManager.cs => TestSceneSceneManager.cs} (89%) rename osu.Game.Tournament.Tests/{TestCaseSchedule.cs => TestSceneSchedule.cs} (92%) rename osu.Game.Tournament.Tests/{TestCaseShowcase.cs => TestSceneShowcase.cs} (92%) rename osu.Game.Tournament.Tests/{TestCaseTeamIntro.cs => TestSceneTeamIntro.cs} (95%) rename osu.Game.Tournament.Tests/{TestCaseTeamWin.cs => TestSceneTeamWin.cs} (95%) diff --git a/osu.Game.Tournament.Tests/LadderTestCase.cs b/osu.Game.Tournament.Tests/LadderTestScene.cs similarity index 87% rename from osu.Game.Tournament.Tests/LadderTestCase.cs rename to osu.Game.Tournament.Tests/LadderTestScene.cs index 450626fd43..cb55f543f6 100644 --- a/osu.Game.Tournament.Tests/LadderTestCase.cs +++ b/osu.Game.Tournament.Tests/LadderTestScene.cs @@ -6,7 +6,7 @@ using osu.Game.Tests.Visual; namespace osu.Game.Tournament.Tests { - public class LadderTestCase : OsuTestScene + public class LadderTestScene : OsuTestScene { [Resolved] protected LadderInfo Ladder { get; private set; } diff --git a/osu.Game.Tournament.Tests/TestCaseBeatmapPanel.cs b/osu.Game.Tournament.Tests/TestSceneBeatmapPanel.cs similarity index 96% rename from osu.Game.Tournament.Tests/TestCaseBeatmapPanel.cs rename to osu.Game.Tournament.Tests/TestSceneBeatmapPanel.cs index 6ebdcc511b..50169adad3 100644 --- a/osu.Game.Tournament.Tests/TestCaseBeatmapPanel.cs +++ b/osu.Game.Tournament.Tests/TestSceneBeatmapPanel.cs @@ -15,7 +15,7 @@ using osu.Game.Tournament.Components; namespace osu.Game.Tournament.Tests { - public class TestCaseBeatmapPanel : OsuTestScene + public class TestSceneBeatmapPanel : OsuTestScene { [Resolved] private IAPIProvider api { get; set; } diff --git a/osu.Game.Tournament.Tests/TestCaseGameplayScreen.cs b/osu.Game.Tournament.Tests/TestSceneGameplayScreen.cs similarity index 91% rename from osu.Game.Tournament.Tests/TestCaseGameplayScreen.cs rename to osu.Game.Tournament.Tests/TestSceneGameplayScreen.cs index b44cb11ec4..1b73c798fc 100644 --- a/osu.Game.Tournament.Tests/TestCaseGameplayScreen.cs +++ b/osu.Game.Tournament.Tests/TestSceneGameplayScreen.cs @@ -8,7 +8,7 @@ using osu.Game.Tournament.Screens.Gameplay; namespace osu.Game.Tournament.Tests { - public class TestCaseGameplayScreen : OsuTestScene + public class TestSceneGameplayScreen : OsuTestScene { [Cached] private MatchChatDisplay chat = new MatchChatDisplay(); diff --git a/osu.Game.Tournament.Tests/TestCaseGroupingsEditorScreen.cs b/osu.Game.Tournament.Tests/TestSceneGroupingsEditorScreen.cs similarity index 73% rename from osu.Game.Tournament.Tests/TestCaseGroupingsEditorScreen.cs rename to osu.Game.Tournament.Tests/TestSceneGroupingsEditorScreen.cs index d3ef011535..993a233960 100644 --- a/osu.Game.Tournament.Tests/TestCaseGroupingsEditorScreen.cs +++ b/osu.Game.Tournament.Tests/TestSceneGroupingsEditorScreen.cs @@ -5,9 +5,9 @@ using osu.Game.Tournament.Screens.Groupings; namespace osu.Game.Tournament.Tests { - public class TestCaseGroupingsEditorScreen : LadderTestCase + public class TestSceneGroupingsEditorScreen : LadderTestScene { - public TestCaseGroupingsEditorScreen() + public TestSceneGroupingsEditorScreen() { Add(new GroupingsEditorScreen()); } diff --git a/osu.Game.Tournament.Tests/TestCaseLadderManager.cs b/osu.Game.Tournament.Tests/TestSceneLadderManager.cs similarity index 91% rename from osu.Game.Tournament.Tests/TestCaseLadderManager.cs rename to osu.Game.Tournament.Tests/TestSceneLadderManager.cs index 8704c3aec5..c9ea740f92 100644 --- a/osu.Game.Tournament.Tests/TestCaseLadderManager.cs +++ b/osu.Game.Tournament.Tests/TestSceneLadderManager.cs @@ -8,7 +8,7 @@ using osu.Game.Tournament.Screens.Ladder; namespace osu.Game.Tournament.Tests { - public class TestCaseLadderManager : LadderTestCase + public class TestSceneLadderManager : LadderTestScene { [BackgroundDependencyLoader] private void load() diff --git a/osu.Game.Tournament.Tests/TestCaseMapPool.cs b/osu.Game.Tournament.Tests/TestSceneMapPool.cs similarity index 91% rename from osu.Game.Tournament.Tests/TestCaseMapPool.cs rename to osu.Game.Tournament.Tests/TestSceneMapPool.cs index 6d2f64e7a7..43f4831a2a 100644 --- a/osu.Game.Tournament.Tests/TestCaseMapPool.cs +++ b/osu.Game.Tournament.Tests/TestSceneMapPool.cs @@ -8,7 +8,7 @@ using osu.Game.Tournament.Screens.MapPool; namespace osu.Game.Tournament.Tests { - public class TestCaseMapPool : LadderTestCase + public class TestSceneMapPool : LadderTestScene { public override IReadOnlyList RequiredTypes => new[] { diff --git a/osu.Game.Tournament.Tests/TestCaseMatchChatDisplay.cs b/osu.Game.Tournament.Tests/TestSceneMatchChatDisplay.cs similarity index 96% rename from osu.Game.Tournament.Tests/TestCaseMatchChatDisplay.cs rename to osu.Game.Tournament.Tests/TestSceneMatchChatDisplay.cs index cec6095598..fb31cd0f7c 100644 --- a/osu.Game.Tournament.Tests/TestCaseMatchChatDisplay.cs +++ b/osu.Game.Tournament.Tests/TestSceneMatchChatDisplay.cs @@ -14,7 +14,7 @@ using osuTK; namespace osu.Game.Tournament.Tests { - public class TestCaseMatchChatDisplay : OsuTestScene + public class TestSceneMatchChatDisplay : OsuTestScene { private readonly Channel testChannel = new Channel(); @@ -43,7 +43,7 @@ namespace osu.Game.Tournament.Tests [Cached] private MatchIPCInfo matchInfo = new MatchIPCInfo(); // hide parent - public TestCaseMatchChatDisplay() + public TestSceneMatchChatDisplay() { MatchChatDisplay chatDisplay; diff --git a/osu.Game.Tournament.Tests/TestCaseMatchPairings.cs b/osu.Game.Tournament.Tests/TestSceneMatchPairings.cs similarity index 97% rename from osu.Game.Tournament.Tests/TestCaseMatchPairings.cs rename to osu.Game.Tournament.Tests/TestSceneMatchPairings.cs index e7a329d35f..4d92e209be 100644 --- a/osu.Game.Tournament.Tests/TestCaseMatchPairings.cs +++ b/osu.Game.Tournament.Tests/TestSceneMatchPairings.cs @@ -11,7 +11,7 @@ using osu.Game.Tournament.Screens.Ladder.Components; namespace osu.Game.Tournament.Tests { - public class TestCaseMatchPairings : OsuTestScene + public class TestSceneMatchPairings : OsuTestScene { public override IReadOnlyList RequiredTypes => new[] { @@ -21,7 +21,7 @@ namespace osu.Game.Tournament.Tests typeof(DrawableTournamentTeam), }; - public TestCaseMatchPairings() + public TestSceneMatchPairings() { Container level1; Container level2; diff --git a/osu.Game.Tournament.Tests/TestCaseMatchScoreDisplay.cs b/osu.Game.Tournament.Tests/TestSceneMatchScoreDisplay.cs similarity index 90% rename from osu.Game.Tournament.Tests/TestCaseMatchScoreDisplay.cs rename to osu.Game.Tournament.Tests/TestSceneMatchScoreDisplay.cs index c7de5cf8ce..7e9b83a61b 100644 --- a/osu.Game.Tournament.Tests/TestCaseMatchScoreDisplay.cs +++ b/osu.Game.Tournament.Tests/TestSceneMatchScoreDisplay.cs @@ -9,12 +9,12 @@ using osu.Game.Tournament.Screens.Gameplay.Components; namespace osu.Game.Tournament.Tests { - public class TestCaseMatchScoreDisplay : LadderTestCase + public class TestSceneMatchScoreDisplay : LadderTestScene { [Cached(Type = typeof(MatchIPCInfo))] private MatchIPCInfo matchInfo = new MatchIPCInfo(); - public TestCaseMatchScoreDisplay() + public TestSceneMatchScoreDisplay() { Add(new MatchScoreDisplay { diff --git a/osu.Game.Tournament.Tests/TestCaseSceneManager.cs b/osu.Game.Tournament.Tests/TestSceneSceneManager.cs similarity index 89% rename from osu.Game.Tournament.Tests/TestCaseSceneManager.cs rename to osu.Game.Tournament.Tests/TestSceneSceneManager.cs index 7c1b794e16..385dc09d58 100644 --- a/osu.Game.Tournament.Tests/TestCaseSceneManager.cs +++ b/osu.Game.Tournament.Tests/TestSceneSceneManager.cs @@ -8,7 +8,7 @@ using osu.Game.Tournament.Screens; namespace osu.Game.Tournament.Tests { - public class TestCaseSceneManager : OsuTestScene + public class TestSceneSceneManager : OsuTestScene { [BackgroundDependencyLoader] private void load(Storage storage) diff --git a/osu.Game.Tournament.Tests/TestCaseSchedule.cs b/osu.Game.Tournament.Tests/TestSceneSchedule.cs similarity index 92% rename from osu.Game.Tournament.Tests/TestCaseSchedule.cs rename to osu.Game.Tournament.Tests/TestSceneSchedule.cs index b5a80d7bee..00eb4c4e41 100644 --- a/osu.Game.Tournament.Tests/TestCaseSchedule.cs +++ b/osu.Game.Tournament.Tests/TestSceneSchedule.cs @@ -9,7 +9,7 @@ using osu.Game.Tournament.Screens.Schedule; namespace osu.Game.Tournament.Tests { - public class TestCaseSchedule : OsuTestScene + public class TestSceneSchedule : OsuTestScene { public override IReadOnlyList RequiredTypes => new[] { diff --git a/osu.Game.Tournament.Tests/TestCaseShowcase.cs b/osu.Game.Tournament.Tests/TestSceneShowcase.cs similarity index 92% rename from osu.Game.Tournament.Tests/TestCaseShowcase.cs rename to osu.Game.Tournament.Tests/TestSceneShowcase.cs index c0816e3594..a4d518eedd 100644 --- a/osu.Game.Tournament.Tests/TestCaseShowcase.cs +++ b/osu.Game.Tournament.Tests/TestSceneShowcase.cs @@ -9,7 +9,7 @@ using osu.Game.Tournament.Screens.Showcase; namespace osu.Game.Tournament.Tests { - public class TestCaseShowcase : OsuTestScene + public class TestSceneShowcase : OsuTestScene { public override IReadOnlyList RequiredTypes => new[] { diff --git a/osu.Game.Tournament.Tests/TestCaseTeamIntro.cs b/osu.Game.Tournament.Tests/TestSceneTeamIntro.cs similarity index 95% rename from osu.Game.Tournament.Tests/TestCaseTeamIntro.cs rename to osu.Game.Tournament.Tests/TestSceneTeamIntro.cs index 78614518ce..b9245c0c25 100644 --- a/osu.Game.Tournament.Tests/TestCaseTeamIntro.cs +++ b/osu.Game.Tournament.Tests/TestSceneTeamIntro.cs @@ -10,7 +10,7 @@ using osu.Game.Tournament.Screens.TeamIntro; namespace osu.Game.Tournament.Tests { - public class TestCaseTeamIntro : LadderTestCase + public class TestSceneTeamIntro : LadderTestScene { [Cached] private readonly Bindable currentMatch = new Bindable(); diff --git a/osu.Game.Tournament.Tests/TestCaseTeamWin.cs b/osu.Game.Tournament.Tests/TestSceneTeamWin.cs similarity index 95% rename from osu.Game.Tournament.Tests/TestCaseTeamWin.cs rename to osu.Game.Tournament.Tests/TestSceneTeamWin.cs index df24877f09..3d6813b8d6 100644 --- a/osu.Game.Tournament.Tests/TestCaseTeamWin.cs +++ b/osu.Game.Tournament.Tests/TestSceneTeamWin.cs @@ -10,7 +10,7 @@ using osu.Game.Tournament.Screens.TeamWin; namespace osu.Game.Tournament.Tests { - public class TestCaseTeamWin : LadderTestCase + public class TestSceneTeamWin : LadderTestScene { [Cached] private readonly Bindable currentMatch = new Bindable(); From eb86d43d19ac790d9903e7cb24762bc479626204 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 14 Jun 2019 17:56:47 +0900 Subject: [PATCH 227/317] Update grouping dropdown after new groupings are added --- osu.Game.Tournament/LadderInfo.cs | 2 +- .../Screens/Groupings/GroupingsEditorScreen.cs | 6 ++++-- .../Ladder/Components/LadderEditorSettings.cs | 16 ++++++++++++---- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/osu.Game.Tournament/LadderInfo.cs b/osu.Game.Tournament/LadderInfo.cs index 9ddca460e2..fae4dcdede 100644 --- a/osu.Game.Tournament/LadderInfo.cs +++ b/osu.Game.Tournament/LadderInfo.cs @@ -13,7 +13,7 @@ namespace osu.Game.Tournament { public List Pairings = new List(); public List Progressions = new List(); - public List Groupings = new List(); + public BindableList Groupings = new BindableList(); public List Teams = new List(); [JsonIgnore] diff --git a/osu.Game.Tournament/Screens/Groupings/GroupingsEditorScreen.cs b/osu.Game.Tournament/Screens/Groupings/GroupingsEditorScreen.cs index 1641b4205a..c90a166581 100644 --- a/osu.Game.Tournament/Screens/Groupings/GroupingsEditorScreen.cs +++ b/osu.Game.Tournament/Screens/Groupings/GroupingsEditorScreen.cs @@ -68,7 +68,7 @@ namespace osu.Game.Tournament.Screens.Groupings protected override void LoadComplete() { base.LoadComplete(); - Scheduler.AddDelayed(() => LadderInfo.Groupings = items.Children.Select(c => c.Grouping).ToList(), 500, true); + Scheduler.AddDelayed(updateGroupings, 500, true); } private void addNew() @@ -80,12 +80,14 @@ namespace osu.Game.Tournament.Screens.Groupings Value = DateTimeOffset.UtcNow } }, updateGroupings)); + updateGroupings(); } private void updateGroupings() { - LadderInfo.Groupings = items.Children.Select(c => c.Grouping).ToList(); + LadderInfo.Groupings.Clear(); + LadderInfo.Groupings.AddRange(items.Children.Select(c => c.Grouping)); } public class GroupingRow : CompositeDrawable diff --git a/osu.Game.Tournament/Screens/Ladder/Components/LadderEditorSettings.cs b/osu.Game.Tournament/Screens/Ladder/Components/LadderEditorSettings.cs index be95b404f8..f701432ea0 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/LadderEditorSettings.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/LadderEditorSettings.cs @@ -39,8 +39,6 @@ namespace osu.Game.Tournament.Screens.Ladder.Components { var teamEntries = ladderInfo.Teams; - var groupingOptions = ladderInfo.Groupings.Prepend(new TournamentGrouping()); - Children = new Drawable[] { new Container @@ -77,8 +75,7 @@ namespace osu.Game.Tournament.Screens.Ladder.Components textboxTeam2 = new OsuTextBox { RelativeSizeAxes = Axes.X, Height = 20 }, groupingDropdown = new SettingsDropdown { - Bindable = new Bindable { Default = groupingOptions.First() }, - Items = groupingOptions + Bindable = new Bindable(), }, losersCheckbox = new PlayerCheckbox { @@ -91,6 +88,17 @@ namespace osu.Game.Tournament.Screens.Ladder.Components } }; + var groupingOptions = ladderInfo.Groupings.Prepend(new TournamentGrouping()); + + void updateDropdownItems() + { + groupingOptions = ladderInfo.Groupings.Prepend(new TournamentGrouping()); + groupingDropdown.Items = groupingOptions; + } + + ladderInfo.Groupings.ItemsRemoved += _ => updateDropdownItems(); + ladderInfo.Groupings.ItemsAdded += _ => updateDropdownItems(); + editorInfo.Selected.ValueChanged += selection => { textboxTeam1.Text = selection.NewValue?.Team1.Value?.Acronym; From ef21a9e1d2e6e1e115e9f12780db56e1e893c237 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 14 Jun 2019 19:16:20 +0900 Subject: [PATCH 228/317] Use bindable flow to avoid scheduled updates --- osu.Game.Tournament/LadderInfo.cs | 8 ++- .../Ladder/Components/DrawableMatchPairing.cs | 64 ++++++++++++++----- .../Ladder/Components/LadderEditorSettings.cs | 5 +- .../Ladder/Components/TournamentGrouping.cs | 1 + .../Screens/Ladder/LadderEditorScreen.cs | 29 ++------- .../Screens/Ladder/LadderScreen.cs | 47 ++++++++++++-- osu.Game.Tournament/TournamentGameBase.cs | 8 +++ 7 files changed, 111 insertions(+), 51 deletions(-) diff --git a/osu.Game.Tournament/LadderInfo.cs b/osu.Game.Tournament/LadderInfo.cs index fae4dcdede..08ef5d9062 100644 --- a/osu.Game.Tournament/LadderInfo.cs +++ b/osu.Game.Tournament/LadderInfo.cs @@ -11,10 +11,12 @@ namespace osu.Game.Tournament { public class LadderInfo { - public List Pairings = new List(); - public List Progressions = new List(); + public BindableList Pairings = new BindableList(); public BindableList Groupings = new BindableList(); - public List Teams = new List(); + public BindableList Teams = new BindableList(); + + // only used for serialisation + public List Progressions = new List(); [JsonIgnore] public Bindable CurrentMatch = new Bindable(); diff --git a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs index cf9fe3f2be..fcd7ed241a 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs @@ -1,6 +1,8 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. +using System; +using System.Collections.Generic; using osu.Framework.Allocation; using osu.Framework.Bindables; using osu.Framework.Graphics; @@ -73,26 +75,56 @@ namespace osu.Game.Tournament.Screens.Ladder.Components } }; - pairing.Team1.BindValueChanged(_ => updateTeams()); - pairing.Team2.BindValueChanged(_ => updateTeams()); - pairing.Team1Score.BindValueChanged(_ => updateWinConditions()); - pairing.Team2Score.BindValueChanged(_ => updateWinConditions()); - pairing.Grouping.BindValueChanged(_ => updateWinConditions()); - pairing.Completed.BindValueChanged(_ => updateProgression()); - pairing.Progression.BindValueChanged(_ => updateProgression()); - pairing.LosersProgression.BindValueChanged(_ => updateProgression()); - pairing.Losers.BindValueChanged(_ => updateTeams()); - pairing.Current.BindValueChanged(_ => updateCurrentMatch(), true); - pairing.Position.BindValueChanged(pos => + boundReference(pairing.Team1).BindValueChanged(_ => updateTeams()); + boundReference(pairing.Team2).BindValueChanged(_ => updateTeams()); + boundReference(pairing.Team1Score).BindValueChanged(_ => updateWinConditions()); + boundReference(pairing.Team2Score).BindValueChanged(_ => updateWinConditions()); + boundReference(pairing.Grouping).BindValueChanged(_ => { - if (IsDragged) return; - - Position = new Vector2(pos.NewValue.X, pos.NewValue.Y); + updateWinConditions(); + Changed?.Invoke(); + }); + boundReference(pairing.Completed).BindValueChanged(_ => updateProgression()); + boundReference(pairing.Progression).BindValueChanged(_ => updateProgression()); + boundReference(pairing.LosersProgression).BindValueChanged(_ => updateProgression()); + boundReference(pairing.Losers).BindValueChanged(_ => + { + updateTeams(); + Changed?.Invoke(); + }); + boundReference(pairing.Current).BindValueChanged(_ => updateCurrentMatch(), true); + boundReference(pairing.Position).BindValueChanged(pos => + { + if (!IsDragged) + Position = new Vector2(pos.NewValue.X, pos.NewValue.Y); + Changed?.Invoke(); }, true); updateTeams(); } + /// + /// Fired when somethign changed that requires a ladder redraw. + /// + public Action Changed; + + private readonly List refBindables = new List(); + + private T boundReference(T obj) + where T : IBindable + { + obj = (T)obj.GetBoundCopy(); + refBindables.Add(obj); + return obj; + } + + protected override void Dispose(bool isDisposing) + { + base.Dispose(isDisposing); + foreach (var b in refBindables) + b.UnbindAll(); + } + private void updateCurrentMatch() { if (Pairing.Current.Value) @@ -149,6 +181,8 @@ namespace osu.Game.Tournament.Screens.Ladder.Components transferProgression(Pairing.Progression?.Value, Pairing.Winner); transferProgression(Pairing.LosersProgression?.Value, Pairing.Loser); } + + Changed?.Invoke(); } private void transferProgression(MatchPairing destination, TournamentTeam team) @@ -273,7 +307,7 @@ namespace osu.Game.Tournament.Screens.Ladder.Components Pairing.Progression.Value = null; Pairing.LosersProgression.Value = null; - Expire(); + ladderInfo.Pairings.Remove(Pairing); } } } diff --git a/osu.Game.Tournament/Screens/Ladder/Components/LadderEditorSettings.cs b/osu.Game.Tournament/Screens/Ladder/Components/LadderEditorSettings.cs index f701432ea0..21d20e1175 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/LadderEditorSettings.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/LadderEditorSettings.cs @@ -2,6 +2,7 @@ // See the LICENCE file in the repository root for full licence text. using System; +using System.Collections.Generic; using System.Linq; using osu.Framework.Allocation; using osu.Framework.Bindables; @@ -88,7 +89,7 @@ namespace osu.Game.Tournament.Screens.Ladder.Components } }; - var groupingOptions = ladderInfo.Groupings.Prepend(new TournamentGrouping()); + IEnumerable groupingOptions = null; void updateDropdownItems() { @@ -99,6 +100,8 @@ namespace osu.Game.Tournament.Screens.Ladder.Components ladderInfo.Groupings.ItemsRemoved += _ => updateDropdownItems(); ladderInfo.Groupings.ItemsAdded += _ => updateDropdownItems(); + updateDropdownItems(); + editorInfo.Selected.ValueChanged += selection => { textboxTeam1.Text = selection.NewValue?.Team1.Value?.Acronym; diff --git a/osu.Game.Tournament/Screens/Ladder/Components/TournamentGrouping.cs b/osu.Game.Tournament/Screens/Ladder/Components/TournamentGrouping.cs index e38b684c28..d6e6b11f28 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/TournamentGrouping.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/TournamentGrouping.cs @@ -21,6 +21,7 @@ namespace osu.Game.Tournament.Screens.Ladder.Components public readonly Bindable StartDate = new Bindable(); + // only used for serialisation public List Pairings = new List(); public override string ToString() => Name.Value ?? "None"; diff --git a/osu.Game.Tournament/Screens/Ladder/LadderEditorScreen.cs b/osu.Game.Tournament/Screens/Ladder/LadderEditorScreen.cs index 4a35f1ad30..fc98753e0a 100644 --- a/osu.Game.Tournament/Screens/Ladder/LadderEditorScreen.cs +++ b/osu.Game.Tournament/Screens/Ladder/LadderEditorScreen.cs @@ -24,6 +24,8 @@ namespace osu.Game.Tournament.Screens.Ladder [Cached] private LadderEditorInfo editorInfo = new LadderEditorInfo(); + protected override bool DrawLoserPaths => true; + [BackgroundDependencyLoader] private void load() { @@ -35,32 +37,9 @@ namespace osu.Game.Tournament.Screens.Ladder }); } - private void updateInfo() - { - LadderInfo.Pairings = PairingsContainer.Select(p => p.Pairing).ToList(); - foreach (var g in LadderInfo.Groupings) - g.Pairings = LadderInfo.Pairings.Where(p => p.Grouping.Value == g).Select(p => p.ID).ToList(); - - LadderInfo.Progressions = LadderInfo.Pairings.Where(p => p.Progression.Value != null).Select(p => new TournamentProgression(p.ID, p.Progression.Value.ID)).Concat( - LadderInfo.Pairings.Where(p => p.LosersProgression.Value != null).Select(p => new TournamentProgression(p.ID, p.LosersProgression.Value.ID, true))) - .ToList(); - } - - protected override void AddPairing(MatchPairing pairing) - { - base.AddPairing(pairing); - updateInfo(); - } - - protected override void UpdateLayout() - { - base.UpdateLayout(); - updateInfo(); - } - public void BeginJoin(MatchPairing pairing, bool losers) { - ScrollContent.Add(new JoinVisualiser(PairingsContainer, pairing, losers, updateInfo)); + ScrollContent.Add(new JoinVisualiser(PairingsContainer, pairing, losers, UpdateLayout)); } public MenuItem[] ContextMenuItems @@ -75,7 +54,7 @@ namespace osu.Game.Tournament.Screens.Ladder new OsuMenuItem("Create new match", MenuItemType.Highlighted, () => { var pos = PairingsContainer.ToLocalSpace(GetContainingInputManager().CurrentState.Mouse.Position); - AddPairing(new MatchPairing { Position = { Value = new Point((int)pos.X, (int)pos.Y) } }); + LadderInfo.Pairings.Add(new MatchPairing { Position = { Value = new Point((int)pos.X, (int)pos.Y) } }); }), new OsuMenuItem("Reset teams", MenuItemType.Destructive, () => { diff --git a/osu.Game.Tournament/Screens/Ladder/LadderScreen.cs b/osu.Game.Tournament/Screens/Ladder/LadderScreen.cs index f2d4ebbb71..1457992003 100644 --- a/osu.Game.Tournament/Screens/Ladder/LadderScreen.cs +++ b/osu.Game.Tournament/Screens/Ladder/LadderScreen.cs @@ -57,16 +57,33 @@ namespace osu.Game.Tournament.Screens.Ladder } }; + void addPairing(MatchPairing pairing) => + PairingsContainer.Add(new DrawableMatchPairing(pairing, this is LadderEditorScreen) + { + Changed = () => layout.Invalidate() + }); + foreach (var pairing in LadderInfo.Pairings) - AddPairing(pairing); + addPairing(pairing); - // todo: fix this - Scheduler.AddDelayed(() => layout.Invalidate(), 1000, true); - } + LadderInfo.Groupings.ItemsAdded += _ => layout.Invalidate(); + LadderInfo.Groupings.ItemsRemoved += _ => layout.Invalidate(); - protected virtual void AddPairing(MatchPairing pairing) - { - PairingsContainer.Add(new DrawableMatchPairing(pairing, this is LadderEditorScreen)); + LadderInfo.Pairings.ItemsAdded += pairings => + { + foreach (var p in pairings) + addPairing(p); + layout.Invalidate(); + }; + + LadderInfo.Pairings.ItemsRemoved += pairings => + { + foreach (var p in pairings) + foreach (var d in PairingsContainer.Where(d => d.Pairing == p)) + d.Expire(); + + layout.Invalidate(); + }; } private Cached layout = new Cached(); @@ -82,6 +99,8 @@ namespace osu.Game.Tournament.Screens.Ladder private Color4 normalPathColour; private Color4 losersPathColour; + protected virtual bool DrawLoserPaths => false; + protected virtual void UpdateLayout() { paths.Clear(); @@ -103,6 +122,20 @@ namespace osu.Game.Tournament.Screens.Ladder else paths.Add(new ProgressionPath(pairing, dest) { Colour = pairing.Pairing.Losers.Value ? losersPathColour : normalPathColour }); } + + if (DrawLoserPaths) + { + if (pairing.Pairing.LosersProgression.Value != null) + { + var dest = PairingsContainer.FirstOrDefault(p => p.Pairing == pairing.Pairing.LosersProgression.Value); + + if (dest == null) + // clean up outdated progressions. + pairing.Pairing.LosersProgression.Value = null; + else + paths.Add(new ProgressionPath(pairing, dest) { Colour = losersPathColour.Opacity(0.1f) }); + } + } } foreach (var group in LadderInfo.Groupings) diff --git a/osu.Game.Tournament/TournamentGameBase.cs b/osu.Game.Tournament/TournamentGameBase.cs index 2d7e4cd83a..54d47625fa 100644 --- a/osu.Game.Tournament/TournamentGameBase.cs +++ b/osu.Game.Tournament/TournamentGameBase.cs @@ -21,6 +21,7 @@ using osu.Game.Online.API.Requests; using osu.Game.Rulesets; using osu.Game.Tournament.Components; using osu.Game.Tournament.IPC; +using osu.Game.Tournament.Screens.Ladder.Components; using osuTK.Input; namespace osu.Game.Tournament @@ -244,6 +245,13 @@ namespace osu.Game.Tournament protected virtual void SaveChanges() { + foreach (var g in ladder.Groupings) + g.Pairings = ladder.Pairings.Where(p => p.Grouping.Value == g).Select(p => p.ID).ToList(); + + ladder.Progressions = ladder.Pairings.Where(p => p.Progression.Value != null).Select(p => new TournamentProgression(p.ID, p.Progression.Value.ID)).Concat( + ladder.Pairings.Where(p => p.LosersProgression.Value != null).Select(p => new TournamentProgression(p.ID, p.LosersProgression.Value.ID, true))) + .ToList(); + using (var stream = storage.GetStream(bracket_filename, FileAccess.Write, FileMode.Create)) using (var sw = new StreamWriter(stream)) { From c9bd62e8157b9779157f75062cf40e1ee21a8565 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 14 Jun 2019 20:30:09 +0900 Subject: [PATCH 229/317] Use bindable logic for grouping name/description updates --- .../Groupings/GroupingsEditorScreen.cs | 29 ++++------ .../Components/DrawableTournamentGrouping.cs | 23 ++++++-- .../Ladder/Components/LadderEditorSettings.cs | 55 +++++++++++++------ 3 files changed, 66 insertions(+), 41 deletions(-) diff --git a/osu.Game.Tournament/Screens/Groupings/GroupingsEditorScreen.cs b/osu.Game.Tournament/Screens/Groupings/GroupingsEditorScreen.cs index c90a166581..87a975aadc 100644 --- a/osu.Game.Tournament/Screens/Groupings/GroupingsEditorScreen.cs +++ b/osu.Game.Tournament/Screens/Groupings/GroupingsEditorScreen.cs @@ -2,7 +2,6 @@ // See the LICENCE file in the repository root for full licence text. using System; -using System.Linq; using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; @@ -62,39 +61,31 @@ namespace osu.Game.Tournament.Screens.Groupings private void load() { foreach (var g in LadderInfo.Groupings) - items.Add(new GroupingRow(g, updateGroupings)); - } - - protected override void LoadComplete() - { - base.LoadComplete(); - Scheduler.AddDelayed(updateGroupings, 500, true); + items.Add(new GroupingRow(g)); } private void addNew() { - items.Add(new GroupingRow(new TournamentGrouping + var grouping = new TournamentGrouping { StartDate = { Value = DateTimeOffset.UtcNow } - }, updateGroupings)); + }; - updateGroupings(); - } - - private void updateGroupings() - { - LadderInfo.Groupings.Clear(); - LadderInfo.Groupings.AddRange(items.Children.Select(c => c.Grouping)); + items.Add(new GroupingRow(grouping)); + LadderInfo.Groupings.Add(grouping); } public class GroupingRow : CompositeDrawable { public readonly TournamentGrouping Grouping; - public GroupingRow(TournamentGrouping grouping, Action onDelete) + [Resolved] + private LadderInfo ladderInfo { get; set; } + + public GroupingRow(TournamentGrouping grouping) { Margin = new MarginPadding(10); @@ -152,7 +143,7 @@ namespace osu.Game.Tournament.Screens.Groupings Action = () => { Expire(); - onDelete(); + ladderInfo.Groupings.Remove(Grouping); }, } }; diff --git a/osu.Game.Tournament/Screens/Ladder/Components/DrawableTournamentGrouping.cs b/osu.Game.Tournament/Screens/Ladder/Components/DrawableTournamentGrouping.cs index 40adc24dc4..a3a7bf4f64 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/DrawableTournamentGrouping.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/DrawableTournamentGrouping.cs @@ -1,6 +1,8 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. +using JetBrains.Annotations; +using osu.Framework.Bindables; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Game.Graphics; @@ -11,8 +13,17 @@ namespace osu.Game.Tournament.Screens.Ladder.Components { public class DrawableTournamentGrouping : CompositeDrawable { + [UsedImplicitly] + private readonly Bindable name; + + [UsedImplicitly] + private readonly Bindable description; + public DrawableTournamentGrouping(TournamentGrouping grouping, bool losers = false) { + OsuSpriteText textName; + OsuSpriteText textDescription; + AutoSizeAxes = Axes.Both; InternalChild = new FillFlowContainer { @@ -20,16 +31,14 @@ namespace osu.Game.Tournament.Screens.Ladder.Components AutoSizeAxes = Axes.Both, Children = new Drawable[] { - new OsuSpriteText + textDescription = new OsuSpriteText { - Text = grouping.Description.Value.ToUpper(), Colour = Color4.Black, Origin = Anchor.TopCentre, Anchor = Anchor.TopCentre }, - new OsuSpriteText + textName = new OsuSpriteText { - Text = ((losers ? "Losers " : "") + grouping.Name).ToUpper(), Font = OsuFont.GetFont(weight: FontWeight.Bold), Colour = Color4.Black, Origin = Anchor.TopCentre, @@ -37,6 +46,12 @@ namespace osu.Game.Tournament.Screens.Ladder.Components }, } }; + + name = grouping.Name.GetBoundCopy(); + name.BindValueChanged(n => textName.Text = ((losers ? "Losers " : "") + grouping.Name).ToUpper(), true); + + description = grouping.Name.GetBoundCopy(); + description.BindValueChanged(n => textDescription.Text = grouping.Description.Value.ToUpper(), true); } } } diff --git a/osu.Game.Tournament/Screens/Ladder/Components/LadderEditorSettings.cs b/osu.Game.Tournament/Screens/Ladder/Components/LadderEditorSettings.cs index 21d20e1175..7d6b7ae57f 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/LadderEditorSettings.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/LadderEditorSettings.cs @@ -6,6 +6,7 @@ using System.Collections.Generic; using System.Linq; using osu.Framework.Allocation; using osu.Framework.Bindables; +using osu.Framework.Extensions.IEnumerableExtensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Input.Events; @@ -74,10 +75,7 @@ namespace osu.Game.Tournament.Screens.Ladder.Components }, }, textboxTeam2 = new OsuTextBox { RelativeSizeAxes = Axes.X, Height = 20 }, - groupingDropdown = new SettingsDropdown - { - Bindable = new Bindable(), - }, + groupingDropdown = new SettingsGroupingDropdown(ladderInfo.Groupings), losersCheckbox = new PlayerCheckbox { LabelText = "Losers Bracket", @@ -89,24 +87,11 @@ namespace osu.Game.Tournament.Screens.Ladder.Components } }; - IEnumerable groupingOptions = null; - - void updateDropdownItems() - { - groupingOptions = ladderInfo.Groupings.Prepend(new TournamentGrouping()); - groupingDropdown.Items = groupingOptions; - } - - ladderInfo.Groupings.ItemsRemoved += _ => updateDropdownItems(); - ladderInfo.Groupings.ItemsAdded += _ => updateDropdownItems(); - - updateDropdownItems(); - editorInfo.Selected.ValueChanged += selection => { textboxTeam1.Text = selection.NewValue?.Team1.Value?.Acronym; textboxTeam2.Text = selection.NewValue?.Team2.Value?.Acronym; - groupingDropdown.Bindable.Value = selection.NewValue?.Grouping.Value ?? groupingOptions.First(); + groupingDropdown.Bindable.Value = selection.NewValue?.Grouping.Value; losersCheckbox.Current.Value = selection.NewValue?.Losers.Value ?? false; dateTimeBox.Bindable.Value = selection.NewValue?.Date.Value ?? DateTimeOffset.UtcNow; }; @@ -164,5 +149,39 @@ namespace osu.Game.Tournament.Screens.Ladder.Components protected override void OnHoverLost(HoverLostEvent e) { } + + private class SettingsGroupingDropdown : SettingsDropdown + { + public SettingsGroupingDropdown(BindableList groupings) + { + Bindable = new Bindable(); + + foreach (var g in groupings.Prepend(new TournamentGrouping())) + add(g); + + groupings.ItemsRemoved += items => items.ForEach(i => Control.RemoveDropdownItem(i)); + groupings.ItemsAdded += items => items.ForEach(add); + } + + private readonly List refBindables = new List(); + + private T boundReference(T obj) + where T : IBindable + { + obj = (T)obj.GetBoundCopy(); + refBindables.Add(obj); + return obj; + } + + private void add(TournamentGrouping grouping) + { + Control.AddDropdownItem(grouping); + boundReference(grouping.Name).BindValueChanged(_ => + { + Control.RemoveDropdownItem(grouping); + Control.AddDropdownItem(grouping); + }); + } + } } } From 1a731782603d6eebd7918cabf2b2d4d56e183226 Mon Sep 17 00:00:00 2001 From: andy840119 Date: Sat, 15 Jun 2019 13:28:03 +0800 Subject: [PATCH 230/317] using FadeTo() instead of FadeIn()/FadeOut() --- osu.Game/Overlays/Mods/ModSection.cs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/osu.Game/Overlays/Mods/ModSection.cs b/osu.Game/Overlays/Mods/ModSection.cs index c110f58b7a..1eaa3deea4 100644 --- a/osu.Game/Overlays/Mods/ModSection.cs +++ b/osu.Game/Overlays/Mods/ModSection.cs @@ -52,17 +52,12 @@ namespace osu.Game.Overlays.Mods buttons = modContainers.OfType().ToArray(); var expand = value.Any(); - if (expand) - { - headerLabel.FadeIn(200); Show(); - } else - { - headerLabel.FadeOut(200); Hide(); - } + + headerLabel.FadeTo(expand ? 1 : 0, 200); } } From 84b4e877f8fa443d79969c7c25bf89847781b50b Mon Sep 17 00:00:00 2001 From: andy840119 Date: Sun, 16 Jun 2019 13:27:01 +0900 Subject: [PATCH 231/317] using FadeTo instead of show/hide headerLabel.FadeTo() is still remain because effect can be visible when expand== true --- osu.Game/Overlays/Mods/ModSection.cs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/osu.Game/Overlays/Mods/ModSection.cs b/osu.Game/Overlays/Mods/ModSection.cs index 1eaa3deea4..155e8ebb75 100644 --- a/osu.Game/Overlays/Mods/ModSection.cs +++ b/osu.Game/Overlays/Mods/ModSection.cs @@ -52,12 +52,8 @@ namespace osu.Game.Overlays.Mods buttons = modContainers.OfType().ToArray(); var expand = value.Any(); - if (expand) - Show(); - else - Hide(); - headerLabel.FadeTo(expand ? 1 : 0, 200); + this.FadeTo(expand ? 1 : 0); } } From bc35a30a257e3509fd360c43c55684dfc622b5f2 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 17 Jun 2019 12:27:53 +0900 Subject: [PATCH 232/317] Fix audio being dimmed during multiplayer --- osu.Game/Screens/Multi/Multiplayer.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/osu.Game/Screens/Multi/Multiplayer.cs b/osu.Game/Screens/Multi/Multiplayer.cs index 9e5c11e098..9939915e16 100644 --- a/osu.Game/Screens/Multi/Multiplayer.cs +++ b/osu.Game/Screens/Multi/Multiplayer.cs @@ -255,7 +255,6 @@ namespace osu.Game.Screens.Multi if (!track.IsRunning) { - game.Audio.AddItem(track); track.Seek(Beatmap.Value.Metadata.PreviewTime); track.Start(); } From c1d2fff651b090da3337f763324f77d516c9d47e Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 17 Jun 2019 12:44:19 +0900 Subject: [PATCH 233/317] Use RestartPoint --- osu.Game/Screens/Multi/Multiplayer.cs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/osu.Game/Screens/Multi/Multiplayer.cs b/osu.Game/Screens/Multi/Multiplayer.cs index 9939915e16..c76f132395 100644 --- a/osu.Game/Screens/Multi/Multiplayer.cs +++ b/osu.Game/Screens/Multi/Multiplayer.cs @@ -251,13 +251,11 @@ namespace osu.Game.Screens.Multi if (track != null) { + track.RestartPoint = Beatmap.Value.Metadata.PreviewTime; track.Looping = true; if (!track.IsRunning) - { - track.Seek(Beatmap.Value.Metadata.PreviewTime); - track.Start(); - } + track.Restart(); } createButton.Hide(); From 98f8b1d59a7b49813ebac070eda65421bddba92c Mon Sep 17 00:00:00 2001 From: iiSaLMaN Date: Mon, 17 Jun 2019 06:44:24 +0300 Subject: [PATCH 234/317] Use ModelBackedDrawable in DrawableFlag --- osu.Game/Users/Country.cs | 44 +++++++++++++-------------------------- 1 file changed, 15 insertions(+), 29 deletions(-) diff --git a/osu.Game/Users/Country.cs b/osu.Game/Users/Country.cs index b513b460bc..a84641d1fd 100644 --- a/osu.Game/Users/Country.cs +++ b/osu.Game/Users/Country.cs @@ -27,53 +27,39 @@ namespace osu.Game.Users public string FlagName; } - public class DrawableFlag : Container, IHasTooltip + public class DrawableFlag : ModelBackedDrawable, IHasTooltip { - private readonly Sprite sprite; private TextureStore textures; - private Country country; + private readonly Country country; public Country Country { - get => country; - set - { - if (value == country) - return; - - country = value; - - if (LoadState >= LoadState.Ready) - sprite.Texture = getFlagTexture(); - } + get => Model; + set => Model = value; } - public string TooltipText => country?.FullName; + public string TooltipText => Country?.FullName; public DrawableFlag(Country country = null) { this.country = country; - - Children = new Drawable[] - { - sprite = new Sprite - { - RelativeSizeAxes = Axes.Both, - }, - }; } [BackgroundDependencyLoader] private void load(TextureStore ts) { - if (ts == null) - throw new ArgumentNullException(nameof(ts)); - - textures = ts; - sprite.Texture = getFlagTexture(); + textures = ts ?? throw new ArgumentNullException(nameof(ts)); + Country = country; } - private Texture getFlagTexture() => textures.Get($@"Flags/{country?.FlagName ?? @"__"}"); + protected override Drawable CreateDrawable(Country country) + { + return new Sprite + { + RelativeSizeAxes = Axes.Both, + Texture = textures.Get($@"Flags/{country?.FlagName ?? @"__"}"), + }; + } } } From 4cb9563af20b43a6a9e64c1631c1ac2bcdaebfc5 Mon Sep 17 00:00:00 2001 From: iiSaLMaN Date: Mon, 17 Jun 2019 07:16:38 +0300 Subject: [PATCH 235/317] Use ModelBackedDrawable in UpdateableAvatar --- osu.Game/Users/UpdateableAvatar.cs | 34 ++++++------------------------ 1 file changed, 7 insertions(+), 27 deletions(-) diff --git a/osu.Game/Users/UpdateableAvatar.cs b/osu.Game/Users/UpdateableAvatar.cs index 7259468674..8eb08f963d 100644 --- a/osu.Game/Users/UpdateableAvatar.cs +++ b/osu.Game/Users/UpdateableAvatar.cs @@ -10,12 +10,8 @@ namespace osu.Game.Users /// /// An avatar which can update to a new user when needed. /// - public class UpdateableAvatar : Container + public class UpdateableAvatar : ModelBackedDrawable { - private Drawable displayedAvatar; - - private User user; - /// /// Whether to show a default guest representation on null user (as opposed to nothing). /// @@ -23,17 +19,8 @@ namespace osu.Game.Users public User User { - get => user; - set - { - if (user?.Id == value?.Id) - return; - - user = value; - - if (IsLoaded) - updateAvatar(); - } + get => Model; + set => Model = value; } /// @@ -41,17 +28,8 @@ namespace osu.Game.Users /// public readonly BindableBool OpenOnClick = new BindableBool(true); - protected override void LoadComplete() + protected override Drawable CreateDrawable(User user) { - base.LoadComplete(); - updateAvatar(); - } - - private void updateAvatar() - { - displayedAvatar?.FadeOut(300); - displayedAvatar?.Expire(); - if (user != null || ShowGuestOnNull) { var avatar = new Avatar(user) @@ -62,8 +40,10 @@ namespace osu.Game.Users avatar.OnLoadComplete += d => d.FadeInFromZero(300, Easing.OutQuint); avatar.OpenOnClick.BindTo(OpenOnClick); - Add(displayedAvatar = new DelayedLoadWrapper(avatar)); + return avatar; } + + return null; } } } From 3087099b32b6d79bee36f126ebbbad09279d8e35 Mon Sep 17 00:00:00 2001 From: iiSaLMaN Date: Mon, 17 Jun 2019 07:34:35 +0300 Subject: [PATCH 236/317] Use ModelBackedDrawable in DrawableRank --- osu.Game/Online/Leaderboards/DrawableRank.cs | 64 +++++++++----------- 1 file changed, 28 insertions(+), 36 deletions(-) diff --git a/osu.Game/Online/Leaderboards/DrawableRank.cs b/osu.Game/Online/Leaderboards/DrawableRank.cs index ce64395dde..b7beb4ffb0 100644 --- a/osu.Game/Online/Leaderboards/DrawableRank.cs +++ b/osu.Game/Online/Leaderboards/DrawableRank.cs @@ -8,67 +8,59 @@ using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Textures; using osu.Game.Scoring; +using System; namespace osu.Game.Online.Leaderboards { - public class DrawableRank : Container + public class DrawableRank : ModelBackedDrawable { - private readonly Sprite rankSprite; private TextureStore textures; - public ScoreRank Rank { get; private set; } + public ScoreRank Rank + { + get => Model; + set => Model = value; + } + + private ScoreRank rank; public DrawableRank(ScoreRank rank) { - Rank = rank; - - Children = new Drawable[] - { - rankSprite = new Sprite - { - RelativeSizeAxes = Axes.Both, - Anchor = Anchor.Centre, - Origin = Anchor.Centre, - FillMode = FillMode.Fit - }, - }; + this.rank = rank; } [BackgroundDependencyLoader] - private void load(TextureStore textures) + private void load(TextureStore ts) { - this.textures = textures; - updateTexture(); + textures = ts ?? throw new ArgumentNullException(nameof(ts)); + Rank = rank; } - private void updateTexture() + protected override Drawable CreateDrawable(ScoreRank rank) { - string textureName; + return new Sprite + { + RelativeSizeAxes = Axes.Both, + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + FillMode = FillMode.Fit, + Texture = textures.Get($"Grades/{getTextureName()}"), + }; + } + private string getTextureName() + { switch (Rank) { default: - textureName = Rank.GetDescription(); - break; + return Rank.GetDescription(); case ScoreRank.SH: - textureName = "SPlus"; - break; + return "SPlus"; case ScoreRank.XH: - textureName = "SSPlus"; - break; + return "SSPlus"; } - - rankSprite.Texture = textures.Get($@"Grades/{textureName}"); - } - - public void UpdateRank(ScoreRank newRank) - { - Rank = newRank; - - if (LoadState >= LoadState.Ready) - updateTexture(); } } } From e58d2594986c0381afa0fe3773afd3569681f549 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 14 Jun 2019 20:32:02 +0900 Subject: [PATCH 237/317] Create wireframe for team editor --- .../TestSceneTeamsEditorScreen.cs | 15 ++ .../Screens/Teams/TeamsEditorScreen.cs | 156 ++++++++++++++++++ .../Screens/TournamentSceneManager.cs | 5 +- 3 files changed, 175 insertions(+), 1 deletion(-) create mode 100644 osu.Game.Tournament.Tests/TestSceneTeamsEditorScreen.cs create mode 100644 osu.Game.Tournament/Screens/Teams/TeamsEditorScreen.cs diff --git a/osu.Game.Tournament.Tests/TestSceneTeamsEditorScreen.cs b/osu.Game.Tournament.Tests/TestSceneTeamsEditorScreen.cs new file mode 100644 index 0000000000..d3268219b3 --- /dev/null +++ b/osu.Game.Tournament.Tests/TestSceneTeamsEditorScreen.cs @@ -0,0 +1,15 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +using osu.Game.Tournament.Screens.Teams; + +namespace osu.Game.Tournament.Tests +{ + public class TestSceneTeamsEditorScreen : LadderTestScene + { + public TestSceneTeamsEditorScreen() + { + Add(new TeamsEditorScreen()); + } + } +} diff --git a/osu.Game.Tournament/Screens/Teams/TeamsEditorScreen.cs b/osu.Game.Tournament/Screens/Teams/TeamsEditorScreen.cs new file mode 100644 index 0000000000..b2392e5dc0 --- /dev/null +++ b/osu.Game.Tournament/Screens/Teams/TeamsEditorScreen.cs @@ -0,0 +1,156 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +using System; +using osu.Framework.Allocation; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Shapes; +using osu.Game.Graphics; +using osu.Game.Graphics.Containers; +using osu.Game.Graphics.UserInterface; +using osu.Game.Overlays.Settings; +using osu.Game.Tournament.Components; +using osu.Game.Tournament.Screens.Ladder.Components; +using osuTK; + +namespace osu.Game.Tournament.Screens.Teams +{ + public class TeamsEditorScreen : TournamentScreen, IProvideVideo + { + private readonly FillFlowContainer items; + + public TeamsEditorScreen() + { + AddRangeInternal(new Drawable[] + { + new Box + { + RelativeSizeAxes = Axes.Both, + Colour = OsuColour.Gray(0.2f), + }, + new OsuScrollContainer + { + RelativeSizeAxes = Axes.Both, + Width = 0.9f, + Anchor = Anchor.TopCentre, + Origin = Anchor.TopCentre, + Child = items = new FillFlowContainer + { + Direction = FillDirection.Vertical, + RelativeSizeAxes = Axes.X, + AutoSizeAxes = Axes.Y, + }, + }, + new ControlPanel + { + Children = new Drawable[] + { + new TriangleButton + { + RelativeSizeAxes = Axes.X, + Text = "Add new", + Action = addNew + }, + } + } + }); + } + + [BackgroundDependencyLoader] + private void load() + { + foreach (var g in LadderInfo.Teams) + items.Add(new TeamRow(g)); + } + + private void addNew() + { + var team = new TournamentTeam + { + StartDate = + { + Value = DateTimeOffset.UtcNow + } + }; + + items.Add(new TeamRow(team)); + LadderInfo.Teams.Add(team); + } + + public class TeamRow : CompositeDrawable + { + public readonly TournamentTeam Team; + + [Resolved] + private LadderInfo ladderInfo { get; set; } + + public TeamRow(TournamentTeam team) + { + Margin = new MarginPadding(10); + + Team = team; + InternalChildren = new Drawable[] + { + new Box + { + Colour = OsuColour.Gray(0.1f), + RelativeSizeAxes = Axes.Both, + }, + new FillFlowContainer + { + Margin = new MarginPadding(5), + Padding = new MarginPadding { Right = 160 }, + Spacing = new Vector2(5), + Direction = FillDirection.Full, + RelativeSizeAxes = Axes.X, + AutoSizeAxes = Axes.Y, + Children = new Drawable[] + { + new SettingsTextBox + { + LabelText = "Name", + Width = 0.33f, + Bindable = Team.Acronym + }, + new SettingsTextBox + { + LabelText = "Description", + Width = 0.33f, + Bindable = Team.Description + }, + new DateTextBox + { + LabelText = "Start Time", + Width = 0.33f, + Bindable = Team.StartDate + }, + new SettingsSlider + { + LabelText = "Best of", + Width = 0.33f, + Bindable = Team.BestOf + }, + } + }, + new DangerousSettingsButton + { + Anchor = Anchor.CentreRight, + Origin = Anchor.CentreRight, + RelativeSizeAxes = Axes.None, + Width = 150, + Text = "Delete", + Action = () => + { + Expire(); + ladderInfo.Teams.Remove(Team); + }, + } + }; + + RelativeSizeAxes = Axes.X; + AutoSizeAxes = Axes.Y; + } + } + } +} diff --git a/osu.Game.Tournament/Screens/TournamentSceneManager.cs b/osu.Game.Tournament/Screens/TournamentSceneManager.cs index 083f26240b..8393cd52a2 100644 --- a/osu.Game.Tournament/Screens/TournamentSceneManager.cs +++ b/osu.Game.Tournament/Screens/TournamentSceneManager.cs @@ -19,6 +19,7 @@ using osu.Game.Tournament.Screens.MapPool; using osu.Game.Tournament.Screens.Schedule; using osu.Game.Tournament.Screens.Showcase; using osu.Game.Tournament.Screens.TeamIntro; +using osu.Game.Tournament.Screens.Teams; using osu.Game.Tournament.Screens.TeamWin; using osuTK; using osuTK.Graphics; @@ -72,6 +73,7 @@ namespace osu.Game.Tournament.Screens new ScheduleScreen(), new LadderScreen(), new LadderEditorScreen(), + new TeamsEditorScreen(), new GroupingsEditorScreen(), new ShowcaseScreen(), new MapPoolScreen(), @@ -105,8 +107,9 @@ namespace osu.Game.Tournament.Screens Direction = FillDirection.Vertical, Children = new Drawable[] { - new OsuButton { RelativeSizeAxes = Axes.X, Text = "Bracket Editor", Action = () => SetScreen(typeof(LadderEditorScreen)) }, + new OsuButton { RelativeSizeAxes = Axes.X, Text = "Team Editor", Action = () => SetScreen(typeof(TeamsEditorScreen)) }, new OsuButton { RelativeSizeAxes = Axes.X, Text = "Groupings Editor", Action = () => SetScreen(typeof(GroupingsEditorScreen)) }, + new OsuButton { RelativeSizeAxes = Axes.X, Text = "Bracket Editor", Action = () => SetScreen(typeof(LadderEditorScreen)) }, new Container { RelativeSizeAxes = Axes.X, Height = 50 }, new OsuButton { RelativeSizeAxes = Axes.X, Text = "Drawings", Action = () => SetScreen(typeof(DrawingsScreen)) }, new OsuButton { RelativeSizeAxes = Axes.X, Text = "Showcase", Action = () => SetScreen(typeof(ShowcaseScreen)) }, From 93fc14426bb4c3000164321c188c321c922b41a2 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 17 Jun 2019 16:28:58 +0900 Subject: [PATCH 238/317] Convert TournamentTeam props to use binadbles --- .../.idea/runConfigurations/VisualTests.xml | 7 ++- .../TestSceneMatchChatDisplay.cs | 6 +- .../TestSceneMatchPairings.cs | 10 +-- .../TestSceneTeamIntro.cs | 4 +- osu.Game.Tournament.Tests/TestSceneTeamWin.cs | 4 +- .../Components/DrawableTournamentTeam.cs | 2 +- .../Components/TournamentTeam.cs | 41 ++++++------ .../Screens/Drawings/Components/Group.cs | 6 +- .../Components/StorageBackedTeamList.cs | 6 +- .../Screens/Drawings/DrawingsScreen.cs | 6 +- .../Gameplay/Components/MatchHeader.cs | 2 +- .../Ladder/Components/LadderEditorSettings.cs | 8 +-- .../Screens/Ladder/Components/MatchPairing.cs | 4 +- .../Screens/TeamIntro/TeamIntroScreen.cs | 2 +- .../Screens/TeamWin/TeamWinScreen.cs | 2 +- .../Screens/Teams/TeamsEditorScreen.cs | 62 ++++++++++++------- osu.Game.Tournament/TournamentGameBase.cs | 10 +-- 17 files changed, 103 insertions(+), 79 deletions(-) diff --git a/.idea/.idea.osu/.idea/runConfigurations/VisualTests.xml b/.idea/.idea.osu/.idea/runConfigurations/VisualTests.xml index 95cb4c0e62..34a83af3a1 100644 --- a/.idea/.idea.osu/.idea/runConfigurations/VisualTests.xml +++ b/.idea/.idea.osu/.idea/runConfigurations/VisualTests.xml @@ -6,12 +6,15 @@ public readonly BindableBool OpenOnClick = new BindableBool(true); + public UpdateableAvatar(User user = null) + { + User = user; + } + protected override Drawable CreateDrawable(User user) { if (user == null && !ShowGuestOnNull) diff --git a/osu.Game/Users/Drawables/DrawableFlag.cs b/osu.Game/Users/Drawables/DrawableFlag.cs index 5a2d1185fe..6f259d3253 100644 --- a/osu.Game/Users/Drawables/DrawableFlag.cs +++ b/osu.Game/Users/Drawables/DrawableFlag.cs @@ -19,7 +19,10 @@ namespace osu.Game.Users.Drawables set => Model = value; } - public UpdateableFlag(Country country = null) => Country = country; + public UpdateableFlag(Country country = null) + { + Country = country; + } protected override Drawable CreateDrawable(Country country) => new DrawableFlag(country) { @@ -33,7 +36,10 @@ namespace osu.Game.Users.Drawables public string TooltipText => country?.FullName; - public DrawableFlag(Country country) => this.country = country; + public DrawableFlag(Country country) + { + this.country = country; + } [BackgroundDependencyLoader] private void load(TextureStore ts) From 796afc0bf963b487a9da2749a96927900fb60832 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 18 Jun 2019 13:44:38 +0900 Subject: [PATCH 249/317] Rename and expand chat tests --- .../TestSceneGameplayScreen.cs | 2 +- ...=> TestSceneTournamentMatchChatDisplay.cs} | 47 ++++++++++++++----- ...splay.cs => TournamentMatchChatDisplay.cs} | 4 +- .../Screens/Gameplay/GameplayScreen.cs | 2 +- .../Screens/TournamentSceneManager.cs | 2 +- 5 files changed, 40 insertions(+), 17 deletions(-) rename osu.Game.Tournament.Tests/{TestSceneMatchChatDisplay.cs => TestSceneTournamentMatchChatDisplay.cs} (64%) rename osu.Game.Tournament/Components/{MatchChatDisplay.cs => TournamentMatchChatDisplay.cs} (96%) diff --git a/osu.Game.Tournament.Tests/TestSceneGameplayScreen.cs b/osu.Game.Tournament.Tests/TestSceneGameplayScreen.cs index 1b73c798fc..74d8615db0 100644 --- a/osu.Game.Tournament.Tests/TestSceneGameplayScreen.cs +++ b/osu.Game.Tournament.Tests/TestSceneGameplayScreen.cs @@ -11,7 +11,7 @@ namespace osu.Game.Tournament.Tests public class TestSceneGameplayScreen : OsuTestScene { [Cached] - private MatchChatDisplay chat = new MatchChatDisplay(); + private TournamentMatchChatDisplay chat = new TournamentMatchChatDisplay(); [BackgroundDependencyLoader] private void load() diff --git a/osu.Game.Tournament.Tests/TestSceneMatchChatDisplay.cs b/osu.Game.Tournament.Tests/TestSceneTournamentMatchChatDisplay.cs similarity index 64% rename from osu.Game.Tournament.Tests/TestSceneMatchChatDisplay.cs rename to osu.Game.Tournament.Tests/TestSceneTournamentMatchChatDisplay.cs index 4fccb2996b..8a3950bac3 100644 --- a/osu.Game.Tournament.Tests/TestSceneMatchChatDisplay.cs +++ b/osu.Game.Tournament.Tests/TestSceneTournamentMatchChatDisplay.cs @@ -10,13 +10,13 @@ using osu.Game.Tournament.Components; using osu.Game.Tournament.IPC; using osu.Game.Tournament.Screens.Ladder.Components; using osu.Game.Users; -using osuTK; namespace osu.Game.Tournament.Tests { - public class TestSceneMatchChatDisplay : OsuTestScene + public class TestSceneTournamentMatchChatDisplay : OsuTestScene { private readonly Channel testChannel = new Channel(); + private readonly Channel testChannel2 = new Channel(); private readonly User admin = new User { @@ -43,15 +43,14 @@ namespace osu.Game.Tournament.Tests [Cached] private MatchIPCInfo matchInfo = new MatchIPCInfo(); // hide parent - public TestSceneMatchChatDisplay() - { - MatchChatDisplay chatDisplay; + private readonly TournamentMatchChatDisplay chatDisplay; - Add(chatDisplay = new MatchChatDisplay + public TestSceneTournamentMatchChatDisplay() + { + Add(chatDisplay = new TournamentMatchChatDisplay { Anchor = Anchor.Centre, Origin = Anchor.Centre, - Size = new Vector2(400, 80) }); ladderInfo.CurrentMatch.Value = new MatchPairing @@ -73,35 +72,59 @@ namespace osu.Game.Tournament.Tests { base.LoadComplete(); - AddStep("message from admin", () => testChannel.AddLocalEcho(new LocalEchoMessage + AddStep("message from admin", () => testChannel.AddNewMessages(new Message(nextMessageId()) { Sender = admin, Content = "I am a wang!" })); - AddStep("message from team red", () => testChannel.AddLocalEcho(new LocalEchoMessage + AddStep("message from team red", () => testChannel.AddNewMessages(new Message(nextMessageId()) { Sender = redUser, Content = "I am team red." })); - AddStep("message from team red", () => testChannel.AddLocalEcho(new LocalEchoMessage + AddStep("message from team red", () => testChannel.AddNewMessages(new Message(nextMessageId()) { Sender = redUser, Content = "I plan to win!" })); - AddStep("message from team blue", () => testChannel.AddLocalEcho(new LocalEchoMessage + AddStep("message from team blue", () => testChannel.AddNewMessages(new Message(nextMessageId()) { Sender = blueUser, Content = "Not on my watch. Prepare to eat saaaaaaaaaand. Lots and lots of saaaaaaand." })); - AddStep("message from admin", () => testChannel.AddLocalEcho(new LocalEchoMessage + AddStep("message from admin", () => testChannel.AddNewMessages(new Message(nextMessageId()) { Sender = admin, Content = "Okay okay, calm down guys. Let's do this!" })); + + AddStep("multiple messages", () => testChannel.AddNewMessages(new Message(nextMessageId()) + { + Sender = admin, + Content = "I spam you!" + }, + new Message(nextMessageId()) + { + Sender = admin, + Content = "I spam you!!!1" + }, + new Message(nextMessageId()) + { + Sender = admin, + Content = "I spam you!1!1" + })); + + AddStep("change channel to 2", () => chatDisplay.Channel.Value = testChannel2); + + AddStep("change channel to 1", () => chatDisplay.Channel.Value = testChannel); } + + private int messageId; + + private long? nextMessageId() => messageId++; } } diff --git a/osu.Game.Tournament/Components/MatchChatDisplay.cs b/osu.Game.Tournament/Components/TournamentMatchChatDisplay.cs similarity index 96% rename from osu.Game.Tournament/Components/MatchChatDisplay.cs rename to osu.Game.Tournament/Components/TournamentMatchChatDisplay.cs index fbf6949540..2afbb0f5ff 100644 --- a/osu.Game.Tournament/Components/MatchChatDisplay.cs +++ b/osu.Game.Tournament/Components/TournamentMatchChatDisplay.cs @@ -13,13 +13,13 @@ using osuTK.Graphics; namespace osu.Game.Tournament.Components { - public class MatchChatDisplay : StandAloneChatDisplay + public class TournamentMatchChatDisplay : StandAloneChatDisplay { private readonly Bindable chatChannel = new Bindable(); private ChannelManager manager; - public MatchChatDisplay() + public TournamentMatchChatDisplay() { RelativeSizeAxes = Axes.X; Y = 100; diff --git a/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs b/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs index ca7d017bf3..fad1919510 100644 --- a/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs +++ b/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs @@ -36,7 +36,7 @@ namespace osu.Game.Tournament.Screens.Gameplay private TournamentSceneManager sceneManager { get; set; } [Resolved] - private MatchChatDisplay chat { get; set; } + private TournamentMatchChatDisplay chat { get; set; } [BackgroundDependencyLoader] private void load(LadderInfo ladder, MatchIPCInfo ipc) diff --git a/osu.Game.Tournament/Screens/TournamentSceneManager.cs b/osu.Game.Tournament/Screens/TournamentSceneManager.cs index f1a2f2219b..2c620f4e56 100644 --- a/osu.Game.Tournament/Screens/TournamentSceneManager.cs +++ b/osu.Game.Tournament/Screens/TournamentSceneManager.cs @@ -32,7 +32,7 @@ namespace osu.Game.Tournament.Screens private TourneyVideo video; [Cached] - private MatchChatDisplay chat = new MatchChatDisplay(); + private TournamentMatchChatDisplay chat = new TournamentMatchChatDisplay(); private Container chatContainer; From 40eb6f49860887d7aebb4828b4a81fbbb1ef07a2 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 18 Jun 2019 14:14:36 +0900 Subject: [PATCH 250/317] Undo ordering change to OsuFont --- osu.Game/Graphics/OsuFont.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Graphics/OsuFont.cs b/osu.Game/Graphics/OsuFont.cs index 2c2f075563..22250d4a56 100644 --- a/osu.Game/Graphics/OsuFont.cs +++ b/osu.Game/Graphics/OsuFont.cs @@ -70,7 +70,7 @@ namespace osu.Game.Graphics string weightString = weight.ToString(); // Only exo has an explicit "regular" weight, other fonts do not - if (weight == FontWeight.Regular && family != GetFamilyString(Typeface.Exo)) + if (family != GetFamilyString(Typeface.Exo) && weight == FontWeight.Regular) weightString = string.Empty; return weightString; From 5bb8649f3b3502707db16c9a5963d74b7f98039a Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 18 Jun 2019 14:22:59 +0900 Subject: [PATCH 251/317] Remove unused property from chat message --- osu.Game/Online/Chat/Message.cs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/osu.Game/Online/Chat/Message.cs b/osu.Game/Online/Chat/Message.cs index 62f20daddf..2e41038a59 100644 --- a/osu.Game/Online/Chat/Message.cs +++ b/osu.Game/Online/Chat/Message.cs @@ -13,10 +13,6 @@ namespace osu.Game.Online.Chat [JsonProperty(@"message_id")] public readonly long? Id; - //todo: this should be inside sender. - [JsonProperty(@"sender_id")] - public long UserId; - [JsonProperty(@"channel_id")] public long ChannelId; From 6823ba1ab08ce335f08b7b5a82c8c715cce2e315 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 18 Jun 2019 14:24:44 +0900 Subject: [PATCH 252/317] Unbind from previous bindable when rebinding a SettingsItem --- osu.Game/Overlays/Settings/SettingsItem.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/osu.Game/Overlays/Settings/SettingsItem.cs b/osu.Game/Overlays/Settings/SettingsItem.cs index 4776cd6442..ae840c8c00 100644 --- a/osu.Game/Overlays/Settings/SettingsItem.cs +++ b/osu.Game/Overlays/Settings/SettingsItem.cs @@ -63,6 +63,9 @@ namespace osu.Game.Overlays.Settings set { + if (bindable != null) + controlWithCurrent?.Current.UnbindFrom(bindable); + bindable = value; controlWithCurrent?.Current.BindTo(bindable); From 4f5abeb79f3093503db833c084f40e8016974219 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 18 Jun 2019 14:44:15 +0900 Subject: [PATCH 253/317] Grouping -> Round --- .../TestSceneGroupingsEditorScreen.cs | 4 +- .../TestSceneTeamIntro.cs | 2 +- osu.Game.Tournament.Tests/TestSceneTeamWin.cs | 2 +- osu.Game.Tournament/IPC/FileBasedIPC.cs | 2 +- osu.Game.Tournament/LadderInfo.cs | 2 +- .../Gameplay/Components/MatchHeader.cs | 2 +- .../Ladder/Components/DrawableMatchPairing.cs | 10 ++--- ...Grouping.cs => DrawableTournamentRound.cs} | 12 +++--- .../Ladder/Components/LadderEditorSettings.cs | 40 +++++++++---------- .../Screens/Ladder/Components/MatchPairing.cs | 4 +- .../{GroupingBeatmap.cs => RoundBeatmap.cs} | 2 +- ...urnamentGrouping.cs => TournamentRound.cs} | 4 +- .../Screens/Ladder/LadderScreen.cs | 16 ++++---- .../Screens/MapPool/MapPoolScreen.cs | 6 +-- .../RoundEditorScreen.cs} | 38 +++++++++--------- .../Screens/Schedule/ScheduleScreen.cs | 2 +- .../Screens/TeamIntro/TeamIntroScreen.cs | 2 +- .../Screens/TeamWin/TeamWinScreen.cs | 2 +- .../Screens/Teams/TeamsEditorScreen.cs | 4 +- .../Screens/TournamentSceneManager.cs | 6 +-- osu.Game.Tournament/TournamentGameBase.cs | 22 +++++----- 21 files changed, 92 insertions(+), 92 deletions(-) rename osu.Game.Tournament/Screens/Ladder/Components/{DrawableTournamentGrouping.cs => DrawableTournamentRound.cs} (82%) rename osu.Game.Tournament/Screens/Ladder/Components/{GroupingBeatmap.cs => RoundBeatmap.cs} (91%) rename osu.Game.Tournament/Screens/Ladder/Components/{TournamentGrouping.cs => TournamentRound.cs} (87%) rename osu.Game.Tournament/Screens/{Groupings/GroupingsEditorScreen.cs => Rounds/RoundEditorScreen.cs} (80%) diff --git a/osu.Game.Tournament.Tests/TestSceneGroupingsEditorScreen.cs b/osu.Game.Tournament.Tests/TestSceneGroupingsEditorScreen.cs index 993a233960..0ef19c2948 100644 --- a/osu.Game.Tournament.Tests/TestSceneGroupingsEditorScreen.cs +++ b/osu.Game.Tournament.Tests/TestSceneGroupingsEditorScreen.cs @@ -1,7 +1,7 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. -using osu.Game.Tournament.Screens.Groupings; +using osu.Game.Tournament.Screens.Rounds; namespace osu.Game.Tournament.Tests { @@ -9,7 +9,7 @@ namespace osu.Game.Tournament.Tests { public TestSceneGroupingsEditorScreen() { - Add(new GroupingsEditorScreen()); + Add(new RoundEditorScreen()); } } } diff --git a/osu.Game.Tournament.Tests/TestSceneTeamIntro.cs b/osu.Game.Tournament.Tests/TestSceneTeamIntro.cs index 7d10923949..560a8f9521 100644 --- a/osu.Game.Tournament.Tests/TestSceneTeamIntro.cs +++ b/osu.Game.Tournament.Tests/TestSceneTeamIntro.cs @@ -21,7 +21,7 @@ namespace osu.Game.Tournament.Tests var pairing = new MatchPairing(); pairing.Team1.Value = Ladder.Teams.FirstOrDefault(t => t.Acronym.Value == "USA"); pairing.Team2.Value = Ladder.Teams.FirstOrDefault(t => t.Acronym.Value == "JPN"); - pairing.Grouping.Value = Ladder.Groupings.FirstOrDefault(g => g.Name.Value == "Finals"); + pairing.Round.Value = Ladder.Rounds.FirstOrDefault(g => g.Name.Value == "Finals"); currentMatch.Value = pairing; Add(new TeamIntroScreen diff --git a/osu.Game.Tournament.Tests/TestSceneTeamWin.cs b/osu.Game.Tournament.Tests/TestSceneTeamWin.cs index 1ef81b7550..9f642103de 100644 --- a/osu.Game.Tournament.Tests/TestSceneTeamWin.cs +++ b/osu.Game.Tournament.Tests/TestSceneTeamWin.cs @@ -21,7 +21,7 @@ namespace osu.Game.Tournament.Tests var pairing = new MatchPairing(); pairing.Team1.Value = Ladder.Teams.FirstOrDefault(t => t.Acronym.Value == "USA"); pairing.Team2.Value = Ladder.Teams.FirstOrDefault(t => t.Acronym.Value == "JPN"); - pairing.Grouping.Value = Ladder.Groupings.FirstOrDefault(g => g.Name.Value == "Finals"); + pairing.Round.Value = Ladder.Rounds.FirstOrDefault(g => g.Name.Value == "Finals"); currentMatch.Value = pairing; Add(new TeamWinScreen diff --git a/osu.Game.Tournament/IPC/FileBasedIPC.cs b/osu.Game.Tournament/IPC/FileBasedIPC.cs index 8be10e2089..438e32c20f 100644 --- a/osu.Game.Tournament/IPC/FileBasedIPC.cs +++ b/osu.Game.Tournament/IPC/FileBasedIPC.cs @@ -61,7 +61,7 @@ namespace osu.Game.Tournament.IPC { lastBeatmapId = beatmapId; - var existing = ladder.CurrentMatch.Value?.Grouping.Value?.Beatmaps.FirstOrDefault(b => b.ID == beatmapId && b.BeatmapInfo != null); + var existing = ladder.CurrentMatch.Value?.Round.Value?.Beatmaps.FirstOrDefault(b => b.ID == beatmapId && b.BeatmapInfo != null); if (existing != null) Beatmap.Value = existing.BeatmapInfo; diff --git a/osu.Game.Tournament/LadderInfo.cs b/osu.Game.Tournament/LadderInfo.cs index 08ef5d9062..fc825d1a9c 100644 --- a/osu.Game.Tournament/LadderInfo.cs +++ b/osu.Game.Tournament/LadderInfo.cs @@ -12,7 +12,7 @@ namespace osu.Game.Tournament public class LadderInfo { public BindableList Pairings = new BindableList(); - public BindableList Groupings = new BindableList(); + public BindableList Rounds = new BindableList(); public BindableList Teams = new BindableList(); // only used for serialisation diff --git a/osu.Game.Tournament/Screens/Gameplay/Components/MatchHeader.cs b/osu.Game.Tournament/Screens/Gameplay/Components/MatchHeader.cs index c921967836..71cfacdc32 100644 --- a/osu.Game.Tournament/Screens/Gameplay/Components/MatchHeader.cs +++ b/osu.Game.Tournament/Screens/Gameplay/Components/MatchHeader.cs @@ -218,7 +218,7 @@ namespace osu.Game.Tournament.Screens.Gameplay.Components Anchor = Anchor.Centre, Origin = Anchor.Centre, Colour = Color4.White, - Text = match.NewValue.Grouping.Value?.Name.Value ?? "Unknown Grouping", + Text = match.NewValue.Round.Value?.Name.Value ?? "Unknown Round", Font = TournamentFont.GetFont(typeface: TournamentTypeface.Aquatico, weight: FontWeight.Regular, size: 18), }, }; diff --git a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs index fcd7ed241a..35741cbb55 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs @@ -79,7 +79,7 @@ namespace osu.Game.Tournament.Screens.Ladder.Components boundReference(pairing.Team2).BindValueChanged(_ => updateTeams()); boundReference(pairing.Team1Score).BindValueChanged(_ => updateWinConditions()); boundReference(pairing.Team2Score).BindValueChanged(_ => updateWinConditions()); - boundReference(pairing.Grouping).BindValueChanged(_ => + boundReference(pairing.Round).BindValueChanged(_ => { updateWinConditions(); Changed?.Invoke(); @@ -210,12 +210,12 @@ namespace osu.Game.Tournament.Screens.Ladder.Components private void updateWinConditions() { - if (Pairing.Grouping.Value == null) return; + if (Pairing.Round.Value == null) return; - var instaWinAmount = Pairing.Grouping.Value.BestOf.Value / 2; + var instaWinAmount = Pairing.Round.Value.BestOf.Value / 2; - Pairing.Completed.Value = Pairing.Grouping.Value.BestOf.Value > 0 - && (Pairing.Team1Score.Value + Pairing.Team2Score.Value >= Pairing.Grouping.Value.BestOf.Value || Pairing.Team1Score.Value > instaWinAmount || Pairing.Team2Score.Value > instaWinAmount); + Pairing.Completed.Value = Pairing.Round.Value.BestOf.Value > 0 + && (Pairing.Team1Score.Value + Pairing.Team2Score.Value >= Pairing.Round.Value.BestOf.Value || Pairing.Team1Score.Value > instaWinAmount || Pairing.Team2Score.Value > instaWinAmount); } protected override void LoadComplete() diff --git a/osu.Game.Tournament/Screens/Ladder/Components/DrawableTournamentGrouping.cs b/osu.Game.Tournament/Screens/Ladder/Components/DrawableTournamentRound.cs similarity index 82% rename from osu.Game.Tournament/Screens/Ladder/Components/DrawableTournamentGrouping.cs rename to osu.Game.Tournament/Screens/Ladder/Components/DrawableTournamentRound.cs index a3a7bf4f64..844c89a968 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/DrawableTournamentGrouping.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/DrawableTournamentRound.cs @@ -11,7 +11,7 @@ using osuTK.Graphics; namespace osu.Game.Tournament.Screens.Ladder.Components { - public class DrawableTournamentGrouping : CompositeDrawable + public class DrawableTournamentRound : CompositeDrawable { [UsedImplicitly] private readonly Bindable name; @@ -19,7 +19,7 @@ namespace osu.Game.Tournament.Screens.Ladder.Components [UsedImplicitly] private readonly Bindable description; - public DrawableTournamentGrouping(TournamentGrouping grouping, bool losers = false) + public DrawableTournamentRound(TournamentRound round, bool losers = false) { OsuSpriteText textName; OsuSpriteText textDescription; @@ -47,11 +47,11 @@ namespace osu.Game.Tournament.Screens.Ladder.Components } }; - name = grouping.Name.GetBoundCopy(); - name.BindValueChanged(n => textName.Text = ((losers ? "Losers " : "") + grouping.Name).ToUpper(), true); + name = round.Name.GetBoundCopy(); + name.BindValueChanged(n => textName.Text = ((losers ? "Losers " : "") + round.Name).ToUpper(), true); - description = grouping.Name.GetBoundCopy(); - description.BindValueChanged(n => textDescription.Text = grouping.Description.Value.ToUpper(), true); + description = round.Name.GetBoundCopy(); + description.BindValueChanged(n => textDescription.Text = round.Description.Value.ToUpper(), true); } } } diff --git a/osu.Game.Tournament/Screens/Ladder/Components/LadderEditorSettings.cs b/osu.Game.Tournament/Screens/Ladder/Components/LadderEditorSettings.cs index 4c280519df..a4b74f00a2 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/LadderEditorSettings.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/LadderEditorSettings.cs @@ -20,7 +20,7 @@ namespace osu.Game.Tournament.Screens.Ladder.Components protected override string Title => @"ladder"; - private SettingsDropdown groupingDropdown; + private SettingsDropdown roundDropdown; private PlayerCheckbox losersCheckbox; private DateTextBox dateTimeBox; private SettingsTeamDropdown team1Dropdown; @@ -39,14 +39,14 @@ namespace osu.Game.Tournament.Screens.Ladder.Components { team1Dropdown = new SettingsTeamDropdown(ladderInfo.Teams) { LabelText = "Team 1" }, team2Dropdown = new SettingsTeamDropdown(ladderInfo.Teams) { LabelText = "Team 2" }, - groupingDropdown = new SettingsGroupingDropdown(ladderInfo.Groupings) { LabelText = "Grouping" }, + roundDropdown = new SettingsRoundDropdown(ladderInfo.Rounds) { LabelText = "Round" }, losersCheckbox = new PlayerCheckbox { LabelText = "Losers Bracket" }, dateTimeBox = new DateTextBox { LabelText = "Match Time" }, }; editorInfo.Selected.ValueChanged += selection => { - groupingDropdown.Bindable = selection.NewValue?.Grouping; + roundDropdown.Bindable = selection.NewValue?.Round; losersCheckbox.Current = selection.NewValue?.Losers; dateTimeBox.Bindable = selection.NewValue?.Date; @@ -54,11 +54,11 @@ namespace osu.Game.Tournament.Screens.Ladder.Components team2Dropdown.Bindable = selection.NewValue?.Team2; }; - groupingDropdown.Bindable.ValueChanged += grouping => + roundDropdown.Bindable.ValueChanged += round => { - if (editorInfo.Selected.Value?.Date.Value < grouping.NewValue?.StartDate.Value) + if (editorInfo.Selected.Value?.Date.Value < round.NewValue?.StartDate.Value) { - editorInfo.Selected.Value.Date.Value = grouping.NewValue.StartDate.Value; + editorInfo.Selected.Value.Date.Value = round.NewValue.StartDate.Value; editorInfo.Selected.TriggerChange(); } }; @@ -79,17 +79,17 @@ namespace osu.Game.Tournament.Screens.Ladder.Components { } - private class SettingsGroupingDropdown : SettingsDropdown + private class SettingsRoundDropdown : SettingsDropdown { - public SettingsGroupingDropdown(BindableList groupings) + public SettingsRoundDropdown(BindableList rounds) { - Bindable = new Bindable(); + Bindable = new Bindable(); - foreach (var g in groupings.Prepend(new TournamentGrouping())) - add(g); + foreach (var r in rounds.Prepend(new TournamentRound())) + add(r); - groupings.ItemsRemoved += items => items.ForEach(i => Control.RemoveDropdownItem(i)); - groupings.ItemsAdded += items => items.ForEach(add); + rounds.ItemsRemoved += items => items.ForEach(i => Control.RemoveDropdownItem(i)); + rounds.ItemsAdded += items => items.ForEach(add); } private readonly List refBindables = new List(); @@ -102,13 +102,13 @@ namespace osu.Game.Tournament.Screens.Ladder.Components return obj; } - private void add(TournamentGrouping grouping) + private void add(TournamentRound round) { - Control.AddDropdownItem(grouping); - boundReference(grouping.Name).BindValueChanged(_ => + Control.AddDropdownItem(round); + boundReference(round.Name).BindValueChanged(_ => { - Control.RemoveDropdownItem(grouping); - Control.AddDropdownItem(grouping); + Control.RemoveDropdownItem(round); + Control.AddDropdownItem(round); }); } } @@ -117,8 +117,8 @@ namespace osu.Game.Tournament.Screens.Ladder.Components { public SettingsTeamDropdown(BindableList teams) { - foreach (var g in teams.Prepend(new TournamentTeam())) - add(g); + foreach (var t in teams.Prepend(new TournamentTeam())) + add(t); teams.ItemsRemoved += items => items.ForEach(i => Control.RemoveDropdownItem(i)); teams.ItemsAdded += items => items.ForEach(add); diff --git a/osu.Game.Tournament/Screens/Ladder/Components/MatchPairing.cs b/osu.Game.Tournament/Screens/Ladder/Components/MatchPairing.cs index f80263e41a..4ff2df1388 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/MatchPairing.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/MatchPairing.cs @@ -51,7 +51,7 @@ namespace osu.Game.Tournament.Screens.Ladder.Components public readonly ObservableCollection PicksBans = new ObservableCollection(); [JsonIgnore] - public readonly Bindable Grouping = new Bindable(); + public readonly Bindable Round = new Bindable(); [JsonIgnore] public readonly Bindable Progression = new Bindable(); @@ -90,7 +90,7 @@ namespace osu.Game.Tournament.Screens.Ladder.Components [JsonIgnore] public TournamentTeam Loser => !Completed.Value ? null : Team1Score.Value > Team2Score.Value ? Team2.Value : Team1.Value; - public int PointsToWin => Grouping.Value?.BestOf.Value / 2 + 1 ?? 0; + public int PointsToWin => Round.Value?.BestOf.Value / 2 + 1 ?? 0; /// /// Remove scores from the match, in case of a false click or false start. diff --git a/osu.Game.Tournament/Screens/Ladder/Components/GroupingBeatmap.cs b/osu.Game.Tournament/Screens/Ladder/Components/RoundBeatmap.cs similarity index 91% rename from osu.Game.Tournament/Screens/Ladder/Components/GroupingBeatmap.cs rename to osu.Game.Tournament/Screens/Ladder/Components/RoundBeatmap.cs index b16ba13f65..ef608c3f06 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/GroupingBeatmap.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/RoundBeatmap.cs @@ -5,7 +5,7 @@ using osu.Game.Beatmaps; namespace osu.Game.Tournament.Screens.Ladder.Components { - public class GroupingBeatmap + public class RoundBeatmap { public int ID; public string Mods; diff --git a/osu.Game.Tournament/Screens/Ladder/Components/TournamentGrouping.cs b/osu.Game.Tournament/Screens/Ladder/Components/TournamentRound.cs similarity index 87% rename from osu.Game.Tournament/Screens/Ladder/Components/TournamentGrouping.cs rename to osu.Game.Tournament/Screens/Ladder/Components/TournamentRound.cs index d6e6b11f28..79b94e06a2 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/TournamentGrouping.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/TournamentRound.cs @@ -9,7 +9,7 @@ using osu.Framework.Bindables; namespace osu.Game.Tournament.Screens.Ladder.Components { [Serializable] - public class TournamentGrouping + public class TournamentRound { public readonly Bindable Name = new Bindable(); public readonly Bindable Description = new Bindable(); @@ -17,7 +17,7 @@ namespace osu.Game.Tournament.Screens.Ladder.Components public readonly BindableInt BestOf = new BindableInt(9) { Default = 9, MinValue = 3, MaxValue = 23 }; [JsonProperty] - public readonly List Beatmaps = new List(); + public readonly List Beatmaps = new List(); public readonly Bindable StartDate = new Bindable(); diff --git a/osu.Game.Tournament/Screens/Ladder/LadderScreen.cs b/osu.Game.Tournament/Screens/Ladder/LadderScreen.cs index 4a50db9997..6a77c6c20e 100644 --- a/osu.Game.Tournament/Screens/Ladder/LadderScreen.cs +++ b/osu.Game.Tournament/Screens/Ladder/LadderScreen.cs @@ -66,8 +66,8 @@ namespace osu.Game.Tournament.Screens.Ladder foreach (var pairing in LadderInfo.Pairings) addPairing(pairing); - LadderInfo.Groupings.ItemsAdded += _ => layout.Invalidate(); - LadderInfo.Groupings.ItemsRemoved += _ => layout.Invalidate(); + LadderInfo.Rounds.ItemsAdded += _ => layout.Invalidate(); + LadderInfo.Rounds.ItemsRemoved += _ => layout.Invalidate(); LadderInfo.Pairings.ItemsAdded += pairings => { @@ -138,13 +138,13 @@ namespace osu.Game.Tournament.Screens.Ladder } } - foreach (var group in LadderInfo.Groupings) + foreach (var round in LadderInfo.Rounds) { - var topPairing = PairingsContainer.Where(p => !p.Pairing.Losers.Value && p.Pairing.Grouping.Value == group).OrderBy(p => p.Y).FirstOrDefault(); + var topPairing = PairingsContainer.Where(p => !p.Pairing.Losers.Value && p.Pairing.Round.Value == round).OrderBy(p => p.Y).FirstOrDefault(); if (topPairing == null) continue; - headings.Add(new DrawableTournamentGrouping(group) + headings.Add(new DrawableTournamentRound(round) { Position = headings.ToLocalSpace((topPairing.ScreenSpaceDrawQuad.TopLeft + topPairing.ScreenSpaceDrawQuad.TopRight) / 2), Margin = new MarginPadding { Bottom = 10 }, @@ -152,13 +152,13 @@ namespace osu.Game.Tournament.Screens.Ladder }); } - foreach (var group in LadderInfo.Groupings) + foreach (var round in LadderInfo.Rounds) { - var topPairing = PairingsContainer.Where(p => p.Pairing.Losers.Value && p.Pairing.Grouping.Value == group).OrderBy(p => p.Y).FirstOrDefault(); + var topPairing = PairingsContainer.Where(p => p.Pairing.Losers.Value && p.Pairing.Round.Value == round).OrderBy(p => p.Y).FirstOrDefault(); if (topPairing == null) continue; - headings.Add(new DrawableTournamentGrouping(group, true) + headings.Add(new DrawableTournamentRound(round, true) { Position = headings.ToLocalSpace((topPairing.ScreenSpaceDrawQuad.TopLeft + topPairing.ScreenSpaceDrawQuad.TopRight) / 2), Margin = new MarginPadding { Bottom = 10 }, diff --git a/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs b/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs index 47d5a36a4b..2c14dad38b 100644 --- a/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs +++ b/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs @@ -179,7 +179,7 @@ namespace osu.Game.Tournament.Screens.MapPool if (currentMatch.Value == null) return; - if (currentMatch.Value.Grouping.Value.Beatmaps.All(b => b.BeatmapInfo.OnlineBeatmapID != beatmapId)) + if (currentMatch.Value.Round.Value.Beatmaps.All(b => b.BeatmapInfo.OnlineBeatmapID != beatmapId)) // don't attempt to add if the beatmap isn't in our pool return; @@ -207,12 +207,12 @@ namespace osu.Game.Tournament.Screens.MapPool { mapFlows.Clear(); - if (match.NewValue.Grouping.Value != null) + if (match.NewValue.Round.Value != null) { FillFlowContainer currentFlow = null; string currentMod = null; - foreach (var b in match.NewValue.Grouping.Value.Beatmaps) + foreach (var b in match.NewValue.Round.Value.Beatmaps) { if (currentFlow == null || currentMod != b.Mods) { diff --git a/osu.Game.Tournament/Screens/Groupings/GroupingsEditorScreen.cs b/osu.Game.Tournament/Screens/Rounds/RoundEditorScreen.cs similarity index 80% rename from osu.Game.Tournament/Screens/Groupings/GroupingsEditorScreen.cs rename to osu.Game.Tournament/Screens/Rounds/RoundEditorScreen.cs index 45dc769c19..69808032cc 100644 --- a/osu.Game.Tournament/Screens/Groupings/GroupingsEditorScreen.cs +++ b/osu.Game.Tournament/Screens/Rounds/RoundEditorScreen.cs @@ -14,13 +14,13 @@ using osu.Game.Tournament.Components; using osu.Game.Tournament.Screens.Ladder.Components; using osuTK; -namespace osu.Game.Tournament.Screens.Groupings +namespace osu.Game.Tournament.Screens.Rounds { - public class GroupingsEditorScreen : TournamentScreen, IProvideVideo + public class RoundEditorScreen : TournamentScreen, IProvideVideo { - private readonly FillFlowContainer items; + private readonly FillFlowContainer items; - public GroupingsEditorScreen() + public RoundEditorScreen() { AddRangeInternal(new Drawable[] { @@ -35,7 +35,7 @@ namespace osu.Game.Tournament.Screens.Groupings Width = 0.9f, Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, - Child = items = new FillFlowContainer + Child = items = new FillFlowContainer { Direction = FillDirection.Vertical, RelativeSizeAxes = Axes.X, @@ -62,13 +62,13 @@ namespace osu.Game.Tournament.Screens.Groupings [BackgroundDependencyLoader] private void load() { - foreach (var g in LadderInfo.Groupings) - items.Add(new GroupingRow(g)); + foreach (var r in LadderInfo.Rounds) + items.Add(new RoundRow(r)); } private void addNew() { - var grouping = new TournamentGrouping + var round = new TournamentRound { StartDate = { @@ -76,22 +76,22 @@ namespace osu.Game.Tournament.Screens.Groupings } }; - items.Add(new GroupingRow(grouping)); - LadderInfo.Groupings.Add(grouping); + items.Add(new RoundRow(round)); + LadderInfo.Rounds.Add(round); } - public class GroupingRow : CompositeDrawable + public class RoundRow : CompositeDrawable { - public readonly TournamentGrouping Grouping; + public readonly TournamentRound Round; [Resolved] private LadderInfo ladderInfo { get; set; } - public GroupingRow(TournamentGrouping grouping) + public RoundRow(TournamentRound round) { Margin = new MarginPadding(10); - Grouping = grouping; + Round = round; InternalChildren = new Drawable[] { new Box @@ -113,25 +113,25 @@ namespace osu.Game.Tournament.Screens.Groupings { LabelText = "Name", Width = 0.33f, - Bindable = Grouping.Name + Bindable = Round.Name }, new SettingsTextBox { LabelText = "Description", Width = 0.33f, - Bindable = Grouping.Description + Bindable = Round.Description }, new DateTextBox { LabelText = "Start Time", Width = 0.33f, - Bindable = Grouping.StartDate + Bindable = Round.StartDate }, new SettingsSlider { LabelText = "Best of", Width = 0.33f, - Bindable = Grouping.BestOf + Bindable = Round.BestOf }, } }, @@ -145,7 +145,7 @@ namespace osu.Game.Tournament.Screens.Groupings Action = () => { Expire(); - ladderInfo.Groupings.Remove(Grouping); + ladderInfo.Rounds.Remove(Round); }, } }; diff --git a/osu.Game.Tournament/Screens/Schedule/ScheduleScreen.cs b/osu.Game.Tournament/Screens/Schedule/ScheduleScreen.cs index be934afe8e..956dd836bb 100644 --- a/osu.Game.Tournament/Screens/Schedule/ScheduleScreen.cs +++ b/osu.Game.Tournament/Screens/Schedule/ScheduleScreen.cs @@ -110,7 +110,7 @@ namespace osu.Game.Tournament.Screens.Schedule { Margin = new MarginPadding { Left = -10, Bottom = 10, Top = -5 }, Spacing = new Vector2(10, 0), - Text = match.NewValue.Grouping.Value?.Name.Value, + Text = match.NewValue.Round.Value?.Name.Value, Colour = Color4.Black, Font = OsuFont.GetFont(size: 20) }, diff --git a/osu.Game.Tournament/Screens/TeamIntro/TeamIntroScreen.cs b/osu.Game.Tournament/Screens/TeamIntro/TeamIntroScreen.cs index 078d823d81..3bb26499bf 100644 --- a/osu.Game.Tournament/Screens/TeamIntro/TeamIntroScreen.cs +++ b/osu.Game.Tournament/Screens/TeamIntro/TeamIntroScreen.cs @@ -112,7 +112,7 @@ namespace osu.Game.Tournament.Screens.TeamIntro Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, Colour = col, - Text = pairing.Grouping.Value?.Name.Value ?? "Unknown Grouping", + Text = pairing.Round.Value?.Name.Value ?? "Unknown Round", Spacing = new Vector2(10, 0), Font = OsuFont.GetFont(size: 50, weight: FontWeight.Light) }, diff --git a/osu.Game.Tournament/Screens/TeamWin/TeamWinScreen.cs b/osu.Game.Tournament/Screens/TeamWin/TeamWinScreen.cs index c80f3b2dfb..8360b17c39 100644 --- a/osu.Game.Tournament/Screens/TeamWin/TeamWinScreen.cs +++ b/osu.Game.Tournament/Screens/TeamWin/TeamWinScreen.cs @@ -133,7 +133,7 @@ namespace osu.Game.Tournament.Screens.TeamWin Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, Colour = col, - Text = pairing.Grouping.Value?.Name.Value ?? "Unknown Grouping", + Text = pairing.Round.Value?.Name.Value ?? "Unknown Round", Font = TournamentFont.GetFont(TournamentTypeface.Aquatico, 50, FontWeight.Light), Spacing = new Vector2(10, 0), }, diff --git a/osu.Game.Tournament/Screens/Teams/TeamsEditorScreen.cs b/osu.Game.Tournament/Screens/Teams/TeamsEditorScreen.cs index 503e7468b0..8f536361c3 100644 --- a/osu.Game.Tournament/Screens/Teams/TeamsEditorScreen.cs +++ b/osu.Game.Tournament/Screens/Teams/TeamsEditorScreen.cs @@ -66,8 +66,8 @@ namespace osu.Game.Tournament.Screens.Teams [BackgroundDependencyLoader] private void load() { - foreach (var g in LadderInfo.Teams) - items.Add(new TeamRow(g)); + foreach (var t in LadderInfo.Teams) + items.Add(new TeamRow(t)); } private void addNew() diff --git a/osu.Game.Tournament/Screens/TournamentSceneManager.cs b/osu.Game.Tournament/Screens/TournamentSceneManager.cs index 2c620f4e56..720e216e96 100644 --- a/osu.Game.Tournament/Screens/TournamentSceneManager.cs +++ b/osu.Game.Tournament/Screens/TournamentSceneManager.cs @@ -12,9 +12,9 @@ using osu.Game.Graphics.UserInterface; using osu.Game.Tournament.Components; using osu.Game.Tournament.Screens.Drawings; using osu.Game.Tournament.Screens.Gameplay; -using osu.Game.Tournament.Screens.Groupings; using osu.Game.Tournament.Screens.Ladder; using osu.Game.Tournament.Screens.MapPool; +using osu.Game.Tournament.Screens.Rounds; using osu.Game.Tournament.Screens.Schedule; using osu.Game.Tournament.Screens.Showcase; using osu.Game.Tournament.Screens.TeamIntro; @@ -72,7 +72,7 @@ namespace osu.Game.Tournament.Screens new LadderScreen(), new LadderEditorScreen(), new TeamsEditorScreen(), - new GroupingsEditorScreen(), + new RoundEditorScreen(), new ShowcaseScreen(), new MapPoolScreen(), new TeamIntroScreen(), @@ -106,7 +106,7 @@ namespace osu.Game.Tournament.Screens Children = new Drawable[] { new OsuButton { RelativeSizeAxes = Axes.X, Text = "Team Editor", Action = () => SetScreen(typeof(TeamsEditorScreen)) }, - new OsuButton { RelativeSizeAxes = Axes.X, Text = "Groupings Editor", Action = () => SetScreen(typeof(GroupingsEditorScreen)) }, + new OsuButton { RelativeSizeAxes = Axes.X, Text = "Rounds Editor", Action = () => SetScreen(typeof(RoundEditorScreen)) }, new OsuButton { RelativeSizeAxes = Axes.X, Text = "Bracket Editor", Action = () => SetScreen(typeof(LadderEditorScreen)) }, new Container { RelativeSizeAxes = Axes.X, Height = 50 }, new OsuButton { RelativeSizeAxes = Axes.X, Text = "Drawings", Action = () => SetScreen(typeof(DrawingsScreen)) }, diff --git a/osu.Game.Tournament/TournamentGameBase.cs b/osu.Game.Tournament/TournamentGameBase.cs index e9e2d0f054..49e626d057 100644 --- a/osu.Game.Tournament/TournamentGameBase.cs +++ b/osu.Game.Tournament/TournamentGameBase.cs @@ -107,7 +107,7 @@ namespace osu.Game.Tournament { conditional.Team1.Value = ladder.Teams.FirstOrDefault(t => t.Acronym.Value == conditional.Team1Acronym); conditional.Team2.Value = ladder.Teams.FirstOrDefault(t => t.Acronym.Value == conditional.Team2Acronym); - conditional.Grouping.Value = pairing.Grouping.Value; + conditional.Round.Value = pairing.Round.Value; } } @@ -128,17 +128,17 @@ namespace osu.Game.Tournament } } - // link pairings to groupings - foreach (var group in ladder.Groupings) - foreach (var id in group.Pairings) + // link pairings to rounds + foreach (var round in ladder.Rounds) + foreach (var id in round.Pairings) { var found = ladder.Pairings.FirstOrDefault(p => p.ID == id); if (found != null) { - found.Grouping.Value = group; - if (group.StartDate.Value > found.Date.Value) - found.Date.Value = group.StartDate.Value; + found.Round.Value = round; + if (round.StartDate.Value > found.Date.Value) + found.Date.Value = round.StartDate.Value; } } @@ -179,8 +179,8 @@ namespace osu.Game.Tournament { bool addedInfo = false; - foreach (var g in ladder.Groupings) - foreach (var b in g.Beatmaps) + foreach (var r in ladder.Rounds) + foreach (var b in r.Beatmaps) if (b.BeatmapInfo == null) { var req = new GetBeatmapRequest(new BeatmapInfo { OnlineBeatmapID = b.ID }); @@ -245,8 +245,8 @@ namespace osu.Game.Tournament protected virtual void SaveChanges() { - foreach (var g in ladder.Groupings) - g.Pairings = ladder.Pairings.Where(p => p.Grouping.Value == g).Select(p => p.ID).ToList(); + foreach (var r in ladder.Rounds) + r.Pairings = ladder.Pairings.Where(p => p.Round.Value == r).Select(p => p.ID).ToList(); ladder.Progressions = ladder.Pairings.Where(p => p.Progression.Value != null).Select(p => new TournamentProgression(p.ID, p.Progression.Value.ID)).Concat( ladder.Pairings.Where(p => p.LosersProgression.Value != null).Select(p => new TournamentProgression(p.ID, p.LosersProgression.Value.ID, true))) From 96e24ebd20eec8a005fc469da3d868ea576dce41 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 18 Jun 2019 14:51:48 +0900 Subject: [PATCH 254/317] General namespace tidy-up --- osu.Game.Tournament.Tests/LadderTestScene.cs | 1 + .../TestSceneGroupingsEditorScreen.cs | 2 +- osu.Game.Tournament.Tests/TestSceneMatchPairings.cs | 1 + osu.Game.Tournament.Tests/TestSceneSceneManager.cs | 1 - osu.Game.Tournament.Tests/TestSceneTeamIntro.cs | 2 +- osu.Game.Tournament.Tests/TestSceneTeamWin.cs | 2 +- osu.Game.Tournament.Tests/TestSceneTeamsEditorScreen.cs | 2 +- .../TestSceneTournamentMatchChatDisplay.cs | 2 +- osu.Game.Tournament/Components/DrawableTournamentTeam.cs | 1 + osu.Game.Tournament/Components/TournamentBeatmapPanel.cs | 2 +- .../Components/TournamentMatchChatDisplay.cs | 1 + osu.Game.Tournament/IPC/FileBasedIPC.cs | 1 + .../{Screens/Ladder/Components => Models}/BeatmapChoice.cs | 2 +- .../Ladder/Components => Models}/LadderEditorInfo.cs | 2 +- osu.Game.Tournament/{ => Models}/LadderInfo.cs | 4 +--- .../{Screens/Ladder/Components => Models}/MatchPairing.cs | 4 ++-- .../{Screens/Ladder/Components => Models}/RoundBeatmap.cs | 2 +- .../Ladder/Components => Models}/TournamentProgression.cs | 2 +- .../Ladder/Components => Models}/TournamentRound.cs | 2 +- .../{Components => Models}/TournamentTeam.cs | 2 +- osu.Game.Tournament/Screens/Drawings/Components/Group.cs | 1 + .../Screens/Drawings/Components/GroupContainer.cs | 2 +- .../Screens/Drawings/Components/ITeamList.cs | 2 +- .../Screens/Drawings/Components/ScrollingTeamContainer.cs | 1 + .../Screens/Drawings/Components/StorageBackedTeamList.cs | 2 +- osu.Game.Tournament/Screens/Drawings/DrawingsScreen.cs | 1 + .../Screens/{Ladder => Editors}/LadderEditorScreen.cs | 4 +++- .../Screens/{Rounds => Editors}/RoundEditorScreen.cs | 4 ++-- .../Screens/{Teams => Editors}/TeamsEditorScreen.cs | 3 ++- .../Screens/Gameplay/Components/MatchHeader.cs | 2 +- .../Screens/Gameplay/Components/MatchScoreDisplay.cs | 1 + osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs | 2 +- osu.Game.Tournament/Screens/IProvideVideo.cs | 3 +++ .../Screens/Ladder/Components/ConditionalMatchPairing.cs | 2 ++ .../Screens/Ladder/Components/DrawableMatchPairing.cs | 2 +- .../Screens/Ladder/Components/DrawableMatchTeam.cs | 2 ++ .../Screens/Ladder/Components/DrawableTournamentRound.cs | 1 + .../Screens/Ladder/Components/LadderEditorSettings.cs | 1 + osu.Game.Tournament/Screens/Ladder/LadderScreen.cs | 2 ++ osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs | 2 +- osu.Game.Tournament/Screens/Schedule/ScheduleScreen.cs | 1 + osu.Game.Tournament/Screens/TeamIntro/TeamIntroScreen.cs | 2 +- osu.Game.Tournament/Screens/TeamWin/TeamWinScreen.cs | 2 +- osu.Game.Tournament/Screens/TournamentScreen.cs | 5 +++-- osu.Game.Tournament/TournamentGame.cs | 1 - osu.Game.Tournament/TournamentGameBase.cs | 3 +-- .../{Screens => }/TournamentSceneManager.cs | 7 ++++--- osu.Game.Tournament/osu.Game.Tournament.csproj | 3 +++ 48 files changed, 63 insertions(+), 39 deletions(-) rename osu.Game.Tournament/{Screens/Ladder/Components => Models}/BeatmapChoice.cs (92%) rename osu.Game.Tournament/{Screens/Ladder/Components => Models}/LadderEditorInfo.cs (85%) rename osu.Game.Tournament/{ => Models}/LadderInfo.cs (86%) rename osu.Game.Tournament/{Screens/Ladder/Components => Models}/MatchPairing.cs (97%) rename osu.Game.Tournament/{Screens/Ladder/Components => Models}/RoundBeatmap.cs (84%) rename osu.Game.Tournament/{Screens/Ladder/Components => Models}/TournamentProgression.cs (92%) rename osu.Game.Tournament/{Screens/Ladder/Components => Models}/TournamentRound.cs (94%) rename osu.Game.Tournament/{Components => Models}/TournamentTeam.cs (97%) rename osu.Game.Tournament/Screens/{Ladder => Editors}/LadderEditorScreen.cs (97%) rename osu.Game.Tournament/Screens/{Rounds => Editors}/RoundEditorScreen.cs (98%) rename osu.Game.Tournament/Screens/{Teams => Editors}/TeamsEditorScreen.cs (99%) rename osu.Game.Tournament/{Screens => }/TournamentSceneManager.cs (97%) diff --git a/osu.Game.Tournament.Tests/LadderTestScene.cs b/osu.Game.Tournament.Tests/LadderTestScene.cs index cb55f543f6..5bb8112157 100644 --- a/osu.Game.Tournament.Tests/LadderTestScene.cs +++ b/osu.Game.Tournament.Tests/LadderTestScene.cs @@ -3,6 +3,7 @@ using osu.Framework.Allocation; using osu.Game.Tests.Visual; +using osu.Game.Tournament.Models; namespace osu.Game.Tournament.Tests { diff --git a/osu.Game.Tournament.Tests/TestSceneGroupingsEditorScreen.cs b/osu.Game.Tournament.Tests/TestSceneGroupingsEditorScreen.cs index 0ef19c2948..e0a6f8e8b9 100644 --- a/osu.Game.Tournament.Tests/TestSceneGroupingsEditorScreen.cs +++ b/osu.Game.Tournament.Tests/TestSceneGroupingsEditorScreen.cs @@ -1,7 +1,7 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. -using osu.Game.Tournament.Screens.Rounds; +using osu.Game.Tournament.Screens.Editors; namespace osu.Game.Tournament.Tests { diff --git a/osu.Game.Tournament.Tests/TestSceneMatchPairings.cs b/osu.Game.Tournament.Tests/TestSceneMatchPairings.cs index 611e87717a..42b68d654c 100644 --- a/osu.Game.Tournament.Tests/TestSceneMatchPairings.cs +++ b/osu.Game.Tournament.Tests/TestSceneMatchPairings.cs @@ -7,6 +7,7 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Game.Tests.Visual; using osu.Game.Tournament.Components; +using osu.Game.Tournament.Models; using osu.Game.Tournament.Screens.Ladder.Components; namespace osu.Game.Tournament.Tests diff --git a/osu.Game.Tournament.Tests/TestSceneSceneManager.cs b/osu.Game.Tournament.Tests/TestSceneSceneManager.cs index 385dc09d58..aa333e39b1 100644 --- a/osu.Game.Tournament.Tests/TestSceneSceneManager.cs +++ b/osu.Game.Tournament.Tests/TestSceneSceneManager.cs @@ -4,7 +4,6 @@ using osu.Framework.Allocation; using osu.Framework.Platform; using osu.Game.Tests.Visual; -using osu.Game.Tournament.Screens; namespace osu.Game.Tournament.Tests { diff --git a/osu.Game.Tournament.Tests/TestSceneTeamIntro.cs b/osu.Game.Tournament.Tests/TestSceneTeamIntro.cs index 560a8f9521..9f0d59fcbc 100644 --- a/osu.Game.Tournament.Tests/TestSceneTeamIntro.cs +++ b/osu.Game.Tournament.Tests/TestSceneTeamIntro.cs @@ -5,7 +5,7 @@ using System.Linq; using osu.Framework.Allocation; using osu.Framework.Bindables; using osu.Framework.Graphics; -using osu.Game.Tournament.Screens.Ladder.Components; +using osu.Game.Tournament.Models; using osu.Game.Tournament.Screens.TeamIntro; namespace osu.Game.Tournament.Tests diff --git a/osu.Game.Tournament.Tests/TestSceneTeamWin.cs b/osu.Game.Tournament.Tests/TestSceneTeamWin.cs index 9f642103de..8beeb50513 100644 --- a/osu.Game.Tournament.Tests/TestSceneTeamWin.cs +++ b/osu.Game.Tournament.Tests/TestSceneTeamWin.cs @@ -5,7 +5,7 @@ using System.Linq; using osu.Framework.Allocation; using osu.Framework.Bindables; using osu.Framework.Graphics; -using osu.Game.Tournament.Screens.Ladder.Components; +using osu.Game.Tournament.Models; using osu.Game.Tournament.Screens.TeamWin; namespace osu.Game.Tournament.Tests diff --git a/osu.Game.Tournament.Tests/TestSceneTeamsEditorScreen.cs b/osu.Game.Tournament.Tests/TestSceneTeamsEditorScreen.cs index d3268219b3..60323e1d84 100644 --- a/osu.Game.Tournament.Tests/TestSceneTeamsEditorScreen.cs +++ b/osu.Game.Tournament.Tests/TestSceneTeamsEditorScreen.cs @@ -1,7 +1,7 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. -using osu.Game.Tournament.Screens.Teams; +using osu.Game.Tournament.Screens.Editors; namespace osu.Game.Tournament.Tests { diff --git a/osu.Game.Tournament.Tests/TestSceneTournamentMatchChatDisplay.cs b/osu.Game.Tournament.Tests/TestSceneTournamentMatchChatDisplay.cs index 8a3950bac3..125bf5679c 100644 --- a/osu.Game.Tournament.Tests/TestSceneTournamentMatchChatDisplay.cs +++ b/osu.Game.Tournament.Tests/TestSceneTournamentMatchChatDisplay.cs @@ -8,7 +8,7 @@ using osu.Game.Online.Chat; using osu.Game.Tests.Visual; using osu.Game.Tournament.Components; using osu.Game.Tournament.IPC; -using osu.Game.Tournament.Screens.Ladder.Components; +using osu.Game.Tournament.Models; using osu.Game.Users; namespace osu.Game.Tournament.Tests diff --git a/osu.Game.Tournament/Components/DrawableTournamentTeam.cs b/osu.Game.Tournament/Components/DrawableTournamentTeam.cs index 704d5a47de..361bd92770 100644 --- a/osu.Game.Tournament/Components/DrawableTournamentTeam.cs +++ b/osu.Game.Tournament/Components/DrawableTournamentTeam.cs @@ -10,6 +10,7 @@ using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Textures; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; +using osu.Game.Tournament.Models; namespace osu.Game.Tournament.Components { diff --git a/osu.Game.Tournament/Components/TournamentBeatmapPanel.cs b/osu.Game.Tournament/Components/TournamentBeatmapPanel.cs index cf826ee2c7..aee7f914e7 100644 --- a/osu.Game.Tournament/Components/TournamentBeatmapPanel.cs +++ b/osu.Game.Tournament/Components/TournamentBeatmapPanel.cs @@ -16,7 +16,7 @@ using osu.Game.Beatmaps; using osu.Game.Beatmaps.Drawables; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; -using osu.Game.Tournament.Screens.Ladder.Components; +using osu.Game.Tournament.Models; using osuTK; using osuTK.Graphics; diff --git a/osu.Game.Tournament/Components/TournamentMatchChatDisplay.cs b/osu.Game.Tournament/Components/TournamentMatchChatDisplay.cs index 2afbb0f5ff..48c5b9bd35 100644 --- a/osu.Game.Tournament/Components/TournamentMatchChatDisplay.cs +++ b/osu.Game.Tournament/Components/TournamentMatchChatDisplay.cs @@ -8,6 +8,7 @@ using osu.Framework.Graphics; using osu.Game.Online.Chat; using osu.Game.Overlays.Chat; using osu.Game.Tournament.IPC; +using osu.Game.Tournament.Models; using osuTK; using osuTK.Graphics; diff --git a/osu.Game.Tournament/IPC/FileBasedIPC.cs b/osu.Game.Tournament/IPC/FileBasedIPC.cs index 438e32c20f..23ebe2f39c 100644 --- a/osu.Game.Tournament/IPC/FileBasedIPC.cs +++ b/osu.Game.Tournament/IPC/FileBasedIPC.cs @@ -13,6 +13,7 @@ using osu.Game.Beatmaps.Legacy; using osu.Game.Online.API; using osu.Game.Online.API.Requests; using osu.Game.Rulesets; +using osu.Game.Tournament.Models; namespace osu.Game.Tournament.IPC { diff --git a/osu.Game.Tournament/Screens/Ladder/Components/BeatmapChoice.cs b/osu.Game.Tournament/Models/BeatmapChoice.cs similarity index 92% rename from osu.Game.Tournament/Screens/Ladder/Components/BeatmapChoice.cs rename to osu.Game.Tournament/Models/BeatmapChoice.cs index bb9ed39b82..c22077553b 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/BeatmapChoice.cs +++ b/osu.Game.Tournament/Models/BeatmapChoice.cs @@ -4,7 +4,7 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; -namespace osu.Game.Tournament.Screens.Ladder.Components +namespace osu.Game.Tournament.Models { public class BeatmapChoice { diff --git a/osu.Game.Tournament/Screens/Ladder/Components/LadderEditorInfo.cs b/osu.Game.Tournament/Models/LadderEditorInfo.cs similarity index 85% rename from osu.Game.Tournament/Screens/Ladder/Components/LadderEditorInfo.cs rename to osu.Game.Tournament/Models/LadderEditorInfo.cs index d6b5d172de..9bf01e76f5 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/LadderEditorInfo.cs +++ b/osu.Game.Tournament/Models/LadderEditorInfo.cs @@ -3,7 +3,7 @@ using osu.Framework.Bindables; -namespace osu.Game.Tournament.Screens.Ladder.Components +namespace osu.Game.Tournament.Models { public class LadderEditorInfo { diff --git a/osu.Game.Tournament/LadderInfo.cs b/osu.Game.Tournament/Models/LadderInfo.cs similarity index 86% rename from osu.Game.Tournament/LadderInfo.cs rename to osu.Game.Tournament/Models/LadderInfo.cs index fc825d1a9c..2fdf1b06b1 100644 --- a/osu.Game.Tournament/LadderInfo.cs +++ b/osu.Game.Tournament/Models/LadderInfo.cs @@ -4,10 +4,8 @@ using System.Collections.Generic; using Newtonsoft.Json; using osu.Framework.Bindables; -using osu.Game.Tournament.Components; -using osu.Game.Tournament.Screens.Ladder.Components; -namespace osu.Game.Tournament +namespace osu.Game.Tournament.Models { public class LadderInfo { diff --git a/osu.Game.Tournament/Screens/Ladder/Components/MatchPairing.cs b/osu.Game.Tournament/Models/MatchPairing.cs similarity index 97% rename from osu.Game.Tournament/Screens/Ladder/Components/MatchPairing.cs rename to osu.Game.Tournament/Models/MatchPairing.cs index 4ff2df1388..caafe8af47 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/MatchPairing.cs +++ b/osu.Game.Tournament/Models/MatchPairing.cs @@ -6,10 +6,10 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using Newtonsoft.Json; using osu.Framework.Bindables; -using osu.Game.Tournament.Components; +using osu.Game.Tournament.Screens.Ladder.Components; using SixLabors.Primitives; -namespace osu.Game.Tournament.Screens.Ladder.Components +namespace osu.Game.Tournament.Models { /// /// A collection of two teams competing in a head-to-head match. diff --git a/osu.Game.Tournament/Screens/Ladder/Components/RoundBeatmap.cs b/osu.Game.Tournament/Models/RoundBeatmap.cs similarity index 84% rename from osu.Game.Tournament/Screens/Ladder/Components/RoundBeatmap.cs rename to osu.Game.Tournament/Models/RoundBeatmap.cs index ef608c3f06..5d43d0ca66 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/RoundBeatmap.cs +++ b/osu.Game.Tournament/Models/RoundBeatmap.cs @@ -3,7 +3,7 @@ using osu.Game.Beatmaps; -namespace osu.Game.Tournament.Screens.Ladder.Components +namespace osu.Game.Tournament.Models { public class RoundBeatmap { diff --git a/osu.Game.Tournament/Screens/Ladder/Components/TournamentProgression.cs b/osu.Game.Tournament/Models/TournamentProgression.cs similarity index 92% rename from osu.Game.Tournament/Screens/Ladder/Components/TournamentProgression.cs rename to osu.Game.Tournament/Models/TournamentProgression.cs index 0019dc8d79..4ef4be599d 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/TournamentProgression.cs +++ b/osu.Game.Tournament/Models/TournamentProgression.cs @@ -1,7 +1,7 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. -namespace osu.Game.Tournament.Screens.Ladder.Components +namespace osu.Game.Tournament.Models { public class TournamentProgression { diff --git a/osu.Game.Tournament/Screens/Ladder/Components/TournamentRound.cs b/osu.Game.Tournament/Models/TournamentRound.cs similarity index 94% rename from osu.Game.Tournament/Screens/Ladder/Components/TournamentRound.cs rename to osu.Game.Tournament/Models/TournamentRound.cs index 79b94e06a2..6fe4b20fa5 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/TournamentRound.cs +++ b/osu.Game.Tournament/Models/TournamentRound.cs @@ -6,7 +6,7 @@ using System.Collections.Generic; using Newtonsoft.Json; using osu.Framework.Bindables; -namespace osu.Game.Tournament.Screens.Ladder.Components +namespace osu.Game.Tournament.Models { [Serializable] public class TournamentRound diff --git a/osu.Game.Tournament/Components/TournamentTeam.cs b/osu.Game.Tournament/Models/TournamentTeam.cs similarity index 97% rename from osu.Game.Tournament/Components/TournamentTeam.cs rename to osu.Game.Tournament/Models/TournamentTeam.cs index 043dcc7084..eea1ef8104 100644 --- a/osu.Game.Tournament/Components/TournamentTeam.cs +++ b/osu.Game.Tournament/Models/TournamentTeam.cs @@ -6,7 +6,7 @@ using Newtonsoft.Json; using osu.Framework.Bindables; using osu.Game.Users; -namespace osu.Game.Tournament.Components +namespace osu.Game.Tournament.Models { [Serializable] public class TournamentTeam diff --git a/osu.Game.Tournament/Screens/Drawings/Components/Group.cs b/osu.Game.Tournament/Screens/Drawings/Components/Group.cs index adeead277c..549ff26018 100644 --- a/osu.Game.Tournament/Screens/Drawings/Components/Group.cs +++ b/osu.Game.Tournament/Screens/Drawings/Components/Group.cs @@ -10,6 +10,7 @@ using osu.Framework.Graphics.Shapes; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; using osu.Game.Tournament.Components; +using osu.Game.Tournament.Models; using osuTK; using osuTK.Graphics; diff --git a/osu.Game.Tournament/Screens/Drawings/Components/GroupContainer.cs b/osu.Game.Tournament/Screens/Drawings/Components/GroupContainer.cs index 6e56dca2fb..8a66ca7bf6 100644 --- a/osu.Game.Tournament/Screens/Drawings/Components/GroupContainer.cs +++ b/osu.Game.Tournament/Screens/Drawings/Components/GroupContainer.cs @@ -7,7 +7,7 @@ using System.Linq; using System.Text; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; -using osu.Game.Tournament.Components; +using osu.Game.Tournament.Models; using osuTK; namespace osu.Game.Tournament.Screens.Drawings.Components diff --git a/osu.Game.Tournament/Screens/Drawings/Components/ITeamList.cs b/osu.Game.Tournament/Screens/Drawings/Components/ITeamList.cs index a532f47176..09208818a9 100644 --- a/osu.Game.Tournament/Screens/Drawings/Components/ITeamList.cs +++ b/osu.Game.Tournament/Screens/Drawings/Components/ITeamList.cs @@ -2,7 +2,7 @@ // See the LICENCE file in the repository root for full licence text. using System.Collections.Generic; -using osu.Game.Tournament.Components; +using osu.Game.Tournament.Models; namespace osu.Game.Tournament.Screens.Drawings.Components { diff --git a/osu.Game.Tournament/Screens/Drawings/Components/ScrollingTeamContainer.cs b/osu.Game.Tournament/Screens/Drawings/Components/ScrollingTeamContainer.cs index 486ce7fe74..b147d680f0 100644 --- a/osu.Game.Tournament/Screens/Drawings/Components/ScrollingTeamContainer.cs +++ b/osu.Game.Tournament/Screens/Drawings/Components/ScrollingTeamContainer.cs @@ -12,6 +12,7 @@ using osu.Framework.Graphics.Shapes; using osu.Framework.Threading; using osu.Game.Graphics; using osu.Game.Tournament.Components; +using osu.Game.Tournament.Models; using osuTK; using osuTK.Graphics; diff --git a/osu.Game.Tournament/Screens/Drawings/Components/StorageBackedTeamList.cs b/osu.Game.Tournament/Screens/Drawings/Components/StorageBackedTeamList.cs index ca3536965f..f96ec01cbb 100644 --- a/osu.Game.Tournament/Screens/Drawings/Components/StorageBackedTeamList.cs +++ b/osu.Game.Tournament/Screens/Drawings/Components/StorageBackedTeamList.cs @@ -6,7 +6,7 @@ using System.Collections.Generic; using System.IO; using osu.Framework.Logging; using osu.Framework.Platform; -using osu.Game.Tournament.Components; +using osu.Game.Tournament.Models; namespace osu.Game.Tournament.Screens.Drawings.Components { diff --git a/osu.Game.Tournament/Screens/Drawings/DrawingsScreen.cs b/osu.Game.Tournament/Screens/Drawings/DrawingsScreen.cs index 2ef7f513b6..52ba73c27c 100644 --- a/osu.Game.Tournament/Screens/Drawings/DrawingsScreen.cs +++ b/osu.Game.Tournament/Screens/Drawings/DrawingsScreen.cs @@ -17,6 +17,7 @@ using osu.Game.Graphics; using osu.Game.Graphics.Sprites; using osu.Game.Graphics.UserInterface; using osu.Game.Tournament.Components; +using osu.Game.Tournament.Models; using osu.Game.Tournament.Screens.Drawings.Components; using osuTK; using osuTK.Graphics; diff --git a/osu.Game.Tournament/Screens/Ladder/LadderEditorScreen.cs b/osu.Game.Tournament/Screens/Editors/LadderEditorScreen.cs similarity index 97% rename from osu.Game.Tournament/Screens/Ladder/LadderEditorScreen.cs rename to osu.Game.Tournament/Screens/Editors/LadderEditorScreen.cs index fc98753e0a..9b298df91d 100644 --- a/osu.Game.Tournament/Screens/Ladder/LadderEditorScreen.cs +++ b/osu.Game.Tournament/Screens/Editors/LadderEditorScreen.cs @@ -11,12 +11,14 @@ using osu.Framework.Graphics.UserInterface; using osu.Framework.Input.Events; using osu.Framework.Input.States; using osu.Game.Graphics.UserInterface; +using osu.Game.Tournament.Models; +using osu.Game.Tournament.Screens.Ladder; using osu.Game.Tournament.Screens.Ladder.Components; using osuTK; using osuTK.Graphics; using SixLabors.Primitives; -namespace osu.Game.Tournament.Screens.Ladder +namespace osu.Game.Tournament.Screens.Editors { [Cached] public class LadderEditorScreen : LadderScreen, IHasContextMenu diff --git a/osu.Game.Tournament/Screens/Rounds/RoundEditorScreen.cs b/osu.Game.Tournament/Screens/Editors/RoundEditorScreen.cs similarity index 98% rename from osu.Game.Tournament/Screens/Rounds/RoundEditorScreen.cs rename to osu.Game.Tournament/Screens/Editors/RoundEditorScreen.cs index 69808032cc..c8c2461b10 100644 --- a/osu.Game.Tournament/Screens/Rounds/RoundEditorScreen.cs +++ b/osu.Game.Tournament/Screens/Editors/RoundEditorScreen.cs @@ -11,10 +11,10 @@ using osu.Game.Graphics.Containers; using osu.Game.Graphics.UserInterface; using osu.Game.Overlays.Settings; using osu.Game.Tournament.Components; -using osu.Game.Tournament.Screens.Ladder.Components; +using osu.Game.Tournament.Models; using osuTK; -namespace osu.Game.Tournament.Screens.Rounds +namespace osu.Game.Tournament.Screens.Editors { public class RoundEditorScreen : TournamentScreen, IProvideVideo { diff --git a/osu.Game.Tournament/Screens/Teams/TeamsEditorScreen.cs b/osu.Game.Tournament/Screens/Editors/TeamsEditorScreen.cs similarity index 99% rename from osu.Game.Tournament/Screens/Teams/TeamsEditorScreen.cs rename to osu.Game.Tournament/Screens/Editors/TeamsEditorScreen.cs index 8f536361c3..1bf3f1c6b9 100644 --- a/osu.Game.Tournament/Screens/Teams/TeamsEditorScreen.cs +++ b/osu.Game.Tournament/Screens/Editors/TeamsEditorScreen.cs @@ -14,10 +14,11 @@ using osu.Game.Online.API; using osu.Game.Online.API.Requests; using osu.Game.Overlays.Settings; using osu.Game.Tournament.Components; +using osu.Game.Tournament.Models; using osu.Game.Users; using osuTK; -namespace osu.Game.Tournament.Screens.Teams +namespace osu.Game.Tournament.Screens.Editors { public class TeamsEditorScreen : TournamentScreen, IProvideVideo { diff --git a/osu.Game.Tournament/Screens/Gameplay/Components/MatchHeader.cs b/osu.Game.Tournament/Screens/Gameplay/Components/MatchHeader.cs index 71cfacdc32..e75872cda4 100644 --- a/osu.Game.Tournament/Screens/Gameplay/Components/MatchHeader.cs +++ b/osu.Game.Tournament/Screens/Gameplay/Components/MatchHeader.cs @@ -11,7 +11,7 @@ using osu.Game.Graphics; using osu.Game.Graphics.Sprites; using osu.Game.Graphics.UserInterface; using osu.Game.Tournament.Components; -using osu.Game.Tournament.Screens.Ladder.Components; +using osu.Game.Tournament.Models; using osu.Game.Tournament.Screens.Showcase; using osuTK; using osuTK.Graphics; diff --git a/osu.Game.Tournament/Screens/Gameplay/Components/MatchScoreDisplay.cs b/osu.Game.Tournament/Screens/Gameplay/Components/MatchScoreDisplay.cs index fc28ddccfd..78455c8bb7 100644 --- a/osu.Game.Tournament/Screens/Gameplay/Components/MatchScoreDisplay.cs +++ b/osu.Game.Tournament/Screens/Gameplay/Components/MatchScoreDisplay.cs @@ -10,6 +10,7 @@ using osu.Framework.Graphics.Shapes; using osu.Game.Graphics; using osu.Game.Graphics.UserInterface; using osu.Game.Tournament.IPC; +using osu.Game.Tournament.Models; using osuTK.Graphics; namespace osu.Game.Tournament.Screens.Gameplay.Components diff --git a/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs b/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs index fad1919510..7b108731f3 100644 --- a/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs +++ b/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs @@ -10,8 +10,8 @@ using osu.Framework.Threading; using osu.Game.Graphics.UserInterface; using osu.Game.Tournament.Components; using osu.Game.Tournament.IPC; +using osu.Game.Tournament.Models; using osu.Game.Tournament.Screens.Gameplay.Components; -using osu.Game.Tournament.Screens.Ladder.Components; using osu.Game.Tournament.Screens.MapPool; using osu.Game.Tournament.Screens.TeamWin; using osuTK; diff --git a/osu.Game.Tournament/Screens/IProvideVideo.cs b/osu.Game.Tournament/Screens/IProvideVideo.cs index c11c921412..61989d8448 100644 --- a/osu.Game.Tournament/Screens/IProvideVideo.cs +++ b/osu.Game.Tournament/Screens/IProvideVideo.cs @@ -3,6 +3,9 @@ namespace osu.Game.Tournament.Screens { + /// + /// Marker interface for a screen which provides its own local video background. + /// public interface IProvideVideo { } diff --git a/osu.Game.Tournament/Screens/Ladder/Components/ConditionalMatchPairing.cs b/osu.Game.Tournament/Screens/Ladder/Components/ConditionalMatchPairing.cs index 7831cac84d..f3b5678c7c 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/ConditionalMatchPairing.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/ConditionalMatchPairing.cs @@ -1,6 +1,8 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. +using osu.Game.Tournament.Models; + namespace osu.Game.Tournament.Screens.Ladder.Components { /// diff --git a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs index 35741cbb55..e48155ab0e 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs @@ -9,7 +9,7 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; using osu.Framework.Input.Events; -using osu.Game.Tournament.Components; +using osu.Game.Tournament.Models; using osuTK; using osuTK.Graphics; using osuTK.Input; diff --git a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs index 6d5ac74267..5514dfce3e 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs @@ -14,6 +14,8 @@ using osu.Game.Graphics; using osu.Game.Graphics.Sprites; using osu.Game.Graphics.UserInterface; using osu.Game.Tournament.Components; +using osu.Game.Tournament.Models; +using osu.Game.Tournament.Screens.Editors; using osuTK; using osuTK.Graphics; using osuTK.Input; diff --git a/osu.Game.Tournament/Screens/Ladder/Components/DrawableTournamentRound.cs b/osu.Game.Tournament/Screens/Ladder/Components/DrawableTournamentRound.cs index 844c89a968..67d6bc4fa6 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/DrawableTournamentRound.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/DrawableTournamentRound.cs @@ -7,6 +7,7 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; +using osu.Game.Tournament.Models; using osuTK.Graphics; namespace osu.Game.Tournament.Screens.Ladder.Components diff --git a/osu.Game.Tournament/Screens/Ladder/Components/LadderEditorSettings.cs b/osu.Game.Tournament/Screens/Ladder/Components/LadderEditorSettings.cs index a4b74f00a2..d947215cfa 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/LadderEditorSettings.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/LadderEditorSettings.cs @@ -11,6 +11,7 @@ using osu.Framework.Input.Events; using osu.Game.Overlays.Settings; using osu.Game.Screens.Play.PlayerSettings; using osu.Game.Tournament.Components; +using osu.Game.Tournament.Models; namespace osu.Game.Tournament.Screens.Ladder.Components { diff --git a/osu.Game.Tournament/Screens/Ladder/LadderScreen.cs b/osu.Game.Tournament/Screens/Ladder/LadderScreen.cs index 6a77c6c20e..50675a6147 100644 --- a/osu.Game.Tournament/Screens/Ladder/LadderScreen.cs +++ b/osu.Game.Tournament/Screens/Ladder/LadderScreen.cs @@ -11,6 +11,8 @@ using osu.Framework.Graphics.Lines; using osu.Framework.Platform; using osu.Game.Graphics; using osu.Game.Tournament.Components; +using osu.Game.Tournament.Models; +using osu.Game.Tournament.Screens.Editors; using osu.Game.Tournament.Screens.Ladder.Components; using osuTK.Graphics; diff --git a/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs b/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs index 2c14dad38b..ab03adbce9 100644 --- a/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs +++ b/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs @@ -13,9 +13,9 @@ using osu.Game.Graphics.Sprites; using osu.Game.Graphics.UserInterface; using osu.Game.Tournament.Components; using osu.Game.Tournament.IPC; +using osu.Game.Tournament.Models; using osu.Game.Tournament.Screens.Gameplay; using osu.Game.Tournament.Screens.Gameplay.Components; -using osu.Game.Tournament.Screens.Ladder.Components; using osuTK; using osuTK.Graphics; using osuTK.Input; diff --git a/osu.Game.Tournament/Screens/Schedule/ScheduleScreen.cs b/osu.Game.Tournament/Screens/Schedule/ScheduleScreen.cs index 956dd836bb..457fb80141 100644 --- a/osu.Game.Tournament/Screens/Schedule/ScheduleScreen.cs +++ b/osu.Game.Tournament/Screens/Schedule/ScheduleScreen.cs @@ -12,6 +12,7 @@ using osu.Framework.Platform; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; using osu.Game.Tournament.Components; +using osu.Game.Tournament.Models; using osu.Game.Tournament.Screens.Ladder.Components; using osuTK; using osuTK.Graphics; diff --git a/osu.Game.Tournament/Screens/TeamIntro/TeamIntroScreen.cs b/osu.Game.Tournament/Screens/TeamIntro/TeamIntroScreen.cs index 3bb26499bf..4e0bb23a62 100644 --- a/osu.Game.Tournament/Screens/TeamIntro/TeamIntroScreen.cs +++ b/osu.Game.Tournament/Screens/TeamIntro/TeamIntroScreen.cs @@ -9,7 +9,7 @@ using osu.Framework.Platform; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; using osu.Game.Tournament.Components; -using osu.Game.Tournament.Screens.Ladder.Components; +using osu.Game.Tournament.Models; using osu.Game.Tournament.Screens.Showcase; using osuTK; using osuTK.Graphics; diff --git a/osu.Game.Tournament/Screens/TeamWin/TeamWinScreen.cs b/osu.Game.Tournament/Screens/TeamWin/TeamWinScreen.cs index 8360b17c39..0a37cf6c4a 100644 --- a/osu.Game.Tournament/Screens/TeamWin/TeamWinScreen.cs +++ b/osu.Game.Tournament/Screens/TeamWin/TeamWinScreen.cs @@ -9,7 +9,7 @@ using osu.Framework.Platform; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; using osu.Game.Tournament.Components; -using osu.Game.Tournament.Screens.Ladder.Components; +using osu.Game.Tournament.Models; using osu.Game.Tournament.Screens.Showcase; using osuTK; using osuTK.Graphics; diff --git a/osu.Game.Tournament/Screens/TournamentScreen.cs b/osu.Game.Tournament/Screens/TournamentScreen.cs index 7f6c5f8e18..9d58ca2240 100644 --- a/osu.Game.Tournament/Screens/TournamentScreen.cs +++ b/osu.Game.Tournament/Screens/TournamentScreen.cs @@ -4,15 +4,16 @@ using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; +using osu.Game.Tournament.Models; namespace osu.Game.Tournament.Screens { - public class TournamentScreen : CompositeDrawable + public abstract class TournamentScreen : CompositeDrawable { [Resolved] protected LadderInfo LadderInfo { get; private set; } - public TournamentScreen() + protected TournamentScreen() { RelativeSizeAxes = Axes.Both; } diff --git a/osu.Game.Tournament/TournamentGame.cs b/osu.Game.Tournament/TournamentGame.cs index c8c462a458..42e4ab3c13 100644 --- a/osu.Game.Tournament/TournamentGame.cs +++ b/osu.Game.Tournament/TournamentGame.cs @@ -5,7 +5,6 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Sprites; using osu.Game.Graphics; using osu.Game.Graphics.Cursor; -using osu.Game.Tournament.Screens; namespace osu.Game.Tournament { diff --git a/osu.Game.Tournament/TournamentGameBase.cs b/osu.Game.Tournament/TournamentGameBase.cs index 49e626d057..e35e0b0d30 100644 --- a/osu.Game.Tournament/TournamentGameBase.cs +++ b/osu.Game.Tournament/TournamentGameBase.cs @@ -19,9 +19,8 @@ using osu.Game.Beatmaps; using osu.Game.Graphics.UserInterface; using osu.Game.Online.API.Requests; using osu.Game.Rulesets; -using osu.Game.Tournament.Components; using osu.Game.Tournament.IPC; -using osu.Game.Tournament.Screens.Ladder.Components; +using osu.Game.Tournament.Models; using osuTK.Input; namespace osu.Game.Tournament diff --git a/osu.Game.Tournament/Screens/TournamentSceneManager.cs b/osu.Game.Tournament/TournamentSceneManager.cs similarity index 97% rename from osu.Game.Tournament/Screens/TournamentSceneManager.cs rename to osu.Game.Tournament/TournamentSceneManager.cs index 720e216e96..29f8eba579 100644 --- a/osu.Game.Tournament/Screens/TournamentSceneManager.cs +++ b/osu.Game.Tournament/TournamentSceneManager.cs @@ -10,20 +10,21 @@ using osu.Framework.Graphics.Shapes; using osu.Framework.Platform; using osu.Game.Graphics.UserInterface; using osu.Game.Tournament.Components; +using osu.Game.Tournament.Models; +using osu.Game.Tournament.Screens; using osu.Game.Tournament.Screens.Drawings; +using osu.Game.Tournament.Screens.Editors; using osu.Game.Tournament.Screens.Gameplay; using osu.Game.Tournament.Screens.Ladder; using osu.Game.Tournament.Screens.MapPool; -using osu.Game.Tournament.Screens.Rounds; using osu.Game.Tournament.Screens.Schedule; using osu.Game.Tournament.Screens.Showcase; using osu.Game.Tournament.Screens.TeamIntro; -using osu.Game.Tournament.Screens.Teams; using osu.Game.Tournament.Screens.TeamWin; using osuTK; using osuTK.Graphics; -namespace osu.Game.Tournament.Screens +namespace osu.Game.Tournament { [Cached] public class TournamentSceneManager : CompositeDrawable diff --git a/osu.Game.Tournament/osu.Game.Tournament.csproj b/osu.Game.Tournament/osu.Game.Tournament.csproj index 8adff80820..8412166250 100644 --- a/osu.Game.Tournament/osu.Game.Tournament.csproj +++ b/osu.Game.Tournament/osu.Game.Tournament.csproj @@ -10,4 +10,7 @@ + + + \ No newline at end of file From da20904a57bb48dc8b1bd3d20a6c0b857967fa36 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 18 Jun 2019 14:57:05 +0900 Subject: [PATCH 255/317] MatchPairing -> TournamentMatch --- .../TestSceneMatchPairings.cs | 50 ++++----- .../TestSceneTeamIntro.cs | 12 +-- osu.Game.Tournament.Tests/TestSceneTeamWin.cs | 12 +-- .../TestSceneTournamentMatchChatDisplay.cs | 2 +- .../Components/TournamentBeatmapPanel.cs | 10 +- .../Models/LadderEditorInfo.cs | 2 +- osu.Game.Tournament/Models/LadderInfo.cs | 4 +- .../{MatchPairing.cs => TournamentMatch.cs} | 12 +-- osu.Game.Tournament/Models/TournamentRound.cs | 2 +- .../Screens/Editors/LadderEditorScreen.cs | 36 +++---- .../Gameplay/Components/MatchHeader.cs | 8 +- .../Screens/Gameplay/GameplayScreen.cs | 2 +- ...iring.cs => ConditionalTournamentMatch.cs} | 4 +- .../Ladder/Components/DrawableMatchPairing.cs | 102 +++++++++--------- .../Ladder/Components/DrawableMatchTeam.cs | 34 +++--- .../Ladder/Components/ProgressionPath.cs | 6 +- .../Screens/Ladder/LadderScreen.cs | 56 +++++----- .../Screens/MapPool/MapPoolScreen.cs | 4 +- .../Screens/Schedule/ScheduleScreen.cs | 30 +++--- .../Screens/TeamIntro/TeamIntroScreen.cs | 18 ++-- .../Screens/TeamWin/TeamWinScreen.cs | 22 ++-- osu.Game.Tournament/TournamentGameBase.cs | 28 ++--- 22 files changed, 228 insertions(+), 228 deletions(-) rename osu.Game.Tournament/Models/{MatchPairing.cs => TournamentMatch.cs} (88%) rename osu.Game.Tournament/Screens/Ladder/Components/{ConditionalMatchPairing.cs => ConditionalTournamentMatch.cs} (72%) diff --git a/osu.Game.Tournament.Tests/TestSceneMatchPairings.cs b/osu.Game.Tournament.Tests/TestSceneMatchPairings.cs index 42b68d654c..9c8ee2965e 100644 --- a/osu.Game.Tournament.Tests/TestSceneMatchPairings.cs +++ b/osu.Game.Tournament.Tests/TestSceneMatchPairings.cs @@ -12,22 +12,22 @@ using osu.Game.Tournament.Screens.Ladder.Components; namespace osu.Game.Tournament.Tests { - public class TestSceneMatchPairings : OsuTestScene + public class TestSceneMatches : OsuTestScene { public override IReadOnlyList RequiredTypes => new[] { - typeof(MatchPairing), - typeof(DrawableMatchPairing), + typeof(TournamentMatch), + typeof(DrawableTournamentMatch), typeof(DrawableMatchTeam), typeof(DrawableTournamentTeam), }; - public TestSceneMatchPairings() + public TestSceneMatches() { - Container level1; - Container level2; + Container level1; + Container level2; - var pairing1 = new MatchPairing( + var match1 = new TournamentMatch( new TournamentTeam { FlagName = { Value = "AU" }, FullName = { Value = "Australia" }, }, new TournamentTeam { FlagName = { Value = "JP" }, FullName = { Value = "Japan" }, Acronym = { Value = "JPN" } }) { @@ -35,7 +35,7 @@ namespace osu.Game.Tournament.Tests Team2Score = { Value = 1 }, }; - var pairing2 = new MatchPairing( + var match2 = new TournamentMatch( new TournamentTeam { FlagName = { Value = "RO" }, @@ -49,47 +49,47 @@ namespace osu.Game.Tournament.Tests Direction = FillDirection.Horizontal, Children = new Drawable[] { - level1 = new FillFlowContainer + level1 = new FillFlowContainer { AutoSizeAxes = Axes.X, Direction = FillDirection.Vertical, Children = new[] { - new DrawableMatchPairing(pairing1), - new DrawableMatchPairing(pairing2), - new DrawableMatchPairing(new MatchPairing()), + new DrawableTournamentMatch(match1), + new DrawableTournamentMatch(match2), + new DrawableTournamentMatch(new TournamentMatch()), } }, - level2 = new FillFlowContainer + level2 = new FillFlowContainer { AutoSizeAxes = Axes.X, Direction = FillDirection.Vertical, Margin = new MarginPadding(20), Children = new[] { - new DrawableMatchPairing(new MatchPairing()), - new DrawableMatchPairing(new MatchPairing()) + new DrawableTournamentMatch(new TournamentMatch()), + new DrawableTournamentMatch(new TournamentMatch()) } } } }; - level1.Children[0].Pairing.Progression.Value = level2.Children[0].Pairing; - level1.Children[1].Pairing.Progression.Value = level2.Children[0].Pairing; + level1.Children[0].Match.Progression.Value = level2.Children[0].Match; + level1.Children[1].Match.Progression.Value = level2.Children[0].Match; - AddRepeatStep("change scores", () => pairing1.Team2Score.Value++, 4); - AddStep("add new team", () => pairing2.Team2.Value = new TournamentTeam { FlagName = { Value = "PT" }, FullName = { Value = "Portugal" } }); - AddStep("Add progression", () => level1.Children[2].Pairing.Progression.Value = level2.Children[1].Pairing); + AddRepeatStep("change scores", () => match1.Team2Score.Value++, 4); + AddStep("add new team", () => match2.Team2.Value = new TournamentTeam { FlagName = { Value = "PT" }, FullName = { Value = "Portugal" } }); + AddStep("Add progression", () => level1.Children[2].Match.Progression.Value = level2.Children[1].Match); - AddStep("start match", () => pairing2.StartMatch()); + AddStep("start match", () => match2.StartMatch()); - AddRepeatStep("change scores", () => pairing2.Team1Score.Value++, 10); + AddRepeatStep("change scores", () => match2.Team1Score.Value++, 10); - AddStep("start submatch", () => level2.Children[0].Pairing.StartMatch()); + AddStep("start submatch", () => level2.Children[0].Match.StartMatch()); - AddRepeatStep("change scores", () => level2.Children[0].Pairing.Team1Score.Value++, 5); + AddRepeatStep("change scores", () => level2.Children[0].Match.Team1Score.Value++, 5); - AddRepeatStep("change scores", () => level2.Children[0].Pairing.Team2Score.Value++, 4); + AddRepeatStep("change scores", () => level2.Children[0].Match.Team2Score.Value++, 4); } } } diff --git a/osu.Game.Tournament.Tests/TestSceneTeamIntro.cs b/osu.Game.Tournament.Tests/TestSceneTeamIntro.cs index 9f0d59fcbc..6b31fd2742 100644 --- a/osu.Game.Tournament.Tests/TestSceneTeamIntro.cs +++ b/osu.Game.Tournament.Tests/TestSceneTeamIntro.cs @@ -13,16 +13,16 @@ namespace osu.Game.Tournament.Tests public class TestSceneTeamIntro : LadderTestScene { [Cached] - private readonly Bindable currentMatch = new Bindable(); + private readonly Bindable currentMatch = new Bindable(); [BackgroundDependencyLoader] private void load() { - var pairing = new MatchPairing(); - pairing.Team1.Value = Ladder.Teams.FirstOrDefault(t => t.Acronym.Value == "USA"); - pairing.Team2.Value = Ladder.Teams.FirstOrDefault(t => t.Acronym.Value == "JPN"); - pairing.Round.Value = Ladder.Rounds.FirstOrDefault(g => g.Name.Value == "Finals"); - currentMatch.Value = pairing; + var match = new TournamentMatch(); + match.Team1.Value = Ladder.Teams.FirstOrDefault(t => t.Acronym.Value == "USA"); + match.Team2.Value = Ladder.Teams.FirstOrDefault(t => t.Acronym.Value == "JPN"); + match.Round.Value = Ladder.Rounds.FirstOrDefault(g => g.Name.Value == "Finals"); + currentMatch.Value = match; Add(new TeamIntroScreen { diff --git a/osu.Game.Tournament.Tests/TestSceneTeamWin.cs b/osu.Game.Tournament.Tests/TestSceneTeamWin.cs index 8beeb50513..d195ad42ca 100644 --- a/osu.Game.Tournament.Tests/TestSceneTeamWin.cs +++ b/osu.Game.Tournament.Tests/TestSceneTeamWin.cs @@ -13,16 +13,16 @@ namespace osu.Game.Tournament.Tests public class TestSceneTeamWin : LadderTestScene { [Cached] - private readonly Bindable currentMatch = new Bindable(); + private readonly Bindable currentMatch = new Bindable(); [BackgroundDependencyLoader] private void load() { - var pairing = new MatchPairing(); - pairing.Team1.Value = Ladder.Teams.FirstOrDefault(t => t.Acronym.Value == "USA"); - pairing.Team2.Value = Ladder.Teams.FirstOrDefault(t => t.Acronym.Value == "JPN"); - pairing.Round.Value = Ladder.Rounds.FirstOrDefault(g => g.Name.Value == "Finals"); - currentMatch.Value = pairing; + var match = new TournamentMatch(); + match.Team1.Value = Ladder.Teams.FirstOrDefault(t => t.Acronym.Value == "USA"); + match.Team2.Value = Ladder.Teams.FirstOrDefault(t => t.Acronym.Value == "JPN"); + match.Round.Value = Ladder.Rounds.FirstOrDefault(g => g.Name.Value == "Finals"); + currentMatch.Value = match; Add(new TeamWinScreen { diff --git a/osu.Game.Tournament.Tests/TestSceneTournamentMatchChatDisplay.cs b/osu.Game.Tournament.Tests/TestSceneTournamentMatchChatDisplay.cs index 125bf5679c..829d8629e5 100644 --- a/osu.Game.Tournament.Tests/TestSceneTournamentMatchChatDisplay.cs +++ b/osu.Game.Tournament.Tests/TestSceneTournamentMatchChatDisplay.cs @@ -53,7 +53,7 @@ namespace osu.Game.Tournament.Tests Origin = Anchor.Centre, }); - ladderInfo.CurrentMatch.Value = new MatchPairing + ladderInfo.CurrentMatch.Value = new TournamentMatch { Team1 = { diff --git a/osu.Game.Tournament/Components/TournamentBeatmapPanel.cs b/osu.Game.Tournament/Components/TournamentBeatmapPanel.cs index aee7f914e7..f7ca25adba 100644 --- a/osu.Game.Tournament/Components/TournamentBeatmapPanel.cs +++ b/osu.Game.Tournament/Components/TournamentBeatmapPanel.cs @@ -32,7 +32,7 @@ namespace osu.Game.Tournament.Components public const float HEIGHT = 50; - private readonly Bindable currentMatch = new Bindable(); + private readonly Bindable currentMatch = new Bindable(); private Box flash; public TournamentBeatmapPanel(BeatmapInfo beatmap, string mods = null) @@ -141,11 +141,11 @@ namespace osu.Game.Tournament.Components }); } - private void matchChanged(ValueChangedEvent pairing) + private void matchChanged(ValueChangedEvent match) { - if (pairing.OldValue != null) - pairing.OldValue.PicksBans.CollectionChanged -= picksBansOnCollectionChanged; - pairing.NewValue.PicksBans.CollectionChanged += picksBansOnCollectionChanged; + if (match.OldValue != null) + match.OldValue.PicksBans.CollectionChanged -= picksBansOnCollectionChanged; + match.NewValue.PicksBans.CollectionChanged += picksBansOnCollectionChanged; updateState(); } diff --git a/osu.Game.Tournament/Models/LadderEditorInfo.cs b/osu.Game.Tournament/Models/LadderEditorInfo.cs index 9bf01e76f5..70fd115e25 100644 --- a/osu.Game.Tournament/Models/LadderEditorInfo.cs +++ b/osu.Game.Tournament/Models/LadderEditorInfo.cs @@ -7,6 +7,6 @@ namespace osu.Game.Tournament.Models { public class LadderEditorInfo { - public readonly Bindable Selected = new Bindable(); + public readonly Bindable Selected = new Bindable(); } } diff --git a/osu.Game.Tournament/Models/LadderInfo.cs b/osu.Game.Tournament/Models/LadderInfo.cs index 2fdf1b06b1..b6dc59c0d9 100644 --- a/osu.Game.Tournament/Models/LadderInfo.cs +++ b/osu.Game.Tournament/Models/LadderInfo.cs @@ -9,7 +9,7 @@ namespace osu.Game.Tournament.Models { public class LadderInfo { - public BindableList Pairings = new BindableList(); + public BindableList Matches = new BindableList(); public BindableList Rounds = new BindableList(); public BindableList Teams = new BindableList(); @@ -17,6 +17,6 @@ namespace osu.Game.Tournament.Models public List Progressions = new List(); [JsonIgnore] - public Bindable CurrentMatch = new Bindable(); + public Bindable CurrentMatch = new Bindable(); } } diff --git a/osu.Game.Tournament/Models/MatchPairing.cs b/osu.Game.Tournament/Models/TournamentMatch.cs similarity index 88% rename from osu.Game.Tournament/Models/MatchPairing.cs rename to osu.Game.Tournament/Models/TournamentMatch.cs index caafe8af47..db41e83038 100644 --- a/osu.Game.Tournament/Models/MatchPairing.cs +++ b/osu.Game.Tournament/Models/TournamentMatch.cs @@ -15,7 +15,7 @@ namespace osu.Game.Tournament.Models /// A collection of two teams competing in a head-to-head match. /// [Serializable] - public class MatchPairing + public class TournamentMatch { public int ID; @@ -54,10 +54,10 @@ namespace osu.Game.Tournament.Models public readonly Bindable Round = new Bindable(); [JsonIgnore] - public readonly Bindable Progression = new Bindable(); + public readonly Bindable Progression = new Bindable(); [JsonIgnore] - public readonly Bindable LosersProgression = new Bindable(); + public readonly Bindable LosersProgression = new Bindable(); /// /// Should not be set directly. Use LadderInfo.CurrentMatch.Value = this instead. @@ -67,17 +67,17 @@ namespace osu.Game.Tournament.Models public readonly Bindable Date = new Bindable(); [JsonProperty] - public readonly BindableList ConditionalPairings = new BindableList(); + public readonly BindableList ConditionalMatches = new BindableList(); public readonly Bindable Position = new Bindable(); - public MatchPairing() + public TournamentMatch() { Team1.BindValueChanged(t => Team1Acronym = t.NewValue?.Acronym.Value, true); Team2.BindValueChanged(t => Team2Acronym = t.NewValue?.Acronym.Value, true); } - public MatchPairing(TournamentTeam team1 = null, TournamentTeam team2 = null) + public TournamentMatch(TournamentTeam team1 = null, TournamentTeam team2 = null) : this() { Team1.Value = team1; diff --git a/osu.Game.Tournament/Models/TournamentRound.cs b/osu.Game.Tournament/Models/TournamentRound.cs index 6fe4b20fa5..e325ad4b96 100644 --- a/osu.Game.Tournament/Models/TournamentRound.cs +++ b/osu.Game.Tournament/Models/TournamentRound.cs @@ -22,7 +22,7 @@ namespace osu.Game.Tournament.Models public readonly Bindable StartDate = new Bindable(); // only used for serialisation - public List Pairings = new List(); + public List Matches = new List(); public override string ToString() => Name.Value ?? "None"; } diff --git a/osu.Game.Tournament/Screens/Editors/LadderEditorScreen.cs b/osu.Game.Tournament/Screens/Editors/LadderEditorScreen.cs index 9b298df91d..ba63013886 100644 --- a/osu.Game.Tournament/Screens/Editors/LadderEditorScreen.cs +++ b/osu.Game.Tournament/Screens/Editors/LadderEditorScreen.cs @@ -39,9 +39,9 @@ namespace osu.Game.Tournament.Screens.Editors }); } - public void BeginJoin(MatchPairing pairing, bool losers) + public void BeginJoin(TournamentMatch match, bool losers) { - ScrollContent.Add(new JoinVisualiser(PairingsContainer, pairing, losers, UpdateLayout)); + ScrollContent.Add(new JoinVisualiser(MatchesContainer, match, losers, UpdateLayout)); } public MenuItem[] ContextMenuItems @@ -55,35 +55,35 @@ namespace osu.Game.Tournament.Screens.Editors { new OsuMenuItem("Create new match", MenuItemType.Highlighted, () => { - var pos = PairingsContainer.ToLocalSpace(GetContainingInputManager().CurrentState.Mouse.Position); - LadderInfo.Pairings.Add(new MatchPairing { Position = { Value = new Point((int)pos.X, (int)pos.Y) } }); + var pos = MatchesContainer.ToLocalSpace(GetContainingInputManager().CurrentState.Mouse.Position); + LadderInfo.Matches.Add(new TournamentMatch { Position = { Value = new Point((int)pos.X, (int)pos.Y) } }); }), new OsuMenuItem("Reset teams", MenuItemType.Destructive, () => { - foreach (var p in PairingsContainer) - p.Pairing.Reset(); + foreach (var p in MatchesContainer) + p.Match.Reset(); }) }; } } - public void Remove(MatchPairing pairing) + public void Remove(TournamentMatch match) { - PairingsContainer.FirstOrDefault(p => p.Pairing == pairing)?.Remove(); + MatchesContainer.FirstOrDefault(p => p.Match == match)?.Remove(); } private class JoinVisualiser : CompositeDrawable { - private readonly Container pairingsContainer; - public readonly MatchPairing Source; + private readonly Container matchesContainer; + public readonly TournamentMatch Source; private readonly bool losers; private readonly Action complete; private ProgressionPath path; - public JoinVisualiser(Container pairingsContainer, MatchPairing source, bool losers, Action complete) + public JoinVisualiser(Container matchesContainer, TournamentMatch source, bool losers, Action complete) { - this.pairingsContainer = pairingsContainer; + this.matchesContainer = matchesContainer; RelativeSizeAxes = Axes.Both; Source = source; @@ -95,9 +95,9 @@ namespace osu.Game.Tournament.Screens.Editors Source.Progression.Value = null; } - private DrawableMatchPairing findTarget(InputState state) + private DrawableTournamentMatch findTarget(InputState state) { - return pairingsContainer.FirstOrDefault(d => d.ReceivePositionalInputAt(state.Mouse.Position)); + return matchesContainer.FirstOrDefault(d => d.ReceivePositionalInputAt(state.Mouse.Position)); } public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) @@ -118,7 +118,7 @@ namespace osu.Game.Tournament.Screens.Editors if (found == null) return false; - AddInternal(path = new ProgressionPath(pairingsContainer.First(c => c.Pairing == Source), found) + AddInternal(path = new ProgressionPath(matchesContainer.First(c => c.Match == Source), found) { Colour = Color4.Yellow, }); @@ -132,12 +132,12 @@ namespace osu.Game.Tournament.Screens.Editors if (found != null) { - if (found.Pairing != Source) + if (found.Match != Source) { if (losers) - Source.LosersProgression.Value = found.Pairing; + Source.LosersProgression.Value = found.Match; else - Source.Progression.Value = found.Pairing; + Source.Progression.Value = found.Match; } complete?.Invoke(); diff --git a/osu.Game.Tournament/Screens/Gameplay/Components/MatchHeader.cs b/osu.Game.Tournament/Screens/Gameplay/Components/MatchHeader.cs index e75872cda4..cfa44537d6 100644 --- a/osu.Game.Tournament/Screens/Gameplay/Components/MatchHeader.cs +++ b/osu.Game.Tournament/Screens/Gameplay/Components/MatchHeader.cs @@ -55,7 +55,7 @@ namespace osu.Game.Tournament.Screens.Gameplay.Components private readonly Color4 red = new Color4(129, 68, 65, 255); private readonly Color4 blue = new Color4(41, 91, 97, 255); - private readonly Bindable currentMatch = new Bindable(); + private readonly Bindable currentMatch = new Bindable(); private readonly Bindable currentTeam = new Bindable(); private readonly Bindable currentTeamScore = new Bindable(); @@ -74,7 +74,7 @@ namespace osu.Game.Tournament.Screens.Gameplay.Components currentMatch.BindTo(ladder.CurrentMatch); } - private void matchChanged(ValueChangedEvent match) + private void matchChanged(ValueChangedEvent match) { currentTeamScore.UnbindBindings(); currentTeamScore.BindTo(teamColour == TeamColour.Red ? match.NewValue.Team1Score : match.NewValue.Team2Score); @@ -187,7 +187,7 @@ namespace osu.Game.Tournament.Screens.Gameplay.Components private class RoundDisplay : CompositeDrawable { - private readonly Bindable currentMatch = new Bindable(); + private readonly Bindable currentMatch = new Bindable(); public RoundDisplay() { @@ -204,7 +204,7 @@ namespace osu.Game.Tournament.Screens.Gameplay.Components currentMatch.BindTo(ladder.CurrentMatch); } - private void matchChanged(ValueChangedEvent match) + private void matchChanged(ValueChangedEvent match) { InternalChildren = new Drawable[] { diff --git a/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs b/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs index 7b108731f3..5bbd049cc0 100644 --- a/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs +++ b/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs @@ -23,7 +23,7 @@ namespace osu.Game.Tournament.Screens.Gameplay { private readonly BindableBool warmup = new BindableBool(); - private readonly Bindable currentMatch = new Bindable(); + private readonly Bindable currentMatch = new Bindable(); public readonly Bindable State = new Bindable(); private TriangleButton warmupButton; diff --git a/osu.Game.Tournament/Screens/Ladder/Components/ConditionalMatchPairing.cs b/osu.Game.Tournament/Screens/Ladder/Components/ConditionalTournamentMatch.cs similarity index 72% rename from osu.Game.Tournament/Screens/Ladder/Components/ConditionalMatchPairing.cs rename to osu.Game.Tournament/Screens/Ladder/Components/ConditionalTournamentMatch.cs index f3b5678c7c..16224a7fb4 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/ConditionalMatchPairing.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/ConditionalTournamentMatch.cs @@ -6,9 +6,9 @@ using osu.Game.Tournament.Models; namespace osu.Game.Tournament.Screens.Ladder.Components { /// - /// A pairing that may not necessarily occur. + /// A match that may not necessarily occur. /// - public class ConditionalMatchPairing : MatchPairing + public class ConditionalTournamentMatch : TournamentMatch { } } diff --git a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs index e48155ab0e..dde280ccd8 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs @@ -17,14 +17,14 @@ using SixLabors.Primitives; namespace osu.Game.Tournament.Screens.Ladder.Components { - public class DrawableMatchPairing : CompositeDrawable + public class DrawableTournamentMatch : CompositeDrawable { - public readonly MatchPairing Pairing; + public readonly TournamentMatch Match; private readonly bool editor; protected readonly FillFlowContainer Flow; private readonly Drawable selectionBox; private readonly Drawable currentMatchSelectionBox; - private Bindable globalSelection; + private Bindable globalSelection; [Resolved(CanBeNull = true)] private LadderEditorInfo editorInfo { get; set; } @@ -32,9 +32,9 @@ namespace osu.Game.Tournament.Screens.Ladder.Components [Resolved(CanBeNull = true)] private LadderInfo ladderInfo { get; set; } - public DrawableMatchPairing(MatchPairing pairing, bool editor = false) + public DrawableTournamentMatch(TournamentMatch match, bool editor = false) { - Pairing = pairing; + Match = match; this.editor = editor; AutoSizeAxes = Axes.Both; @@ -75,25 +75,25 @@ namespace osu.Game.Tournament.Screens.Ladder.Components } }; - boundReference(pairing.Team1).BindValueChanged(_ => updateTeams()); - boundReference(pairing.Team2).BindValueChanged(_ => updateTeams()); - boundReference(pairing.Team1Score).BindValueChanged(_ => updateWinConditions()); - boundReference(pairing.Team2Score).BindValueChanged(_ => updateWinConditions()); - boundReference(pairing.Round).BindValueChanged(_ => + boundReference(match.Team1).BindValueChanged(_ => updateTeams()); + boundReference(match.Team2).BindValueChanged(_ => updateTeams()); + boundReference(match.Team1Score).BindValueChanged(_ => updateWinConditions()); + boundReference(match.Team2Score).BindValueChanged(_ => updateWinConditions()); + boundReference(match.Round).BindValueChanged(_ => { updateWinConditions(); Changed?.Invoke(); }); - boundReference(pairing.Completed).BindValueChanged(_ => updateProgression()); - boundReference(pairing.Progression).BindValueChanged(_ => updateProgression()); - boundReference(pairing.LosersProgression).BindValueChanged(_ => updateProgression()); - boundReference(pairing.Losers).BindValueChanged(_ => + boundReference(match.Completed).BindValueChanged(_ => updateProgression()); + boundReference(match.Progression).BindValueChanged(_ => updateProgression()); + boundReference(match.LosersProgression).BindValueChanged(_ => updateProgression()); + boundReference(match.Losers).BindValueChanged(_ => { updateTeams(); Changed?.Invoke(); }); - boundReference(pairing.Current).BindValueChanged(_ => updateCurrentMatch(), true); - boundReference(pairing.Position).BindValueChanged(pos => + boundReference(match.Current).BindValueChanged(_ => updateCurrentMatch(), true); + boundReference(match.Position).BindValueChanged(pos => { if (!IsDragged) Position = new Vector2(pos.NewValue.X, pos.NewValue.Y); @@ -127,7 +127,7 @@ namespace osu.Game.Tournament.Screens.Ladder.Components private void updateCurrentMatch() { - if (Pairing.Current.Value) + if (Match.Current.Value) currentMatchSelectionBox.Show(); else currentMatchSelectionBox.Hide(); @@ -149,9 +149,9 @@ namespace osu.Game.Tournament.Screens.Ladder.Components { selectionBox.Show(); if (editor) - editorInfo.Selected.Value = Pairing; + editorInfo.Selected.Value = Match; else - ladderInfo.CurrentMatch.Value = Pairing; + ladderInfo.CurrentMatch.Value = Match; } else selectionBox.Hide(); @@ -160,36 +160,36 @@ namespace osu.Game.Tournament.Screens.Ladder.Components private void updateProgression() { - if (!Pairing.Completed.Value) + if (!Match.Completed.Value) { // ensure we clear any of our teams from our progression. // this is not pretty logic but should suffice for now. - if (Pairing.Progression.Value != null && Pairing.Progression.Value.Team1.Value == Pairing.Team1.Value) - Pairing.Progression.Value.Team1.Value = null; + if (Match.Progression.Value != null && Match.Progression.Value.Team1.Value == Match.Team1.Value) + Match.Progression.Value.Team1.Value = null; - if (Pairing.Progression.Value != null && Pairing.Progression.Value.Team2.Value == Pairing.Team2.Value) - Pairing.Progression.Value.Team2.Value = null; + if (Match.Progression.Value != null && Match.Progression.Value.Team2.Value == Match.Team2.Value) + Match.Progression.Value.Team2.Value = null; - if (Pairing.LosersProgression.Value != null && Pairing.LosersProgression.Value.Team1.Value == Pairing.Team1.Value) - Pairing.LosersProgression.Value.Team1.Value = null; + if (Match.LosersProgression.Value != null && Match.LosersProgression.Value.Team1.Value == Match.Team1.Value) + Match.LosersProgression.Value.Team1.Value = null; - if (Pairing.LosersProgression.Value != null && Pairing.LosersProgression.Value.Team2.Value == Pairing.Team2.Value) - Pairing.LosersProgression.Value.Team2.Value = null; + if (Match.LosersProgression.Value != null && Match.LosersProgression.Value.Team2.Value == Match.Team2.Value) + Match.LosersProgression.Value.Team2.Value = null; } else { - transferProgression(Pairing.Progression?.Value, Pairing.Winner); - transferProgression(Pairing.LosersProgression?.Value, Pairing.Loser); + transferProgression(Match.Progression?.Value, Match.Winner); + transferProgression(Match.LosersProgression?.Value, Match.Loser); } Changed?.Invoke(); } - private void transferProgression(MatchPairing destination, TournamentTeam team) + private void transferProgression(TournamentMatch destination, TournamentTeam team) { if (destination == null) return; - bool progressionAbove = destination.ID < Pairing.ID; + bool progressionAbove = destination.ID < Match.ID; Bindable destinationTeam; @@ -210,12 +210,12 @@ namespace osu.Game.Tournament.Screens.Ladder.Components private void updateWinConditions() { - if (Pairing.Round.Value == null) return; + if (Match.Round.Value == null) return; - var instaWinAmount = Pairing.Round.Value.BestOf.Value / 2; + var instaWinAmount = Match.Round.Value.BestOf.Value / 2; - Pairing.Completed.Value = Pairing.Round.Value.BestOf.Value > 0 - && (Pairing.Team1Score.Value + Pairing.Team2Score.Value >= Pairing.Round.Value.BestOf.Value || Pairing.Team1Score.Value > instaWinAmount || Pairing.Team2Score.Value > instaWinAmount); + Match.Completed.Value = Match.Round.Value.BestOf.Value > 0 + && (Match.Team1Score.Value + Match.Team2Score.Value >= Match.Round.Value.BestOf.Value || Match.Team1Score.Value > instaWinAmount || Match.Team2Score.Value > instaWinAmount); } protected override void LoadComplete() @@ -228,7 +228,7 @@ namespace osu.Game.Tournament.Screens.Ladder.Components globalSelection = editorInfo.Selected.GetBoundCopy(); globalSelection.BindValueChanged(s => { - if (s.NewValue != Pairing) Selected = false; + if (s.NewValue != Match) Selected = false; }); } } @@ -240,25 +240,25 @@ namespace osu.Game.Tournament.Screens.Ladder.Components // todo: teams may need to be bindable for transitions at a later point. - if (Pairing.Team1.Value == null || Pairing.Team2.Value == null) - Pairing.CancelMatchStart(); + if (Match.Team1.Value == null || Match.Team2.Value == null) + Match.CancelMatchStart(); - if (Pairing.ConditionalPairings.Count > 0) + if (Match.ConditionalMatches.Count > 0) { - foreach (var conditional in Pairing.ConditionalPairings) + foreach (var conditional in Match.ConditionalMatches) { - var team1Match = conditional.Acronyms.Contains(Pairing.Team1Acronym); - var team2Match = conditional.Acronyms.Contains(Pairing.Team2Acronym); + var team1Match = conditional.Acronyms.Contains(Match.Team1Acronym); + var team2Match = conditional.Acronyms.Contains(Match.Team2Acronym); if (team1Match && team2Match) - Pairing.Date.Value = conditional.Date.Value; + Match.Date.Value = conditional.Date.Value; } } Flow.Children = new[] { - new DrawableMatchTeam(Pairing.Team1.Value, Pairing, Pairing.Losers.Value), - new DrawableMatchTeam(Pairing.Team2.Value, Pairing, Pairing.Losers.Value) + new DrawableMatchTeam(Match.Team1.Value, Match, Match.Losers.Value), + new DrawableMatchTeam(Match.Team2.Value, Match, Match.Losers.Value) }; SchedulerAfterChildren.Add(() => Scheduler.Add(updateProgression)); @@ -282,7 +282,7 @@ namespace osu.Game.Tournament.Screens.Ladder.Components protected override bool OnClick(ClickEvent e) { - if (editorInfo == null || Pairing is ConditionalMatchPairing) + if (editorInfo == null || Match is ConditionalTournamentMatch) return false; Selected = true; @@ -297,17 +297,17 @@ namespace osu.Game.Tournament.Screens.Ladder.Components this.MoveToOffset(e.Delta); var pos = Position; - Pairing.Position.Value = new Point((int)pos.X, (int)pos.Y); + Match.Position.Value = new Point((int)pos.X, (int)pos.Y); return true; } public void Remove() { Selected = false; - Pairing.Progression.Value = null; - Pairing.LosersProgression.Value = null; + Match.Progression.Value = null; + Match.LosersProgression.Value = null; - ladderInfo.Pairings.Remove(Pairing); + ladderInfo.Matches.Remove(Match); } } } diff --git a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs index 5514dfce3e..ded21730f3 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs @@ -24,7 +24,7 @@ namespace osu.Game.Tournament.Screens.Ladder.Components { public class DrawableMatchTeam : DrawableTournamentTeam, IHasContextMenu { - private readonly MatchPairing pairing; + private readonly TournamentMatch match; private readonly bool losers; private OsuSpriteText scoreText; private Box background; @@ -47,17 +47,17 @@ namespace osu.Game.Tournament.Screens.Ladder.Components if (ladderInfo.CurrentMatch.Value != null) ladderInfo.CurrentMatch.Value.Current.Value = false; - ladderInfo.CurrentMatch.Value = pairing; + ladderInfo.CurrentMatch.Value = match; ladderInfo.CurrentMatch.Value.Current.Value = true; } [Resolved(CanBeNull = true)] private LadderEditorInfo editorInfo { get; set; } - public DrawableMatchTeam(TournamentTeam team, MatchPairing pairing, bool losers) + public DrawableMatchTeam(TournamentTeam team, TournamentMatch match, bool losers) : base(team) { - this.pairing = pairing; + this.match = match; this.losers = losers; Size = new Vector2(150, 40); @@ -71,13 +71,13 @@ namespace osu.Game.Tournament.Screens.Ladder.Components AcronymText.Padding = new MarginPadding { Left = 50 }; AcronymText.Font = OsuFont.GetFont(size: 24); - if (pairing != null) + if (match != null) { - isWinner = () => pairing.Winner == Team; + isWinner = () => match.Winner == Team; - completed.BindTo(pairing.Completed); + completed.BindTo(match.Completed); if (team != null) - score.BindTo(team == pairing.Team1.Value ? pairing.Team1Score : pairing.Team2Score); + score.BindTo(team == match.Team1.Value ? match.Team1Score : match.Team2Score); } } @@ -144,7 +144,7 @@ namespace osu.Game.Tournament.Screens.Ladder.Components { if (Team == null || editorInfo != null) return false; - if (!pairing.Current.Value) + if (!match.Current.Value) { setCurrent(); return true; @@ -154,25 +154,25 @@ namespace osu.Game.Tournament.Screens.Ladder.Components { if (score.Value == null) { - pairing.StartMatch(); + match.StartMatch(); } - else if (!pairing.Completed.Value) + else if (!match.Completed.Value) score.Value++; } else { - if (pairing.Progression.Value?.Completed.Value == true) + if (match.Progression.Value?.Completed.Value == true) // don't allow changing scores if the match has a progression. can cause large data loss return false; - if (pairing.Completed.Value && pairing.Winner != Team) + if (match.Completed.Value && match.Winner != Team) // don't allow changing scores from the non-winner return false; if (score.Value > 0) score.Value--; else - pairing.CancelMatchStart(); + match.CancelMatchStart(); } return false; @@ -197,9 +197,9 @@ namespace osu.Game.Tournament.Screens.Ladder.Components return new MenuItem[] { new OsuMenuItem("Set as current", MenuItemType.Standard, setCurrent), - new OsuMenuItem("Join with", MenuItemType.Standard, () => ladderEditor.BeginJoin(pairing, false)), - new OsuMenuItem("Join with (loser)", MenuItemType.Standard, () => ladderEditor.BeginJoin(pairing, true)), - new OsuMenuItem("Remove", MenuItemType.Destructive, () => ladderEditor.Remove(pairing)), + new OsuMenuItem("Join with", MenuItemType.Standard, () => ladderEditor.BeginJoin(match, false)), + new OsuMenuItem("Join with (loser)", MenuItemType.Standard, () => ladderEditor.BeginJoin(match, true)), + new OsuMenuItem("Remove", MenuItemType.Destructive, () => ladderEditor.Remove(match)), }; } } diff --git a/osu.Game.Tournament/Screens/Ladder/Components/ProgressionPath.cs b/osu.Game.Tournament/Screens/Ladder/Components/ProgressionPath.cs index 5468844f66..34e0dc770f 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/ProgressionPath.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/ProgressionPath.cs @@ -10,10 +10,10 @@ namespace osu.Game.Tournament.Screens.Ladder.Components { public class ProgressionPath : Path { - public DrawableMatchPairing Source { get; private set; } - public DrawableMatchPairing Destination { get; private set; } + public DrawableTournamentMatch Source { get; private set; } + public DrawableTournamentMatch Destination { get; private set; } - public ProgressionPath(DrawableMatchPairing source, DrawableMatchPairing destination) + public ProgressionPath(DrawableTournamentMatch source, DrawableTournamentMatch destination) { Source = source; Destination = destination; diff --git a/osu.Game.Tournament/Screens/Ladder/LadderScreen.cs b/osu.Game.Tournament/Screens/Ladder/LadderScreen.cs index 50675a6147..67531ce5d3 100644 --- a/osu.Game.Tournament/Screens/Ladder/LadderScreen.cs +++ b/osu.Game.Tournament/Screens/Ladder/LadderScreen.cs @@ -20,7 +20,7 @@ namespace osu.Game.Tournament.Screens.Ladder { public class LadderScreen : TournamentScreen, IProvideVideo { - protected Container PairingsContainer; + protected Container MatchesContainer; private Container paths; private Container headings; @@ -53,35 +53,35 @@ namespace osu.Game.Tournament.Screens.Ladder { paths = new Container { RelativeSizeAxes = Axes.Both }, headings = new Container { RelativeSizeAxes = Axes.Both }, - PairingsContainer = new Container { RelativeSizeAxes = Axes.Both }, + MatchesContainer = new Container { RelativeSizeAxes = Axes.Both }, } }, } }; - void addPairing(MatchPairing pairing) => - PairingsContainer.Add(new DrawableMatchPairing(pairing, this is LadderEditorScreen) + void addMatch(TournamentMatch match) => + MatchesContainer.Add(new DrawableTournamentMatch(match, this is LadderEditorScreen) { Changed = () => layout.Invalidate() }); - foreach (var pairing in LadderInfo.Pairings) - addPairing(pairing); + foreach (var match in LadderInfo.Matches) + addMatch(match); LadderInfo.Rounds.ItemsAdded += _ => layout.Invalidate(); LadderInfo.Rounds.ItemsRemoved += _ => layout.Invalidate(); - LadderInfo.Pairings.ItemsAdded += pairings => + LadderInfo.Matches.ItemsAdded += matches => { - foreach (var p in pairings) - addPairing(p); + foreach (var p in matches) + addMatch(p); layout.Invalidate(); }; - LadderInfo.Pairings.ItemsRemoved += pairings => + LadderInfo.Matches.ItemsRemoved += matches => { - foreach (var p in pairings) - foreach (var d in PairingsContainer.Where(d => d.Pairing == p)) + foreach (var p in matches) + foreach (var d in MatchesContainer.Where(d => d.Match == p)) d.Expire(); layout.Invalidate(); @@ -110,45 +110,45 @@ namespace osu.Game.Tournament.Screens.Ladder int id = 1; - foreach (var pairing in PairingsContainer.OrderBy(d => d.Y).ThenBy(d => d.X)) + foreach (var match in MatchesContainer.OrderBy(d => d.Y).ThenBy(d => d.X)) { - pairing.Pairing.ID = id++; + match.Match.ID = id++; - if (pairing.Pairing.Progression.Value != null) + if (match.Match.Progression.Value != null) { - var dest = PairingsContainer.FirstOrDefault(p => p.Pairing == pairing.Pairing.Progression.Value); + var dest = MatchesContainer.FirstOrDefault(p => p.Match == match.Match.Progression.Value); if (dest == null) // clean up outdated progressions. - pairing.Pairing.Progression.Value = null; + match.Match.Progression.Value = null; else - paths.Add(new ProgressionPath(pairing, dest) { Colour = pairing.Pairing.Losers.Value ? losersPathColour : normalPathColour }); + paths.Add(new ProgressionPath(match, dest) { Colour = match.Match.Losers.Value ? losersPathColour : normalPathColour }); } if (DrawLoserPaths) { - if (pairing.Pairing.LosersProgression.Value != null) + if (match.Match.LosersProgression.Value != null) { - var dest = PairingsContainer.FirstOrDefault(p => p.Pairing == pairing.Pairing.LosersProgression.Value); + var dest = MatchesContainer.FirstOrDefault(p => p.Match == match.Match.LosersProgression.Value); if (dest == null) // clean up outdated progressions. - pairing.Pairing.LosersProgression.Value = null; + match.Match.LosersProgression.Value = null; else - paths.Add(new ProgressionPath(pairing, dest) { Colour = losersPathColour.Opacity(0.1f) }); + paths.Add(new ProgressionPath(match, dest) { Colour = losersPathColour.Opacity(0.1f) }); } } } foreach (var round in LadderInfo.Rounds) { - var topPairing = PairingsContainer.Where(p => !p.Pairing.Losers.Value && p.Pairing.Round.Value == round).OrderBy(p => p.Y).FirstOrDefault(); + var topMatch = MatchesContainer.Where(p => !p.Match.Losers.Value && p.Match.Round.Value == round).OrderBy(p => p.Y).FirstOrDefault(); - if (topPairing == null) continue; + if (topMatch == null) continue; headings.Add(new DrawableTournamentRound(round) { - Position = headings.ToLocalSpace((topPairing.ScreenSpaceDrawQuad.TopLeft + topPairing.ScreenSpaceDrawQuad.TopRight) / 2), + Position = headings.ToLocalSpace((topMatch.ScreenSpaceDrawQuad.TopLeft + topMatch.ScreenSpaceDrawQuad.TopRight) / 2), Margin = new MarginPadding { Bottom = 10 }, Origin = Anchor.BottomCentre, }); @@ -156,13 +156,13 @@ namespace osu.Game.Tournament.Screens.Ladder foreach (var round in LadderInfo.Rounds) { - var topPairing = PairingsContainer.Where(p => p.Pairing.Losers.Value && p.Pairing.Round.Value == round).OrderBy(p => p.Y).FirstOrDefault(); + var topMatch = MatchesContainer.Where(p => p.Match.Losers.Value && p.Match.Round.Value == round).OrderBy(p => p.Y).FirstOrDefault(); - if (topPairing == null) continue; + if (topMatch == null) continue; headings.Add(new DrawableTournamentRound(round, true) { - Position = headings.ToLocalSpace((topPairing.ScreenSpaceDrawQuad.TopLeft + topPairing.ScreenSpaceDrawQuad.TopRight) / 2), + Position = headings.ToLocalSpace((topMatch.ScreenSpaceDrawQuad.TopLeft + topMatch.ScreenSpaceDrawQuad.TopRight) / 2), Margin = new MarginPadding { Bottom = 10 }, Origin = Anchor.BottomCentre, }); diff --git a/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs b/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs index ab03adbce9..1c5f07ce19 100644 --- a/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs +++ b/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs @@ -26,7 +26,7 @@ namespace osu.Game.Tournament.Screens.MapPool { private readonly FillFlowContainer> mapFlows; - private readonly Bindable currentMatch = new Bindable(); + private readonly Bindable currentMatch = new Bindable(); [Resolved(canBeNull: true)] private TournamentSceneManager sceneManager { get; set; } @@ -203,7 +203,7 @@ namespace osu.Game.Tournament.Screens.MapPool } } - private void matchChanged(ValueChangedEvent match) + private void matchChanged(ValueChangedEvent match) { mapFlows.Clear(); diff --git a/osu.Game.Tournament/Screens/Schedule/ScheduleScreen.cs b/osu.Game.Tournament/Screens/Schedule/ScheduleScreen.cs index 457fb80141..4b46264055 100644 --- a/osu.Game.Tournament/Screens/Schedule/ScheduleScreen.cs +++ b/osu.Game.Tournament/Screens/Schedule/ScheduleScreen.cs @@ -21,7 +21,7 @@ namespace osu.Game.Tournament.Screens.Schedule { public class ScheduleScreen : TournamentScreen, IProvideVideo { - private readonly Bindable currentMatch = new Bindable(); + private readonly Bindable currentMatch = new Bindable(); private Container mainContainer; private LadderInfo ladder; @@ -49,7 +49,7 @@ namespace osu.Game.Tournament.Screens.Schedule currentMatch.BindTo(ladder.CurrentMatch); } - private void matchChanged(ValueChangedEvent match) + private void matchChanged(ValueChangedEvent match) { if (match.NewValue == null) { @@ -57,10 +57,10 @@ namespace osu.Game.Tournament.Screens.Schedule return; } - var upcoming = ladder.Pairings.Where(p => !p.Completed.Value && p.Team1.Value != null && p.Team2.Value != null && Math.Abs(p.Date.Value.DayOfYear - DateTimeOffset.UtcNow.DayOfYear) < 4); + var upcoming = ladder.Matches.Where(p => !p.Completed.Value && p.Team1.Value != null && p.Team2.Value != null && Math.Abs(p.Date.Value.DayOfYear - DateTimeOffset.UtcNow.DayOfYear) < 4); var conditionals = ladder - .Pairings.Where(p => !p.Completed.Value && (p.Team1.Value == null || p.Team2.Value == null) && Math.Abs(p.Date.Value.DayOfYear - DateTimeOffset.UtcNow.DayOfYear) < 4) - .SelectMany(m => m.ConditionalPairings.Where(cp => m.Acronyms.TrueForAll(a => cp.Acronyms.Contains(a)))); + .Matches.Where(p => !p.Completed.Value && (p.Team1.Value == null || p.Team2.Value == null) && Math.Abs(p.Date.Value.DayOfYear - DateTimeOffset.UtcNow.DayOfYear) < 4) + .SelectMany(m => m.ConditionalMatches.Where(cp => m.Acronyms.TrueForAll(a => cp.Acronyms.Contains(a)))); upcoming = upcoming.Concat(conditionals); upcoming = upcoming.OrderBy(p => p.Date.Value).Take(12); @@ -85,18 +85,18 @@ namespace osu.Game.Tournament.Screens.Schedule { RelativeSizeAxes = Axes.Both, Width = 0.4f, - ChildrenEnumerable = ladder.Pairings + ChildrenEnumerable = ladder.Matches .Where(p => p.Completed.Value && p.Team1.Value != null && p.Team2.Value != null && Math.Abs(p.Date.Value.DayOfYear - DateTimeOffset.UtcNow.DayOfYear) < 4) .OrderByDescending(p => p.Date.Value) .Take(8) - .Select(p => new SchedulePairing(p)) + .Select(p => new ScheduleMatch(p)) }, new ScheduleContainer("match overview") { RelativeSizeAxes = Axes.Both, Width = 0.6f, - ChildrenEnumerable = upcoming.Select(p => new SchedulePairing(p)) + ChildrenEnumerable = upcoming.Select(p => new ScheduleMatch(p)) }, } } @@ -115,7 +115,7 @@ namespace osu.Game.Tournament.Screens.Schedule Colour = Color4.Black, Font = OsuFont.GetFont(size: 20) }, - new SchedulePairing(match.NewValue, false), + new ScheduleMatch(match.NewValue, false), new OsuSpriteText { Text = "Start Time " + match.NewValue.Date.Value.ToUniversalTime().ToString("HH:mm UTC"), @@ -128,21 +128,21 @@ namespace osu.Game.Tournament.Screens.Schedule }; } - public class SchedulePairing : DrawableMatchPairing + public class ScheduleMatch : DrawableTournamentMatch { - public SchedulePairing(MatchPairing pairing, bool showTimestamp = true) - : base(pairing) + public ScheduleMatch(TournamentMatch match, bool showTimestamp = true) + : base(match) { Flow.Direction = FillDirection.Horizontal; - bool conditional = pairing is ConditionalMatchPairing; + bool conditional = match is ConditionalTournamentMatch; if (conditional) Colour = OsuColour.Gray(0.5f); if (showTimestamp) { - AddInternal(new DrawableDate(Pairing.Date.Value) + AddInternal(new DrawableDate(Match.Date.Value) { Anchor = Anchor.TopRight, Origin = Anchor.TopLeft, @@ -157,7 +157,7 @@ namespace osu.Game.Tournament.Screens.Schedule Colour = Color4.Black, Alpha = conditional ? 0.6f : 1, Margin = new MarginPadding { Horizontal = 10, Vertical = 5 }, - Text = pairing.Date.Value.ToUniversalTime().ToString("HH:mm UTC") + (conditional ? " (conditional)" : "") + Text = match.Date.Value.ToUniversalTime().ToString("HH:mm UTC") + (conditional ? " (conditional)" : "") }); } } diff --git a/osu.Game.Tournament/Screens/TeamIntro/TeamIntroScreen.cs b/osu.Game.Tournament/Screens/TeamIntro/TeamIntroScreen.cs index 4e0bb23a62..2cb4ffe4e9 100644 --- a/osu.Game.Tournament/Screens/TeamIntro/TeamIntroScreen.cs +++ b/osu.Game.Tournament/Screens/TeamIntro/TeamIntroScreen.cs @@ -20,7 +20,7 @@ namespace osu.Game.Tournament.Screens.TeamIntro { private Container mainContainer; - private readonly Bindable currentMatch = new Bindable(); + private readonly Bindable currentMatch = new Bindable(); [BackgroundDependencyLoader] private void load(Storage storage) @@ -45,9 +45,9 @@ namespace osu.Game.Tournament.Screens.TeamIntro currentMatch.BindTo(LadderInfo.CurrentMatch); } - private void matchChanged(ValueChangedEvent pairing) + private void matchChanged(ValueChangedEvent match) { - if (pairing.NewValue == null) + if (match.NewValue == null) { mainContainer.Clear(); return; @@ -55,7 +55,7 @@ namespace osu.Game.Tournament.Screens.TeamIntro mainContainer.Children = new Drawable[] { - new TeamWithPlayers(pairing.NewValue.Team1.Value, true) + new TeamWithPlayers(match.NewValue.Team1.Value, true) { RelativeSizeAxes = Axes.Both, Width = 0.5f, @@ -63,7 +63,7 @@ namespace osu.Game.Tournament.Screens.TeamIntro Anchor = Anchor.Centre, Origin = Anchor.CentreRight }, - new TeamWithPlayers(pairing.NewValue.Team2.Value) + new TeamWithPlayers(match.NewValue.Team2.Value) { RelativeSizeAxes = Axes.Both, Width = 0.5f, @@ -71,7 +71,7 @@ namespace osu.Game.Tournament.Screens.TeamIntro Anchor = Anchor.Centre, Origin = Anchor.CentreLeft }, - new RoundDisplay(pairing.NewValue) + new RoundDisplay(match.NewValue) { RelativeSizeAxes = Axes.Both, Height = 0.25f, @@ -83,7 +83,7 @@ namespace osu.Game.Tournament.Screens.TeamIntro private class RoundDisplay : CompositeDrawable { - public RoundDisplay(MatchPairing pairing) + public RoundDisplay(TournamentMatch match) { var col = OsuColour.Gray(0.33f); @@ -112,7 +112,7 @@ namespace osu.Game.Tournament.Screens.TeamIntro Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, Colour = col, - Text = pairing.Round.Value?.Name.Value ?? "Unknown Round", + Text = match.Round.Value?.Name.Value ?? "Unknown Round", Spacing = new Vector2(10, 0), Font = OsuFont.GetFont(size: 50, weight: FontWeight.Light) }, @@ -121,7 +121,7 @@ namespace osu.Game.Tournament.Screens.TeamIntro Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, Colour = col, - Text = pairing.Date.Value.ToUniversalTime().ToString("dd MMMM HH:mm UTC"), + Text = match.Date.Value.ToUniversalTime().ToString("dd MMMM HH:mm UTC"), Font = OsuFont.GetFont(size: 20) }, } diff --git a/osu.Game.Tournament/Screens/TeamWin/TeamWinScreen.cs b/osu.Game.Tournament/Screens/TeamWin/TeamWinScreen.cs index 0a37cf6c4a..efe4ee92fc 100644 --- a/osu.Game.Tournament/Screens/TeamWin/TeamWinScreen.cs +++ b/osu.Game.Tournament/Screens/TeamWin/TeamWinScreen.cs @@ -20,7 +20,7 @@ namespace osu.Game.Tournament.Screens.TeamWin { private Container mainContainer; - private readonly Bindable currentMatch = new Bindable(); + private readonly Bindable currentMatch = new Bindable(); private readonly Bindable currentCompleted = new Bindable(); private TourneyVideo blueWinVideo; @@ -61,31 +61,31 @@ namespace osu.Game.Tournament.Screens.TeamWin currentCompleted.BindValueChanged(_ => update()); } - private void matchChanged(ValueChangedEvent pairing) + private void matchChanged(ValueChangedEvent match) { currentCompleted.UnbindBindings(); - currentCompleted.BindTo(pairing.NewValue.Completed); + currentCompleted.BindTo(match.NewValue.Completed); update(); } private void update() { - var pairing = currentMatch.Value; + var match = currentMatch.Value; - if (pairing.Winner == null) + if (match.Winner == null) { mainContainer.Clear(); return; } - bool redWin = pairing.Winner == pairing.Team1.Value; + bool redWin = match.Winner == match.Team1.Value; redWinVideo.Alpha = redWin ? 1 : 0; blueWinVideo.Alpha = redWin ? 0 : 1; mainContainer.Children = new Drawable[] { - new TeamWithPlayers(pairing.Winner, redWin) + new TeamWithPlayers(match.Winner, redWin) { RelativeSizeAxes = Axes.Both, Width = 0.5f, @@ -93,7 +93,7 @@ namespace osu.Game.Tournament.Screens.TeamWin Anchor = Anchor.Centre, Origin = Anchor.Centre }, - new RoundDisplay(pairing) + new RoundDisplay(match) { RelativeSizeAxes = Axes.Both, Height = 0.25f, @@ -105,7 +105,7 @@ namespace osu.Game.Tournament.Screens.TeamWin private class RoundDisplay : CompositeDrawable { - public RoundDisplay(MatchPairing pairing) + public RoundDisplay(TournamentMatch match) { var col = OsuColour.Gray(0.33f); @@ -133,7 +133,7 @@ namespace osu.Game.Tournament.Screens.TeamWin Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, Colour = col, - Text = pairing.Round.Value?.Name.Value ?? "Unknown Round", + Text = match.Round.Value?.Name.Value ?? "Unknown Round", Font = TournamentFont.GetFont(TournamentTypeface.Aquatico, 50, FontWeight.Light), Spacing = new Vector2(10, 0), }, @@ -142,7 +142,7 @@ namespace osu.Game.Tournament.Screens.TeamWin Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, Colour = col, - Text = pairing.Date.Value.ToUniversalTime().ToString("dd MMMM HH:mm UTC"), + Text = match.Date.Value.ToUniversalTime().ToString("dd MMMM HH:mm UTC"), Font = TournamentFont.GetFont(TournamentTypeface.Aquatico, 20, FontWeight.Light), }, } diff --git a/osu.Game.Tournament/TournamentGameBase.cs b/osu.Game.Tournament/TournamentGameBase.cs index e35e0b0d30..fb96641bcf 100644 --- a/osu.Game.Tournament/TournamentGameBase.cs +++ b/osu.Game.Tournament/TournamentGameBase.cs @@ -61,7 +61,7 @@ namespace osu.Game.Tournament readBracket(); - ladder.CurrentMatch.Value = ladder.Pairings.FirstOrDefault(p => p.Current.Value); + ladder.CurrentMatch.Value = ladder.Matches.FirstOrDefault(p => p.Current.Value); dependencies.CacheAs(ipc = new FileBasedIPC()); Add(ipc); @@ -97,24 +97,24 @@ namespace osu.Game.Tournament bool addedInfo = false; // assign teams - foreach (var pairing in ladder.Pairings) + foreach (var match in ladder.Matches) { - pairing.Team1.Value = ladder.Teams.FirstOrDefault(t => t.Acronym.Value == pairing.Team1Acronym); - pairing.Team2.Value = ladder.Teams.FirstOrDefault(t => t.Acronym.Value == pairing.Team2Acronym); + match.Team1.Value = ladder.Teams.FirstOrDefault(t => t.Acronym.Value == match.Team1Acronym); + match.Team2.Value = ladder.Teams.FirstOrDefault(t => t.Acronym.Value == match.Team2Acronym); - foreach (var conditional in pairing.ConditionalPairings) + foreach (var conditional in match.ConditionalMatches) { conditional.Team1.Value = ladder.Teams.FirstOrDefault(t => t.Acronym.Value == conditional.Team1Acronym); conditional.Team2.Value = ladder.Teams.FirstOrDefault(t => t.Acronym.Value == conditional.Team2Acronym); - conditional.Round.Value = pairing.Round.Value; + conditional.Round.Value = match.Round.Value; } } // assign progressions foreach (var pair in ladder.Progressions) { - var src = ladder.Pairings.FirstOrDefault(p => p.ID == pair.SourceID); - var dest = ladder.Pairings.FirstOrDefault(p => p.ID == pair.TargetID); + var src = ladder.Matches.FirstOrDefault(p => p.ID == pair.SourceID); + var dest = ladder.Matches.FirstOrDefault(p => p.ID == pair.TargetID); if (src == null) throw new InvalidOperationException(); @@ -127,11 +127,11 @@ namespace osu.Game.Tournament } } - // link pairings to rounds + // link matches to rounds foreach (var round in ladder.Rounds) - foreach (var id in round.Pairings) + foreach (var id in round.Matches) { - var found = ladder.Pairings.FirstOrDefault(p => p.ID == id); + var found = ladder.Matches.FirstOrDefault(p => p.ID == id); if (found != null) { @@ -245,10 +245,10 @@ namespace osu.Game.Tournament protected virtual void SaveChanges() { foreach (var r in ladder.Rounds) - r.Pairings = ladder.Pairings.Where(p => p.Round.Value == r).Select(p => p.ID).ToList(); + r.Matches = ladder.Matches.Where(p => p.Round.Value == r).Select(p => p.ID).ToList(); - ladder.Progressions = ladder.Pairings.Where(p => p.Progression.Value != null).Select(p => new TournamentProgression(p.ID, p.Progression.Value.ID)).Concat( - ladder.Pairings.Where(p => p.LosersProgression.Value != null).Select(p => new TournamentProgression(p.ID, p.LosersProgression.Value.ID, true))) + ladder.Progressions = ladder.Matches.Where(p => p.Progression.Value != null).Select(p => new TournamentProgression(p.ID, p.Progression.Value.ID)).Concat( + ladder.Matches.Where(p => p.LosersProgression.Value != null).Select(p => new TournamentProgression(p.ID, p.LosersProgression.Value.ID, true))) .ToList(); using (var stream = storage.GetStream(bracket_filename, FileAccess.Write, FileMode.Create)) From 6226889d1c9f04e96bfd08d9045afed614e123cc Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 18 Jun 2019 15:00:33 +0900 Subject: [PATCH 256/317] Add xmldoc and serialisable attributes --- osu.Game.Tournament/Models/BeatmapChoice.cs | 5 +++++ osu.Game.Tournament/Models/LadderInfo.cs | 5 +++++ osu.Game.Tournament/Models/TournamentProgression.cs | 7 +++++++ osu.Game.Tournament/Models/TournamentRound.cs | 3 +++ osu.Game.Tournament/Models/TournamentTeam.cs | 3 +++ 5 files changed, 23 insertions(+) diff --git a/osu.Game.Tournament/Models/BeatmapChoice.cs b/osu.Game.Tournament/Models/BeatmapChoice.cs index c22077553b..384b349b24 100644 --- a/osu.Game.Tournament/Models/BeatmapChoice.cs +++ b/osu.Game.Tournament/Models/BeatmapChoice.cs @@ -1,11 +1,16 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. +using System; using Newtonsoft.Json; using Newtonsoft.Json.Converters; namespace osu.Game.Tournament.Models { + /// + /// A beatmap choice by a team from a tournament's map pool. + /// + [Serializable] public class BeatmapChoice { [JsonProperty(DefaultValueHandling = DefaultValueHandling.Populate)] diff --git a/osu.Game.Tournament/Models/LadderInfo.cs b/osu.Game.Tournament/Models/LadderInfo.cs index b6dc59c0d9..547c4eab08 100644 --- a/osu.Game.Tournament/Models/LadderInfo.cs +++ b/osu.Game.Tournament/Models/LadderInfo.cs @@ -1,12 +1,17 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. +using System; using System.Collections.Generic; using Newtonsoft.Json; using osu.Framework.Bindables; namespace osu.Game.Tournament.Models { + /// + /// Holds the complete data required to operate the tournament system. + /// + [Serializable] public class LadderInfo { public BindableList Matches = new BindableList(); diff --git a/osu.Game.Tournament/Models/TournamentProgression.cs b/osu.Game.Tournament/Models/TournamentProgression.cs index 4ef4be599d..3e9b2e05c5 100644 --- a/osu.Game.Tournament/Models/TournamentProgression.cs +++ b/osu.Game.Tournament/Models/TournamentProgression.cs @@ -1,8 +1,15 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. +using System; + namespace osu.Game.Tournament.Models { + /// + /// A mapping between two es. + /// Used for serialisation exclusively. + /// + [Serializable] public class TournamentProgression { public int SourceID; diff --git a/osu.Game.Tournament/Models/TournamentRound.cs b/osu.Game.Tournament/Models/TournamentRound.cs index e325ad4b96..35215e90c5 100644 --- a/osu.Game.Tournament/Models/TournamentRound.cs +++ b/osu.Game.Tournament/Models/TournamentRound.cs @@ -8,6 +8,9 @@ using osu.Framework.Bindables; namespace osu.Game.Tournament.Models { + /// + /// A tournament round, containing many matches, generally executed in a short time period. + /// [Serializable] public class TournamentRound { diff --git a/osu.Game.Tournament/Models/TournamentTeam.cs b/osu.Game.Tournament/Models/TournamentTeam.cs index eea1ef8104..54b8a35180 100644 --- a/osu.Game.Tournament/Models/TournamentTeam.cs +++ b/osu.Game.Tournament/Models/TournamentTeam.cs @@ -8,6 +8,9 @@ using osu.Game.Users; namespace osu.Game.Tournament.Models { + /// + /// A team representation. For official tournaments this is generally a country. + /// [Serializable] public class TournamentTeam { From 21138e6e2caf7a4e6f5fef7bc5092cbf9915d7be Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 18 Jun 2019 15:05:55 +0900 Subject: [PATCH 257/317] Fix mismatching filenames --- ...eMatchPairings.cs => TestSceneDrawableTournamentMatch.cs} | 5 ++--- .../{DrawableMatchPairing.cs => DrawableTournamentMatch.cs} | 0 2 files changed, 2 insertions(+), 3 deletions(-) rename osu.Game.Tournament.Tests/{TestSceneMatchPairings.cs => TestSceneDrawableTournamentMatch.cs} (96%) rename osu.Game.Tournament/Screens/Ladder/Components/{DrawableMatchPairing.cs => DrawableTournamentMatch.cs} (100%) diff --git a/osu.Game.Tournament.Tests/TestSceneMatchPairings.cs b/osu.Game.Tournament.Tests/TestSceneDrawableTournamentMatch.cs similarity index 96% rename from osu.Game.Tournament.Tests/TestSceneMatchPairings.cs rename to osu.Game.Tournament.Tests/TestSceneDrawableTournamentMatch.cs index 9c8ee2965e..c3a4519597 100644 --- a/osu.Game.Tournament.Tests/TestSceneMatchPairings.cs +++ b/osu.Game.Tournament.Tests/TestSceneDrawableTournamentMatch.cs @@ -12,17 +12,16 @@ using osu.Game.Tournament.Screens.Ladder.Components; namespace osu.Game.Tournament.Tests { - public class TestSceneMatches : OsuTestScene + public class TestSceneDrawableTournamentMatch : OsuTestScene { public override IReadOnlyList RequiredTypes => new[] { typeof(TournamentMatch), typeof(DrawableTournamentMatch), - typeof(DrawableMatchTeam), typeof(DrawableTournamentTeam), }; - public TestSceneMatches() + public TestSceneDrawableTournamentMatch() { Container level1; Container level2; diff --git a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs b/osu.Game.Tournament/Screens/Ladder/Components/DrawableTournamentMatch.cs similarity index 100% rename from osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs rename to osu.Game.Tournament/Screens/Ladder/Components/DrawableTournamentMatch.cs From 7652339dc0ff985abf5b5dd1f619b134696f7f84 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 18 Jun 2019 15:07:33 +0900 Subject: [PATCH 258/317] Remove test file --- osu.Game.Tournament.Tests/teams.json | 1 - 1 file changed, 1 deletion(-) delete mode 100644 osu.Game.Tournament.Tests/teams.json diff --git a/osu.Game.Tournament.Tests/teams.json b/osu.Game.Tournament.Tests/teams.json deleted file mode 100644 index 7df0040469..0000000000 --- a/osu.Game.Tournament.Tests/teams.json +++ /dev/null @@ -1 +0,0 @@ -[{"Players":[{"id":3632846,"username":"lxLucasxl"},{"id":7110363,"username":"BubShish"},{"id":5748843,"username":"Fisk-"},{"id":4585260,"username":"A b y s s"},{"id":9513273,"username":"VorticalEx"},{"id":7341471,"username":"Bossplays_02"}],"Name":"Argentina","Acronym":"ARG"},{"Players":[{"id":2956184,"username":"Lusty Platypus"},{"id":2145124,"username":"Spartan-"},{"id":4018184,"username":"Rek"},{"id":4247722,"username":"PotassiumF"},{"id":9527845,"username":"AngeLItchysick"},{"id":8832989,"username":"[Crz]Yukikaze-"}],"Name":"Australia","Acronym":"AUS"},{"Players":[{"id":9530019,"username":"Lothus"},{"id":2288363,"username":"SillyFangirl"},{"id":4917435,"username":"FelipeLink"},{"id":5691061,"username":"andreymc"},{"id":4794096,"username":"Shedin"},{"id":3224958,"username":"Lazarento"}],"Name":"Brazil","Acronym":"BRA"},{"Players":[{"id":2747704,"username":"Dawt"},{"id":7025841,"username":"CommandoBlack"},{"id":5390121,"username":"Piggy"},{"id":2198070,"username":"beary605"},{"id":2777647,"username":"Freeflow"},{"id":9675053,"username":"Kiyora"}],"Name":"Canada","Acronym":"CAN"},{"Players":[{"id":5281416,"username":"WalterToro"},{"id":2225008,"username":"Skalim"},{"id":469808,"username":"Sophti"},{"id":4686036,"username":"sebaex"},{"id":4116072,"username":"Arkener"},{"id":4531184,"username":"Raizenn"}],"Name":"Chile","Acronym":"CHL"},{"Players":[{"id":89545,"username":"ZhangFan"},{"id":7215250,"username":"[Crz]Mix0130"},{"id":7961511,"username":"[Crz]Hina"},{"id":7082178,"username":"[Crz]Satori"},{"id":6659363,"username":"Wilben_Chan"},{"id":5270332,"username":"[Crz]Lucifer"}],"Name":"China","Acronym":"CHN"},{"Players":[{"id":2883132,"username":"Jole"},{"id":5001658,"username":"FreakyHands"},{"id":4402263,"username":"mart732c"},{"id":6751666,"username":"tailsdk"},{"id":5352616,"username":"Kainura"},{"id":8969233,"username":"zyglrox"}],"Name":"Denmark","Acronym":"DNK"},{"Players":[{"id":8132964,"username":"Camopoltergeist"},{"id":4789005,"username":"princesswell"},{"id":9663200,"username":"--Vanilla--"},{"id":1982941,"username":"matti644"},{"id":8370443,"username":"Your Daughter"},{"id":8105584,"username":"Twist-X"}],"Name":"Finland","Acronym":"FIN"},{"Players":[{"id":1594604,"username":"Azubeur"},{"id":2284328,"username":"Elementaires"},{"id":3897919,"username":"AntoAa"},{"id":4056690,"username":"Todestrieb"},{"id":7190228,"username":"Cunu"},{"id":3909293,"username":"DemonWaves"}],"Name":"France","Acronym":"FRA"},{"Players":[{"id":4516252,"username":"Malox"},{"id":3357640,"username":"ElectroYan"},{"id":5587671,"username":"-Dom-"},{"id":9764403,"username":"tyro901"},{"id":7009106,"username":"Nediz"},{"id":6232245,"username":"LastExceed"}],"Name":"Germany","Acronym":"GER"},{"Players":[{"id":5417362,"username":"Mooncha"},{"id":2121137,"username":"ng051106"},{"id":4544555,"username":"Opean"},{"id":643394,"username":"Snow Note"}],"Name":"['Hong Kong']","Acronym":"HKG"},{"Players":[{"id":5767941,"username":"RemFangirl"},{"id":4557440,"username":"reyss"},{"id":5492871,"username":"LovelySerenade"},{"id":6045757,"username":"Nixeria-sama"},{"id":5114499,"username":"lombit"},{"id":3497139,"username":"LordBoker-"}],"Name":"Indonesia","Acronym":"IDN"},{"Players":[{"id":3461860,"username":"Yomiel"},{"id":5245132,"username":"BadIsTheNewGod"},{"id":3244389,"username":"Mura7797"},{"id":8889323,"username":"extramen"},{"id":8485394,"username":"Cribob"},{"id":6380163,"username":"CribobFanBoy"}],"Name":"Italy","Acronym":"ITA"},{"Players":[{"id":1824775,"username":"inteliser"},{"id":7540718,"username":"tinpura"},{"id":1847698,"username":"PiraTom"},{"id":10011429,"username":"[ misa ]"},{"id":8679066,"username":"mach_jp"},{"id":10242062,"username":"AMDuskia1996"}],"Name":"Japan","Acronym":"JPN"},{"Players":[{"id":3946113,"username":"idqoos123"},{"id":10543278,"username":"hh27v5Fangirl"},{"id":8566617,"username":"capchon"},{"id":5315736,"username":"my2tic"}],"Name":"Macau","Acronym":"MAC"},{"Players":[{"id":7727987,"username":"Neokje"},{"id":8287005,"username":"[MY]xRay"},{"id":9627666,"username":"Minisora"},{"id":6237337,"username":"watarakisah"},{"id":6363947,"username":"Kiritolow"},{"id":4477497,"username":"cheewee10"}],"Name":"Malaysia","Acronym":"MYS"},{"Players":[{"id":1098581,"username":"mrdawn2"},{"id":9369363,"username":"TheSnooperPS"},{"id":6964358,"username":"Redenor"},{"id":9630674,"username":"Freek"},{"id":2827823,"username":"Boots"},{"id":5183940,"username":"2fast4you98"}],"Name":"Netherlands","Acronym":"NLD"},{"Players":[{"id":86188,"username":"Staiain"},{"id":7676585,"username":"Bizarrely_F4st"},{"id":3494742,"username":"KarlF"},{"id":3750387,"username":"Falniir"},{"id":9000473,"username":"Jesen"},{"id":2764122,"username":"Hjeg"}],"Name":"Norway","Acronym":"NOR"},{"Players":[{"id":914472,"username":"akuma123"},{"id":6114633,"username":"DaZeRo5"},{"id":11885200,"username":"DaKub"},{"id":10218427,"username":"Ovento17"}],"Name":"Peru","Acronym":"PER"},{"Players":[{"id":2039089,"username":"arcwinolivirus"},{"id":4469895,"username":"SurfChu85"},{"id":2471512,"username":"JztCallMeRon"},{"id":9770359,"username":"Toyohime-"},{"id":2722489,"username":"Cielo Day"},{"id":3770641,"username":"Ainyan"}],"Name":"Philippines","Acronym":"PHL"},{"Players":[{"id":743282,"username":"Tidek"},{"id":1654221,"username":"Hudonom"},{"id":6382502,"username":"Kroly-"},{"id":6905790,"username":"Arkitev"},{"id":2235750,"username":"_underjoy"},{"id":3353343,"username":"[-Agonys-]"}],"Name":"Poland","Acronym":"POL"},{"Players":[{"id":9074986,"username":"AngeloLagusa"},{"id":5145890,"username":"Jormungand"},{"id":9847747,"username":"MAZAFUKER1337"},{"id":8035172,"username":"fegasaren"},{"id":7767168,"username":"claer"}],"Name":"['Russian Federation']","Acronym":"RUS"},{"Players":[{"id":7199159,"username":"ByeForNow"},{"id":876528,"username":"Tamaneko"},{"id":8612061,"username":"Polytetral"},{"id":7462804,"username":"Lindyes"},{"id":4574597,"username":"OrienST8"},{"id":9362562,"username":"LuigiClaren"}],"Name":"Singapore","Acronym":"SGP"},{"Players":[{"id":6699923,"username":"SuddenDeath"},{"id":7014697,"username":"Estonians"},{"id":8474029,"username":"wonder5193"},{"id":8283444,"username":"[ Special ]"},{"id":903155,"username":"Nausicaa"},{"id":7945868,"username":"SnowScent"}],"Name":"['South Korea']","Acronym":"KOR"},{"Players":[{"id":3154852,"username":"aitor98"},{"id":8141215,"username":"David5_"},{"id":7935867,"username":"miguel-580"},{"id":6809566,"username":"itsdarious555"},{"id":8497100,"username":"GreenSoul"}],"Name":"Spain","Acronym":"ESP"},{"Players":[{"id":1612580,"username":"Vent"},{"id":6872025,"username":"Couil"},{"id":2229274,"username":"Xytox"},{"id":4899311,"username":"Stug"},{"id":5045509,"username":"YoShiZoRi"},{"id":3918056,"username":"Craty"}],"Name":"Sweden","Acronym":"SWE"},{"Players":[{"id":4952941,"username":"Gamer97"},{"id":8642966,"username":"Adyrem"},{"id":8372292,"username":"doere_"},{"id":9593126,"username":"Monogai"},{"id":3974114,"username":"Haprapra"},{"id":2573716,"username":"Akayro"}],"Name":"Switzerland","Acronym":"CHE"},{"Players":[{"id":766374,"username":"LostCool"},{"id":2838908,"username":"4ksrub"},{"id":6535376,"username":"SharpKunG1412"},{"id":2772110,"username":"BossMadWolf"},{"id":8521723,"username":"MyZterioN-"},{"id":6456531,"username":"-[DaNieL_TH]-"}],"Name":"Thailand","Acronym":"THA"},{"Players":[{"id":2656856,"username":"Sakaki"},{"id":6193819,"username":"SaKuRaLaN"},{"id":1990582,"username":"mspstommy"},{"id":8819232,"username":"Tamamo Desu"},{"id":11531528,"username":"Red MewFew"},{"id":1967808,"username":"luckygino"}],"Name":"Taiwan","Acronym":"TWN"},{"Players":[{"id":3359035,"username":"Amascite"},{"id":4168230,"username":"PikachuNick"},{"id":3617889,"username":"itsjakey"},{"id":3799946,"username":"xSnaggles"},{"id":6814203,"username":"Civilization"},{"id":6701945,"username":"Domblade"}],"Name":"['United Kingdom']","Acronym":"GBR"},{"Players":[{"id":7616811,"username":"TheToaphster"},{"id":2141612,"username":"stupud man"},{"id":7687954,"username":"Neuro-"},{"id":3251373,"username":"-Electro-"},{"id":5610085,"username":"EtienneXC"},{"id":2594280,"username":"Chrubble"}],"Name":"['United States']","Acronym":"USA"},{"Players":[{"id":2243452,"username":"Nakatoru"},{"id":8065567,"username":"Aezlack"},{"id":8301758,"username":"Edvo"},{"id":2140739,"username":"[_Chichinya_]"},{"id":8198818,"username":"[_Gearfrik_]"},{"id":1489811,"username":"_Yisus_"}],"Name":"Venezuela","Acronym":"VEN"}] \ No newline at end of file From 7c163ad911f4c29b927dbd391cd000b1e0503802 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 18 Jun 2019 15:08:36 +0900 Subject: [PATCH 259/317] Move font-related code out of TournamentGame --- osu.Game.Tournament/TournamentFont.cs | 5 +++++ osu.Game.Tournament/TournamentGame.cs | 29 +-------------------------- 2 files changed, 6 insertions(+), 28 deletions(-) diff --git a/osu.Game.Tournament/TournamentFont.cs b/osu.Game.Tournament/TournamentFont.cs index d2925d7632..f9e60ff2bc 100644 --- a/osu.Game.Tournament/TournamentFont.cs +++ b/osu.Game.Tournament/TournamentFont.cs @@ -67,4 +67,9 @@ namespace osu.Game.Tournament return weightString; } } + + public enum TournamentTypeface + { + Aquatico + } } diff --git a/osu.Game.Tournament/TournamentGame.cs b/osu.Game.Tournament/TournamentGame.cs index 42e4ab3c13..7dbcf37af6 100644 --- a/osu.Game.Tournament/TournamentGame.cs +++ b/osu.Game.Tournament/TournamentGame.cs @@ -2,8 +2,6 @@ // See the LICENCE file in the repository root for full licence text. using osu.Framework.Graphics; -using osu.Framework.Graphics.Sprites; -using osu.Game.Graphics; using osu.Game.Graphics.Cursor; namespace osu.Game.Tournament @@ -20,33 +18,8 @@ namespace osu.Game.Tournament Child = new TournamentSceneManager() }); + // we don't want to show the menu cursor as it would appear on stream output. MenuCursorContainer.Cursor.Alpha = 0; } } - - public static class TournamentFontExtensions - { - /// - /// Creates a new by applying adjustments to this . - /// - /// The base . - /// The font typeface. If null, the value is copied from this . - /// The text size. If null, the value is copied from this . - /// The font weight. If null, the value is copied from this . - /// Whether the font is italic. If null, the value is copied from this . - /// Whether all characters should be spaced apart the same distance. If null, the value is copied from this . - /// The resulting . - public static FontUsage With(this FontUsage usage, TournamentTypeface? typeface = null, float? size = null, FontWeight? weight = null, bool? italics = null, bool? fixedWidth = null) - { - string familyString = typeface != null ? TournamentFont.GetFamilyString(typeface.Value) : usage.Family; - string weightString = weight != null ? TournamentFont.GetWeightString(familyString, weight.Value) : usage.Weight; - - return usage.With(familyString, size, weightString, italics, fixedWidth); - } - } - - public enum TournamentTypeface - { - Aquatico - } } From 3db6913a9c107d6b8b670833ffe419f2f72051e8 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 18 Jun 2019 15:15:28 +0900 Subject: [PATCH 260/317] Rename editor screens removing plurals --- ...oupingsEditorScreen.cs => TestSceneRoundEditorScreen.cs} | 4 ++-- ...eneTeamsEditorScreen.cs => TestSceneTeamEditorScreen.cs} | 6 +++--- .../Editors/{TeamsEditorScreen.cs => TeamEditorScreen.cs} | 4 ++-- osu.Game.Tournament/TournamentSceneManager.cs | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) rename osu.Game.Tournament.Tests/{TestSceneGroupingsEditorScreen.cs => TestSceneRoundEditorScreen.cs} (72%) rename osu.Game.Tournament.Tests/{TestSceneTeamsEditorScreen.cs => TestSceneTeamEditorScreen.cs} (64%) rename osu.Game.Tournament/Screens/Editors/{TeamsEditorScreen.cs => TeamEditorScreen.cs} (99%) diff --git a/osu.Game.Tournament.Tests/TestSceneGroupingsEditorScreen.cs b/osu.Game.Tournament.Tests/TestSceneRoundEditorScreen.cs similarity index 72% rename from osu.Game.Tournament.Tests/TestSceneGroupingsEditorScreen.cs rename to osu.Game.Tournament.Tests/TestSceneRoundEditorScreen.cs index e0a6f8e8b9..9c1207a718 100644 --- a/osu.Game.Tournament.Tests/TestSceneGroupingsEditorScreen.cs +++ b/osu.Game.Tournament.Tests/TestSceneRoundEditorScreen.cs @@ -5,9 +5,9 @@ using osu.Game.Tournament.Screens.Editors; namespace osu.Game.Tournament.Tests { - public class TestSceneGroupingsEditorScreen : LadderTestScene + public class TestSceneRoundEditorScreen : LadderTestScene { - public TestSceneGroupingsEditorScreen() + public TestSceneRoundEditorScreen() { Add(new RoundEditorScreen()); } diff --git a/osu.Game.Tournament.Tests/TestSceneTeamsEditorScreen.cs b/osu.Game.Tournament.Tests/TestSceneTeamEditorScreen.cs similarity index 64% rename from osu.Game.Tournament.Tests/TestSceneTeamsEditorScreen.cs rename to osu.Game.Tournament.Tests/TestSceneTeamEditorScreen.cs index 60323e1d84..df0b79d8a9 100644 --- a/osu.Game.Tournament.Tests/TestSceneTeamsEditorScreen.cs +++ b/osu.Game.Tournament.Tests/TestSceneTeamEditorScreen.cs @@ -5,11 +5,11 @@ using osu.Game.Tournament.Screens.Editors; namespace osu.Game.Tournament.Tests { - public class TestSceneTeamsEditorScreen : LadderTestScene + public class TestSceneTeamEditorScreen : LadderTestScene { - public TestSceneTeamsEditorScreen() + public TestSceneTeamEditorScreen() { - Add(new TeamsEditorScreen()); + Add(new TeamEditorScreen()); } } } diff --git a/osu.Game.Tournament/Screens/Editors/TeamsEditorScreen.cs b/osu.Game.Tournament/Screens/Editors/TeamEditorScreen.cs similarity index 99% rename from osu.Game.Tournament/Screens/Editors/TeamsEditorScreen.cs rename to osu.Game.Tournament/Screens/Editors/TeamEditorScreen.cs index 1bf3f1c6b9..ff272d5123 100644 --- a/osu.Game.Tournament/Screens/Editors/TeamsEditorScreen.cs +++ b/osu.Game.Tournament/Screens/Editors/TeamEditorScreen.cs @@ -20,11 +20,11 @@ using osuTK; namespace osu.Game.Tournament.Screens.Editors { - public class TeamsEditorScreen : TournamentScreen, IProvideVideo + public class TeamEditorScreen : TournamentScreen, IProvideVideo { private readonly FillFlowContainer items; - public TeamsEditorScreen() + public TeamEditorScreen() { AddRangeInternal(new Drawable[] { diff --git a/osu.Game.Tournament/TournamentSceneManager.cs b/osu.Game.Tournament/TournamentSceneManager.cs index 29f8eba579..4c255be463 100644 --- a/osu.Game.Tournament/TournamentSceneManager.cs +++ b/osu.Game.Tournament/TournamentSceneManager.cs @@ -72,7 +72,7 @@ namespace osu.Game.Tournament new ScheduleScreen(), new LadderScreen(), new LadderEditorScreen(), - new TeamsEditorScreen(), + new TeamEditorScreen(), new RoundEditorScreen(), new ShowcaseScreen(), new MapPoolScreen(), @@ -106,7 +106,7 @@ namespace osu.Game.Tournament Direction = FillDirection.Vertical, Children = new Drawable[] { - new OsuButton { RelativeSizeAxes = Axes.X, Text = "Team Editor", Action = () => SetScreen(typeof(TeamsEditorScreen)) }, + new OsuButton { RelativeSizeAxes = Axes.X, Text = "Team Editor", Action = () => SetScreen(typeof(TeamEditorScreen)) }, new OsuButton { RelativeSizeAxes = Axes.X, Text = "Rounds Editor", Action = () => SetScreen(typeof(RoundEditorScreen)) }, new OsuButton { RelativeSizeAxes = Axes.X, Text = "Bracket Editor", Action = () => SetScreen(typeof(LadderEditorScreen)) }, new Container { RelativeSizeAxes = Axes.X, Height = 50 }, From 1a9226365284a02c676f49fce7ddc774d421ac58 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 18 Jun 2019 15:18:06 +0900 Subject: [PATCH 261/317] Ignore parse errors rather than dying --- osu.Game.Tournament/TournamentGameBase.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game.Tournament/TournamentGameBase.cs b/osu.Game.Tournament/TournamentGameBase.cs index fb96641bcf..9f63cc2302 100644 --- a/osu.Game.Tournament/TournamentGameBase.cs +++ b/osu.Game.Tournament/TournamentGameBase.cs @@ -1,7 +1,6 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. -using System; using System.Collections.Generic; using System.Drawing; using System.IO; @@ -116,7 +115,8 @@ namespace osu.Game.Tournament var src = ladder.Matches.FirstOrDefault(p => p.ID == pair.SourceID); var dest = ladder.Matches.FirstOrDefault(p => p.ID == pair.TargetID); - if (src == null) throw new InvalidOperationException(); + if (src == null) + continue; if (dest != null) { From fa61b08a05211ddcda53dc68a238c68ef703ecdd Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 18 Jun 2019 15:20:28 +0900 Subject: [PATCH 262/317] Mark LadderTestScene abstract --- osu.Game.Tournament.Tests/LadderTestScene.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Tournament.Tests/LadderTestScene.cs b/osu.Game.Tournament.Tests/LadderTestScene.cs index 5bb8112157..b49341d0d1 100644 --- a/osu.Game.Tournament.Tests/LadderTestScene.cs +++ b/osu.Game.Tournament.Tests/LadderTestScene.cs @@ -7,7 +7,7 @@ using osu.Game.Tournament.Models; namespace osu.Game.Tournament.Tests { - public class LadderTestScene : OsuTestScene + public abstract class LadderTestScene : OsuTestScene { [Resolved] protected LadderInfo Ladder { get; private set; } From 3fcb8081dd9bcab26656b7aa15d652d1ecc1c09f Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 18 Jun 2019 15:20:36 +0900 Subject: [PATCH 263/317] Remove unused ruleset bindable --- osu.Game.Tournament/TournamentGameBase.cs | 3 --- 1 file changed, 3 deletions(-) diff --git a/osu.Game.Tournament/TournamentGameBase.cs b/osu.Game.Tournament/TournamentGameBase.cs index 9f63cc2302..2f8d084848 100644 --- a/osu.Game.Tournament/TournamentGameBase.cs +++ b/osu.Game.Tournament/TournamentGameBase.cs @@ -17,7 +17,6 @@ using osu.Framework.Platform; using osu.Game.Beatmaps; using osu.Game.Graphics.UserInterface; using osu.Game.Online.API.Requests; -using osu.Game.Rulesets; using osu.Game.Tournament.IPC; using osu.Game.Tournament.Models; using osuTK.Input; @@ -34,8 +33,6 @@ namespace osu.Game.Tournament private DependencyContainer dependencies; - private readonly Bindable ruleset = new Bindable(); - private Bindable windowSize; private FileBasedIPC ipc; From 926a11ab8ccd3f7728ddca773e997c8e73f005b1 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 18 Jun 2019 15:28:36 +0900 Subject: [PATCH 264/317] Group, rename and standardise tests --- .../TestSceneDrawableTournamentMatch.cs | 3 +-- .../TestSceneMatchScoreDisplay.cs | 2 +- .../TestSceneTournamentBeatmapPanel.cs} | 11 ++------- .../TestSceneTournamentMatchChatDisplay.cs | 2 +- .../{ => Screens}/TestSceneGameplayScreen.cs | 2 +- .../Screens/TestSceneLadderEditorScreen.cs | 23 +++++++++++++++++++ .../TestSceneLadderScreen.cs} | 4 ++-- .../TestSceneMapPoolScreen.cs} | 4 ++-- .../TestSceneRoundEditorScreen.cs | 2 +- .../TestSceneScheduleScreen.cs} | 11 ++------- .../TestSceneShowcaseScreen.cs} | 11 ++------- .../TestSceneTeamEditorScreen.cs | 2 +- .../TestSceneTeamIntroScreen.cs} | 4 ++-- .../TestSceneTeamWinScreen.cs} | 4 ++-- ....cs => TestSceneTournamentSceneManager.cs} | 2 +- .../osu.Game.Tournament.csproj | 3 --- 16 files changed, 44 insertions(+), 46 deletions(-) rename osu.Game.Tournament.Tests/{ => Components}/TestSceneDrawableTournamentMatch.cs (97%) rename osu.Game.Tournament.Tests/{ => Components}/TestSceneMatchScoreDisplay.cs (96%) rename osu.Game.Tournament.Tests/{TestSceneBeatmapPanel.cs => Components/TestSceneTournamentBeatmapPanel.cs} (80%) rename osu.Game.Tournament.Tests/{ => Components}/TestSceneTournamentMatchChatDisplay.cs (98%) rename osu.Game.Tournament.Tests/{ => Screens}/TestSceneGameplayScreen.cs (93%) create mode 100644 osu.Game.Tournament.Tests/Screens/TestSceneLadderEditorScreen.cs rename osu.Game.Tournament.Tests/{TestSceneLadderManager.cs => Screens/TestSceneLadderScreen.cs} (84%) rename osu.Game.Tournament.Tests/{TestSceneMapPool.cs => Screens/TestSceneMapPoolScreen.cs} (84%) rename osu.Game.Tournament.Tests/{ => Screens}/TestSceneRoundEditorScreen.cs (89%) rename osu.Game.Tournament.Tests/{TestSceneSchedule.cs => Screens/TestSceneScheduleScreen.cs} (60%) rename osu.Game.Tournament.Tests/{TestSceneShowcase.cs => Screens/TestSceneShowcaseScreen.cs} (60%) rename osu.Game.Tournament.Tests/{ => Screens}/TestSceneTeamEditorScreen.cs (89%) rename osu.Game.Tournament.Tests/{TestSceneTeamIntro.cs => Screens/TestSceneTeamIntroScreen.cs} (91%) rename osu.Game.Tournament.Tests/{TestSceneTeamWin.cs => Screens/TestSceneTeamWinScreen.cs} (91%) rename osu.Game.Tournament.Tests/{TestSceneSceneManager.cs => TestSceneTournamentSceneManager.cs} (87%) diff --git a/osu.Game.Tournament.Tests/TestSceneDrawableTournamentMatch.cs b/osu.Game.Tournament.Tests/Components/TestSceneDrawableTournamentMatch.cs similarity index 97% rename from osu.Game.Tournament.Tests/TestSceneDrawableTournamentMatch.cs rename to osu.Game.Tournament.Tests/Components/TestSceneDrawableTournamentMatch.cs index c3a4519597..f329623703 100644 --- a/osu.Game.Tournament.Tests/TestSceneDrawableTournamentMatch.cs +++ b/osu.Game.Tournament.Tests/Components/TestSceneDrawableTournamentMatch.cs @@ -10,14 +10,13 @@ using osu.Game.Tournament.Components; using osu.Game.Tournament.Models; using osu.Game.Tournament.Screens.Ladder.Components; -namespace osu.Game.Tournament.Tests +namespace osu.Game.Tournament.Tests.Components { public class TestSceneDrawableTournamentMatch : OsuTestScene { public override IReadOnlyList RequiredTypes => new[] { typeof(TournamentMatch), - typeof(DrawableTournamentMatch), typeof(DrawableTournamentTeam), }; diff --git a/osu.Game.Tournament.Tests/TestSceneMatchScoreDisplay.cs b/osu.Game.Tournament.Tests/Components/TestSceneMatchScoreDisplay.cs similarity index 96% rename from osu.Game.Tournament.Tests/TestSceneMatchScoreDisplay.cs rename to osu.Game.Tournament.Tests/Components/TestSceneMatchScoreDisplay.cs index 7e9b83a61b..72d9eb0e07 100644 --- a/osu.Game.Tournament.Tests/TestSceneMatchScoreDisplay.cs +++ b/osu.Game.Tournament.Tests/Components/TestSceneMatchScoreDisplay.cs @@ -7,7 +7,7 @@ using osu.Framework.MathUtils; using osu.Game.Tournament.IPC; using osu.Game.Tournament.Screens.Gameplay.Components; -namespace osu.Game.Tournament.Tests +namespace osu.Game.Tournament.Tests.Components { public class TestSceneMatchScoreDisplay : LadderTestScene { diff --git a/osu.Game.Tournament.Tests/TestSceneBeatmapPanel.cs b/osu.Game.Tournament.Tests/Components/TestSceneTournamentBeatmapPanel.cs similarity index 80% rename from osu.Game.Tournament.Tests/TestSceneBeatmapPanel.cs rename to osu.Game.Tournament.Tests/Components/TestSceneTournamentBeatmapPanel.cs index 50169adad3..77fa411058 100644 --- a/osu.Game.Tournament.Tests/TestSceneBeatmapPanel.cs +++ b/osu.Game.Tournament.Tests/Components/TestSceneTournamentBeatmapPanel.cs @@ -1,8 +1,6 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. -using System; -using System.Collections.Generic; using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Game.Beatmaps; @@ -13,9 +11,9 @@ using osu.Game.Rulesets; using osu.Game.Tests.Visual; using osu.Game.Tournament.Components; -namespace osu.Game.Tournament.Tests +namespace osu.Game.Tournament.Tests.Components { - public class TestSceneBeatmapPanel : OsuTestScene + public class TestSceneTournamentBeatmapPanel : OsuTestScene { [Resolved] private IAPIProvider api { get; set; } @@ -23,11 +21,6 @@ namespace osu.Game.Tournament.Tests [Resolved] private RulesetStore rulesets { get; set; } - public override IReadOnlyList RequiredTypes => new[] - { - typeof(TournamentBeatmapPanel), - }; - [BackgroundDependencyLoader] private void load() { diff --git a/osu.Game.Tournament.Tests/TestSceneTournamentMatchChatDisplay.cs b/osu.Game.Tournament.Tests/Components/TestSceneTournamentMatchChatDisplay.cs similarity index 98% rename from osu.Game.Tournament.Tests/TestSceneTournamentMatchChatDisplay.cs rename to osu.Game.Tournament.Tests/Components/TestSceneTournamentMatchChatDisplay.cs index 829d8629e5..41d32d9448 100644 --- a/osu.Game.Tournament.Tests/TestSceneTournamentMatchChatDisplay.cs +++ b/osu.Game.Tournament.Tests/Components/TestSceneTournamentMatchChatDisplay.cs @@ -11,7 +11,7 @@ using osu.Game.Tournament.IPC; using osu.Game.Tournament.Models; using osu.Game.Users; -namespace osu.Game.Tournament.Tests +namespace osu.Game.Tournament.Tests.Components { public class TestSceneTournamentMatchChatDisplay : OsuTestScene { diff --git a/osu.Game.Tournament.Tests/TestSceneGameplayScreen.cs b/osu.Game.Tournament.Tests/Screens/TestSceneGameplayScreen.cs similarity index 93% rename from osu.Game.Tournament.Tests/TestSceneGameplayScreen.cs rename to osu.Game.Tournament.Tests/Screens/TestSceneGameplayScreen.cs index 74d8615db0..201736f38a 100644 --- a/osu.Game.Tournament.Tests/TestSceneGameplayScreen.cs +++ b/osu.Game.Tournament.Tests/Screens/TestSceneGameplayScreen.cs @@ -6,7 +6,7 @@ using osu.Game.Tests.Visual; using osu.Game.Tournament.Components; using osu.Game.Tournament.Screens.Gameplay; -namespace osu.Game.Tournament.Tests +namespace osu.Game.Tournament.Tests.Screens { public class TestSceneGameplayScreen : OsuTestScene { diff --git a/osu.Game.Tournament.Tests/Screens/TestSceneLadderEditorScreen.cs b/osu.Game.Tournament.Tests/Screens/TestSceneLadderEditorScreen.cs new file mode 100644 index 0000000000..a45c5de2bd --- /dev/null +++ b/osu.Game.Tournament.Tests/Screens/TestSceneLadderEditorScreen.cs @@ -0,0 +1,23 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +using osu.Framework.Allocation; +using osu.Framework.Graphics; +using osu.Game.Graphics.Cursor; +using osu.Game.Tournament.Screens.Editors; + +namespace osu.Game.Tournament.Tests.Screens +{ + public class TestSceneLadderEditorScreen : LadderTestScene + { + [BackgroundDependencyLoader] + private void load() + { + Add(new OsuContextMenuContainer + { + RelativeSizeAxes = Axes.Both, + Child = new LadderEditorScreen() + }); + } + } +} diff --git a/osu.Game.Tournament.Tests/TestSceneLadderManager.cs b/osu.Game.Tournament.Tests/Screens/TestSceneLadderScreen.cs similarity index 84% rename from osu.Game.Tournament.Tests/TestSceneLadderManager.cs rename to osu.Game.Tournament.Tests/Screens/TestSceneLadderScreen.cs index c9ea740f92..2be0564c82 100644 --- a/osu.Game.Tournament.Tests/TestSceneLadderManager.cs +++ b/osu.Game.Tournament.Tests/Screens/TestSceneLadderScreen.cs @@ -6,9 +6,9 @@ using osu.Framework.Graphics; using osu.Game.Graphics.Cursor; using osu.Game.Tournament.Screens.Ladder; -namespace osu.Game.Tournament.Tests +namespace osu.Game.Tournament.Tests.Screens { - public class TestSceneLadderManager : LadderTestScene + public class TestSceneLadderScreen : LadderTestScene { [BackgroundDependencyLoader] private void load() diff --git a/osu.Game.Tournament.Tests/TestSceneMapPool.cs b/osu.Game.Tournament.Tests/Screens/TestSceneMapPoolScreen.cs similarity index 84% rename from osu.Game.Tournament.Tests/TestSceneMapPool.cs rename to osu.Game.Tournament.Tests/Screens/TestSceneMapPoolScreen.cs index 43f4831a2a..a7011c6d3c 100644 --- a/osu.Game.Tournament.Tests/TestSceneMapPool.cs +++ b/osu.Game.Tournament.Tests/Screens/TestSceneMapPoolScreen.cs @@ -6,9 +6,9 @@ using System.Collections.Generic; using osu.Framework.Allocation; using osu.Game.Tournament.Screens.MapPool; -namespace osu.Game.Tournament.Tests +namespace osu.Game.Tournament.Tests.Screens { - public class TestSceneMapPool : LadderTestScene + public class TestSceneMapPoolScreen : LadderTestScene { public override IReadOnlyList RequiredTypes => new[] { diff --git a/osu.Game.Tournament.Tests/TestSceneRoundEditorScreen.cs b/osu.Game.Tournament.Tests/Screens/TestSceneRoundEditorScreen.cs similarity index 89% rename from osu.Game.Tournament.Tests/TestSceneRoundEditorScreen.cs rename to osu.Game.Tournament.Tests/Screens/TestSceneRoundEditorScreen.cs index 9c1207a718..6203d68e80 100644 --- a/osu.Game.Tournament.Tests/TestSceneRoundEditorScreen.cs +++ b/osu.Game.Tournament.Tests/Screens/TestSceneRoundEditorScreen.cs @@ -3,7 +3,7 @@ using osu.Game.Tournament.Screens.Editors; -namespace osu.Game.Tournament.Tests +namespace osu.Game.Tournament.Tests.Screens { public class TestSceneRoundEditorScreen : LadderTestScene { diff --git a/osu.Game.Tournament.Tests/TestSceneSchedule.cs b/osu.Game.Tournament.Tests/Screens/TestSceneScheduleScreen.cs similarity index 60% rename from osu.Game.Tournament.Tests/TestSceneSchedule.cs rename to osu.Game.Tournament.Tests/Screens/TestSceneScheduleScreen.cs index 00eb4c4e41..f3e65919eb 100644 --- a/osu.Game.Tournament.Tests/TestSceneSchedule.cs +++ b/osu.Game.Tournament.Tests/Screens/TestSceneScheduleScreen.cs @@ -1,21 +1,14 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. -using System; -using System.Collections.Generic; using osu.Framework.Allocation; using osu.Game.Tests.Visual; using osu.Game.Tournament.Screens.Schedule; -namespace osu.Game.Tournament.Tests +namespace osu.Game.Tournament.Tests.Screens { - public class TestSceneSchedule : OsuTestScene + public class TestSceneScheduleScreen : OsuTestScene { - public override IReadOnlyList RequiredTypes => new[] - { - typeof(ScheduleScreen) - }; - [BackgroundDependencyLoader] private void load() { diff --git a/osu.Game.Tournament.Tests/TestSceneShowcase.cs b/osu.Game.Tournament.Tests/Screens/TestSceneShowcaseScreen.cs similarity index 60% rename from osu.Game.Tournament.Tests/TestSceneShowcase.cs rename to osu.Game.Tournament.Tests/Screens/TestSceneShowcaseScreen.cs index a4d518eedd..edf1477b06 100644 --- a/osu.Game.Tournament.Tests/TestSceneShowcase.cs +++ b/osu.Game.Tournament.Tests/Screens/TestSceneShowcaseScreen.cs @@ -1,21 +1,14 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. -using System; -using System.Collections.Generic; using osu.Framework.Allocation; using osu.Game.Tests.Visual; using osu.Game.Tournament.Screens.Showcase; -namespace osu.Game.Tournament.Tests +namespace osu.Game.Tournament.Tests.Screens { - public class TestSceneShowcase : OsuTestScene + public class TestSceneShowcaseScreen : OsuTestScene { - public override IReadOnlyList RequiredTypes => new[] - { - typeof(ShowcaseScreen) - }; - [BackgroundDependencyLoader] private void load() { diff --git a/osu.Game.Tournament.Tests/TestSceneTeamEditorScreen.cs b/osu.Game.Tournament.Tests/Screens/TestSceneTeamEditorScreen.cs similarity index 89% rename from osu.Game.Tournament.Tests/TestSceneTeamEditorScreen.cs rename to osu.Game.Tournament.Tests/Screens/TestSceneTeamEditorScreen.cs index df0b79d8a9..126e0c2fda 100644 --- a/osu.Game.Tournament.Tests/TestSceneTeamEditorScreen.cs +++ b/osu.Game.Tournament.Tests/Screens/TestSceneTeamEditorScreen.cs @@ -3,7 +3,7 @@ using osu.Game.Tournament.Screens.Editors; -namespace osu.Game.Tournament.Tests +namespace osu.Game.Tournament.Tests.Screens { public class TestSceneTeamEditorScreen : LadderTestScene { diff --git a/osu.Game.Tournament.Tests/TestSceneTeamIntro.cs b/osu.Game.Tournament.Tests/Screens/TestSceneTeamIntroScreen.cs similarity index 91% rename from osu.Game.Tournament.Tests/TestSceneTeamIntro.cs rename to osu.Game.Tournament.Tests/Screens/TestSceneTeamIntroScreen.cs index 6b31fd2742..3d340e393c 100644 --- a/osu.Game.Tournament.Tests/TestSceneTeamIntro.cs +++ b/osu.Game.Tournament.Tests/Screens/TestSceneTeamIntroScreen.cs @@ -8,9 +8,9 @@ using osu.Framework.Graphics; using osu.Game.Tournament.Models; using osu.Game.Tournament.Screens.TeamIntro; -namespace osu.Game.Tournament.Tests +namespace osu.Game.Tournament.Tests.Screens { - public class TestSceneTeamIntro : LadderTestScene + public class TestSceneTeamIntroScreen : LadderTestScene { [Cached] private readonly Bindable currentMatch = new Bindable(); diff --git a/osu.Game.Tournament.Tests/TestSceneTeamWin.cs b/osu.Game.Tournament.Tests/Screens/TestSceneTeamWinScreen.cs similarity index 91% rename from osu.Game.Tournament.Tests/TestSceneTeamWin.cs rename to osu.Game.Tournament.Tests/Screens/TestSceneTeamWinScreen.cs index d195ad42ca..6f5e17a36e 100644 --- a/osu.Game.Tournament.Tests/TestSceneTeamWin.cs +++ b/osu.Game.Tournament.Tests/Screens/TestSceneTeamWinScreen.cs @@ -8,9 +8,9 @@ using osu.Framework.Graphics; using osu.Game.Tournament.Models; using osu.Game.Tournament.Screens.TeamWin; -namespace osu.Game.Tournament.Tests +namespace osu.Game.Tournament.Tests.Screens { - public class TestSceneTeamWin : LadderTestScene + public class TestSceneTeamWinScreen : LadderTestScene { [Cached] private readonly Bindable currentMatch = new Bindable(); diff --git a/osu.Game.Tournament.Tests/TestSceneSceneManager.cs b/osu.Game.Tournament.Tests/TestSceneTournamentSceneManager.cs similarity index 87% rename from osu.Game.Tournament.Tests/TestSceneSceneManager.cs rename to osu.Game.Tournament.Tests/TestSceneTournamentSceneManager.cs index aa333e39b1..378614343a 100644 --- a/osu.Game.Tournament.Tests/TestSceneSceneManager.cs +++ b/osu.Game.Tournament.Tests/TestSceneTournamentSceneManager.cs @@ -7,7 +7,7 @@ using osu.Game.Tests.Visual; namespace osu.Game.Tournament.Tests { - public class TestSceneSceneManager : OsuTestScene + public class TestSceneTournamentSceneManager : OsuTestScene { [BackgroundDependencyLoader] private void load(Storage storage) diff --git a/osu.Game.Tournament/osu.Game.Tournament.csproj b/osu.Game.Tournament/osu.Game.Tournament.csproj index 8412166250..8adff80820 100644 --- a/osu.Game.Tournament/osu.Game.Tournament.csproj +++ b/osu.Game.Tournament/osu.Game.Tournament.csproj @@ -10,7 +10,4 @@ - - - \ No newline at end of file From e4eae3a6d5868952ae0d31492456cc0534d7f069 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 18 Jun 2019 15:40:57 +0900 Subject: [PATCH 265/317] Move rider configurations into folders --- ...RulesetTests__catch_.xml => CatchRuleset__Tests_.xml} | 9 ++++++--- ...RulesetTests__mania_.xml => ManiaRuleset__Tests_.xml} | 9 ++++++--- .../{RulesetTests__osu__.xml => OsuRuleset__Tests_.xml} | 9 ++++++--- ...RulesetTests__taiko_.xml => TaikoRuleset__Tests_.xml} | 9 ++++++--- .../{osu___Tournament_.xml => Tournament.xml} | 6 +++--- .../{TournamentTests.xml => Tournament__Tests_.xml} | 7 +++++-- .idea/.idea.osu/.idea/runConfigurations/osu_.xml | 2 +- .../{VisualTests.xml => osu___Tests_.xml} | 2 +- 8 files changed, 34 insertions(+), 19 deletions(-) rename .idea/.idea.osu/.idea/runConfigurations/{RulesetTests__catch_.xml => CatchRuleset__Tests_.xml} (73%) rename .idea/.idea.osu/.idea/runConfigurations/{RulesetTests__mania_.xml => ManiaRuleset__Tests_.xml} (73%) rename .idea/.idea.osu/.idea/runConfigurations/{RulesetTests__osu__.xml => OsuRuleset__Tests_.xml} (72%) rename .idea/.idea.osu/.idea/runConfigurations/{RulesetTests__taiko_.xml => TaikoRuleset__Tests_.xml} (73%) rename .idea/.idea.osu/.idea/runConfigurations/{osu___Tournament_.xml => Tournament.xml} (78%) rename .idea/.idea.osu/.idea/runConfigurations/{TournamentTests.xml => Tournament__Tests_.xml} (77%) rename .idea/.idea.osu/.idea/runConfigurations/{VisualTests.xml => osu___Tests_.xml} (88%) diff --git a/.idea/.idea.osu/.idea/runConfigurations/RulesetTests__catch_.xml b/.idea/.idea.osu/.idea/runConfigurations/CatchRuleset__Tests_.xml similarity index 73% rename from .idea/.idea.osu/.idea/runConfigurations/RulesetTests__catch_.xml rename to .idea/.idea.osu/.idea/runConfigurations/CatchRuleset__Tests_.xml index 2eff16cc91..6463dd6ea5 100644 --- a/.idea/.idea.osu/.idea/runConfigurations/RulesetTests__catch_.xml +++ b/.idea/.idea.osu/.idea/runConfigurations/CatchRuleset__Tests_.xml @@ -1,18 +1,21 @@ - + \ No newline at end of file diff --git a/.idea/.idea.osu/.idea/runConfigurations/RulesetTests__mania_.xml b/.idea/.idea.osu/.idea/runConfigurations/ManiaRuleset__Tests_.xml similarity index 73% rename from .idea/.idea.osu/.idea/runConfigurations/RulesetTests__mania_.xml rename to .idea/.idea.osu/.idea/runConfigurations/ManiaRuleset__Tests_.xml index cae9754560..0b63b2d966 100644 --- a/.idea/.idea.osu/.idea/runConfigurations/RulesetTests__mania_.xml +++ b/.idea/.idea.osu/.idea/runConfigurations/ManiaRuleset__Tests_.xml @@ -1,18 +1,21 @@ - + \ No newline at end of file diff --git a/.idea/.idea.osu/.idea/runConfigurations/RulesetTests__osu__.xml b/.idea/.idea.osu/.idea/runConfigurations/OsuRuleset__Tests_.xml similarity index 72% rename from .idea/.idea.osu/.idea/runConfigurations/RulesetTests__osu__.xml rename to .idea/.idea.osu/.idea/runConfigurations/OsuRuleset__Tests_.xml index 49ec93e1b3..750ece648b 100644 --- a/.idea/.idea.osu/.idea/runConfigurations/RulesetTests__osu__.xml +++ b/.idea/.idea.osu/.idea/runConfigurations/OsuRuleset__Tests_.xml @@ -1,18 +1,21 @@ - + \ No newline at end of file diff --git a/.idea/.idea.osu/.idea/runConfigurations/RulesetTests__taiko_.xml b/.idea/.idea.osu/.idea/runConfigurations/TaikoRuleset__Tests_.xml similarity index 73% rename from .idea/.idea.osu/.idea/runConfigurations/RulesetTests__taiko_.xml rename to .idea/.idea.osu/.idea/runConfigurations/TaikoRuleset__Tests_.xml index d0964c6f68..7b359a1ca0 100644 --- a/.idea/.idea.osu/.idea/runConfigurations/RulesetTests__taiko_.xml +++ b/.idea/.idea.osu/.idea/runConfigurations/TaikoRuleset__Tests_.xml @@ -1,18 +1,21 @@ - + \ No newline at end of file diff --git a/.idea/.idea.osu/.idea/runConfigurations/osu___Tournament_.xml b/.idea/.idea.osu/.idea/runConfigurations/Tournament.xml similarity index 78% rename from .idea/.idea.osu/.idea/runConfigurations/osu___Tournament_.xml rename to .idea/.idea.osu/.idea/runConfigurations/Tournament.xml index a5f93489e8..3722f3dc04 100644 --- a/.idea/.idea.osu/.idea/runConfigurations/osu___Tournament_.xml +++ b/.idea/.idea.osu/.idea/runConfigurations/Tournament.xml @@ -1,6 +1,6 @@ - -