From 7ce3b73ecdaf0f1df0d390f51c24a5318a0c4cf0 Mon Sep 17 00:00:00 2001 From: DrabWeb Date: Mon, 22 May 2017 03:11:42 -0300 Subject: [PATCH 01/25] Added UserPanel and UserStatus --- .../Tests/TestCaseUserPanel.cs | 40 ++++ .../osu.Desktop.VisualTests.csproj | 1 + osu.Game/Users/UserPanel.cs | 183 ++++++++++++++++++ osu.Game/Users/UserStatus.cs | 55 ++++++ osu.Game/osu.Game.csproj | 2 + 5 files changed, 281 insertions(+) create mode 100644 osu.Desktop.VisualTests/Tests/TestCaseUserPanel.cs create mode 100644 osu.Game/Users/UserPanel.cs create mode 100644 osu.Game/Users/UserStatus.cs diff --git a/osu.Desktop.VisualTests/Tests/TestCaseUserPanel.cs b/osu.Desktop.VisualTests/Tests/TestCaseUserPanel.cs new file mode 100644 index 0000000000..ab8bb425a7 --- /dev/null +++ b/osu.Desktop.VisualTests/Tests/TestCaseUserPanel.cs @@ -0,0 +1,40 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework.Testing; +using osu.Framework.Graphics; +using osu.Game.Graphics.UserInterface; +using osu.Game.Users; + +namespace osu.Desktop.VisualTests.Tests +{ + internal class TestCaseUserPanel : TestCase + { + public override string Description => @"Panels for displaying a user's status"; + + public override void Reset() + { + base.Reset(); + + UserPanel p; + Add(p = new UserPanel(new User + { + Username = @"flyte", + Id = 3103765, + Country = new Country { FlagName = @"JP" }, + CoverUrl = @"https://assets.ppy.sh/user-profile-covers/3103765/5b012e13611d5761caa7e24fecb3d3a16e1cf48fc2a3032cfd43dd444af83d82.jpeg" + }) + { + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + Width = 300, + }); + + p.Status.Value = new UserStatusOnline(); + + AddStep(@"spectating", () => { p.Status.Value = new UserStatusSpectating(); }); + AddStep(@"multiplaying", () => { p.Status.Value = new UserStatusMultiplayerGame(); }); + AddStep(@"modding", () => { p.Status.Value = new UserStatusModding(); }); + } + } +} diff --git a/osu.Desktop.VisualTests/osu.Desktop.VisualTests.csproj b/osu.Desktop.VisualTests/osu.Desktop.VisualTests.csproj index dbb1750b72..e68935a561 100644 --- a/osu.Desktop.VisualTests/osu.Desktop.VisualTests.csproj +++ b/osu.Desktop.VisualTests/osu.Desktop.VisualTests.csproj @@ -220,6 +220,7 @@ + diff --git a/osu.Game/Users/UserPanel.cs b/osu.Game/Users/UserPanel.cs new file mode 100644 index 0000000000..80d706d985 --- /dev/null +++ b/osu.Game/Users/UserPanel.cs @@ -0,0 +1,183 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using OpenTK; +using OpenTK.Graphics; +using osu.Framework.Allocation; +using osu.Framework.Configuration; +using osu.Framework.Extensions.Color4Extensions; +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.Users +{ + public class UserPanel : Container + { + private const float height = 100; + private const float content_padding = 10; + private const float status_height = 30; + + private readonly User user; + private OsuColour colours; + + private readonly Container cover; + private readonly Box statusBg; + private readonly OsuSpriteText statusMessage; + + public readonly Bindable Status = new Bindable(); + + public UserPanel(User user) + { + this.user = user; + + Height = height; + Masking = true; + CornerRadius = 5; + EdgeEffect = new EdgeEffect + { + Type = EdgeEffectType.Shadow, + Colour = Color4.Black.Opacity(0.25f), + Radius = 4, + }; + + Children = new Drawable[] + { + cover = new Container + { + RelativeSizeAxes = Axes.Both, + }, + new Box + { + RelativeSizeAxes = Axes.Both, + Colour = Color4.Black.Opacity(0.7f), + }, + new Container + { + RelativeSizeAxes = Axes.Both, + Padding = new MarginPadding { Top = content_padding, Bottom = status_height + content_padding, Left = content_padding, Right = content_padding }, + Children = new Drawable[] + { + new UpdateableAvatar + { + Size = new Vector2(height - status_height - content_padding * 2), + User = user, + Masking = true, + CornerRadius = 5, + EdgeEffect = new EdgeEffect + { + Type = EdgeEffectType.Shadow, + Colour = Color4.Black.Opacity(0.25f), + Radius = 4, + }, + }, + new Container + { + RelativeSizeAxes = Axes.Both, + Margin = new MarginPadding { Left = height - status_height - content_padding }, + Children = new Drawable[] + { + new OsuSpriteText + { + Text = user.Username, + TextSize = 18, + Font = @"Exo2.0-SemiBoldItalic", + }, + new FillFlowContainer + { + Anchor = Anchor.BottomLeft, + Origin = Anchor.BottomLeft, + AutoSizeAxes = Axes.X, + Height = 20f, + Direction = FillDirection.Horizontal, + Spacing = new Vector2(5f, 0f), + Children = new Drawable[] + { + new DrawableFlag(user.Country?.FlagName ?? @"__") + { + Width = 30f, + RelativeSizeAxes = Axes.Y, + }, + new Container + { + Width = 40f, + RelativeSizeAxes = Axes.Y, + }, + new CircularContainer + { + Width = 20f, + RelativeSizeAxes = Axes.Y, + }, + }, + }, + }, + }, + }, + }, + new Container + { + Anchor = Anchor.BottomLeft, + Origin = Anchor.BottomLeft, + RelativeSizeAxes = Axes.X, + Height = status_height, + Children = new Drawable[] + { + statusBg = new Box + { + RelativeSizeAxes = Axes.Both, + Alpha = 0.5f, + }, + new FillFlowContainer + { + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + AutoSizeAxes = Axes.Both, + Spacing = new Vector2(5f, 0f), + Children = new[] + { + new TextAwesome + { + Anchor = Anchor.CentreLeft, + Origin = Anchor.CentreLeft, + Icon = FontAwesome.fa_circle_o, + Shadow = true, + TextSize = 14, + }, + statusMessage = new OsuSpriteText + { + Anchor = Anchor.CentreLeft, + Origin = Anchor.CentreLeft, + Font = @"Exo2.0-Semibold", + }, + }, + }, + }, + }, + }; + + Status.ValueChanged += displayStatus; + } + + [BackgroundDependencyLoader] + private void load(OsuColour colours, TextureStore textures) + { + this.colours = colours; + + cover.Add(new AsyncLoadWrapper(new Sprite + { + Texture = textures.Get(user.CoverUrl), + FillMode = FillMode.Fill, + OnLoadComplete = d => d.FadeInFromZero(200), + }) { RelativeSizeAxes = Axes.Both }); + } + + private void displayStatus(UserStatus status) + { + statusBg.FadeColour(status.Colour(colours), 200); + statusMessage.Text = status.Message; + } + } +} diff --git a/osu.Game/Users/UserStatus.cs b/osu.Game/Users/UserStatus.cs new file mode 100644 index 0000000000..b6ae53c9cd --- /dev/null +++ b/osu.Game/Users/UserStatus.cs @@ -0,0 +1,55 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using OpenTK.Graphics; +using osu.Game.Graphics; + +namespace osu.Game.Users +{ + public abstract class UserStatus + { + public abstract string Message { get; } + public abstract Color4 Colour(OsuColour colours); + } + + public abstract class UserStatusAvailable : UserStatus + { + public override Color4 Colour(OsuColour colours) => colours.BlueDarker; + } + + public abstract class UserStatusBusy : UserStatus + { + public override Color4 Colour(OsuColour colours) => colours.YellowDark; + } + + public class UserStatusOnline : UserStatusAvailable + { + public override string Message => @"Online"; + } + + public class UserStatusSpectating : UserStatusAvailable + { + public override string Message => @"Spectating a game"; + } + + public class UserStatusInLobby : UserStatusAvailable + { + public override string Message => @"in Multiplayer Lobby"; + } + + public class UserStatusSoloGame : UserStatusBusy + { + public override string Message => @"Solo Game"; + } + + public class UserStatusMultiplayerGame: UserStatusBusy + { + public override string Message => @"Multiplaying"; + } + + public class UserStatusModding : UserStatus + { + public override string Message => @"Modding a map"; + public override Color4 Colour(OsuColour colours) => colours.PurpleDark; + } +} diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 1631311ef6..ba72b0422d 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -425,6 +425,8 @@ + + From a73cf929946cb30ec7154014b66fe091595c6bdc Mon Sep 17 00:00:00 2001 From: DrabWeb Date: Mon, 22 May 2017 03:27:08 -0300 Subject: [PATCH 02/25] Add second UserPanel to visual test, center cover sprite --- .../Tests/TestCaseUserPanel.cs | 42 +++++++++++++------ osu.Game/Users/UserPanel.cs | 3 ++ 2 files changed, 32 insertions(+), 13 deletions(-) diff --git a/osu.Desktop.VisualTests/Tests/TestCaseUserPanel.cs b/osu.Desktop.VisualTests/Tests/TestCaseUserPanel.cs index ab8bb425a7..efee8e0e24 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseUserPanel.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseUserPanel.cs @@ -5,6 +5,8 @@ using osu.Framework.Testing; using osu.Framework.Graphics; using osu.Game.Graphics.UserInterface; using osu.Game.Users; +using osu.Framework.Graphics.Containers; +using OpenTK; namespace osu.Desktop.VisualTests.Tests { @@ -16,25 +18,39 @@ namespace osu.Desktop.VisualTests.Tests { base.Reset(); - UserPanel p; - Add(p = new UserPanel(new User - { - Username = @"flyte", - Id = 3103765, - Country = new Country { FlagName = @"JP" }, - CoverUrl = @"https://assets.ppy.sh/user-profile-covers/3103765/5b012e13611d5761caa7e24fecb3d3a16e1cf48fc2a3032cfd43dd444af83d82.jpeg" - }) + UserPanel flyte; + UserPanel peppy; + Add(new FillFlowContainer { Anchor = Anchor.Centre, Origin = Anchor.Centre, - Width = 300, + AutoSizeAxes = Axes.Both, + Spacing = new Vector2(10f), + Children = new[] + { + flyte = new UserPanel(new User + { + Username = @"flyte", + Id = 3103765, + Country = new Country { FlagName = @"JP" }, + CoverUrl = @"https://assets.ppy.sh/user-profile-covers/3103765/5b012e13611d5761caa7e24fecb3d3a16e1cf48fc2a3032cfd43dd444af83d82.jpeg" + }), + peppy = new UserPanel(new User + { + Username = @"peppy", + Id = 2, + Country = new Country { FlagName = @"AU" }, + CoverUrl = @"https://assets.ppy.sh/user-profile-covers/2/08cad88747c235a64fca5f1b770e100f120827ded1ffe3b66bfcd19c940afa65.jpeg" + }), + }, }); - p.Status.Value = new UserStatusOnline(); + flyte.Status.Value = new UserStatusOnline(); + peppy.Status.Value = new UserStatusSoloGame(); - AddStep(@"spectating", () => { p.Status.Value = new UserStatusSpectating(); }); - AddStep(@"multiplaying", () => { p.Status.Value = new UserStatusMultiplayerGame(); }); - AddStep(@"modding", () => { p.Status.Value = new UserStatusModding(); }); + AddStep(@"spectating", () => { flyte.Status.Value = new UserStatusSpectating(); }); + AddStep(@"multiplaying", () => { flyte.Status.Value = new UserStatusMultiplayerGame(); }); + AddStep(@"modding", () => { flyte.Status.Value = new UserStatusModding(); }); } } } diff --git a/osu.Game/Users/UserPanel.cs b/osu.Game/Users/UserPanel.cs index 80d706d985..4de309fb62 100644 --- a/osu.Game/Users/UserPanel.cs +++ b/osu.Game/Users/UserPanel.cs @@ -34,6 +34,7 @@ namespace osu.Game.Users { this.user = user; + Width = 300; Height = height; Masking = true; CornerRadius = 5; @@ -168,6 +169,8 @@ namespace osu.Game.Users cover.Add(new AsyncLoadWrapper(new Sprite { + Anchor = Anchor.Centre, + Origin = Anchor.Centre, Texture = textures.Get(user.CoverUrl), FillMode = FillMode.Fill, OnLoadComplete = d => d.FadeInFromZero(200), From aa40f882586b9a9137e9b0a1aa0c1cffaa9aad8f Mon Sep 17 00:00:00 2001 From: DrabWeb Date: Mon, 22 May 2017 03:32:02 -0300 Subject: [PATCH 03/25] Add UserStatusOffline --- osu.Desktop.VisualTests/Tests/TestCaseUserPanel.cs | 1 + osu.Game/Users/UserStatus.cs | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/osu.Desktop.VisualTests/Tests/TestCaseUserPanel.cs b/osu.Desktop.VisualTests/Tests/TestCaseUserPanel.cs index efee8e0e24..d783d42f1f 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseUserPanel.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseUserPanel.cs @@ -51,6 +51,7 @@ namespace osu.Desktop.VisualTests.Tests AddStep(@"spectating", () => { flyte.Status.Value = new UserStatusSpectating(); }); AddStep(@"multiplaying", () => { flyte.Status.Value = new UserStatusMultiplayerGame(); }); AddStep(@"modding", () => { flyte.Status.Value = new UserStatusModding(); }); + AddStep(@"offline", () => { flyte.Status.Value = new UserStatusOffline(); }); } } } diff --git a/osu.Game/Users/UserStatus.cs b/osu.Game/Users/UserStatus.cs index b6ae53c9cd..97ee47423e 100644 --- a/osu.Game/Users/UserStatus.cs +++ b/osu.Game/Users/UserStatus.cs @@ -22,6 +22,12 @@ namespace osu.Game.Users public override Color4 Colour(OsuColour colours) => colours.YellowDark; } + public class UserStatusOffline : UserStatus + { + public override string Message => @"Offline"; + public override Color4 Colour(OsuColour colours) => colours.Gray7; + } + public class UserStatusOnline : UserStatusAvailable { public override string Message => @"Online"; From 8a364c606824d7376286f38429dfe5545db3454e Mon Sep 17 00:00:00 2001 From: DrabWeb Date: Mon, 22 May 2017 03:37:36 -0300 Subject: [PATCH 04/25] CI fixes --- osu.Desktop.VisualTests/Tests/TestCaseUserPanel.cs | 8 ++++---- osu.Game/Users/UserStatus.cs | 12 ++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/osu.Desktop.VisualTests/Tests/TestCaseUserPanel.cs b/osu.Desktop.VisualTests/Tests/TestCaseUserPanel.cs index d783d42f1f..f7f0f8b24a 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseUserPanel.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseUserPanel.cs @@ -10,10 +10,10 @@ using OpenTK; namespace osu.Desktop.VisualTests.Tests { - internal class TestCaseUserPanel : TestCase - { - public override string Description => @"Panels for displaying a user's status"; - + internal class TestCaseUserPanel : TestCase + { + public override string Description => @"Panels for displaying a user's status"; + public override void Reset() { base.Reset(); diff --git a/osu.Game/Users/UserStatus.cs b/osu.Game/Users/UserStatus.cs index 97ee47423e..0ff8333c24 100644 --- a/osu.Game/Users/UserStatus.cs +++ b/osu.Game/Users/UserStatus.cs @@ -24,7 +24,7 @@ namespace osu.Game.Users public class UserStatusOffline : UserStatus { - public override string Message => @"Offline"; + public override string Message => @"Offline"; public override Color4 Colour(OsuColour colours) => colours.Gray7; } @@ -35,27 +35,27 @@ namespace osu.Game.Users public class UserStatusSpectating : UserStatusAvailable { - public override string Message => @"Spectating a game"; + public override string Message => @"Spectating a game"; } public class UserStatusInLobby : UserStatusAvailable { - public override string Message => @"in Multiplayer Lobby"; + public override string Message => @"in Multiplayer Lobby"; } public class UserStatusSoloGame : UserStatusBusy { - public override string Message => @"Solo Game"; + public override string Message => @"Solo Game"; } public class UserStatusMultiplayerGame: UserStatusBusy { - public override string Message => @"Multiplaying"; + public override string Message => @"Multiplaying"; } public class UserStatusModding : UserStatus { - public override string Message => @"Modding a map"; + public override string Message => @"Modding a map"; public override Color4 Colour(OsuColour colours) => colours.PurpleDark; } } From 62ca76bc4188f5241fa222b7e4ac971c449b9c3f Mon Sep 17 00:00:00 2001 From: DrabWeb Date: Mon, 22 May 2017 03:42:32 -0300 Subject: [PATCH 05/25] Unused using --- osu.Desktop.VisualTests/Tests/TestCaseUserPanel.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/osu.Desktop.VisualTests/Tests/TestCaseUserPanel.cs b/osu.Desktop.VisualTests/Tests/TestCaseUserPanel.cs index f7f0f8b24a..7c2745ee0f 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseUserPanel.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseUserPanel.cs @@ -3,7 +3,6 @@ using osu.Framework.Testing; using osu.Framework.Graphics; -using osu.Game.Graphics.UserInterface; using osu.Game.Users; using osu.Framework.Graphics.Containers; using OpenTK; From 6cef3021c7f0a3e5fcc8694adc40e08b149c6b86 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Mon, 22 May 2017 19:50:01 +0900 Subject: [PATCH 06/25] Adjust sizing to better fit glows within the playfield. --- .../Objects/Drawables/Pieces/CirclePiece.cs | 2 +- osu.Game.Rulesets.Taiko/Objects/TaikoHitObject.cs | 4 ++-- osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/CirclePiece.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/CirclePiece.cs index 9f91488fe3..6d3a9e79f6 100644 --- a/osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/CirclePiece.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/CirclePiece.cs @@ -145,7 +145,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces { Type = EdgeEffectType.Glow, Colour = AccentColour, - Radius = KiaiMode ? 50 : 8 + Radius = KiaiMode ? 40 : 8 }; } } diff --git a/osu.Game.Rulesets.Taiko/Objects/TaikoHitObject.cs b/osu.Game.Rulesets.Taiko/Objects/TaikoHitObject.cs index 6a6353fde2..816c5042ce 100644 --- a/osu.Game.Rulesets.Taiko/Objects/TaikoHitObject.cs +++ b/osu.Game.Rulesets.Taiko/Objects/TaikoHitObject.cs @@ -13,12 +13,12 @@ namespace osu.Game.Rulesets.Taiko.Objects /// /// Diameter of a circle relative to the size of the . /// - public const float PLAYFIELD_RELATIVE_DIAMETER = 0.5f; + public const float PLAYFIELD_RELATIVE_DIAMETER = 0.45f; /// /// Scale multiplier for a strong circle. /// - public const float STRONG_CIRCLE_DIAMETER_SCALE = 1.5f; + public const float STRONG_CIRCLE_DIAMETER_SCALE = 1.4f; /// /// Default circle diameter. diff --git a/osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs b/osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs index 2278158506..d1d895fc1d 100644 --- a/osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs +++ b/osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs @@ -24,7 +24,7 @@ namespace osu.Game.Rulesets.Taiko.UI /// /// The default play field height. /// - public const float DEFAULT_PLAYFIELD_HEIGHT = 168f; + public const float DEFAULT_PLAYFIELD_HEIGHT = 178f; /// /// The offset from which the center of the hit target lies at. @@ -221,7 +221,7 @@ namespace osu.Game.Rulesets.Taiko.UI /// /// This is a very special type of container. It serves a similar purpose to , however unlike , /// this will only adjust the scale relative to the height of its parent and will maintain the original width relative to its parent. - /// + /// /// /// By adjusting the scale relative to the height of its parent, the aspect ratio of this container's children is maintained, however this is undesirable /// in the case where the hit object container should not have its width adjusted by scale. To counteract this, another container is nested inside this From 35814e47e46bdd0df6f98d43b91a72e58a96eb91 Mon Sep 17 00:00:00 2001 From: DrabWeb Date: Mon, 22 May 2017 12:37:19 -0300 Subject: [PATCH 07/25] Colour -> GetAppropriateColour, adjust status change transition --- osu.Game/Users/UserPanel.cs | 4 ++-- osu.Game/Users/UserStatus.cs | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/osu.Game/Users/UserPanel.cs b/osu.Game/Users/UserPanel.cs index 4de309fb62..745fd166f8 100644 --- a/osu.Game/Users/UserPanel.cs +++ b/osu.Game/Users/UserPanel.cs @@ -78,7 +78,7 @@ namespace osu.Game.Users new Container { RelativeSizeAxes = Axes.Both, - Margin = new MarginPadding { Left = height - status_height - content_padding }, + Padding = new MarginPadding { Left = height - status_height - content_padding }, Children = new Drawable[] { new OsuSpriteText @@ -179,7 +179,7 @@ namespace osu.Game.Users private void displayStatus(UserStatus status) { - statusBg.FadeColour(status.Colour(colours), 200); + statusBg.FadeColour(status.GetAppropriateColour(colours), 500, EasingTypes.OutQuint); statusMessage.Text = status.Message; } } diff --git a/osu.Game/Users/UserStatus.cs b/osu.Game/Users/UserStatus.cs index 0ff8333c24..dcb5ccbd8f 100644 --- a/osu.Game/Users/UserStatus.cs +++ b/osu.Game/Users/UserStatus.cs @@ -9,23 +9,23 @@ namespace osu.Game.Users public abstract class UserStatus { public abstract string Message { get; } - public abstract Color4 Colour(OsuColour colours); + public abstract Color4 GetAppropriateColour(OsuColour colours); } public abstract class UserStatusAvailable : UserStatus { - public override Color4 Colour(OsuColour colours) => colours.BlueDarker; + public override Color4 GetAppropriateColour(OsuColour colours) => colours.BlueDarker; } public abstract class UserStatusBusy : UserStatus { - public override Color4 Colour(OsuColour colours) => colours.YellowDark; + public override Color4 GetAppropriateColour(OsuColour colours) => colours.YellowDark; } - public class UserStatusOffline : UserStatus - { + public class UserStatusOffline : UserStatus + { public override string Message => @"Offline"; - public override Color4 Colour(OsuColour colours) => colours.Gray7; + public override Color4 GetAppropriateColour(OsuColour colours) => colours.Gray7; } public class UserStatusOnline : UserStatusAvailable @@ -56,6 +56,6 @@ namespace osu.Game.Users public class UserStatusModding : UserStatus { public override string Message => @"Modding a map"; - public override Color4 Colour(OsuColour colours) => colours.PurpleDark; + public override Color4 GetAppropriateColour(OsuColour colours) => colours.PurpleDark; } } From 261ea4c1767c85931e5f7ebef1062fe746fd7f31 Mon Sep 17 00:00:00 2001 From: DrabWeb Date: Mon, 22 May 2017 12:41:59 -0300 Subject: [PATCH 08/25] CoverBackgroundSprite for actually async cover loading --- osu.Game/Users/UserPanel.cs | 36 ++++++++++++++++++++++++++---------- 1 file changed, 26 insertions(+), 10 deletions(-) diff --git a/osu.Game/Users/UserPanel.cs b/osu.Game/Users/UserPanel.cs index 745fd166f8..81e28e2735 100644 --- a/osu.Game/Users/UserPanel.cs +++ b/osu.Game/Users/UserPanel.cs @@ -159,22 +159,21 @@ namespace osu.Game.Users }, }; + cover.Add(new AsyncLoadWrapper(new CoverBackgroundSprite(user) + { + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + FillMode = FillMode.Fill, + OnLoadComplete = d => d.FadeInFromZero(200), + }) { RelativeSizeAxes = Axes.Both }); + Status.ValueChanged += displayStatus; } [BackgroundDependencyLoader] - private void load(OsuColour colours, TextureStore textures) + private void load(OsuColour colours) { this.colours = colours; - - cover.Add(new AsyncLoadWrapper(new Sprite - { - Anchor = Anchor.Centre, - Origin = Anchor.Centre, - Texture = textures.Get(user.CoverUrl), - FillMode = FillMode.Fill, - OnLoadComplete = d => d.FadeInFromZero(200), - }) { RelativeSizeAxes = Axes.Both }); } private void displayStatus(UserStatus status) @@ -182,5 +181,22 @@ namespace osu.Game.Users statusBg.FadeColour(status.GetAppropriateColour(colours), 500, EasingTypes.OutQuint); statusMessage.Text = status.Message; } + + private class CoverBackgroundSprite : Sprite + { + private readonly User user; + + public CoverBackgroundSprite(User user) + { + this.user = user; + } + + [BackgroundDependencyLoader] + private void load(TextureStore textures) + { + if (!string.IsNullOrEmpty(user.CoverUrl)) + Texture = textures.Get(user.CoverUrl); + } + } } } From 8b505a9e8b2458beefbeab5efe017026df6c7e87 Mon Sep 17 00:00:00 2001 From: DrabWeb Date: Mon, 22 May 2017 13:06:52 -0300 Subject: [PATCH 09/25] Remove tab character --- osu.Game/Users/UserPanel.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/osu.Game/Users/UserPanel.cs b/osu.Game/Users/UserPanel.cs index 81e28e2735..6eff471989 100644 --- a/osu.Game/Users/UserPanel.cs +++ b/osu.Game/Users/UserPanel.cs @@ -159,9 +159,9 @@ namespace osu.Game.Users }, }; - cover.Add(new AsyncLoadWrapper(new CoverBackgroundSprite(user) - { - Anchor = Anchor.Centre, + cover.Add(new AsyncLoadWrapper(new CoverBackgroundSprite(user) + { + Anchor = Anchor.Centre, Origin = Anchor.Centre, FillMode = FillMode.Fill, OnLoadComplete = d => d.FadeInFromZero(200), From 4681beab5d2c64ccf1b958378dceb3eb0c4736f0 Mon Sep 17 00:00:00 2001 From: DrabWeb Date: Mon, 22 May 2017 13:22:14 -0300 Subject: [PATCH 10/25] CI fixes --- osu.Game/Users/UserPanel.cs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/osu.Game/Users/UserPanel.cs b/osu.Game/Users/UserPanel.cs index 6eff471989..3502443d49 100644 --- a/osu.Game/Users/UserPanel.cs +++ b/osu.Game/Users/UserPanel.cs @@ -21,10 +21,8 @@ namespace osu.Game.Users private const float content_padding = 10; private const float status_height = 30; - private readonly User user; private OsuColour colours; - private readonly Container cover; private readonly Box statusBg; private readonly OsuSpriteText statusMessage; @@ -32,8 +30,6 @@ namespace osu.Game.Users public UserPanel(User user) { - this.user = user; - Width = 300; Height = height; Masking = true; @@ -45,6 +41,7 @@ namespace osu.Game.Users Radius = 4, }; + Container cover; Children = new Drawable[] { cover = new Container From 61348ff08d7269f1e4752a79d00f9e81e34ab7a0 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Tue, 23 May 2017 16:42:17 +0900 Subject: [PATCH 11/25] Restructure playfield so that various elements are masked. --- osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs | 49 +++++++++++--------- 1 file changed, 27 insertions(+), 22 deletions(-) diff --git a/osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs b/osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs index d1d895fc1d..e6677ff0cd 100644 --- a/osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs +++ b/osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs @@ -44,10 +44,12 @@ namespace osu.Game.Rulesets.Taiko.UI private readonly Container hitObjectContainer; private readonly Container topLevelHitContainer; - private readonly Container leftBackgroundContainer; - private readonly Container rightBackgroundContainer; - private readonly Box leftBackground; - private readonly Box rightBackground; + + private readonly Container overlayBackgroundContainer; + private readonly Container backgroundContainer; + + private readonly Box overlayBackground; + private readonly Box background; public TaikoPlayfield() { @@ -59,7 +61,7 @@ namespace osu.Game.Rulesets.Taiko.UI Height = DEFAULT_PLAYFIELD_HEIGHT, Children = new[] { - rightBackgroundContainer = new Container + backgroundContainer = new Container { Name = "Transparent playfield background", RelativeSizeAxes = Axes.Both, @@ -73,7 +75,7 @@ namespace osu.Game.Rulesets.Taiko.UI }, Children = new Drawable[] { - rightBackground = new Box + background = new Box { RelativeSizeAxes = Axes.Both, Alpha = 0.6f @@ -82,16 +84,17 @@ namespace osu.Game.Rulesets.Taiko.UI }, new Container { - Name = "Transparent playfield elements", + Name = "Right area", RelativeSizeAxes = Axes.Both, - Padding = new MarginPadding { Left = left_area_size }, + Margin = new MarginPadding { Left = left_area_size }, Children = new Drawable[] { new Container { - Name = "Hit target container", - X = hit_target_offset, + Name = "Masked elements", RelativeSizeAxes = Axes.Both, + Padding = new MarginPadding { Left = hit_target_offset }, + Masking = true, Children = new Drawable[] { hitExplosionContainer = new Container @@ -114,23 +117,25 @@ namespace osu.Game.Rulesets.Taiko.UI { RelativeSizeAxes = Axes.Both, }, - judgementContainer = new Container - { - RelativeSizeAxes = Axes.Y, - BlendingMode = BlendingMode.Additive - }, - }, + } + }, + judgementContainer = new Container + { + Name = "Judgements", + RelativeSizeAxes = Axes.Y, + Margin = new MarginPadding { Left = hit_target_offset }, + BlendingMode = BlendingMode.Additive }, } }, - leftBackgroundContainer = new Container + overlayBackgroundContainer = new Container { Name = "Left overlay", Size = new Vector2(left_area_size, DEFAULT_PLAYFIELD_HEIGHT), BorderThickness = 1, Children = new Drawable[] { - leftBackground = new Box + overlayBackground = new Box { RelativeSizeAxes = Axes.Both, }, @@ -164,11 +169,11 @@ namespace osu.Game.Rulesets.Taiko.UI [BackgroundDependencyLoader] private void load(OsuColour colours) { - leftBackgroundContainer.BorderColour = colours.Gray0; - leftBackground.Colour = colours.Gray1; + overlayBackgroundContainer.BorderColour = colours.Gray0; + overlayBackground.Colour = colours.Gray1; - rightBackgroundContainer.BorderColour = colours.Gray1; - rightBackground.Colour = colours.Gray0; + backgroundContainer.BorderColour = colours.Gray1; + background.Colour = colours.Gray0; } public override void Add(DrawableHitObject h) From 25a48d832f2ec71e52b3df4a894d3026714a31ae Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Tue, 23 May 2017 17:36:35 +0900 Subject: [PATCH 12/25] Make kiai time hit object pulse on bar line beats. --- osu-framework | 2 +- .../Objects/Drawables/Pieces/CirclePiece.cs | 15 +++++++++++++++ .../Objects/Drawables/Pieces/TaikoPiece.cs | 8 +++----- 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/osu-framework b/osu-framework index 773d60eb6b..71177efb0c 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 773d60eb6b811f395e32a22dc66bb4d2e63a6dbc +Subproject commit 71177efb0c416361e4b346a92dd61ab20bf333d0 diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/CirclePiece.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/CirclePiece.cs index 6d3a9e79f6..f182eb6993 100644 --- a/osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/CirclePiece.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/CirclePiece.cs @@ -7,6 +7,8 @@ using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Sprites; using osu.Game.Graphics.Backgrounds; using OpenTK.Graphics; +using osu.Game.Beatmaps.ControlPoints; +using osu.Framework.Audio.Track; namespace osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces { @@ -148,5 +150,18 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces Radius = KiaiMode ? 40 : 8 }; } + + protected override void OnNewBeat(int beatIndex, TimingControlPoint timingPoint, EffectControlPoint effectPoint, TrackAmplitudes amplitudes) + { + if (!effectPoint.KiaiMode) + return; + + if (beatIndex % (int)timingPoint.TimeSignature != 0) + return; + + background.FadeEdgeEffectTo(Color4.White); + using (BeginDelayedSequence(200)) + background.FadeEdgeEffectTo(AccentColour, 500, EasingTypes.OutQuint); + } } } \ No newline at end of file diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/TaikoPiece.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/TaikoPiece.cs index 83b2e59e44..d54bfe9e17 100644 --- a/osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/TaikoPiece.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/TaikoPiece.cs @@ -5,10 +5,11 @@ using osu.Framework.Graphics.Containers; using osu.Game.Graphics; using OpenTK; using OpenTK.Graphics; +using osu.Game.Graphics.Containers; namespace osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces { - public class TaikoPiece : Container, IHasAccentColour + public class TaikoPiece : BeatSyncedContainer, IHasAccentColour { private Color4 accentColour; /// @@ -17,10 +18,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces public virtual Color4 AccentColour { get { return accentColour; } - set - { - accentColour = value; - } + set { accentColour = value; } } private bool kiaiMode; From ae94e6ea85007142089bbb61efb1c91612009650 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Tue, 23 May 2017 17:57:34 +0900 Subject: [PATCH 13/25] Redesign hit explosions. --- osu.Game.Rulesets.Taiko/UI/HitExplosion.cs | 35 +++++++++----------- osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs | 20 +++++------ 2 files changed, 25 insertions(+), 30 deletions(-) diff --git a/osu.Game.Rulesets.Taiko/UI/HitExplosion.cs b/osu.Game.Rulesets.Taiko/UI/HitExplosion.cs index 2ebdeaa5b0..57cc42643b 100644 --- a/osu.Game.Rulesets.Taiko/UI/HitExplosion.cs +++ b/osu.Game.Rulesets.Taiko/UI/HitExplosion.cs @@ -16,23 +16,25 @@ namespace osu.Game.Rulesets.Taiko.UI /// /// A circle explodes from the hit target to indicate a hitobject has been hit. /// - internal class HitExplosion : CircularContainer + internal class HitExplosion : Container { - /// - /// The judgement this hit explosion visualises. - /// public readonly TaikoJudgement Judgement; private readonly Box innerFill; - public HitExplosion(TaikoJudgement judgement) + private bool isRim; + + public HitExplosion(TaikoJudgement judgement, bool isRim) { + this.isRim = isRim; + Judgement = judgement; - Size = new Vector2(TaikoHitObject.DEFAULT_CIRCLE_DIAMETER); + RelativeSizeAxes = Axes.Y; + Width = TaikoPlayfield.HIT_TARGET_OFFSET + TaikoHitObject.DEFAULT_CIRCLE_DIAMETER; - Anchor = Anchor.Centre; - Origin = Anchor.Centre; + Anchor = Anchor.CentreLeft; + Origin = Anchor.CentreLeft; RelativePositionAxes = Axes.Both; @@ -54,22 +56,17 @@ namespace osu.Game.Rulesets.Taiko.UI [BackgroundDependencyLoader] private void load(OsuColour colours) { - switch (Judgement.TaikoResult) - { - case TaikoHitResult.Good: - innerFill.Colour = colours.Green; - break; - case TaikoHitResult.Great: - innerFill.Colour = colours.Blue; - break; - } + if (isRim) + innerFill.Colour = colours.BlueDarker; + else + innerFill.Colour = colours.PinkDarker; } protected override void LoadComplete() { base.LoadComplete(); - ScaleTo(5f, 1000, EasingTypes.OutQuint); + ScaleTo(new Vector2(2f, 1), 1000, EasingTypes.OutQuint); FadeOut(500); Expire(); @@ -80,7 +77,7 @@ namespace osu.Game.Rulesets.Taiko.UI /// public void VisualiseSecondHit() { - ResizeTo(Size * TaikoHitObject.STRONG_CIRCLE_DIAMETER_SCALE, 50); + ResizeTo(new Vector2(TaikoPlayfield.HIT_TARGET_OFFSET + TaikoHitObject.DEFAULT_STRONG_CIRCLE_DIAMETER, 1), 50); } } } diff --git a/osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs b/osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs index e6677ff0cd..d6b2b26b7c 100644 --- a/osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs +++ b/osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs @@ -29,7 +29,7 @@ namespace osu.Game.Rulesets.Taiko.UI /// /// The offset from which the center of the hit target lies at. /// - private const float hit_target_offset = TaikoHitObject.DEFAULT_STRONG_CIRCLE_DIAMETER / 2f + 40; + public const float HIT_TARGET_OFFSET = TaikoHitObject.DEFAULT_STRONG_CIRCLE_DIAMETER / 2f + 40; /// /// The size of the left area of the playfield. This area contains the input drum. @@ -89,21 +89,19 @@ namespace osu.Game.Rulesets.Taiko.UI Margin = new MarginPadding { Left = left_area_size }, Children = new Drawable[] { + hitExplosionContainer = new Container + { + RelativeSizeAxes = Axes.Y, + BlendingMode = BlendingMode.Additive + }, new Container { Name = "Masked elements", RelativeSizeAxes = Axes.Both, - Padding = new MarginPadding { Left = hit_target_offset }, + Padding = new MarginPadding { Left = HIT_TARGET_OFFSET }, Masking = true, Children = new Drawable[] { - hitExplosionContainer = new Container - { - Anchor = Anchor.CentreLeft, - Origin = Anchor.Centre, - RelativeSizeAxes = Axes.Y, - BlendingMode = BlendingMode.Additive - }, barLineContainer = new Container { RelativeSizeAxes = Axes.Both, @@ -123,7 +121,7 @@ namespace osu.Game.Rulesets.Taiko.UI { Name = "Judgements", RelativeSizeAxes = Axes.Y, - Margin = new MarginPadding { Left = hit_target_offset }, + Margin = new MarginPadding { Left = HIT_TARGET_OFFSET }, BlendingMode = BlendingMode.Additive }, } @@ -217,7 +215,7 @@ namespace osu.Game.Rulesets.Taiko.UI topLevelHitContainer.Add(judgedObject.CreateProxy()); } - hitExplosionContainer.Add(new HitExplosion(judgedObject.Judgement)); + hitExplosionContainer.Add(new HitExplosion(judgedObject.Judgement, judgedObject is DrawableRimHit)); } else hitExplosionContainer.Children.FirstOrDefault(e => e.Judgement == judgedObject.Judgement)?.VisualiseSecondHit(); From 92552970757214337f02acb659c457676cf5d6ed Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Tue, 23 May 2017 17:58:12 +0900 Subject: [PATCH 14/25] Cleanup. --- .../Objects/Drawables/Pieces/TaikoPiece.cs | 1 - osu.Game.Rulesets.Taiko/UI/HitExplosion.cs | 7 ++----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/TaikoPiece.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/TaikoPiece.cs index d54bfe9e17..5e7e9e6350 100644 --- a/osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/TaikoPiece.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/TaikoPiece.cs @@ -1,7 +1,6 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using osu.Framework.Graphics.Containers; using osu.Game.Graphics; using OpenTK; using OpenTK.Graphics; diff --git a/osu.Game.Rulesets.Taiko/UI/HitExplosion.cs b/osu.Game.Rulesets.Taiko/UI/HitExplosion.cs index 57cc42643b..868f1cd9c0 100644 --- a/osu.Game.Rulesets.Taiko/UI/HitExplosion.cs +++ b/osu.Game.Rulesets.Taiko/UI/HitExplosion.cs @@ -22,7 +22,7 @@ namespace osu.Game.Rulesets.Taiko.UI private readonly Box innerFill; - private bool isRim; + private readonly bool isRim; public HitExplosion(TaikoJudgement judgement, bool isRim) { @@ -56,10 +56,7 @@ namespace osu.Game.Rulesets.Taiko.UI [BackgroundDependencyLoader] private void load(OsuColour colours) { - if (isRim) - innerFill.Colour = colours.BlueDarker; - else - innerFill.Colour = colours.PinkDarker; + innerFill.Colour = isRim ? colours.BlueDarker : colours.PinkDarker; } protected override void LoadComplete() From 247d8e9b21edb038de7a7869c349d5797d34f92e Mon Sep 17 00:00:00 2001 From: DrabWeb Date: Wed, 24 May 2017 00:23:48 -0300 Subject: [PATCH 15/25] Replace "Connected as _" in login form with a UserPanel --- osu.Desktop.VisualTests/Tests/TestCaseUserPanel.cs | 4 ++-- .../Overlays/Settings/Sections/General/LoginSettings.cs | 7 +++++-- osu.Game/Users/UserPanel.cs | 1 - 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/osu.Desktop.VisualTests/Tests/TestCaseUserPanel.cs b/osu.Desktop.VisualTests/Tests/TestCaseUserPanel.cs index 7c2745ee0f..254c5bc243 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseUserPanel.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseUserPanel.cs @@ -33,14 +33,14 @@ namespace osu.Desktop.VisualTests.Tests Id = 3103765, Country = new Country { FlagName = @"JP" }, CoverUrl = @"https://assets.ppy.sh/user-profile-covers/3103765/5b012e13611d5761caa7e24fecb3d3a16e1cf48fc2a3032cfd43dd444af83d82.jpeg" - }), + }) { Width = 300 }, peppy = new UserPanel(new User { Username = @"peppy", Id = 2, Country = new Country { FlagName = @"AU" }, CoverUrl = @"https://assets.ppy.sh/user-profile-covers/2/08cad88747c235a64fca5f1b770e100f120827ded1ffe3b66bfcd19c940afa65.jpeg" - }), + }) { Width = 300 }, }, }); diff --git a/osu.Game/Overlays/Settings/Sections/General/LoginSettings.cs b/osu.Game/Overlays/Settings/Sections/General/LoginSettings.cs index 86a47d8a95..73521a31c3 100644 --- a/osu.Game/Overlays/Settings/Sections/General/LoginSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/General/LoginSettings.cs @@ -12,6 +12,7 @@ using osu.Game.Graphics.UserInterface; using osu.Game.Online.API; using OpenTK; using osu.Framework.Input; +using osu.Game.Users; namespace osu.Game.Overlays.Settings.Sections.General { @@ -71,11 +72,12 @@ namespace osu.Game.Overlays.Settings.Sections.General }; break; case APIState.Online: + UserPanel p; Children = new Drawable[] { - new OsuSpriteText + p = new UserPanel(api.LocalUser.Value) { - Text = $"Connected as {api.Username}!", + RelativeSizeAxes = Axes.X, }, new OsuButton { @@ -84,6 +86,7 @@ namespace osu.Game.Overlays.Settings.Sections.General Action = api.Logout } }; + p.Status.Value = new UserStatusOnline(); break; } diff --git a/osu.Game/Users/UserPanel.cs b/osu.Game/Users/UserPanel.cs index 3502443d49..f32158e00b 100644 --- a/osu.Game/Users/UserPanel.cs +++ b/osu.Game/Users/UserPanel.cs @@ -30,7 +30,6 @@ namespace osu.Game.Users public UserPanel(User user) { - Width = 300; Height = height; Masking = true; CornerRadius = 5; From 2be1b00a766d063305575522f345183eb64dd81f Mon Sep 17 00:00:00 2001 From: DrabWeb Date: Wed, 24 May 2017 00:45:56 -0300 Subject: [PATCH 16/25] Hide status bar when Status is null --- .../Tests/TestCaseUserPanel.cs | 1 + .../Settings/Sections/General/LoginSettings.cs | 4 +--- osu.Game/Users/UserPanel.cs | 17 ++++++++++++----- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/osu.Desktop.VisualTests/Tests/TestCaseUserPanel.cs b/osu.Desktop.VisualTests/Tests/TestCaseUserPanel.cs index 254c5bc243..513bf24e0d 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseUserPanel.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseUserPanel.cs @@ -51,6 +51,7 @@ namespace osu.Desktop.VisualTests.Tests AddStep(@"multiplaying", () => { flyte.Status.Value = new UserStatusMultiplayerGame(); }); AddStep(@"modding", () => { flyte.Status.Value = new UserStatusModding(); }); AddStep(@"offline", () => { flyte.Status.Value = new UserStatusOffline(); }); + AddStep(@"null status", () => { flyte.Status.Value = null; }); } } } diff --git a/osu.Game/Overlays/Settings/Sections/General/LoginSettings.cs b/osu.Game/Overlays/Settings/Sections/General/LoginSettings.cs index 73521a31c3..d94388ed87 100644 --- a/osu.Game/Overlays/Settings/Sections/General/LoginSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/General/LoginSettings.cs @@ -72,10 +72,9 @@ namespace osu.Game.Overlays.Settings.Sections.General }; break; case APIState.Online: - UserPanel p; Children = new Drawable[] { - p = new UserPanel(api.LocalUser.Value) + new UserPanel(api.LocalUser.Value) { RelativeSizeAxes = Axes.X, }, @@ -86,7 +85,6 @@ namespace osu.Game.Overlays.Settings.Sections.General Action = api.Logout } }; - p.Status.Value = new UserStatusOnline(); break; } diff --git a/osu.Game/Users/UserPanel.cs b/osu.Game/Users/UserPanel.cs index f32158e00b..df37b339c3 100644 --- a/osu.Game/Users/UserPanel.cs +++ b/osu.Game/Users/UserPanel.cs @@ -23,6 +23,7 @@ namespace osu.Game.Users private OsuColour colours; + private readonly Container statusBar; private readonly Box statusBg; private readonly OsuSpriteText statusMessage; @@ -30,7 +31,7 @@ namespace osu.Game.Users public UserPanel(User user) { - Height = height; + Height = height - status_height; Masking = true; CornerRadius = 5; EdgeEffect = new EdgeEffect @@ -54,8 +55,9 @@ namespace osu.Game.Users }, new Container { - RelativeSizeAxes = Axes.Both, - Padding = new MarginPadding { Top = content_padding, Bottom = status_height + content_padding, Left = content_padding, Right = content_padding }, + RelativeSizeAxes = Axes.X, + AutoSizeAxes = Axes.Y, + Padding = new MarginPadding { Top = content_padding, Left = content_padding, Right = content_padding }, Children = new Drawable[] { new UpdateableAvatar @@ -114,12 +116,12 @@ namespace osu.Game.Users }, }, }, - new Container + statusBar = new Container { Anchor = Anchor.BottomLeft, Origin = Anchor.BottomLeft, RelativeSizeAxes = Axes.X, - Height = status_height, + Alpha = 0f, Children = new Drawable[] { statusBg = new Box @@ -174,6 +176,11 @@ namespace osu.Game.Users private void displayStatus(UserStatus status) { + statusBar.ResizeHeightTo(status == null ? 0f : status_height, 500, EasingTypes.OutQuint); + statusBar.FadeTo(status == null ? 0f : 1f, 500, EasingTypes.OutQuint); + ResizeHeightTo(status == null ? height - status_height : height, 500, EasingTypes.OutQuint); + if (status == null) return; + statusBg.FadeColour(status.GetAppropriateColour(colours), 500, EasingTypes.OutQuint); statusMessage.Text = status.Message; } From 4224143136f4136ada12c60e05f4e2d499051b9c Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Wed, 24 May 2017 14:53:28 +0900 Subject: [PATCH 17/25] Add faint kiai explosion on the hit marker. --- .../UI/KiaiHitExplosion.cs | 68 +++++++++++++++++++ osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs | 16 ++++- .../osu.Game.Rulesets.Taiko.csproj | 1 + 3 files changed, 84 insertions(+), 1 deletion(-) create mode 100644 osu.Game.Rulesets.Taiko/UI/KiaiHitExplosion.cs diff --git a/osu.Game.Rulesets.Taiko/UI/KiaiHitExplosion.cs b/osu.Game.Rulesets.Taiko/UI/KiaiHitExplosion.cs new file mode 100644 index 0000000000..62e4165ce4 --- /dev/null +++ b/osu.Game.Rulesets.Taiko/UI/KiaiHitExplosion.cs @@ -0,0 +1,68 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using OpenTK; +using osu.Framework.Allocation; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Sprites; +using osu.Game.Graphics; +using osu.Game.Rulesets.Taiko.Judgements; +using osu.Game.Rulesets.Taiko.Objects; + +namespace osu.Game.Rulesets.Taiko.UI +{ + public class KiaiHitExplosion : CircularContainer + { + public readonly TaikoJudgement Judgement; + + private readonly bool isRim; + + public KiaiHitExplosion(TaikoJudgement judgement, bool isRim) + { + this.isRim = isRim; + + Judgement = judgement; + + Anchor = Anchor.Centre; + Origin = Anchor.Centre; + + RelativeSizeAxes = Axes.Y; + Size = new Vector2(TaikoHitObject.DEFAULT_CIRCLE_DIAMETER, 1); + + Masking = true; + Alpha = 0.15f; + + Children = new[] + { + new Box + { + RelativeSizeAxes = Axes.Both, + Alpha = 0, + AlwaysPresent = true + } + }; + } + + [BackgroundDependencyLoader] + private void load(OsuColour colours) + { + EdgeEffect = new EdgeEffect + { + Type = EdgeEffectType.Glow, + Colour = isRim ? colours.BlueDarker : colours.PinkDarker, + Radius = 60, + }; + } + + protected override void LoadComplete() + { + base.LoadComplete(); + + ScaleTo(new Vector2(1, 3f), 500, EasingTypes.OutQuint); + FadeOut(250); + + Expire(); + } + } +} \ No newline at end of file diff --git a/osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs b/osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs index d6b2b26b7c..8f2d89dd05 100644 --- a/osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs +++ b/osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs @@ -39,6 +39,7 @@ namespace osu.Game.Rulesets.Taiko.UI protected override Container Content => hitObjectContainer; private readonly Container hitExplosionContainer; + private readonly Container kiaiExplosionContainer; private readonly Container barLineContainer; private readonly Container judgementContainer; @@ -117,6 +118,13 @@ namespace osu.Game.Rulesets.Taiko.UI }, } }, + kiaiExplosionContainer = new Container + { + Name = "Kiai hit explosions", + RelativeSizeAxes = Axes.Y, + Margin = new MarginPadding { Left = HIT_TARGET_OFFSET }, + BlendingMode = BlendingMode.Additive + }, judgementContainer = new Container { Name = "Judgements", @@ -207,6 +215,8 @@ namespace osu.Game.Rulesets.Taiko.UI if (!wasHit) return; + bool isRim = judgedObject.HitObject is RimHit; + if (!secondHit) { if (judgedObject.X >= -0.05f && !(judgedObject is DrawableSwell)) @@ -215,7 +225,11 @@ namespace osu.Game.Rulesets.Taiko.UI topLevelHitContainer.Add(judgedObject.CreateProxy()); } - hitExplosionContainer.Add(new HitExplosion(judgedObject.Judgement, judgedObject is DrawableRimHit)); + hitExplosionContainer.Add(new HitExplosion(judgedObject.Judgement, isRim)); + + if (judgedObject.HitObject.Kiai) + kiaiExplosionContainer.Add(new KiaiHitExplosion(judgedObject.Judgement, isRim)); + } else hitExplosionContainer.Children.FirstOrDefault(e => e.Judgement == judgedObject.Judgement)?.VisualiseSecondHit(); diff --git a/osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj b/osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj index 983dc72d9e..8d6fcb503c 100644 --- a/osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj +++ b/osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj @@ -87,6 +87,7 @@ + From 445b469e47fe81acc9a99b2d2f2d375eec4ed1d3 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Wed, 24 May 2017 15:22:46 +0900 Subject: [PATCH 18/25] Use ligher hue instead of white. --- .../Objects/Drawables/DrawableCentreHit.cs | 1 + .../Objects/Drawables/DrawableCentreHitStrong.cs | 1 + osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableRimHit.cs | 1 + .../Objects/Drawables/DrawableRimHitStrong.cs | 1 + .../Objects/Drawables/Pieces/CirclePiece.cs | 2 +- .../Objects/Drawables/Pieces/TaikoPiece.cs | 5 +++++ 6 files changed, 10 insertions(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableCentreHit.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableCentreHit.cs index 8bb78669ca..b2760e6914 100644 --- a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableCentreHit.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableCentreHit.cs @@ -22,6 +22,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables private void load(OsuColour colours) { MainPiece.AccentColour = colours.PinkDarker; + MainPiece.KiaiFlashColour = colours.PinkLight; } } } diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableCentreHitStrong.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableCentreHitStrong.cs index 434fb9377f..da2e4a5733 100644 --- a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableCentreHitStrong.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableCentreHitStrong.cs @@ -22,6 +22,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables private void load(OsuColour colours) { MainPiece.AccentColour = colours.PinkDarker; + MainPiece.KiaiFlashColour = colours.PinkLight; } } } diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableRimHit.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableRimHit.cs index 20e8d36105..cd5ceaa965 100644 --- a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableRimHit.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableRimHit.cs @@ -22,6 +22,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables private void load(OsuColour colours) { MainPiece.AccentColour = colours.BlueDarker; + MainPiece.KiaiFlashColour = colours.BlueLight; } } } diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableRimHitStrong.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableRimHitStrong.cs index 4b1bb62bab..c9387f6e72 100644 --- a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableRimHitStrong.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableRimHitStrong.cs @@ -22,6 +22,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables private void load(OsuColour colours) { MainPiece.AccentColour = colours.BlueDarker; + MainPiece.KiaiFlashColour = colours.BlueLight; } } } diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/CirclePiece.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/CirclePiece.cs index f182eb6993..6118e00e25 100644 --- a/osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/CirclePiece.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/CirclePiece.cs @@ -159,7 +159,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces if (beatIndex % (int)timingPoint.TimeSignature != 0) return; - background.FadeEdgeEffectTo(Color4.White); + background.FadeEdgeEffectTo(KiaiFlashColour); using (BeginDelayedSequence(200)) background.FadeEdgeEffectTo(AccentColour, 500, EasingTypes.OutQuint); } diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/TaikoPiece.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/TaikoPiece.cs index 5e7e9e6350..9ef9224942 100644 --- a/osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/TaikoPiece.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/TaikoPiece.cs @@ -20,6 +20,11 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces set { accentColour = value; } } + /// + /// The colour to be flashed on a kiai beat. + /// + public Color4 KiaiFlashColour; + private bool kiaiMode; /// /// Whether Kiai mode effects are enabled for this circle piece. From c29f4b2ee86385c51b0bae0acbfca382dc9931c1 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Wed, 24 May 2017 15:40:34 +0900 Subject: [PATCH 19/25] Fix weird glow + add small pre-beat transition. --- .../Objects/Drawables/Pieces/CirclePiece.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/CirclePiece.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/CirclePiece.cs index 6118e00e25..992c10fa99 100644 --- a/osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/CirclePiece.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/CirclePiece.cs @@ -24,6 +24,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces public const float SYMBOL_SIZE = TaikoHitObject.DEFAULT_CIRCLE_DIAMETER * 0.45f; public const float SYMBOL_BORDER = 8; public const float SYMBOL_INNER_SIZE = SYMBOL_SIZE - 2 * SYMBOL_BORDER; + private const double pre_beat_transition_time = 50; /// /// The colour of the inner circle and outer glows. @@ -65,6 +66,8 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces public CirclePiece(bool isStrong = false) { + EarlyActivationMilliseconds = pre_beat_transition_time; + AddInternal(new Drawable[] { background = new CircularContainer @@ -159,9 +162,11 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces if (beatIndex % (int)timingPoint.TimeSignature != 0) return; - background.FadeEdgeEffectTo(KiaiFlashColour); - using (BeginDelayedSequence(200)) - background.FadeEdgeEffectTo(AccentColour, 500, EasingTypes.OutQuint); + double duration = timingPoint.BeatLength * (int)timingPoint.TimeSignature; + + background.FadeEdgeEffectTo(KiaiFlashColour, pre_beat_transition_time, EasingTypes.OutQuint); + using (background.BeginDelayedSequence(pre_beat_transition_time)) + background.FadeEdgeEffectTo(AccentColour, duration, EasingTypes.OutQuint); } } } \ No newline at end of file From 56fe97a147197bd4cba09a6f462829481fbfef25 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Wed, 24 May 2017 15:48:27 +0900 Subject: [PATCH 20/25] Make kiai hit explosions slightly more prominent. --- osu.Game.Rulesets.Taiko/UI/KiaiHitExplosion.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Taiko/UI/KiaiHitExplosion.cs b/osu.Game.Rulesets.Taiko/UI/KiaiHitExplosion.cs index 62e4165ce4..e0da3ed3db 100644 --- a/osu.Game.Rulesets.Taiko/UI/KiaiHitExplosion.cs +++ b/osu.Game.Rulesets.Taiko/UI/KiaiHitExplosion.cs @@ -31,7 +31,7 @@ namespace osu.Game.Rulesets.Taiko.UI Size = new Vector2(TaikoHitObject.DEFAULT_CIRCLE_DIAMETER, 1); Masking = true; - Alpha = 0.15f; + Alpha = 0.25f; Children = new[] { From 7afa1766e17f50507bb93041ff9ca54c5f22c62e Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Wed, 24 May 2017 15:48:47 +0900 Subject: [PATCH 21/25] Make HitExplosion circular again, keep it masked to the stage. --- osu.Game.Rulesets.Taiko/UI/HitExplosion.cs | 13 ++++++------- osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs | 10 +++++----- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/osu.Game.Rulesets.Taiko/UI/HitExplosion.cs b/osu.Game.Rulesets.Taiko/UI/HitExplosion.cs index 868f1cd9c0..c0c329c870 100644 --- a/osu.Game.Rulesets.Taiko/UI/HitExplosion.cs +++ b/osu.Game.Rulesets.Taiko/UI/HitExplosion.cs @@ -16,7 +16,7 @@ namespace osu.Game.Rulesets.Taiko.UI /// /// A circle explodes from the hit target to indicate a hitobject has been hit. /// - internal class HitExplosion : Container + internal class HitExplosion : CircularContainer { public readonly TaikoJudgement Judgement; @@ -30,11 +30,10 @@ namespace osu.Game.Rulesets.Taiko.UI Judgement = judgement; - RelativeSizeAxes = Axes.Y; - Width = TaikoPlayfield.HIT_TARGET_OFFSET + TaikoHitObject.DEFAULT_CIRCLE_DIAMETER; + Anchor = Anchor.Centre; + Origin = Anchor.Centre; - Anchor = Anchor.CentreLeft; - Origin = Anchor.CentreLeft; + Size = new Vector2(TaikoPlayfield.HIT_TARGET_OFFSET + TaikoHitObject.DEFAULT_CIRCLE_DIAMETER); RelativePositionAxes = Axes.Both; @@ -63,7 +62,7 @@ namespace osu.Game.Rulesets.Taiko.UI { base.LoadComplete(); - ScaleTo(new Vector2(2f, 1), 1000, EasingTypes.OutQuint); + ScaleTo(3f, 1000, EasingTypes.OutQuint); FadeOut(500); Expire(); @@ -74,7 +73,7 @@ namespace osu.Game.Rulesets.Taiko.UI /// public void VisualiseSecondHit() { - ResizeTo(new Vector2(TaikoPlayfield.HIT_TARGET_OFFSET + TaikoHitObject.DEFAULT_STRONG_CIRCLE_DIAMETER, 1), 50); + ResizeTo(new Vector2(TaikoPlayfield.HIT_TARGET_OFFSET + TaikoHitObject.DEFAULT_STRONG_CIRCLE_DIAMETER), 50); } } } diff --git a/osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs b/osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs index 8f2d89dd05..c7bd4a6704 100644 --- a/osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs +++ b/osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs @@ -90,11 +90,6 @@ namespace osu.Game.Rulesets.Taiko.UI Margin = new MarginPadding { Left = left_area_size }, Children = new Drawable[] { - hitExplosionContainer = new Container - { - RelativeSizeAxes = Axes.Y, - BlendingMode = BlendingMode.Additive - }, new Container { Name = "Masked elements", @@ -103,6 +98,11 @@ namespace osu.Game.Rulesets.Taiko.UI Masking = true, Children = new Drawable[] { + hitExplosionContainer = new Container + { + RelativeSizeAxes = Axes.Y, + BlendingMode = BlendingMode.Additive, + }, barLineContainer = new Container { RelativeSizeAxes = Axes.Both, From 7c6540b008b568b5647cf330194342c20f3ee7c1 Mon Sep 17 00:00:00 2001 From: DrabWeb Date: Wed, 24 May 2017 03:49:06 -0300 Subject: [PATCH 22/25] Cleanup status transition code --- osu.Game/Users/UserPanel.cs | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/osu.Game/Users/UserPanel.cs b/osu.Game/Users/UserPanel.cs index df37b339c3..7a6fdda825 100644 --- a/osu.Game/Users/UserPanel.cs +++ b/osu.Game/Users/UserPanel.cs @@ -176,13 +176,23 @@ namespace osu.Game.Users private void displayStatus(UserStatus status) { - statusBar.ResizeHeightTo(status == null ? 0f : status_height, 500, EasingTypes.OutQuint); - statusBar.FadeTo(status == null ? 0f : 1f, 500, EasingTypes.OutQuint); - ResizeHeightTo(status == null ? height - status_height : height, 500, EasingTypes.OutQuint); - if (status == null) return; + float transition_duration = 500; - statusBg.FadeColour(status.GetAppropriateColour(colours), 500, EasingTypes.OutQuint); - statusMessage.Text = status.Message; + if (status == null) + { + statusBar.ResizeHeightTo(0f, transition_duration, EasingTypes.OutQuint); + statusBar.FadeOut(transition_duration, EasingTypes.OutQuint); + ResizeHeightTo(height - status_height, transition_duration, EasingTypes.OutQuint); + } + else + { + statusBar.ResizeHeightTo(status_height, transition_duration, EasingTypes.OutQuint); + statusBar.FadeIn(transition_duration, EasingTypes.OutQuint); + ResizeHeightTo(height, transition_duration, EasingTypes.OutQuint); + + statusBg.FadeColour(status.GetAppropriateColour(colours), 500, EasingTypes.OutQuint); + statusMessage.Text = status.Message; + } } private class CoverBackgroundSprite : Sprite From a7914dc1e837f4e47c7f07766067e64e24321845 Mon Sep 17 00:00:00 2001 From: DrabWeb Date: Wed, 24 May 2017 04:00:39 -0300 Subject: [PATCH 23/25] Convert transition_duration to const --- osu.Game/Users/UserPanel.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Users/UserPanel.cs b/osu.Game/Users/UserPanel.cs index 7a6fdda825..f7714fd819 100644 --- a/osu.Game/Users/UserPanel.cs +++ b/osu.Game/Users/UserPanel.cs @@ -176,7 +176,7 @@ namespace osu.Game.Users private void displayStatus(UserStatus status) { - float transition_duration = 500; + const float transition_duration = 500; if (status == null) { From ca6a9b1b71432f3ed68f9cdf3185687b69d6fd28 Mon Sep 17 00:00:00 2001 From: DrabWeb Date: Wed, 24 May 2017 04:21:34 -0300 Subject: [PATCH 24/25] Inline cover --- osu.Game/Users/UserPanel.cs | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/osu.Game/Users/UserPanel.cs b/osu.Game/Users/UserPanel.cs index f7714fd819..c78a69dac8 100644 --- a/osu.Game/Users/UserPanel.cs +++ b/osu.Game/Users/UserPanel.cs @@ -41,13 +41,15 @@ namespace osu.Game.Users Radius = 4, }; - Container cover; Children = new Drawable[] { - cover = new Container + new AsyncLoadWrapper(new CoverBackgroundSprite(user) { - RelativeSizeAxes = Axes.Both, - }, + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + FillMode = FillMode.Fill, + OnLoadComplete = d => d.FadeInFromZero(200), + }) { RelativeSizeAxes = Axes.Both }, new Box { RelativeSizeAxes = Axes.Both, @@ -157,14 +159,6 @@ namespace osu.Game.Users }, }; - cover.Add(new AsyncLoadWrapper(new CoverBackgroundSprite(user) - { - Anchor = Anchor.Centre, - Origin = Anchor.Centre, - FillMode = FillMode.Fill, - OnLoadComplete = d => d.FadeInFromZero(200), - }) { RelativeSizeAxes = Axes.Both }); - Status.ValueChanged += displayStatus; } From 391134b1d3f328640fcb89f3b5d2228b4fc4750b Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 24 May 2017 17:15:51 +0900 Subject: [PATCH 25/25] Adjust glow a bit --- .../Objects/Drawables/DrawableCentreHit.cs | 1 - .../Objects/Drawables/DrawableCentreHitStrong.cs | 1 - .../Objects/Drawables/DrawableRimHit.cs | 1 - .../Objects/Drawables/DrawableRimHitStrong.cs | 1 - .../Objects/Drawables/Pieces/CirclePiece.cs | 14 ++++++++------ .../Objects/Drawables/Pieces/TaikoPiece.cs | 5 ----- 6 files changed, 8 insertions(+), 15 deletions(-) diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableCentreHit.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableCentreHit.cs index b2760e6914..8bb78669ca 100644 --- a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableCentreHit.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableCentreHit.cs @@ -22,7 +22,6 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables private void load(OsuColour colours) { MainPiece.AccentColour = colours.PinkDarker; - MainPiece.KiaiFlashColour = colours.PinkLight; } } } diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableCentreHitStrong.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableCentreHitStrong.cs index da2e4a5733..434fb9377f 100644 --- a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableCentreHitStrong.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableCentreHitStrong.cs @@ -22,7 +22,6 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables private void load(OsuColour colours) { MainPiece.AccentColour = colours.PinkDarker; - MainPiece.KiaiFlashColour = colours.PinkLight; } } } diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableRimHit.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableRimHit.cs index cd5ceaa965..20e8d36105 100644 --- a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableRimHit.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableRimHit.cs @@ -22,7 +22,6 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables private void load(OsuColour colours) { MainPiece.AccentColour = colours.BlueDarker; - MainPiece.KiaiFlashColour = colours.BlueLight; } } } diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableRimHitStrong.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableRimHitStrong.cs index c9387f6e72..4b1bb62bab 100644 --- a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableRimHitStrong.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableRimHitStrong.cs @@ -22,7 +22,6 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables private void load(OsuColour colours) { MainPiece.AccentColour = colours.BlueDarker; - MainPiece.KiaiFlashColour = colours.BlueLight; } } } diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/CirclePiece.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/CirclePiece.cs index 992c10fa99..3ea05b6558 100644 --- a/osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/CirclePiece.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/CirclePiece.cs @@ -24,7 +24,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces public const float SYMBOL_SIZE = TaikoHitObject.DEFAULT_CIRCLE_DIAMETER * 0.45f; public const float SYMBOL_BORDER = 8; public const float SYMBOL_INNER_SIZE = SYMBOL_SIZE - 2 * SYMBOL_BORDER; - private const double pre_beat_transition_time = 50; + private const double pre_beat_transition_time = 80; /// /// The colour of the inner circle and outer glows. @@ -144,13 +144,15 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces Content.Width = 1 / Content.Scale.X; } + private const float edge_alpha_kiai = 0.5f; + private void resetEdgeEffects() { background.EdgeEffect = new EdgeEffect { Type = EdgeEffectType.Glow, - Colour = AccentColour, - Radius = KiaiMode ? 40 : 8 + Colour = AccentColour.Opacity(KiaiMode ? edge_alpha_kiai : 1f), + Radius = KiaiMode ? 32 : 8 }; } @@ -162,11 +164,11 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces if (beatIndex % (int)timingPoint.TimeSignature != 0) return; - double duration = timingPoint.BeatLength * (int)timingPoint.TimeSignature; + double duration = timingPoint.BeatLength * 2; - background.FadeEdgeEffectTo(KiaiFlashColour, pre_beat_transition_time, EasingTypes.OutQuint); + background.FadeEdgeEffectTo(1, pre_beat_transition_time, EasingTypes.OutQuint); using (background.BeginDelayedSequence(pre_beat_transition_time)) - background.FadeEdgeEffectTo(AccentColour, duration, EasingTypes.OutQuint); + background.FadeEdgeEffectTo(edge_alpha_kiai, duration, EasingTypes.OutQuint); } } } \ No newline at end of file diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/TaikoPiece.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/TaikoPiece.cs index 9ef9224942..5e7e9e6350 100644 --- a/osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/TaikoPiece.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/TaikoPiece.cs @@ -20,11 +20,6 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces set { accentColour = value; } } - /// - /// The colour to be flashed on a kiai beat. - /// - public Color4 KiaiFlashColour; - private bool kiaiMode; /// /// Whether Kiai mode effects are enabled for this circle piece.