diff --git a/osu.Android.props b/osu.Android.props
index 1c4a6ffe75..97f7a7edb1 100644
--- a/osu.Android.props
+++ b/osu.Android.props
@@ -52,6 +52,6 @@
-
+
diff --git a/osu.Game.Rulesets.Osu.Tests/Mods/TestSceneOsuModDoubleTime.cs b/osu.Game.Rulesets.Osu.Tests/Mods/TestSceneOsuModDoubleTime.cs
new file mode 100644
index 0000000000..dcf19ad993
--- /dev/null
+++ b/osu.Game.Rulesets.Osu.Tests/Mods/TestSceneOsuModDoubleTime.cs
@@ -0,0 +1,35 @@
+// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.
+// See the LICENCE file in the repository root for full licence text.
+
+using NUnit.Framework;
+using osu.Framework.Utils;
+using osu.Game.Rulesets.Osu.Mods;
+using osu.Game.Tests.Visual;
+
+namespace osu.Game.Rulesets.Osu.Tests.Mods
+{
+ public class TestSceneOsuModDoubleTime : ModTestScene
+ {
+ public TestSceneOsuModDoubleTime()
+ : base(new OsuRuleset())
+ {
+ }
+
+ [TestCase(0.5)]
+ [TestCase(1.01)]
+ [TestCase(1.5)]
+ [TestCase(2)]
+ [TestCase(5)]
+ public void TestSpeedChangeCustomisation(double rate)
+ {
+ var mod = new OsuModDoubleTime { SpeedChange = { Value = rate } };
+
+ CreateModTest(new ModTestData
+ {
+ Mod = mod,
+ PassCondition = () => Player.ScoreProcessor.JudgedHits >= 2 &&
+ Precision.AlmostEquals(Player.GameplayClockContainer.GameplayClock.Rate, mod.SpeedChange.Value)
+ });
+ }
+ }
+}
diff --git a/osu.Game.Rulesets.Osu.Tests/TestSceneHitCircleArea.cs b/osu.Game.Rulesets.Osu.Tests/TestSceneHitCircleArea.cs
new file mode 100644
index 0000000000..67b6dac787
--- /dev/null
+++ b/osu.Game.Rulesets.Osu.Tests/TestSceneHitCircleArea.cs
@@ -0,0 +1,108 @@
+// 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 NUnit.Framework;
+using osu.Framework.Graphics;
+using osu.Framework.Testing;
+using osu.Game.Beatmaps;
+using osu.Game.Beatmaps.ControlPoints;
+using osu.Game.Rulesets.Osu.Objects;
+using osu.Game.Rulesets.Osu.Objects.Drawables;
+using osu.Game.Rulesets.Scoring;
+using osu.Game.Skinning;
+using osuTK;
+
+namespace osu.Game.Rulesets.Osu.Tests
+{
+ public class TestSceneHitCircleArea : ManualInputManagerTestScene
+ {
+ private HitCircle hitCircle;
+ private DrawableHitCircle drawableHitCircle;
+ private DrawableHitCircle.HitReceptor hitAreaReceptor => drawableHitCircle.HitArea;
+
+ [SetUp]
+ public new void SetUp()
+ {
+ base.SetUp();
+
+ Schedule(() =>
+ {
+ hitCircle = new HitCircle
+ {
+ Position = new Vector2(100, 100),
+ StartTime = Time.Current + 500
+ };
+
+ hitCircle.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty());
+
+ Child = new SkinProvidingContainer(new DefaultSkin())
+ {
+ RelativeSizeAxes = Axes.Both,
+ Child = drawableHitCircle = new DrawableHitCircle(hitCircle)
+ {
+ Size = new Vector2(100)
+ }
+ };
+ });
+ }
+
+ [Test]
+ public void TestCircleHitCentre()
+ {
+ AddStep("move mouse to centre", () => InputManager.MoveMouseTo(hitAreaReceptor.ScreenSpaceDrawQuad.Centre));
+ scheduleHit();
+
+ AddAssert("hit registered", () => hitAreaReceptor.HitAction == OsuAction.LeftButton);
+ }
+
+ [Test]
+ public void TestCircleHitLeftEdge()
+ {
+ AddStep("move mouse to left edge", () =>
+ {
+ var drawQuad = hitAreaReceptor.ScreenSpaceDrawQuad;
+ var mousePosition = new Vector2(drawQuad.TopLeft.X, drawQuad.Centre.Y);
+
+ InputManager.MoveMouseTo(mousePosition);
+ });
+ scheduleHit();
+
+ AddAssert("hit registered", () => hitAreaReceptor.HitAction == OsuAction.LeftButton);
+ }
+
+ [TestCase(0.95f, OsuAction.LeftButton)]
+ [TestCase(1.05f, null)]
+ public void TestHitsCloseToEdge(float relativeDistanceFromCentre, OsuAction? expectedAction)
+ {
+ AddStep("move mouse to top left circle edge", () =>
+ {
+ var drawQuad = hitAreaReceptor.ScreenSpaceDrawQuad;
+ // sqrt(2) / 2 = sin(45deg) = cos(45deg)
+ // draw width halved to get radius
+ float correction = relativeDistanceFromCentre * (float)Math.Sqrt(2) / 2 * (drawQuad.Width / 2);
+ var mousePosition = new Vector2(drawQuad.Centre.X - correction, drawQuad.Centre.Y - correction);
+
+ InputManager.MoveMouseTo(mousePosition);
+ });
+ scheduleHit();
+
+ AddAssert($"hit {(expectedAction == null ? "not " : string.Empty)}registered", () => hitAreaReceptor.HitAction == expectedAction);
+ }
+
+ [Test]
+ public void TestCircleMissBoundingBoxCorner()
+ {
+ AddStep("move mouse to top left corner of bounding box", () => InputManager.MoveMouseTo(hitAreaReceptor.ScreenSpaceDrawQuad.TopLeft));
+ scheduleHit();
+
+ AddAssert("hit not registered", () => hitAreaReceptor.HitAction == null);
+ }
+
+ private void scheduleHit() => AddStep("schedule action", () =>
+ {
+ var delay = hitCircle.StartTime - hitCircle.HitWindows.WindowFor(HitResult.Great) - Time.Current;
+ Scheduler.AddDelayed(() => hitAreaReceptor.OnPressed(OsuAction.LeftButton), delay);
+ });
+ }
+}
diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableHitCircle.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableHitCircle.cs
index 4ef63bb2a0..da1e666aba 100644
--- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableHitCircle.cs
+++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableHitCircle.cs
@@ -170,7 +170,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
public Drawable ProxiedLayer => ApproachCircle;
- public class HitReceptor : Drawable, IKeyBindingHandler
+ public class HitReceptor : CompositeDrawable, IKeyBindingHandler
{
// IsHovered is used
public override bool HandlePositionalInput => true;
@@ -185,6 +185,9 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
Anchor = Anchor.Centre;
Origin = Anchor.Centre;
+
+ CornerRadius = OsuHitObject.OBJECT_RADIUS;
+ CornerExponent = 2;
}
public bool OnPressed(OsuAction action)
diff --git a/osu.Game.Tests/Visual/Gameplay/TestSceneAutoplay.cs b/osu.Game.Tests/Visual/Gameplay/TestSceneAutoplay.cs
index 756f31e0bf..afeda5fb7c 100644
--- a/osu.Game.Tests/Visual/Gameplay/TestSceneAutoplay.cs
+++ b/osu.Game.Tests/Visual/Gameplay/TestSceneAutoplay.cs
@@ -3,10 +3,8 @@
using System.ComponentModel;
using System.Linq;
-using osu.Game.Beatmaps;
using osu.Game.Rulesets;
using osu.Game.Screens.Play;
-using osu.Game.Storyboards;
namespace osu.Game.Tests.Visual.Gameplay
{
@@ -15,8 +13,6 @@ namespace osu.Game.Tests.Visual.Gameplay
{
protected new TestPlayer Player => (TestPlayer)base.Player;
- private ClockBackedTestWorkingBeatmap.TrackVirtualManual track;
-
protected override Player CreatePlayer(Ruleset ruleset)
{
SelectedMods.Value = SelectedMods.Value.Concat(new[] { ruleset.GetAutoplayMod() }).ToArray();
@@ -27,17 +23,12 @@ namespace osu.Game.Tests.Visual.Gameplay
{
AddUntilStep("score above zero", () => Player.ScoreProcessor.TotalScore.Value > 0);
AddUntilStep("key counter counted keys", () => Player.HUDOverlay.KeyCounter.Children.Any(kc => kc.CountPresses > 2));
- AddStep("rewind", () => track.Seek(-10000));
+ AddStep("seek to break time", () => Player.GameplayClockContainer.Seek(Player.BreakOverlay.Breaks.First().StartTime));
+ AddUntilStep("wait for seek to complete", () =>
+ Player.HUDOverlay.Progress.ReferenceClock.CurrentTime >= Player.BreakOverlay.Breaks.First().StartTime);
+ AddAssert("test keys not counting", () => !Player.HUDOverlay.KeyCounter.IsCounting);
+ AddStep("rewind", () => Player.GameplayClockContainer.Seek(-80000));
AddUntilStep("key counter reset", () => Player.HUDOverlay.KeyCounter.Children.All(kc => kc.CountPresses == 0));
}
-
- protected override WorkingBeatmap CreateWorkingBeatmap(IBeatmap beatmap, Storyboard storyboard = null)
- {
- var working = base.CreateWorkingBeatmap(beatmap, storyboard);
-
- track = (ClockBackedTestWorkingBeatmap.TrackVirtualManual)working.Track;
-
- return working;
- }
}
}
diff --git a/osu.Game.Tests/Visual/Gameplay/TestSceneKeyCounter.cs b/osu.Game.Tests/Visual/Gameplay/TestSceneKeyCounter.cs
index e7b3e007fc..227ada70fe 100644
--- a/osu.Game.Tests/Visual/Gameplay/TestSceneKeyCounter.cs
+++ b/osu.Game.Tests/Visual/Gameplay/TestSceneKeyCounter.cs
@@ -47,21 +47,22 @@ namespace osu.Game.Tests.Visual.Gameplay
Key testKey = ((KeyCounterKeyboard)kc.Children.First()).Key;
- AddStep($"Press {testKey} key", () =>
+ void addPressKeyStep()
{
- InputManager.PressKey(testKey);
- InputManager.ReleaseKey(testKey);
- });
+ AddStep($"Press {testKey} key", () =>
+ {
+ InputManager.PressKey(testKey);
+ InputManager.ReleaseKey(testKey);
+ });
+ }
+ addPressKeyStep();
AddAssert($"Check {testKey} counter after keypress", () => testCounter.CountPresses == 1);
-
- AddStep($"Press {testKey} key", () =>
- {
- InputManager.PressKey(testKey);
- InputManager.ReleaseKey(testKey);
- });
-
+ addPressKeyStep();
AddAssert($"Check {testKey} counter after keypress", () => testCounter.CountPresses == 2);
+ AddStep("Disable counting", () => testCounter.IsCounting = false);
+ addPressKeyStep();
+ AddAssert($"Check {testKey} count has not changed", () => testCounter.CountPresses == 2);
Add(kc);
}
diff --git a/osu.Game.Tests/Visual/Gameplay/TestSceneScoreCounter.cs b/osu.Game.Tests/Visual/Gameplay/TestSceneScoreCounter.cs
index ffd6f55b53..030d420ec0 100644
--- a/osu.Game.Tests/Visual/Gameplay/TestSceneScoreCounter.cs
+++ b/osu.Game.Tests/Visual/Gameplay/TestSceneScoreCounter.cs
@@ -3,9 +3,6 @@
using NUnit.Framework;
using osu.Framework.Graphics;
-using osu.Framework.Graphics.Sprites;
-using osu.Framework.Utils;
-using osu.Game.Graphics.Sprites;
using osu.Game.Graphics.UserInterface;
using osu.Game.Screens.Play.HUD;
using osuTK;
@@ -45,32 +42,12 @@ namespace osu.Game.Tests.Visual.Gameplay
};
Add(accuracyCounter);
- StarCounter stars = new StarCounter
- {
- Origin = Anchor.BottomLeft,
- Anchor = Anchor.BottomLeft,
- Position = new Vector2(20, -160),
- CountStars = 5,
- };
- Add(stars);
-
- SpriteText starsLabel = new OsuSpriteText
- {
- Origin = Anchor.BottomLeft,
- Anchor = Anchor.BottomLeft,
- Position = new Vector2(20, -190),
- Text = stars.CountStars.ToString("0.00"),
- };
- Add(starsLabel);
-
AddStep(@"Reset all", delegate
{
score.Current.Value = 0;
comboCounter.Current.Value = 0;
numerator = denominator = 0;
accuracyCounter.SetFraction(0, 0);
- stars.CountStars = 0;
- starsLabel.Text = stars.CountStars.ToString("0.00");
});
AddStep(@"Hit! :D", delegate
@@ -88,20 +65,6 @@ namespace osu.Game.Tests.Visual.Gameplay
denominator++;
accuracyCounter.SetFraction(numerator, denominator);
});
-
- AddStep(@"Alter stars", delegate
- {
- stars.CountStars = RNG.NextSingle() * (stars.StarCount + 1);
- starsLabel.Text = stars.CountStars.ToString("0.00");
- });
-
- AddStep(@"Stop counters", delegate
- {
- score.StopRolling();
- comboCounter.StopRolling();
- accuracyCounter.StopRolling();
- stars.StopAnimation();
- });
}
}
}
diff --git a/osu.Game.Tests/Visual/Gameplay/TestSceneStarCounter.cs b/osu.Game.Tests/Visual/Gameplay/TestSceneStarCounter.cs
new file mode 100644
index 0000000000..709e71d195
--- /dev/null
+++ b/osu.Game.Tests/Visual/Gameplay/TestSceneStarCounter.cs
@@ -0,0 +1,57 @@
+// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.
+// See the LICENCE file in the repository root for full licence text.
+
+using NUnit.Framework;
+using osu.Framework.Graphics;
+using osu.Framework.Graphics.Sprites;
+using osu.Framework.Utils;
+using osu.Game.Graphics.Sprites;
+using osu.Game.Graphics.UserInterface;
+using osuTK;
+
+namespace osu.Game.Tests.Visual.Gameplay
+{
+ [TestFixture]
+ public class TestSceneStarCounter : OsuTestScene
+ {
+ public TestSceneStarCounter()
+ {
+ StarCounter stars = new StarCounter
+ {
+ Origin = Anchor.Centre,
+ Anchor = Anchor.Centre,
+ Current = 5,
+ };
+
+ Add(stars);
+
+ SpriteText starsLabel = new OsuSpriteText
+ {
+ Origin = Anchor.Centre,
+ Anchor = Anchor.Centre,
+ Scale = new Vector2(2),
+ Y = 50,
+ Text = stars.Current.ToString("0.00"),
+ };
+
+ Add(starsLabel);
+
+ AddRepeatStep(@"random value", delegate
+ {
+ stars.Current = RNG.NextSingle() * (stars.StarCount + 1);
+ starsLabel.Text = stars.Current.ToString("0.00");
+ }, 10);
+
+ AddStep(@"Stop animation", delegate
+ {
+ stars.StopAnimation();
+ });
+
+ AddStep(@"Reset", delegate
+ {
+ stars.Current = 0;
+ starsLabel.Text = stars.Current.ToString("0.00");
+ });
+ }
+ }
+}
diff --git a/osu.Game.Tournament.Tests/Components/TestSceneDrawableTournamentTeam.cs b/osu.Game.Tournament.Tests/Components/TestSceneDrawableTournamentTeam.cs
new file mode 100644
index 0000000000..41f7d3d847
--- /dev/null
+++ b/osu.Game.Tournament.Tests/Components/TestSceneDrawableTournamentTeam.cs
@@ -0,0 +1,124 @@
+// 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.Graphics;
+using osu.Game.Tests.Visual;
+using osu.Game.Tournament.Components;
+using osu.Game.Tournament.Models;
+using osu.Game.Tournament.Screens.Drawings.Components;
+using osu.Game.Tournament.Screens.Gameplay.Components;
+using osu.Game.Tournament.Screens.Ladder.Components;
+using osu.Game.Users;
+
+namespace osu.Game.Tournament.Tests.Components
+{
+ public class TestSceneDrawableTournamentTeam : OsuGridTestScene
+ {
+ public override IReadOnlyList RequiredTypes => new[]
+ {
+ typeof(DrawableTeamFlag),
+ typeof(DrawableTeamTitle),
+ typeof(DrawableTeamTitleWithHeader),
+ typeof(DrawableMatchTeam),
+ typeof(DrawableTeamWithPlayers),
+ typeof(GroupTeam),
+ typeof(TeamDisplay),
+ };
+
+ public TestSceneDrawableTournamentTeam()
+ : base(4, 3)
+ {
+ var team = new TournamentTeam
+ {
+ FlagName = { Value = "AU" },
+ FullName = { Value = "Australia" },
+ Players =
+ {
+ new User { Username = "ASecretBox" },
+ new User { Username = "Dereban" },
+ new User { Username = "mReKk" },
+ new User { Username = "uyghti" },
+ new User { Username = "Parkes" },
+ new User { Username = "Shiroha" },
+ new User { Username = "Jordan The Bear" },
+ }
+ };
+
+ var match = new TournamentMatch { Team1 = { Value = team } };
+
+ int i = 0;
+
+ Cell(i++).AddRange(new Drawable[]
+ {
+ new TournamentSpriteText { Text = "DrawableTeamFlag" },
+ new DrawableTeamFlag(team)
+ {
+ Anchor = Anchor.Centre,
+ Origin = Anchor.Centre,
+ }
+ });
+
+ Cell(i++).AddRange(new Drawable[]
+ {
+ new TournamentSpriteText { Text = "DrawableTeamTitle" },
+ new DrawableTeamTitle(team)
+ {
+ Anchor = Anchor.Centre,
+ Origin = Anchor.Centre,
+ }
+ });
+
+ Cell(i++).AddRange(new Drawable[]
+ {
+ new TournamentSpriteText { Text = "DrawableTeamTitleWithHeader" },
+ new DrawableTeamTitleWithHeader(team, TeamColour.Red)
+ {
+ Anchor = Anchor.Centre,
+ Origin = Anchor.Centre,
+ }
+ });
+
+ Cell(i++).AddRange(new Drawable[]
+ {
+ new TournamentSpriteText { Text = "DrawableMatchTeam" },
+ new DrawableMatchTeam(team, match, false)
+ {
+ Anchor = Anchor.Centre,
+ Origin = Anchor.Centre,
+ }
+ });
+
+ Cell(i++).AddRange(new Drawable[]
+ {
+ new TournamentSpriteText { Text = "TeamWithPlayers" },
+ new DrawableTeamWithPlayers(team, TeamColour.Blue)
+ {
+ Anchor = Anchor.Centre,
+ Origin = Anchor.Centre,
+ }
+ });
+
+ Cell(i++).AddRange(new Drawable[]
+ {
+ new TournamentSpriteText { Text = "GroupTeam" },
+ new GroupTeam(team)
+ {
+ Anchor = Anchor.Centre,
+ Origin = Anchor.Centre,
+ }
+ });
+
+ Cell(i).AddRange(new Drawable[]
+ {
+ new TournamentSpriteText { Text = "TeamDisplay" },
+ new TeamDisplay(team, TournamentGame.COLOUR_RED, false)
+ {
+ Anchor = Anchor.Centre,
+ Origin = Anchor.Centre,
+ }
+ });
+ }
+ }
+}
diff --git a/osu.Game.Tournament/Components/DrawableTeamFlag.cs b/osu.Game.Tournament/Components/DrawableTeamFlag.cs
new file mode 100644
index 0000000000..8c85c9a46f
--- /dev/null
+++ b/osu.Game.Tournament/Components/DrawableTeamFlag.cs
@@ -0,0 +1,33 @@
+// 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.Allocation;
+using osu.Framework.Bindables;
+using osu.Framework.Graphics.Sprites;
+using osu.Framework.Graphics.Textures;
+using osu.Game.Tournament.Models;
+
+namespace osu.Game.Tournament.Components
+{
+ public class DrawableTeamFlag : Sprite
+ {
+ private readonly TournamentTeam team;
+
+ [UsedImplicitly]
+ private Bindable flag;
+
+ public DrawableTeamFlag(TournamentTeam team)
+ {
+ this.team = team;
+ }
+
+ [BackgroundDependencyLoader]
+ private void load(TextureStore textures)
+ {
+ if (team == null) return;
+
+ (flag = team.FlagName.GetBoundCopy()).BindValueChanged(acronym => Texture = textures.Get($@"Flags/{team.FlagName}"), true);
+ }
+ }
+}
diff --git a/osu.Game.Tournament/Components/DrawableTeamHeader.cs b/osu.Game.Tournament/Components/DrawableTeamHeader.cs
new file mode 100644
index 0000000000..3d9e8a6e00
--- /dev/null
+++ b/osu.Game.Tournament/Components/DrawableTeamHeader.cs
@@ -0,0 +1,20 @@
+// 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;
+using osuTK;
+
+namespace osu.Game.Tournament.Components
+{
+ public class DrawableTeamHeader : TournamentSpriteTextWithBackground
+ {
+ public DrawableTeamHeader(TeamColour colour)
+ {
+ Background.Colour = TournamentGame.GetTeamColour(colour);
+
+ Text.Colour = TournamentGame.TEXT_COLOUR;
+ Text.Text = $"Team {colour}".ToUpperInvariant();
+ Text.Scale = new Vector2(0.6f);
+ }
+ }
+}
diff --git a/osu.Game.Tournament/Components/DrawableTeamTitle.cs b/osu.Game.Tournament/Components/DrawableTeamTitle.cs
new file mode 100644
index 0000000000..5aac37259f
--- /dev/null
+++ b/osu.Game.Tournament/Components/DrawableTeamTitle.cs
@@ -0,0 +1,32 @@
+// 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.Allocation;
+using osu.Framework.Bindables;
+using osu.Framework.Graphics.Textures;
+using osu.Game.Tournament.Models;
+
+namespace osu.Game.Tournament.Components
+{
+ public class DrawableTeamTitle : TournamentSpriteTextWithBackground
+ {
+ private readonly TournamentTeam team;
+
+ [UsedImplicitly]
+ private Bindable acronym;
+
+ public DrawableTeamTitle(TournamentTeam team)
+ {
+ this.team = team;
+ }
+
+ [BackgroundDependencyLoader]
+ private void load(TextureStore textures)
+ {
+ if (team == null) return;
+
+ (acronym = team.Acronym.GetBoundCopy()).BindValueChanged(acronym => Text.Text = team?.FullName.Value ?? string.Empty, true);
+ }
+ }
+}
diff --git a/osu.Game.Tournament/Components/DrawableTeamTitleWithHeader.cs b/osu.Game.Tournament/Components/DrawableTeamTitleWithHeader.cs
new file mode 100644
index 0000000000..ceffe3d315
--- /dev/null
+++ b/osu.Game.Tournament/Components/DrawableTeamTitleWithHeader.cs
@@ -0,0 +1,30 @@
+// 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;
+using osu.Game.Tournament.Models;
+using osuTK;
+
+namespace osu.Game.Tournament.Components
+{
+ public class DrawableTeamTitleWithHeader : CompositeDrawable
+ {
+ public DrawableTeamTitleWithHeader(TournamentTeam team, TeamColour colour)
+ {
+ AutoSizeAxes = Axes.Both;
+
+ InternalChild = new FillFlowContainer
+ {
+ AutoSizeAxes = Axes.Both,
+ Direction = FillDirection.Vertical,
+ Spacing = new Vector2(0, 10),
+ Children = new Drawable[]
+ {
+ new DrawableTeamHeader(colour),
+ new DrawableTeamTitle(team),
+ }
+ };
+ }
+ }
+}
diff --git a/osu.Game.Tournament/Components/DrawableTeamWithPlayers.cs b/osu.Game.Tournament/Components/DrawableTeamWithPlayers.cs
new file mode 100644
index 0000000000..e949bf9881
--- /dev/null
+++ b/osu.Game.Tournament/Components/DrawableTeamWithPlayers.cs
@@ -0,0 +1,66 @@
+// 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;
+using osu.Framework.Graphics.Containers;
+using osu.Game.Graphics;
+using osu.Game.Tournament.Models;
+using osu.Game.Users;
+using osuTK;
+using osuTK.Graphics;
+
+namespace osu.Game.Tournament.Components
+{
+ public class DrawableTeamWithPlayers : CompositeDrawable
+ {
+ public DrawableTeamWithPlayers(TournamentTeam team, TeamColour colour)
+ {
+ AutoSizeAxes = Axes.Both;
+
+ InternalChildren = new Drawable[]
+ {
+ new FillFlowContainer
+ {
+ AutoSizeAxes = Axes.Both,
+ Direction = FillDirection.Vertical,
+ Spacing = new Vector2(30),
+ Children = new Drawable[]
+ {
+ new DrawableTeamTitleWithHeader(team, colour),
+ new FillFlowContainer
+ {
+ AutoSizeAxes = Axes.Both,
+ Direction = FillDirection.Horizontal,
+ Padding = new MarginPadding { Left = 10 },
+ Spacing = new Vector2(30),
+ Children = new Drawable[]
+ {
+ new FillFlowContainer
+ {
+ Direction = FillDirection.Vertical,
+ AutoSizeAxes = Axes.Both,
+ ChildrenEnumerable = team?.Players.Select(createPlayerText).Take(5) ?? Enumerable.Empty()
+ },
+ new FillFlowContainer
+ {
+ Direction = FillDirection.Vertical,
+ AutoSizeAxes = Axes.Both,
+ ChildrenEnumerable = team?.Players.Select(createPlayerText).Skip(5) ?? Enumerable.Empty()
+ },
+ }
+ },
+ }
+ },
+ };
+
+ TournamentSpriteText createPlayerText(User p) =>
+ new TournamentSpriteText
+ {
+ Text = p.Username,
+ Font = OsuFont.Torus.With(size: 24, weight: FontWeight.SemiBold),
+ Colour = Color4.White,
+ };
+ }
+ }
+}
diff --git a/osu.Game.Tournament/Components/DrawableTournamentTeam.cs b/osu.Game.Tournament/Components/DrawableTournamentTeam.cs
index 99116d4a17..f8aed26ce1 100644
--- a/osu.Game.Tournament/Components/DrawableTournamentTeam.cs
+++ b/osu.Game.Tournament/Components/DrawableTournamentTeam.cs
@@ -23,14 +23,11 @@ namespace osu.Game.Tournament.Components
[UsedImplicitly]
private Bindable acronym;
- [UsedImplicitly]
- private Bindable flag;
-
protected DrawableTournamentTeam(TournamentTeam team)
{
Team = team;
- Flag = new Sprite
+ Flag = new DrawableTeamFlag(team)
{
RelativeSizeAxes = Axes.Both,
FillMode = FillMode.Fit
@@ -48,7 +45,6 @@ namespace osu.Game.Tournament.Components
if (Team == null) return;
(acronym = Team.Acronym.GetBoundCopy()).BindValueChanged(acronym => AcronymText.Text = Team?.Acronym.Value?.ToUpperInvariant() ?? string.Empty, true);
- (flag = Team.FlagName.GetBoundCopy()).BindValueChanged(acronym => Flag.Texture = textures.Get($@"Flags/{Team.FlagName}"), true);
}
}
}
diff --git a/osu.Game.Tournament/Components/DrawableTournamentTitleText.cs b/osu.Game.Tournament/Components/DrawableTournamentTitleText.cs
new file mode 100644
index 0000000000..4fbc6cd060
--- /dev/null
+++ b/osu.Game.Tournament/Components/DrawableTournamentTitleText.cs
@@ -0,0 +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 osu.Game.Graphics;
+
+namespace osu.Game.Tournament.Components
+{
+ public class DrawableTournamentTitleText : TournamentSpriteText
+ {
+ public DrawableTournamentTitleText()
+ {
+ Text = "osu!taiko world cup 2020";
+ Font = OsuFont.Torus.With(size: 26, weight: FontWeight.SemiBold);
+ }
+ }
+}
diff --git a/osu.Game.Tournament/Components/RoundDisplay.cs b/osu.Game.Tournament/Components/RoundDisplay.cs
new file mode 100644
index 0000000000..dd56c83c57
--- /dev/null
+++ b/osu.Game.Tournament/Components/RoundDisplay.cs
@@ -0,0 +1,36 @@
+// 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;
+using osu.Game.Graphics;
+using osu.Game.Tournament.Models;
+
+namespace osu.Game.Tournament.Components
+{
+ public class RoundDisplay : CompositeDrawable
+ {
+ public RoundDisplay(TournamentMatch match)
+ {
+ AutoSizeAxes = Axes.Both;
+
+ InternalChildren = new Drawable[]
+ {
+ new FillFlowContainer
+ {
+ AutoSizeAxes = Axes.Both,
+ Direction = FillDirection.Vertical,
+ Children = new Drawable[]
+ {
+ new DrawableTournamentTitleText(),
+ new TournamentSpriteText
+ {
+ Text = match.Round.Value?.Name.Value ?? "Unknown Round",
+ Font = OsuFont.Torus.With(size: 26, weight: FontWeight.SemiBold)
+ },
+ }
+ }
+ };
+ }
+ }
+}
diff --git a/osu.Game.Tournament/Components/TournamentBeatmapPanel.cs b/osu.Game.Tournament/Components/TournamentBeatmapPanel.cs
index 394ffe304e..09c4a96807 100644
--- a/osu.Game.Tournament/Components/TournamentBeatmapPanel.cs
+++ b/osu.Game.Tournament/Components/TournamentBeatmapPanel.cs
@@ -27,7 +27,7 @@ namespace osu.Game.Tournament.Components
private readonly string mods;
private const float horizontal_padding = 10;
- private const float vertical_padding = 5;
+ private const float vertical_padding = 10;
public const float HEIGHT = 50;
@@ -50,8 +50,6 @@ namespace osu.Game.Tournament.Components
currentMatch.BindValueChanged(matchChanged);
currentMatch.BindTo(ladder.CurrentMatch);
- CornerRadius = HEIGHT / 2;
- CornerExponent = 2;
Masking = true;
AddRangeInternal(new Drawable[]
@@ -70,16 +68,12 @@ namespace osu.Game.Tournament.Components
new FillFlowContainer
{
AutoSizeAxes = Axes.Both,
- Anchor = Anchor.TopCentre,
- Origin = Anchor.TopCentre,
Padding = new MarginPadding(vertical_padding),
Direction = FillDirection.Vertical,
Children = new Drawable[]
{
new TournamentSpriteText
{
- Anchor = Anchor.TopCentre,
- Origin = Anchor.TopCentre,
Text = new LocalisedString((
$"{Beatmap.Metadata.ArtistUnicode ?? Beatmap.Metadata.Artist} - {Beatmap.Metadata.TitleUnicode ?? Beatmap.Metadata.Title}",
$"{Beatmap.Metadata.Artist} - {Beatmap.Metadata.Title}")),
@@ -88,9 +82,6 @@ namespace osu.Game.Tournament.Components
new FillFlowContainer
{
AutoSizeAxes = Axes.Both,
- Anchor = Anchor.TopCentre,
- Origin = Anchor.TopCentre,
- Padding = new MarginPadding(vertical_padding),
Direction = FillDirection.Horizontal,
Children = new Drawable[]
{
@@ -170,16 +161,7 @@ namespace osu.Game.Tournament.Components
BorderThickness = 6;
- switch (found.Team)
- {
- case TeamColour.Red:
- BorderColour = Color4.Red;
- break;
-
- case TeamColour.Blue:
- BorderColour = Color4.Blue;
- break;
- }
+ BorderColour = TournamentGame.GetTeamColour(found.Team);
switch (found.Type)
{
diff --git a/osu.Game.Tournament/Components/TournamentMatchChatDisplay.cs b/osu.Game.Tournament/Components/TournamentMatchChatDisplay.cs
index 48c5b9bd35..f9cd18be2c 100644
--- a/osu.Game.Tournament/Components/TournamentMatchChatDisplay.cs
+++ b/osu.Game.Tournament/Components/TournamentMatchChatDisplay.cs
@@ -66,6 +66,10 @@ namespace osu.Game.Tournament.Components
}
}
+ public void Expand() => this.FadeIn(300);
+
+ public void Contract() => this.FadeOut(200);
+
protected override ChatLine CreateMessage(Message message) => new MatchMessage(message);
protected class MatchMessage : StandAloneMessage
diff --git a/osu.Game.Tournament/Components/TournamentSpriteTextWithBackground.cs b/osu.Game.Tournament/Components/TournamentSpriteTextWithBackground.cs
new file mode 100644
index 0000000000..d92b9eb605
--- /dev/null
+++ b/osu.Game.Tournament/Components/TournamentSpriteTextWithBackground.cs
@@ -0,0 +1,37 @@
+// 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;
+using osu.Framework.Graphics.Shapes;
+using osu.Game.Graphics;
+
+namespace osu.Game.Tournament.Components
+{
+ public class TournamentSpriteTextWithBackground : CompositeDrawable
+ {
+ protected readonly TournamentSpriteText Text;
+ protected readonly Box Background;
+
+ public TournamentSpriteTextWithBackground(string text = "")
+ {
+ AutoSizeAxes = Axes.Both;
+
+ InternalChildren = new Drawable[]
+ {
+ Background = new Box
+ {
+ Colour = TournamentGame.ELEMENT_BACKGROUND_COLOUR,
+ RelativeSizeAxes = Axes.Both,
+ },
+ Text = new TournamentSpriteText
+ {
+ Colour = TournamentGame.ELEMENT_FOREGROUND_COLOUR,
+ Font = OsuFont.Torus.With(weight: FontWeight.SemiBold, size: 50),
+ Padding = new MarginPadding { Left = 10, Right = 20 },
+ Text = text
+ }
+ };
+ }
+ }
+}
diff --git a/osu.Game.Tournament/Components/TourneyVideo.cs b/osu.Game.Tournament/Components/TourneyVideo.cs
index 206689ca1a..43088d6b92 100644
--- a/osu.Game.Tournament/Components/TourneyVideo.cs
+++ b/osu.Game.Tournament/Components/TourneyVideo.cs
@@ -1,12 +1,13 @@
// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
-using System.IO;
+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.Video;
+using osu.Framework.Platform;
using osu.Framework.Timing;
using osu.Game.Graphics;
@@ -14,13 +15,34 @@ namespace osu.Game.Tournament.Components
{
public class TourneyVideo : CompositeDrawable
{
- private readonly VideoSprite video;
+ private readonly string filename;
+ private readonly bool drawFallbackGradient;
+ private VideoSprite video;
- private readonly ManualClock manualClock;
+ private ManualClock manualClock;
- public TourneyVideo(Stream stream)
+ public TourneyVideo(string filename, bool drawFallbackGradient = false)
{
- if (stream == null)
+ this.filename = filename;
+ this.drawFallbackGradient = drawFallbackGradient;
+ }
+
+ [BackgroundDependencyLoader]
+ private void load(Storage storage)
+ {
+ var stream = storage.GetStream($@"videos/{filename}.m4v");
+
+ if (stream != null)
+ {
+ InternalChild = video = new VideoSprite(stream)
+ {
+ RelativeSizeAxes = Axes.Both,
+ FillMode = FillMode.Fit,
+ Clock = new FramedClock(manualClock = new ManualClock()),
+ Loop = loop,
+ };
+ }
+ else if (drawFallbackGradient)
{
InternalChild = new Box
{
@@ -28,26 +50,26 @@ namespace osu.Game.Tournament.Components
RelativeSizeAxes = Axes.Both,
};
}
- else
- {
- InternalChild = video = new VideoSprite(stream)
- {
- RelativeSizeAxes = Axes.Both,
- FillMode = FillMode.Fit,
- Clock = new FramedClock(manualClock = new ManualClock())
- };
- }
}
+ private bool loop;
+
public bool Loop
{
set
{
+ loop = value;
if (video != null)
video.Loop = value;
}
}
+ public void Reset()
+ {
+ if (manualClock != null)
+ manualClock.CurrentTime = 0;
+ }
+
protected override void Update()
{
base.Update();
diff --git a/osu.Game.Tournament/Models/TournamentMatch.cs b/osu.Game.Tournament/Models/TournamentMatch.cs
index 06cce3d59e..8ebcbf4e15 100644
--- a/osu.Game.Tournament/Models/TournamentMatch.cs
+++ b/osu.Game.Tournament/Models/TournamentMatch.cs
@@ -90,6 +90,8 @@ namespace osu.Game.Tournament.Models
[JsonIgnore]
public TournamentTeam Loser => !Completed.Value ? null : Team1Score.Value > Team2Score.Value ? Team2.Value : Team1.Value;
+ public TeamColour WinnerColour => Winner == Team1.Value ? TeamColour.Red : TeamColour.Blue;
+
public int PointsToWin => Round.Value?.BestOf.Value / 2 + 1 ?? 0;
///
diff --git a/osu.Game.Tournament/Screens/Drawings/Components/Group.cs b/osu.Game.Tournament/Screens/Drawings/Components/Group.cs
index 4126f2db65..ece1c431e2 100644
--- a/osu.Game.Tournament/Screens/Drawings/Components/Group.cs
+++ b/osu.Game.Tournament/Screens/Drawings/Components/Group.cs
@@ -8,7 +8,6 @@ using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Game.Graphics;
-using osu.Game.Tournament.Components;
using osu.Game.Tournament.Models;
using osuTK;
using osuTK.Graphics;
@@ -116,53 +115,5 @@ namespace osu.Game.Tournament.Screens.Drawings.Components
sb.AppendLine(gt.Team.FullName.Value);
return sb.ToString();
}
-
- private class GroupTeam : DrawableTournamentTeam
- {
- private readonly FillFlowContainer innerContainer;
-
- public GroupTeam(TournamentTeam team)
- : base(team)
- {
- Width = 36;
- AutoSizeAxes = Axes.Y;
-
- Flag.Anchor = Anchor.TopCentre;
- Flag.Origin = Anchor.TopCentre;
-
- AcronymText.Anchor = Anchor.TopCentre;
- AcronymText.Origin = Anchor.TopCentre;
- AcronymText.Text = team.Acronym.Value.ToUpperInvariant();
- AcronymText.Font = OsuFont.Torus.With(weight: FontWeight.Bold, size: 10);
-
- InternalChildren = new Drawable[]
- {
- innerContainer = new FillFlowContainer
- {
- Anchor = Anchor.Centre,
- Origin = Anchor.Centre,
-
- RelativeSizeAxes = Axes.X,
- AutoSizeAxes = Axes.Y,
-
- Direction = FillDirection.Vertical,
- Spacing = new Vector2(0, 5f),
-
- Children = new Drawable[]
- {
- Flag,
- AcronymText
- }
- }
- };
- }
-
- protected override void LoadComplete()
- {
- base.LoadComplete();
- innerContainer.ScaleTo(1.5f);
- innerContainer.ScaleTo(1f, 200);
- }
- }
}
}
diff --git a/osu.Game.Tournament/Screens/Drawings/Components/GroupTeam.cs b/osu.Game.Tournament/Screens/Drawings/Components/GroupTeam.cs
new file mode 100644
index 0000000000..4f0ce0bbe7
--- /dev/null
+++ b/osu.Game.Tournament/Screens/Drawings/Components/GroupTeam.cs
@@ -0,0 +1,60 @@
+// 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;
+using osu.Game.Graphics;
+using osu.Game.Tournament.Components;
+using osu.Game.Tournament.Models;
+using osuTK;
+
+namespace osu.Game.Tournament.Screens.Drawings.Components
+{
+ public class GroupTeam : DrawableTournamentTeam
+ {
+ private readonly FillFlowContainer innerContainer;
+
+ public GroupTeam(TournamentTeam team)
+ : base(team)
+ {
+ Width = 36;
+ AutoSizeAxes = Axes.Y;
+
+ Flag.Anchor = Anchor.TopCentre;
+ Flag.Origin = Anchor.TopCentre;
+
+ AcronymText.Anchor = Anchor.TopCentre;
+ AcronymText.Origin = Anchor.TopCentre;
+ AcronymText.Text = team.Acronym.Value.ToUpperInvariant();
+ AcronymText.Font = OsuFont.Torus.With(weight: FontWeight.Bold, size: 10);
+
+ InternalChildren = new Drawable[]
+ {
+ innerContainer = new FillFlowContainer
+ {
+ Anchor = Anchor.Centre,
+ Origin = Anchor.Centre,
+
+ RelativeSizeAxes = Axes.X,
+ AutoSizeAxes = Axes.Y,
+
+ Direction = FillDirection.Vertical,
+ Spacing = new Vector2(0, 5f),
+
+ Children = new Drawable[]
+ {
+ Flag,
+ AcronymText
+ }
+ }
+ };
+ }
+
+ protected override void LoadComplete()
+ {
+ base.LoadComplete();
+ innerContainer.ScaleTo(1.5f);
+ innerContainer.ScaleTo(1f, 200);
+ }
+ }
+}
diff --git a/osu.Game.Tournament/Screens/Editors/RoundEditorScreen.cs b/osu.Game.Tournament/Screens/Editors/RoundEditorScreen.cs
index 7119533743..8b8078e119 100644
--- a/osu.Game.Tournament/Screens/Editors/RoundEditorScreen.cs
+++ b/osu.Game.Tournament/Screens/Editors/RoundEditorScreen.cs
@@ -129,8 +129,6 @@ namespace osu.Game.Tournament.Screens.Editors
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Direction = FillDirection.Vertical,
- LayoutDuration = 200,
- LayoutEasing = Easing.OutQuint,
ChildrenEnumerable = round.Beatmaps.Select(p => new RoundBeatmapRow(round, p))
};
}
diff --git a/osu.Game.Tournament/Screens/Editors/SeedingEditorScreen.cs b/osu.Game.Tournament/Screens/Editors/SeedingEditorScreen.cs
index e68946aaf2..46bb7b83e3 100644
--- a/osu.Game.Tournament/Screens/Editors/SeedingEditorScreen.cs
+++ b/osu.Game.Tournament/Screens/Editors/SeedingEditorScreen.cs
@@ -124,8 +124,6 @@ namespace osu.Game.Tournament.Screens.Editors
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Direction = FillDirection.Vertical,
- LayoutDuration = 200,
- LayoutEasing = Easing.OutQuint,
ChildrenEnumerable = round.Beatmaps.Select(p => new SeedingBeatmapRow(round, p))
};
}
diff --git a/osu.Game.Tournament/Screens/Editors/TeamEditorScreen.cs b/osu.Game.Tournament/Screens/Editors/TeamEditorScreen.cs
index ca8bce1cca..7468c9484d 100644
--- a/osu.Game.Tournament/Screens/Editors/TeamEditorScreen.cs
+++ b/osu.Game.Tournament/Screens/Editors/TeamEditorScreen.cs
@@ -172,19 +172,6 @@ namespace osu.Game.Tournament.Screens.Editors
drawableContainer.Child = new DrawableTeamFlag(Model);
}
- private class DrawableTeamFlag : DrawableTournamentTeam
- {
- public DrawableTeamFlag(TournamentTeam team)
- : base(team)
- {
- InternalChild = Flag;
- RelativeSizeAxes = Axes.Both;
-
- Flag.Anchor = Anchor.Centre;
- Flag.Origin = Anchor.Centre;
- }
- }
-
public class PlayerEditor : CompositeDrawable
{
private readonly TournamentTeam team;
@@ -202,8 +189,6 @@ namespace osu.Game.Tournament.Screens.Editors
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Direction = FillDirection.Vertical,
- LayoutDuration = 200,
- LayoutEasing = Easing.OutQuint,
ChildrenEnumerable = team.Players.Select(p => new PlayerRow(team, p))
};
}
diff --git a/osu.Game.Tournament/Screens/Editors/TournamentEditorScreen.cs b/osu.Game.Tournament/Screens/Editors/TournamentEditorScreen.cs
index 5598910824..8e5df72cc8 100644
--- a/osu.Game.Tournament/Screens/Editors/TournamentEditorScreen.cs
+++ b/osu.Game.Tournament/Screens/Editors/TournamentEditorScreen.cs
@@ -40,7 +40,6 @@ namespace osu.Game.Tournament.Screens.Editors
new OsuScrollContainer
{
RelativeSizeAxes = Axes.Both,
- Width = 0.9f,
Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre,
Child = flow = new FillFlowContainer
@@ -48,8 +47,6 @@ namespace osu.Game.Tournament.Screens.Editors
Direction = FillDirection.Vertical,
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
- LayoutDuration = 200,
- LayoutEasing = Easing.OutQuint,
Spacing = new Vector2(20)
},
},
diff --git a/osu.Game.Tournament/Screens/Gameplay/Components/MatchHeader.cs b/osu.Game.Tournament/Screens/Gameplay/Components/MatchHeader.cs
index ce17c392d0..c86132a802 100644
--- a/osu.Game.Tournament/Screens/Gameplay/Components/MatchHeader.cs
+++ b/osu.Game.Tournament/Screens/Gameplay/Components/MatchHeader.cs
@@ -5,15 +5,9 @@ using osu.Framework.Allocation;
using osu.Framework.Bindables;
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.UserInterface;
-using osu.Game.Tournament.Components;
using osu.Game.Tournament.Models;
using osu.Game.Tournament.Screens.Showcase;
-using osuTK;
-using osuTK.Graphics;
using osuTK.Input;
namespace osu.Game.Tournament.Screens.Gameplay.Components
@@ -46,181 +40,75 @@ namespace osu.Game.Tournament.Screens.Gameplay.Components
},
};
}
+ }
- private class TeamScoreDisplay : CompositeDrawable
+ public class TeamScoreDisplay : CompositeDrawable
+ {
+ private readonly TeamColour teamColour;
+
+ private readonly Bindable currentMatch = new Bindable();
+ private readonly Bindable currentTeam = new Bindable();
+ private readonly Bindable currentTeamScore = new Bindable();
+
+ public TeamScoreDisplay(TeamColour teamColour)
{
- private readonly TeamColour teamColour;
+ this.teamColour = teamColour;
- private readonly Bindable currentMatch = new Bindable();
- private readonly Bindable currentTeam = new Bindable();
- private readonly Bindable currentTeamScore = new Bindable();
+ RelativeSizeAxes = Axes.Y;
+ Width = 300;
+ }
- public TeamScoreDisplay(TeamColour teamColour)
+ [BackgroundDependencyLoader]
+ private void load(LadderInfo ladder)
+ {
+ currentMatch.BindValueChanged(matchChanged);
+ currentMatch.BindTo(ladder.CurrentMatch);
+ }
+
+ private void matchChanged(ValueChangedEvent match)
+ {
+ currentTeamScore.UnbindBindings();
+ currentTeamScore.BindTo(teamColour == TeamColour.Red ? match.NewValue.Team1Score : match.NewValue.Team2Score);
+
+ currentTeam.UnbindBindings();
+ 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.
+ teamChanged(currentTeam.Value);
+ }
+
+ protected override bool OnMouseDown(MouseDownEvent e)
+ {
+ switch (e.Button)
{
- this.teamColour = teamColour;
+ case MouseButton.Left:
+ if (currentTeamScore.Value < currentMatch.Value.PointsToWin)
+ currentTeamScore.Value++;
+ return true;
- RelativeSizeAxes = Axes.Y;
- Width = 300;
+ case MouseButton.Right:
+ if (currentTeamScore.Value > 0)
+ currentTeamScore.Value--;
+ return true;
}
- [BackgroundDependencyLoader]
- private void load(LadderInfo ladder)
+ return base.OnMouseDown(e);
+ }
+
+ private void teamChanged(TournamentTeam team)
+ {
+ var colour = teamColour == TeamColour.Red ? TournamentGame.COLOUR_RED : TournamentGame.COLOUR_BLUE;
+ var flip = teamColour == TeamColour.Red;
+
+ InternalChildren = new Drawable[]
{
- currentMatch.BindValueChanged(matchChanged);
- currentMatch.BindTo(ladder.CurrentMatch);
- }
-
- private void matchChanged(ValueChangedEvent match)
- {
- currentTeamScore.UnbindBindings();
- currentTeamScore.BindTo(teamColour == TeamColour.Red ? match.NewValue.Team1Score : match.NewValue.Team2Score);
-
- currentTeam.UnbindBindings();
- 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.
- teamChanged(currentTeam.Value);
- }
-
- protected override bool OnMouseDown(MouseDownEvent e)
- {
- switch (e.Button)
+ new TeamDisplay(team, colour, flip),
+ new TeamScore(currentTeamScore, flip, currentMatch.Value.PointsToWin)
{
- case MouseButton.Left:
- if (currentTeamScore.Value < currentMatch.Value.PointsToWin)
- currentTeamScore.Value++;
- return true;
-
- case MouseButton.Right:
- if (currentTeamScore.Value > 0)
- currentTeamScore.Value--;
- return true;
+ Colour = colour
}
-
- return base.OnMouseDown(e);
- }
-
- private void teamChanged(TournamentTeam team)
- {
- var colour = teamColour == TeamColour.Red ? TournamentGame.COLOUR_RED : TournamentGame.COLOUR_BLUE;
- var flip = teamColour != TeamColour.Red;
-
- InternalChildren = new Drawable[]
- {
- new TeamDisplay(team, colour, flip),
- new TeamScore(currentTeamScore, flip, currentMatch.Value.PointsToWin)
- {
- Colour = colour
- }
- };
- }
- }
-
- private class TeamScore : CompositeDrawable
- {
- private readonly Bindable currentTeamScore = new Bindable();
- private readonly StarCounter counter;
-
- public TeamScore(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,
- };
-
- currentTeamScore.BindValueChanged(scoreChanged);
- currentTeamScore.BindTo(score);
- }
-
- private void scoreChanged(ValueChangedEvent score) => counter.CountStars = score.NewValue ?? 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 TournamentSpriteText
- {
- Text = team?.FullName.Value.ToUpper() ?? "???",
- X = (flip ? -1 : 1) * 90,
- Y = -10,
- Colour = colour,
- Font = OsuFont.Torus.With(weight: FontWeight.Regular, size: 20),
- Origin = anchor,
- Anchor = anchor,
- },
- }
- };
- }
- }
-
- private class RoundDisplay : CompositeDrawable
- {
- private readonly Bindable currentMatch = new Bindable();
-
- private readonly TournamentSpriteText text;
-
- public RoundDisplay()
- {
- Width = 200;
- Height = 20;
-
- Masking = true;
- CornerRadius = 10;
-
- InternalChildren = new Drawable[]
- {
- new Box
- {
- Colour = OsuColour.Gray(0.18f),
- RelativeSizeAxes = Axes.Both,
- },
- text = new TournamentSpriteText
- {
- Anchor = Anchor.Centre,
- Origin = Anchor.Centre,
- Colour = Color4.White,
- Font = OsuFont.Torus.With(weight: FontWeight.Regular, size: 16),
- },
- };
- }
-
- [BackgroundDependencyLoader]
- private void load(LadderInfo ladder)
- {
- currentMatch.BindValueChanged(matchChanged);
- currentMatch.BindTo(ladder.CurrentMatch);
- }
-
- private void matchChanged(ValueChangedEvent match) =>
- text.Text = match.NewValue.Round.Value?.Name.Value ?? "Unknown Round";
+ };
}
}
}
diff --git a/osu.Game.Tournament/Screens/Gameplay/Components/RoundDisplay.cs b/osu.Game.Tournament/Screens/Gameplay/Components/RoundDisplay.cs
new file mode 100644
index 0000000000..5322cf9a76
--- /dev/null
+++ b/osu.Game.Tournament/Screens/Gameplay/Components/RoundDisplay.cs
@@ -0,0 +1,56 @@
+// 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;
+using osu.Framework.Graphics;
+using osu.Framework.Graphics.Containers;
+using osu.Framework.Graphics.Shapes;
+using osu.Game.Graphics;
+using osu.Game.Tournament.Models;
+using osuTK.Graphics;
+
+namespace osu.Game.Tournament.Screens.Gameplay.Components
+{
+ public class RoundDisplay : CompositeDrawable
+ {
+ private readonly Bindable currentMatch = new Bindable();
+
+ private readonly TournamentSpriteText text;
+
+ public RoundDisplay()
+ {
+ Width = 200;
+ Height = 20;
+
+ Masking = true;
+ CornerRadius = 10;
+
+ InternalChildren = new Drawable[]
+ {
+ new Box
+ {
+ Colour = OsuColour.Gray(0.18f),
+ RelativeSizeAxes = Axes.Both,
+ },
+ text = new TournamentSpriteText
+ {
+ Anchor = Anchor.Centre,
+ Origin = Anchor.Centre,
+ Colour = Color4.White,
+ Font = OsuFont.Torus.With(weight: FontWeight.Regular, size: 16),
+ },
+ };
+ }
+
+ [BackgroundDependencyLoader]
+ private void load(LadderInfo ladder)
+ {
+ currentMatch.BindValueChanged(matchChanged);
+ currentMatch.BindTo(ladder.CurrentMatch);
+ }
+
+ private void matchChanged(ValueChangedEvent match) =>
+ text.Text = match.NewValue.Round.Value?.Name.Value ?? "Unknown Round";
+ }
+}
diff --git a/osu.Game.Tournament/Screens/Gameplay/Components/TeamDisplay.cs b/osu.Game.Tournament/Screens/Gameplay/Components/TeamDisplay.cs
new file mode 100644
index 0000000000..891435c48e
--- /dev/null
+++ b/osu.Game.Tournament/Screens/Gameplay/Components/TeamDisplay.cs
@@ -0,0 +1,50 @@
+// 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;
+using osu.Game.Graphics;
+using osu.Game.Tournament.Components;
+using osu.Game.Tournament.Models;
+using osuTK;
+using osuTK.Graphics;
+
+namespace osu.Game.Tournament.Screens.Gameplay.Components
+{
+ public 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 TournamentSpriteText
+ {
+ Text = team?.FullName.Value.ToUpper() ?? "???",
+ X = (flip ? -1 : 1) * 90,
+ Y = -10,
+ Colour = colour,
+ Font = OsuFont.Torus.With(weight: FontWeight.Regular, size: 20),
+ Origin = anchor,
+ Anchor = anchor,
+ },
+ }
+ };
+ }
+ }
+}
diff --git a/osu.Game.Tournament/Screens/Gameplay/Components/TeamScore.cs b/osu.Game.Tournament/Screens/Gameplay/Components/TeamScore.cs
new file mode 100644
index 0000000000..04fee8cd7d
--- /dev/null
+++ b/osu.Game.Tournament/Screens/Gameplay/Components/TeamScore.cs
@@ -0,0 +1,38 @@
+// 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;
+using osu.Framework.Graphics.Containers;
+using osu.Game.Graphics.UserInterface;
+using osuTK;
+
+namespace osu.Game.Tournament.Screens.Gameplay.Components
+{
+ public class TeamScore : CompositeDrawable
+ {
+ private readonly Bindable currentTeamScore = new Bindable();
+ private readonly StarCounter counter;
+
+ public TeamScore(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,
+ };
+
+ currentTeamScore.BindValueChanged(scoreChanged);
+ currentTeamScore.BindTo(score);
+ }
+
+ private void scoreChanged(ValueChangedEvent score) => counter.Current = score.NewValue ?? 0;
+ }
+}
diff --git a/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs b/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs
index 6a3095d42d..6ba57c60b8 100644
--- a/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs
+++ b/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs
@@ -6,6 +6,7 @@ using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
+using osu.Framework.Platform;
using osu.Framework.Threading;
using osu.Game.Graphics.UserInterface;
using osu.Game.Tournament.Components;
@@ -19,7 +20,7 @@ using osuTK.Graphics;
namespace osu.Game.Tournament.Screens.Gameplay
{
- public class GameplayScreen : BeatmapInfoScreen
+ public class GameplayScreen : BeatmapInfoScreen, IProvideVideo
{
private readonly BindableBool warmup = new BindableBool();
@@ -39,12 +40,17 @@ namespace osu.Game.Tournament.Screens.Gameplay
private TournamentMatchChatDisplay chat { get; set; }
[BackgroundDependencyLoader]
- private void load(LadderInfo ladder, MatchIPCInfo ipc)
+ private void load(LadderInfo ladder, MatchIPCInfo ipc, Storage storage)
{
this.ipc = ipc;
AddRangeInternal(new Drawable[]
{
+ new TourneyVideo("gameplay")
+ {
+ Loop = true,
+ RelativeSizeAxes = Axes.Both,
+ },
new MatchHeader(),
new Container
{
@@ -156,7 +162,7 @@ namespace osu.Game.Tournament.Screens.Gameplay
void expand()
{
- chat?.Expand();
+ chat?.Contract();
using (BeginDelayedSequence(300, true))
{
@@ -170,7 +176,7 @@ namespace osu.Game.Tournament.Screens.Gameplay
SongBar.Expanded = false;
scoreDisplay.FadeOut(100);
using (chat?.BeginDelayedSequence(500))
- chat?.Contract();
+ chat?.Expand();
}
switch (state.NewValue)
@@ -197,7 +203,7 @@ namespace osu.Game.Tournament.Screens.Gameplay
break;
default:
- chat.Expand();
+ chat.Contract();
expand();
break;
}
diff --git a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs
index 88d7b95b0c..fe7e80873c 100644
--- a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs
+++ b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchTeam.cs
@@ -27,21 +27,23 @@ namespace osu.Game.Tournament.Screens.Ladder.Components
private readonly bool losers;
private TournamentSpriteText scoreText;
private Box background;
+ private Box backgroundRight;
private readonly Bindable score = new Bindable();
private readonly BindableBool completed = new BindableBool();
private Color4 colourWinner;
- private Color4 colourNormal;
private readonly Func isWinner;
private LadderEditorScreen ladderEditor;
- [Resolved]
+ [Resolved(canBeNull: true)]
private LadderInfo ladderInfo { get; set; }
private void setCurrent()
{
+ if (ladderInfo == null) return;
+
//todo: tournamentgamebase?
if (ladderInfo.CurrentMatch.Value != null)
ladderInfo.CurrentMatch.Value.Current.Value = false;
@@ -60,15 +62,12 @@ namespace osu.Game.Tournament.Screens.Ladder.Components
this.losers = losers;
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.Font = OsuFont.Torus.With(size: 24);
+ AcronymText.Font = OsuFont.Torus.With(size: 22, weight: FontWeight.Bold);
if (match != null)
{
@@ -85,8 +84,9 @@ namespace osu.Game.Tournament.Screens.Ladder.Components
{
this.ladderEditor = ladderEditor;
- colourWinner = losers ? colours.YellowDarker : colours.BlueDarker;
- colourNormal = OsuColour.Gray(0.2f);
+ colourWinner = losers
+ ? OsuColour.FromHex("#8E7F48")
+ : OsuColour.FromHex("#1462AA");
InternalChildren = new Drawable[]
{
@@ -102,29 +102,28 @@ namespace osu.Game.Tournament.Screens.Ladder.Components
{
AcronymText,
Flag,
- new Container
+ }
+ },
+ new Container
+ {
+ Masking = true,
+ Width = 0.3f,
+ Anchor = Anchor.CentreRight,
+ Origin = Anchor.CentreRight,
+ RelativeSizeAxes = Axes.Both,
+ Children = new Drawable[]
+ {
+ backgroundRight = new Box
{
- Masking = true,
- CornerRadius = 5,
- Width = 0.3f,
- Anchor = Anchor.CentreRight,
- Origin = Anchor.CentreRight,
+ Colour = OsuColour.Gray(0.1f),
+ Alpha = 0.8f,
RelativeSizeAxes = Axes.Both,
- Children = new Drawable[]
- {
- new Box
- {
- Colour = OsuColour.Gray(0.1f),
- Alpha = 0.8f,
- RelativeSizeAxes = Axes.Both,
- },
- scoreText = new TournamentSpriteText
- {
- Anchor = Anchor.Centre,
- Origin = Anchor.Centre,
- Font = OsuFont.Torus.With(size: 20),
- }
- }
+ },
+ scoreText = new TournamentSpriteText
+ {
+ Anchor = Anchor.Centre,
+ Origin = Anchor.Centre,
+ Font = OsuFont.Torus.With(size: 22),
}
}
}
@@ -181,9 +180,12 @@ namespace osu.Game.Tournament.Screens.Ladder.Components
{
bool winner = completed.Value && isWinner?.Invoke() == true;
- background.FadeColour(winner ? colourWinner : colourNormal, winner ? 500 : 0, Easing.OutQuint);
+ background.FadeColour(winner ? Color4.White : OsuColour.FromHex("#444"), winner ? 500 : 0, Easing.OutQuint);
+ backgroundRight.FadeColour(winner ? colourWinner : OsuColour.FromHex("#333"), winner ? 500 : 0, Easing.OutQuint);
- scoreText.Font = AcronymText.Font = OsuFont.Torus.With(weight: winner ? FontWeight.Bold : FontWeight.Regular);
+ AcronymText.Colour = winner ? Color4.Black : Color4.White;
+
+ scoreText.Font = scoreText.Font.With(weight: winner ? FontWeight.Bold : FontWeight.Regular);
}
public MenuItem[] ContextMenuItems
diff --git a/osu.Game.Tournament/Screens/Ladder/Components/DrawableTournamentMatch.cs b/osu.Game.Tournament/Screens/Ladder/Components/DrawableTournamentMatch.cs
index c4b670f059..82a4c7017f 100644
--- a/osu.Game.Tournament/Screens/Ladder/Components/DrawableTournamentMatch.cs
+++ b/osu.Game.Tournament/Screens/Ladder/Components/DrawableTournamentMatch.cs
@@ -9,6 +9,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.Tournament.Models;
using osuTK;
using osuTK.Graphics;
@@ -45,9 +46,7 @@ namespace osu.Game.Tournament.Screens.Ladder.Components
{
selectionBox = new Container
{
- CornerRadius = 5,
- Masking = true,
- Scale = new Vector2(1.05f),
+ Scale = new Vector2(1.1f),
RelativeSizeAxes = Axes.Both,
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
@@ -57,14 +56,12 @@ namespace osu.Game.Tournament.Screens.Ladder.Components
},
currentMatchSelectionBox = new Container
{
- CornerRadius = 5,
- Masking = true,
- Scale = new Vector2(1.05f),
+ Scale = new Vector2(1.1f),
RelativeSizeAxes = Axes.Both,
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Alpha = 0,
- Colour = Color4.OrangeRed,
+ Colour = OsuColour.FromHex("#D24747"),
Child = new Box { RelativeSizeAxes = Axes.Both }
},
Flow = new FillFlowContainer
diff --git a/osu.Game.Tournament/Screens/Ladder/Components/DrawableTournamentRound.cs b/osu.Game.Tournament/Screens/Ladder/Components/DrawableTournamentRound.cs
index d14ebb4d03..cad0b827c0 100644
--- a/osu.Game.Tournament/Screens/Ladder/Components/DrawableTournamentRound.cs
+++ b/osu.Game.Tournament/Screens/Ladder/Components/DrawableTournamentRound.cs
@@ -7,7 +7,6 @@ using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Game.Graphics;
using osu.Game.Tournament.Models;
-using osuTK.Graphics;
namespace osu.Game.Tournament.Screens.Ladder.Components
{
@@ -33,14 +32,14 @@ namespace osu.Game.Tournament.Screens.Ladder.Components
{
textDescription = new TournamentSpriteText
{
- Colour = Color4.Black,
+ Colour = TournamentGame.TEXT_COLOUR,
Origin = Anchor.TopCentre,
Anchor = Anchor.TopCentre
},
textName = new TournamentSpriteText
{
Font = OsuFont.Torus.With(weight: FontWeight.Bold),
- Colour = Color4.Black,
+ Colour = TournamentGame.TEXT_COLOUR,
Origin = Anchor.TopCentre,
Anchor = Anchor.TopCentre
},
diff --git a/osu.Game.Tournament/Screens/Ladder/LadderScreen.cs b/osu.Game.Tournament/Screens/Ladder/LadderScreen.cs
index 293f6e0068..c7e59cfa7b 100644
--- a/osu.Game.Tournament/Screens/Ladder/LadderScreen.cs
+++ b/osu.Game.Tournament/Screens/Ladder/LadderScreen.cs
@@ -32,8 +32,8 @@ namespace osu.Game.Tournament.Screens.Ladder
[BackgroundDependencyLoader]
private void load(OsuColour colours, Storage storage)
{
- normalPathColour = colours.BlueDarker.Darken(2);
- losersPathColour = colours.YellowDarker.Darken(2);
+ normalPathColour = OsuColour.FromHex("#66D1FF");
+ losersPathColour = OsuColour.FromHex("#FFC700");
RelativeSizeAxes = Axes.Both;
@@ -42,11 +42,17 @@ namespace osu.Game.Tournament.Screens.Ladder
RelativeSizeAxes = Axes.Both,
Children = new Drawable[]
{
- new TourneyVideo(storage.GetStream(@"videos/ladder.m4v"))
+ new TourneyVideo("ladder")
{
RelativeSizeAxes = Axes.Both,
Loop = true,
},
+ new DrawableTournamentTitleText
+ {
+ Y = 100,
+ Anchor = Anchor.TopCentre,
+ Origin = Anchor.TopCentre,
+ },
ScrollContent = new LadderDragContainer
{
RelativeSizeAxes = Axes.Both,
diff --git a/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs b/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs
index c42d0a6da3..4f3f7cfdbf 100644
--- a/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs
+++ b/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs
@@ -42,6 +42,11 @@ namespace osu.Game.Tournament.Screens.MapPool
{
InternalChildren = new Drawable[]
{
+ new TourneyVideo("gameplay")
+ {
+ Loop = true,
+ RelativeSizeAxes = Axes.Both,
+ },
new MatchHeader(),
mapFlows = new FillFlowContainer>
{
diff --git a/osu.Game.Tournament/Screens/Schedule/ScheduleScreen.cs b/osu.Game.Tournament/Screens/Schedule/ScheduleScreen.cs
index 080570eac4..4c93c04fcf 100644
--- a/osu.Game.Tournament/Screens/Schedule/ScheduleScreen.cs
+++ b/osu.Game.Tournament/Screens/Schedule/ScheduleScreen.cs
@@ -18,7 +18,7 @@ using osuTK.Graphics;
namespace osu.Game.Tournament.Screens.Schedule
{
- public class ScheduleScreen : TournamentScreen, IProvideVideo
+ public class ScheduleScreen : TournamentScreen
{
private readonly Bindable currentMatch = new Bindable();
private Container mainContainer;
@@ -33,7 +33,7 @@ namespace osu.Game.Tournament.Screens.Schedule
InternalChildren = new Drawable[]
{
- new TourneyVideo(storage.GetStream(@"videos/schedule.m4v"))
+ new TourneyVideo("schedule")
{
RelativeSizeAxes = Axes.Both,
Loop = true,
diff --git a/osu.Game.Tournament/Screens/TeamIntro/SeedingScreen.cs b/osu.Game.Tournament/Screens/TeamIntro/SeedingScreen.cs
index db5363c155..513d84b594 100644
--- a/osu.Game.Tournament/Screens/TeamIntro/SeedingScreen.cs
+++ b/osu.Game.Tournament/Screens/TeamIntro/SeedingScreen.cs
@@ -34,7 +34,7 @@ namespace osu.Game.Tournament.Screens.TeamIntro
InternalChildren = new Drawable[]
{
- new TourneyVideo(storage.GetStream(@"videos/seeding.m4v"))
+ new TourneyVideo("seeding")
{
RelativeSizeAxes = Axes.Both,
Loop = true,
diff --git a/osu.Game.Tournament/Screens/TeamIntro/TeamIntroScreen.cs b/osu.Game.Tournament/Screens/TeamIntro/TeamIntroScreen.cs
index 6559113f55..6c2848897b 100644
--- a/osu.Game.Tournament/Screens/TeamIntro/TeamIntroScreen.cs
+++ b/osu.Game.Tournament/Screens/TeamIntro/TeamIntroScreen.cs
@@ -6,7 +6,6 @@ using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Platform;
-using osu.Game.Graphics;
using osu.Game.Tournament.Components;
using osu.Game.Tournament.Models;
using osuTK;
@@ -26,7 +25,7 @@ namespace osu.Game.Tournament.Screens.TeamIntro
InternalChildren = new Drawable[]
{
- new TourneyVideo(storage.GetStream(@"videos/teamintro.m4v"))
+ new TourneyVideo("teamintro")
{
RelativeSizeAxes = Axes.Both,
Loop = true,
@@ -49,141 +48,33 @@ namespace osu.Game.Tournament.Screens.TeamIntro
return;
}
+ const float y_flag_offset = 292;
+
+ const float y_offset = 460;
+
mainContainer.Children = new Drawable[]
{
- new TeamWithPlayers(match.NewValue.Team1.Value, true)
- {
- RelativeSizeAxes = Axes.Both,
- Width = 0.5f,
- Height = 0.6f,
- Anchor = Anchor.Centre,
- Origin = Anchor.CentreRight
- },
- new TeamWithPlayers(match.NewValue.Team2.Value)
- {
- RelativeSizeAxes = Axes.Both,
- Width = 0.5f,
- Height = 0.6f,
- Anchor = Anchor.Centre,
- Origin = Anchor.CentreLeft
- },
new RoundDisplay(match.NewValue)
{
- RelativeSizeAxes = Axes.Both,
- Height = 0.25f,
- Anchor = Anchor.TopCentre,
- Origin = Anchor.TopCentre,
- Y = 180,
- }
+ Position = new Vector2(100, 100)
+ },
+ new DrawableTeamFlag(match.NewValue.Team1.Value)
+ {
+ Position = new Vector2(165, y_flag_offset),
+ },
+ new DrawableTeamWithPlayers(match.NewValue.Team1.Value, TeamColour.Red)
+ {
+ Position = new Vector2(165, y_offset),
+ },
+ new DrawableTeamFlag(match.NewValue.Team2.Value)
+ {
+ Position = new Vector2(740, y_flag_offset),
+ },
+ new DrawableTeamWithPlayers(match.NewValue.Team2.Value, TeamColour.Blue)
+ {
+ Position = new Vector2(740, y_offset),
+ },
};
}
-
- private class RoundDisplay : CompositeDrawable
- {
- public RoundDisplay(TournamentMatch match)
- {
- 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 TournamentSpriteText
- {
- Anchor = Anchor.TopCentre,
- Origin = Anchor.TopCentre,
- Colour = OsuColour.Gray(0.33f),
- Text = match.Round.Value?.Name.Value ?? "Unknown Round",
- Font = OsuFont.Torus.With(size: 26, weight: FontWeight.Light)
- },
- }
- }
- };
- }
- }
-
- private class TeamWithPlayers : CompositeDrawable
- {
- public TeamWithPlayers(TournamentTeam team, bool left = false)
- {
- FillFlowContainer players;
- var colour = left ? TournamentGame.COLOUR_RED : TournamentGame.COLOUR_BLUE;
- InternalChildren = new Drawable[]
- {
- new TeamDisplay(team)
- {
- Anchor = left ? Anchor.CentreRight : Anchor.CentreLeft,
- Origin = Anchor.TopCentre,
- RelativePositionAxes = Axes.Both,
- X = (left ? -1 : 1) * 0.3145f,
- Y = -0.077f,
- },
- 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 ? -1 : 1) * 0.58f,
- },
- };
-
- if (team != null)
- {
- foreach (var p in team.Players)
- {
- players.Add(new TournamentSpriteText
- {
- Text = p.Username,
- Font = OsuFont.Torus.With(size: 24),
- Colour = colour,
- Anchor = left ? Anchor.CentreRight : Anchor.CentreLeft,
- Origin = left ? Anchor.CentreRight : Anchor.CentreLeft,
- });
- }
- }
- }
-
- private class TeamDisplay : DrawableTournamentTeam
- {
- public TeamDisplay(TournamentTeam team)
- : 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.32f);
-
- InternalChild = new FillFlowContainer
- {
- AutoSizeAxes = Axes.Both,
- Direction = FillDirection.Vertical,
- Spacing = new Vector2(160),
- Children = new Drawable[]
- {
- Flag,
- new TournamentSpriteText
- {
- Text = team?.FullName.Value ?? "???",
- Font = OsuFont.Torus.With(size: 20, weight: FontWeight.Regular),
- Colour = OsuColour.Gray(0.2f),
- 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 30b86f8421..3870f486e1 100644
--- a/osu.Game.Tournament/Screens/TeamWin/TeamWinScreen.cs
+++ b/osu.Game.Tournament/Screens/TeamWin/TeamWinScreen.cs
@@ -10,7 +10,6 @@ using osu.Game.Graphics;
using osu.Game.Tournament.Components;
using osu.Game.Tournament.Models;
using osuTK;
-using osuTK.Graphics;
namespace osu.Game.Tournament.Screens.TeamWin
{
@@ -31,13 +30,13 @@ namespace osu.Game.Tournament.Screens.TeamWin
InternalChildren = new Drawable[]
{
- blueWinVideo = new TourneyVideo(storage.GetStream(@"videos/teamwin-blue.m4v"))
+ blueWinVideo = new TourneyVideo("teamwin-blue")
{
Alpha = 1,
RelativeSizeAxes = Axes.Both,
Loop = true,
},
- redWinVideo = new TourneyVideo(storage.GetStream(@"videos/teamwin-red.m4v"))
+ redWinVideo = new TourneyVideo("teamwin-red")
{
Alpha = 0,
RelativeSizeAxes = Axes.Both,
@@ -63,7 +62,9 @@ namespace osu.Game.Tournament.Screens.TeamWin
update();
}
- private void update()
+ private bool firstDisplay = true;
+
+ private void update() => Schedule(() =>
{
var match = currentMatch.Value;
@@ -73,105 +74,53 @@ namespace osu.Game.Tournament.Screens.TeamWin
return;
}
- bool redWin = match.Winner == match.Team1.Value;
- redWinVideo.Alpha = redWin ? 1 : 0;
- blueWinVideo.Alpha = redWin ? 0 : 1;
+ redWinVideo.Alpha = match.WinnerColour == TeamColour.Red ? 1 : 0;
+ blueWinVideo.Alpha = match.WinnerColour == TeamColour.Blue ? 1 : 0;
+
+ if (firstDisplay)
+ {
+ if (match.WinnerColour == TeamColour.Red)
+ redWinVideo.Reset();
+ else
+ blueWinVideo.Reset();
+ firstDisplay = false;
+ }
mainContainer.Children = new Drawable[]
{
- new TeamFlagDisplay(match.Winner)
+ new DrawableTeamFlag(match.Winner)
{
Size = new Vector2(300, 200),
Scale = new Vector2(0.5f),
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
- X = -387,
+ Position = new Vector2(-300, 10),
},
- new TournamentSpriteText
+ new FillFlowContainer
{
+ AutoSizeAxes = Axes.Both,
+ Direction = FillDirection.Vertical,
Anchor = Anchor.Centre,
- Origin = Anchor.TopLeft,
- Position = new Vector2(78, -70),
- Colour = OsuColour.Gray(0.33f),
- Text = match.Round.Value?.Name.Value ?? "Unknown Round",
- Font = OsuFont.Torus.With(size: 30, weight: FontWeight.Regular)
- },
- new TeamWithPlayers(match.Winner, redWin)
- {
- RelativeSizeAxes = Axes.Both,
- Width = 0.5f,
- Height = 0.6f,
- Anchor = Anchor.Centre,
- Origin = Anchor.TopLeft,
- Position = new Vector2(78, 0),
+ Origin = Anchor.Centre,
+ X = 260,
+ Children = new Drawable[]
+ {
+ new RoundDisplay(match)
+ {
+ Margin = new MarginPadding { Bottom = 30 },
+ },
+ new TournamentSpriteText
+ {
+ Text = "WINNER",
+ Font = OsuFont.Torus.With(size: 100, weight: FontWeight.Bold),
+ Margin = new MarginPadding { Bottom = 50 },
+ },
+ new DrawableTeamWithPlayers(match.Winner, match.WinnerColour)
+ }
},
};
- }
-
- private class TeamWithPlayers : CompositeDrawable
- {
- public TeamWithPlayers(TournamentTeam team, bool left = false)
- {
- FillFlowContainer players;
-
- var colour = left ? TournamentGame.COLOUR_RED : TournamentGame.COLOUR_BLUE;
- InternalChildren = new Drawable[]
- {
- new FillFlowContainer
- {
- Direction = FillDirection.Vertical,
- AutoSizeAxes = Axes.Both,
- Children = new Drawable[]
- {
- new TournamentSpriteText
- {
- Text = "WINNER",
- Font = OsuFont.Torus.With(size: 24, weight: FontWeight.SemiBold),
- Colour = Color4.Black,
- },
- new TournamentSpriteText
- {
- Text = team?.FullName.Value ?? "???",
- Font = OsuFont.Torus.With(size: 30, weight: FontWeight.SemiBold),
- Colour = Color4.Black,
- },
- players = new FillFlowContainer
- {
- Direction = FillDirection.Vertical,
- AutoSizeAxes = Axes.Both,
- Padding = new MarginPadding { Top = 10 },
- },
- }
- },
- };
-
- if (team != null)
- {
- foreach (var p in team.Players)
- {
- players.Add(new TournamentSpriteText
- {
- Text = p.Username,
- Font = OsuFont.Torus.With(size: 24),
- Colour = colour,
- Anchor = left ? Anchor.CentreRight : Anchor.CentreLeft,
- Origin = left ? Anchor.CentreRight : Anchor.CentreLeft,
- });
- }
- }
- }
- }
-
- private class TeamFlagDisplay : DrawableTournamentTeam
- {
- public TeamFlagDisplay(TournamentTeam team)
- : base(team)
- {
- InternalChildren = new Drawable[]
- {
- Flag
- };
- }
- }
+ mainContainer.FadeOut();
+ mainContainer.Delay(2000).FadeIn(1600, Easing.OutQuint);
+ });
}
}
diff --git a/osu.Game.Tournament/Screens/TournamentScreen.cs b/osu.Game.Tournament/Screens/TournamentScreen.cs
index 0b5b3e728b..5da7c7a5d2 100644
--- a/osu.Game.Tournament/Screens/TournamentScreen.cs
+++ b/osu.Game.Tournament/Screens/TournamentScreen.cs
@@ -18,6 +18,9 @@ namespace osu.Game.Tournament.Screens
protected TournamentScreen()
{
RelativeSizeAxes = Axes.Both;
+
+ FillMode = FillMode.Fit;
+ FillAspectRatio = 16 / 9f;
}
public override void Hide() => this.FadeOut(FADE_DELAY);
diff --git a/osu.Game.Tournament/TournamentGame.cs b/osu.Game.Tournament/TournamentGame.cs
index 608fc5f04a..6d597d5e7d 100644
--- a/osu.Game.Tournament/TournamentGame.cs
+++ b/osu.Game.Tournament/TournamentGame.cs
@@ -2,15 +2,25 @@
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.Graphics;
+using osu.Framework.Graphics.Colour;
+using osu.Game.Graphics;
using osu.Game.Graphics.Cursor;
+using osu.Game.Tournament.Models;
using osuTK.Graphics;
namespace osu.Game.Tournament
{
public class TournamentGame : TournamentGameBase
{
- public static readonly Color4 COLOUR_RED = new Color4(144, 0, 0, 255);
- public static readonly Color4 COLOUR_BLUE = new Color4(0, 84, 144, 255);
+ public static ColourInfo GetTeamColour(TeamColour teamColour) => teamColour == TeamColour.Red ? COLOUR_RED : COLOUR_BLUE;
+
+ public static readonly Color4 COLOUR_RED = OsuColour.FromHex("#AA1414");
+ public static readonly Color4 COLOUR_BLUE = OsuColour.FromHex("#1462AA");
+
+ public static readonly Color4 ELEMENT_BACKGROUND_COLOUR = OsuColour.FromHex("#fff");
+ public static readonly Color4 ELEMENT_FOREGROUND_COLOUR = OsuColour.FromHex("#000");
+
+ public static readonly Color4 TEXT_COLOUR = OsuColour.FromHex("#fff");
protected override void LoadComplete()
{
diff --git a/osu.Game.Tournament/TournamentGameBase.cs b/osu.Game.Tournament/TournamentGameBase.cs
index 435f315c8d..41165ca141 100644
--- a/osu.Game.Tournament/TournamentGameBase.cs
+++ b/osu.Game.Tournament/TournamentGameBase.cs
@@ -22,6 +22,7 @@ using osu.Game.Online.API.Requests;
using osu.Game.Tournament.IPC;
using osu.Game.Tournament.Models;
using osu.Game.Users;
+using osuTK;
using osuTK.Graphics;
using osuTK.Input;
@@ -74,16 +75,40 @@ namespace osu.Game.Tournament
AddRange(new[]
{
- new TourneyButton
+ new Container
{
- Text = "Save Changes",
- Width = 140,
- Height = 50,
+ CornerRadius = 10,
Depth = float.MinValue,
+ Position = new Vector2(5),
+ Masking = true,
+ AutoSizeAxes = Axes.Both,
Anchor = Anchor.BottomRight,
Origin = Anchor.BottomRight,
- Padding = new MarginPadding(10),
- Action = SaveChanges,
+ Children = new Drawable[]
+ {
+ new Box
+ {
+ Colour = OsuColour.Gray(0.2f),
+ RelativeSizeAxes = Axes.Both,
+ },
+ new TourneyButton
+ {
+ Text = "Save Changes",
+ Width = 140,
+ Height = 50,
+ Padding = new MarginPadding
+ {
+ Top = 10,
+ Left = 10,
+ },
+ Margin = new MarginPadding
+ {
+ Right = 10,
+ Bottom = 10,
+ },
+ Action = SaveChanges,
+ },
+ }
},
heightWarning = new Container
{
diff --git a/osu.Game.Tournament/TournamentSceneManager.cs b/osu.Game.Tournament/TournamentSceneManager.cs
index 9f5f2b6827..287e25b1fb 100644
--- a/osu.Game.Tournament/TournamentSceneManager.cs
+++ b/osu.Game.Tournament/TournamentSceneManager.cs
@@ -61,7 +61,7 @@ namespace osu.Game.Tournament
//Masking = true,
Children = new Drawable[]
{
- video = new TourneyVideo(storage.GetStream("videos/main.m4v"))
+ video = new TourneyVideo("main", true)
{
Loop = true,
RelativeSizeAxes = Axes.Both,
diff --git a/osu.Game/Graphics/UserInterface/OsuPasswordTextBox.cs b/osu.Game/Graphics/UserInterface/OsuPasswordTextBox.cs
index e7699e5255..0c82a869f8 100644
--- a/osu.Game/Graphics/UserInterface/OsuPasswordTextBox.cs
+++ b/osu.Game/Graphics/UserInterface/OsuPasswordTextBox.cs
@@ -18,7 +18,11 @@ namespace osu.Game.Graphics.UserInterface
{
public class OsuPasswordTextBox : OsuTextBox, ISuppressKeyEventLogging
{
- protected override Drawable GetDrawableCharacter(char c) => new PasswordMaskChar(CalculatedTextSize);
+ protected override Drawable GetDrawableCharacter(char c) => new FallingDownContainer
+ {
+ AutoSizeAxes = Axes.Both,
+ Child = new PasswordMaskChar(CalculatedTextSize),
+ };
protected override bool AllowClipboardExport => false;
diff --git a/osu.Game/Graphics/UserInterface/OsuTextBox.cs b/osu.Game/Graphics/UserInterface/OsuTextBox.cs
index 4abbf8db57..6f440d8138 100644
--- a/osu.Game/Graphics/UserInterface/OsuTextBox.cs
+++ b/osu.Game/Graphics/UserInterface/OsuTextBox.cs
@@ -63,7 +63,11 @@ namespace osu.Game.Graphics.UserInterface
base.OnFocusLost(e);
}
- protected override Drawable GetDrawableCharacter(char c) => new OsuSpriteText { Text = c.ToString(), Font = OsuFont.GetFont(size: CalculatedTextSize) };
+ protected override Drawable GetDrawableCharacter(char c) => new FallingDownContainer
+ {
+ AutoSizeAxes = Axes.Both,
+ Child = new OsuSpriteText { Text = c.ToString(), Font = OsuFont.GetFont(size: CalculatedTextSize) },
+ };
protected override Caret CreateCaret() => new OsuCaret
{
diff --git a/osu.Game/Graphics/UserInterface/StarCounter.cs b/osu.Game/Graphics/UserInterface/StarCounter.cs
index 586cd2ce84..b13d6485ac 100644
--- a/osu.Game/Graphics/UserInterface/StarCounter.cs
+++ b/osu.Game/Graphics/UserInterface/StarCounter.cs
@@ -13,7 +13,7 @@ namespace osu.Game.Graphics.UserInterface
{
public class StarCounter : Container
{
- private readonly Container stars;
+ private readonly FillFlowContainer stars;
///
/// Maximum amount of stars displayed.
@@ -23,34 +23,29 @@ namespace osu.Game.Graphics.UserInterface
///
public int StarCount { get; }
- private double animationDelay => 80;
+ ///
+ /// The added delay for each subsequent star to be animated.
+ ///
+ protected virtual double AnimationDelay => 80;
- private double scalingDuration => 1000;
- private Easing scalingEasing => Easing.OutElasticHalf;
- private float minStarScale => 0.4f;
-
- private double fadingDuration => 100;
- private float minStarAlpha => 0.5f;
-
- private const float star_size = 20;
private const float star_spacing = 4;
- private float countStars;
+ private float current;
///
/// Amount of stars represented.
///
- public float CountStars
+ public float Current
{
- get => countStars;
+ get => current;
set
{
- if (countStars == value) return;
+ if (current == value) return;
if (IsLoaded)
- transformCount(value);
- countStars = value;
+ animate(value);
+ current = value;
}
}
@@ -71,11 +66,13 @@ namespace osu.Game.Graphics.UserInterface
AutoSizeAxes = Axes.Both,
Direction = FillDirection.Horizontal,
Spacing = new Vector2(star_spacing),
- ChildrenEnumerable = Enumerable.Range(0, StarCount).Select(i => new Star { Alpha = minStarAlpha })
+ ChildrenEnumerable = Enumerable.Range(0, StarCount).Select(i => CreateStar())
}
};
}
+ public virtual Star CreateStar() => new DefaultStar();
+
protected override void LoadComplete()
{
base.LoadComplete();
@@ -86,63 +83,60 @@ namespace osu.Game.Graphics.UserInterface
public void ResetCount()
{
- countStars = 0;
+ current = 0;
StopAnimation();
}
public void ReplayAnimation()
{
- var t = countStars;
+ var t = current;
ResetCount();
- CountStars = t;
+ Current = t;
}
public void StopAnimation()
{
- int i = 0;
-
+ animate(current);
foreach (var star in stars.Children)
+ star.FinishTransforms(true);
+ }
+
+ private float getStarScale(int i, float value) => i + 1 <= value ? 1.0f : Interpolation.ValueAt(value, 0, 1.0f, i, i + 1);
+
+ private void animate(float newValue)
+ {
+ for (var i = 0; i < stars.Children.Count; i++)
{
+ var star = stars.Children[i];
+
star.ClearTransforms(true);
- star.FadeTo(i < countStars ? 1.0f : minStarAlpha);
- star.Icon.ScaleTo(getStarScale(i, countStars));
- i++;
+
+ double delay = (current <= newValue ? Math.Max(i - current, 0) : Math.Max(current - 1 - i, 0)) * AnimationDelay;
+
+ using (star.BeginDelayedSequence(delay, true))
+ star.DisplayAt(getStarScale(i, newValue));
}
}
- private float getStarScale(int i, float value)
+ public class DefaultStar : Star
{
- if (value <= i)
- return minStarScale;
+ private const double scaling_duration = 1000;
- return i + 1 <= value ? 1.0f : Interpolation.ValueAt(value, minStarScale, 1.0f, i, i + 1);
- }
+ private const double fading_duration = 100;
- private void transformCount(float newValue)
- {
- int i = 0;
+ private const Easing scaling_easing = Easing.OutElasticHalf;
- foreach (var star in stars.Children)
- {
- star.ClearTransforms(true);
+ private const float min_star_scale = 0.4f;
- var delay = (countStars <= newValue ? Math.Max(i - countStars, 0) : Math.Max(countStars - 1 - i, 0)) * animationDelay;
- star.Delay(delay).FadeTo(i < newValue ? 1.0f : minStarAlpha, fadingDuration);
- star.Icon.Delay(delay).ScaleTo(getStarScale(i, newValue), scalingDuration, scalingEasing);
+ private const float star_size = 20;
- i++;
- }
- }
-
- private class Star : Container
- {
public readonly SpriteIcon Icon;
- public Star()
+ public DefaultStar()
{
Size = new Vector2(star_size);
- Child = Icon = new SpriteIcon
+ InternalChild = Icon = new SpriteIcon
{
Size = new Vector2(star_size),
Icon = FontAwesome.Solid.Star,
@@ -150,6 +144,19 @@ namespace osu.Game.Graphics.UserInterface
Origin = Anchor.Centre,
};
}
+
+ public override void DisplayAt(float scale)
+ {
+ scale = Math.Clamp(scale, min_star_scale, 1);
+
+ this.FadeTo(scale, fading_duration);
+ Icon.ScaleTo(scale, scaling_duration, scaling_easing);
+ }
+ }
+
+ public abstract class Star : CompositeDrawable
+ {
+ public abstract void DisplayAt(float scale);
}
}
}
diff --git a/osu.Game/Online/Chat/StandAloneChatDisplay.cs b/osu.Game/Online/Chat/StandAloneChatDisplay.cs
index 21d0bcc4bf..0914f688e9 100644
--- a/osu.Game/Online/Chat/StandAloneChatDisplay.cs
+++ b/osu.Game/Online/Chat/StandAloneChatDisplay.cs
@@ -92,18 +92,6 @@ namespace osu.Game.Online.Chat
textbox.Text = string.Empty;
}
- public void Contract()
- {
- this.FadeIn(300);
- this.MoveToY(0, 500, Easing.OutQuint);
- }
-
- public void Expand()
- {
- this.FadeOut(200);
- this.MoveToY(100, 500, Easing.In);
- }
-
protected virtual ChatLine CreateMessage(Message message) => new StandAloneMessage(message);
private void channelChanged(ValueChangedEvent e)
diff --git a/osu.Game/Overlays/Comments/CommentEditor.cs b/osu.Game/Overlays/Comments/CommentEditor.cs
index 2fa4cb68f3..7b4bf882dc 100644
--- a/osu.Game/Overlays/Comments/CommentEditor.cs
+++ b/osu.Game/Overlays/Comments/CommentEditor.cs
@@ -158,7 +158,11 @@ namespace osu.Game.Overlays.Comments
Font = OsuFont.GetFont(weight: FontWeight.Regular),
};
- protected override Drawable GetDrawableCharacter(char c) => new OsuSpriteText { Text = c.ToString(), Font = OsuFont.GetFont(size: CalculatedTextSize) };
+ protected override Drawable GetDrawableCharacter(char c) => new FallingDownContainer
+ {
+ AutoSizeAxes = Axes.Both,
+ Child = new OsuSpriteText { Text = c.ToString(), Font = OsuFont.GetFont(size: CalculatedTextSize) },
+ };
}
private class CommitButton : LoadingButton
diff --git a/osu.Game/Overlays/Profile/Sections/Historical/DrawableMostPlayedBeatmap.cs b/osu.Game/Overlays/Profile/Sections/Historical/DrawableMostPlayedBeatmap.cs
index e75ad2f161..5b7c5efbe2 100644
--- a/osu.Game/Overlays/Profile/Sections/Historical/DrawableMostPlayedBeatmap.cs
+++ b/osu.Game/Overlays/Profile/Sections/Historical/DrawableMostPlayedBeatmap.cs
@@ -37,7 +37,7 @@ namespace osu.Game.Overlays.Profile.Sections.Historical
}
[BackgroundDependencyLoader]
- private void load(OsuColour colours)
+ private void load(OverlayColourProvider colourProvider)
{
AddRangeInternal(new Drawable[]
{
@@ -61,7 +61,7 @@ namespace osu.Game.Overlays.Profile.Sections.Historical
CornerRadius = corner_radius,
Children = new Drawable[]
{
- new ProfileItemContainer
+ new MostPlayedBeatmapContainer
{
Child = new Container
{
@@ -78,11 +78,14 @@ namespace osu.Game.Overlays.Profile.Sections.Historical
Children = new Drawable[]
{
new MostPlayedBeatmapMetadataContainer(beatmap),
- new LinkFlowContainer(t => t.Font = OsuFont.GetFont(size: 12, weight: FontWeight.Regular))
+ new LinkFlowContainer(t =>
+ {
+ t.Font = OsuFont.GetFont(size: 12, weight: FontWeight.Regular);
+ t.Colour = colourProvider.Foreground1;
+ })
{
AutoSizeAxes = Axes.Both,
Direction = FillDirection.Horizontal,
- Colour = colours.GreySeafoamLighter
}.With(d =>
{
d.AddText("mapped by ");
@@ -105,6 +108,16 @@ namespace osu.Game.Overlays.Profile.Sections.Historical
});
}
+ private class MostPlayedBeatmapContainer : ProfileItemContainer
+ {
+ [BackgroundDependencyLoader]
+ private void load(OverlayColourProvider colourProvider)
+ {
+ IdleColour = colourProvider.Background4;
+ HoverColour = colourProvider.Background3;
+ }
+ }
+
private class MostPlayedBeatmapMetadataContainer : BeatmapMetadataContainer
{
public MostPlayedBeatmapMetadataContainer(BeatmapInfo beatmap)
diff --git a/osu.Game/Overlays/Profile/Sections/ProfileItemContainer.cs b/osu.Game/Overlays/Profile/Sections/ProfileItemContainer.cs
index f65c909155..afa6bd9f79 100644
--- a/osu.Game/Overlays/Profile/Sections/ProfileItemContainer.cs
+++ b/osu.Game/Overlays/Profile/Sections/ProfileItemContainer.cs
@@ -16,12 +16,33 @@ namespace osu.Game.Overlays.Profile.Sections
protected override Container Content => content;
- private Color4 idleColour;
- private Color4 hoverColour;
-
private readonly Box background;
private readonly Container content;
+ private Color4 idleColour;
+
+ protected Color4 IdleColour
+ {
+ get => idleColour;
+ set
+ {
+ idleColour = value;
+ fadeBackgroundColour();
+ }
+ }
+
+ private Color4 hoverColour;
+
+ protected Color4 HoverColour
+ {
+ get => hoverColour;
+ set
+ {
+ hoverColour = value;
+ fadeBackgroundColour();
+ }
+ }
+
public ProfileItemContainer()
{
RelativeSizeAxes = Axes.Both;
@@ -44,20 +65,25 @@ namespace osu.Game.Overlays.Profile.Sections
[BackgroundDependencyLoader]
private void load(OverlayColourProvider colourProvider)
{
- background.Colour = idleColour = colourProvider.Background3;
- hoverColour = colourProvider.Background2;
+ IdleColour = colourProvider.Background3;
+ HoverColour = colourProvider.Background2;
}
protected override bool OnHover(HoverEvent e)
{
- background.FadeColour(hoverColour, hover_duration, Easing.OutQuint);
- return base.OnHover(e);
+ fadeBackgroundColour(hover_duration);
+ return true;
}
protected override void OnHoverLost(HoverLostEvent e)
{
base.OnHoverLost(e);
- background.FadeColour(idleColour, hover_duration, Easing.OutQuint);
+ fadeBackgroundColour(hover_duration);
+ }
+
+ private void fadeBackgroundColour(double fadeDuration = 0)
+ {
+ background.FadeColour(IsHovered ? HoverColour : IdleColour, fadeDuration, Easing.OutQuint);
}
}
}
diff --git a/osu.Game/Screens/Play/HUD/HitErrorMeters/BarHitErrorMeter.cs b/osu.Game/Screens/Play/HUD/HitErrorMeters/BarHitErrorMeter.cs
index 9edbddc0b1..f99c84fc01 100644
--- a/osu.Game/Screens/Play/HUD/HitErrorMeters/BarHitErrorMeter.cs
+++ b/osu.Game/Screens/Play/HUD/HitErrorMeters/BarHitErrorMeter.cs
@@ -1,6 +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 System;
using System.Linq;
using osu.Framework.Allocation;
using osu.Framework.Extensions.Color4Extensions;
@@ -240,7 +241,7 @@ namespace osu.Game.Screens.Play.HUD.HitErrorMeters
, arrow_move_duration, Easing.Out);
}
- private float getRelativeJudgementPosition(double value) => (float)((value / maxHitWindow) + 1) / 2;
+ private float getRelativeJudgementPosition(double value) => Math.Clamp((float)((value / maxHitWindow) + 1) / 2, 0, 1);
private class JudgementLine : CompositeDrawable
{
diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs
index 11ca36e25f..bcadba14af 100644
--- a/osu.Game/Screens/Play/Player.cs
+++ b/osu.Game/Screens/Play/Player.cs
@@ -184,7 +184,7 @@ namespace osu.Game.Screens.Play
foreach (var mod in Mods.Value.OfType())
mod.ApplyToHealthProcessor(HealthProcessor);
- BreakOverlay.IsBreakTime.ValueChanged += _ => updatePauseOnFocusLostState();
+ BreakOverlay.IsBreakTime.BindValueChanged(onBreakTimeChanged, true);
}
private void addUnderlayComponents(Container target)
@@ -229,7 +229,11 @@ namespace osu.Game.Screens.Play
IsPaused = { BindTarget = GameplayClockContainer.IsPaused }
},
PlayerSettingsOverlay = { PlaybackSettings = { UserPlaybackRate = { BindTarget = GameplayClockContainer.UserPlaybackRate } } },
- KeyCounter = { AlwaysVisible = { BindTarget = DrawableRuleset.HasReplayLoaded } },
+ KeyCounter =
+ {
+ AlwaysVisible = { BindTarget = DrawableRuleset.HasReplayLoaded },
+ IsCounting = false
+ },
RequestSeek = GameplayClockContainer.Seek,
Anchor = Anchor.Centre,
Origin = Anchor.Centre
@@ -286,6 +290,12 @@ namespace osu.Game.Screens.Play
HealthProcessor.IsBreakTime.BindTo(BreakOverlay.IsBreakTime);
}
+ private void onBreakTimeChanged(ValueChangedEvent isBreakTime)
+ {
+ updatePauseOnFocusLostState();
+ HUDOverlay.KeyCounter.IsCounting = !isBreakTime.NewValue;
+ }
+
private void updatePauseOnFocusLostState() =>
HUDOverlay.HoldToQuit.PauseOnFocusLost = PauseOnFocusLost
&& !DrawableRuleset.HasReplayLoaded.Value
diff --git a/osu.Game/Screens/Play/SkipOverlay.cs b/osu.Game/Screens/Play/SkipOverlay.cs
index 3daf5b1ff1..ac7e509c2c 100644
--- a/osu.Game/Screens/Play/SkipOverlay.cs
+++ b/osu.Game/Screens/Play/SkipOverlay.cs
@@ -116,7 +116,7 @@ namespace osu.Game.Screens.Play
{
base.Update();
- var progress = Math.Max(0, 1 - (gameplayClock.CurrentTime - displayTime) / (fadeOutBeginTime - displayTime));
+ var progress = fadeOutBeginTime <= displayTime ? 1 : Math.Max(0, 1 - (gameplayClock.CurrentTime - displayTime) / (fadeOutBeginTime - displayTime));
remainingTimeBox.Width = (float)Interpolation.Lerp(remainingTimeBox.Width, progress, Math.Clamp(Time.Elapsed / 40, 0, 1));
diff --git a/osu.Game/Screens/Select/Carousel/DrawableCarouselBeatmap.cs b/osu.Game/Screens/Select/Carousel/DrawableCarouselBeatmap.cs
index d9eeec9f85..50419a5fb9 100644
--- a/osu.Game/Screens/Select/Carousel/DrawableCarouselBeatmap.cs
+++ b/osu.Game/Screens/Select/Carousel/DrawableCarouselBeatmap.cs
@@ -123,7 +123,7 @@ namespace osu.Game.Screens.Select.Carousel
},
starCounter = new StarCounter
{
- CountStars = (float)beatmap.StarDifficulty,
+ Current = (float)beatmap.StarDifficulty,
Scale = new Vector2(0.8f),
}
}
diff --git a/osu.Game/Tests/Visual/OsuTestScene.cs b/osu.Game/Tests/Visual/OsuTestScene.cs
index f102e2ece3..d1d8059cb1 100644
--- a/osu.Game/Tests/Visual/OsuTestScene.cs
+++ b/osu.Game/Tests/Visual/OsuTestScene.cs
@@ -231,15 +231,8 @@ namespace osu.Game.Tests.Visual
{
private readonly IFrameBasedClock referenceClock;
- private readonly ManualClock clock = new ManualClock();
-
private bool running;
- ///
- /// Local offset added to the reference clock to resolve correct time.
- ///
- private double offset;
-
public TrackVirtualManual(IFrameBasedClock referenceClock)
{
this.referenceClock = referenceClock;
@@ -248,10 +241,10 @@ namespace osu.Game.Tests.Visual
public override bool Seek(double seek)
{
- offset = Math.Clamp(seek, 0, Length);
+ accumulated = Math.Clamp(seek, 0, Length);
lastReferenceTime = null;
- return offset == seek;
+ return accumulated == seek;
}
public override void Start()
@@ -270,9 +263,6 @@ namespace osu.Game.Tests.Visual
if (running)
{
running = false;
- // on stopping, the current value should be transferred out of the clock, as we can no longer rely on
- // the referenceClock (which will still be counting time).
- offset = clock.CurrentTime;
lastReferenceTime = null;
}
}
@@ -281,7 +271,9 @@ namespace osu.Game.Tests.Visual
private double? lastReferenceTime;
- public override double CurrentTime => clock.CurrentTime;
+ private double accumulated;
+
+ public override double CurrentTime => Math.Min(accumulated, Length);
protected override void UpdateState()
{
@@ -291,18 +283,12 @@ namespace osu.Game.Tests.Visual
{
double refTime = referenceClock.CurrentTime;
- if (!lastReferenceTime.HasValue)
- {
- // if the clock just started running, the current value should be transferred to the offset
- // (to zero the progression of time).
- offset -= refTime;
- }
+ if (lastReferenceTime.HasValue)
+ accumulated += (refTime - lastReferenceTime.Value) * Rate;
lastReferenceTime = refTime;
}
- clock.CurrentTime = Math.Min((lastReferenceTime ?? 0) + offset, Length);
-
if (CurrentTime >= Length)
{
Stop();
diff --git a/osu.Game/Users/Drawables/UpdateableAvatar.cs b/osu.Game/Users/Drawables/UpdateableAvatar.cs
index 59fbb5f910..171462f3fc 100644
--- a/osu.Game/Users/Drawables/UpdateableAvatar.cs
+++ b/osu.Game/Users/Drawables/UpdateableAvatar.cs
@@ -43,6 +43,8 @@ namespace osu.Game.Users.Drawables
set => base.EdgeEffect = value;
}
+ protected override double LoadDelay => 200;
+
///
/// Whether to show a default guest representation on null user (as opposed to nothing).
///
diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj
index 4d59b709aa..855bda3679 100644
--- a/osu.Game/osu.Game.csproj
+++ b/osu.Game/osu.Game.csproj
@@ -23,7 +23,7 @@
-
+
diff --git a/osu.iOS.props b/osu.iOS.props
index 6897d3e625..e2c4c09047 100644
--- a/osu.iOS.props
+++ b/osu.iOS.props
@@ -71,7 +71,7 @@
-
+
@@ -79,7 +79,7 @@
-
+