From f14690e3b888d48a3ec7b58b53009d676f6a4f44 Mon Sep 17 00:00:00 2001 From: Joehu Date: Sun, 12 May 2019 09:04:11 -0700 Subject: [PATCH 01/12] Swap profile play styles and last visit positions --- .../Profile/Header/BottomHeaderContainer.cs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/osu.Game/Overlays/Profile/Header/BottomHeaderContainer.cs b/osu.Game/Overlays/Profile/Header/BottomHeaderContainer.cs index 52336dcd30..633085960b 100644 --- a/osu.Game/Overlays/Profile/Header/BottomHeaderContainer.cs +++ b/osu.Game/Overlays/Profile/Header/BottomHeaderContainer.cs @@ -87,14 +87,6 @@ private void updateDisplay(User user) addSpacer(topLinkContainer); - if (user.PlayStyles?.Length > 0) - { - topLinkContainer.AddText("Plays with "); - topLinkContainer.AddText(string.Join(", ", user.PlayStyles.Select(style => style.GetDescription())), embolden); - - addSpacer(topLinkContainer); - } - if (user.LastVisit.HasValue) { topLinkContainer.AddText("Last seen "); @@ -103,6 +95,14 @@ private void updateDisplay(User user) addSpacer(topLinkContainer); } + if (user.PlayStyles?.Length > 0) + { + topLinkContainer.AddText("Plays with "); + topLinkContainer.AddText(string.Join(", ", user.PlayStyles.Select(style => style.GetDescription())), embolden); + + addSpacer(topLinkContainer); + } + topLinkContainer.AddText("Contributed "); topLinkContainer.AddLink($@"{user.PostCount:#,##0} forum posts", $"https://osu.ppy.sh/users/{user.Id}/posts", creationParameters: embolden); From c119a6a13587830469b009919e376d8e3c5048d6 Mon Sep 17 00:00:00 2001 From: Joehu Date: Sun, 12 May 2019 09:30:43 -0700 Subject: [PATCH 02/12] Use VolumeMute icon for mute button --- osu.Game/Overlays/Volume/MuteButton.cs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/osu.Game/Overlays/Volume/MuteButton.cs b/osu.Game/Overlays/Volume/MuteButton.cs index 2b1f78243b..c87ca65dba 100644 --- a/osu.Game/Overlays/Volume/MuteButton.cs +++ b/osu.Game/Overlays/Volume/MuteButton.cs @@ -64,16 +64,15 @@ private void load(OsuColour colours) }, icon = new SpriteIcon { - Anchor = Anchor.CentreLeft, - Origin = Anchor.CentreLeft, + Anchor = Anchor.Centre, + Origin = Anchor.Centre, Size = new Vector2(20), } }); Current.ValueChanged += muted => { - icon.Icon = muted.NewValue ? FontAwesome.Solid.VolumeOff : FontAwesome.Solid.VolumeUp; - icon.Margin = new MarginPadding { Left = muted.NewValue ? width / 2 - 15 : width / 2 - 10 }; //Magic numbers to line up both icons because they're different widths + icon.Icon = muted.NewValue ? FontAwesome.Solid.VolumeMute : FontAwesome.Solid.VolumeUp; }; Current.TriggerChange(); } From 3981cf55fa8d47a25a94395e774c0d68b3c2b33f Mon Sep 17 00:00:00 2001 From: HoLLy Date: Sun, 12 May 2019 21:31:16 +0200 Subject: [PATCH 03/12] Fix order of nested hitobjects on 2B Catch maps --- .../Difficulty/CatchDifficultyCalculator.cs | 33 ++++++------------- 1 file changed, 10 insertions(+), 23 deletions(-) diff --git a/osu.Game.Rulesets.Catch/Difficulty/CatchDifficultyCalculator.cs b/osu.Game.Rulesets.Catch/Difficulty/CatchDifficultyCalculator.cs index bd647fd667..f24e67366a 100644 --- a/osu.Game.Rulesets.Catch/Difficulty/CatchDifficultyCalculator.cs +++ b/osu.Game.Rulesets.Catch/Difficulty/CatchDifficultyCalculator.cs @@ -57,33 +57,20 @@ protected override IEnumerable CreateDifficultyHitObjects(I CatchHitObject lastObject = null; - foreach (var hitObject in beatmap.HitObjects.OfType()) + // In 2B beatmaps, it is possible that a normal Fruit is placed in the middle of a JuiceStream. + foreach (var hitObject in beatmap.HitObjects + .SelectMany(obj => obj is JuiceStream stream ? stream.NestedHitObjects : new[] { obj }) + .OfType() + .OrderBy(x => x.StartTime)) { - if (lastObject == null) - { - lastObject = hitObject; + // We want to only consider fruits that contribute to the combo. + if (hitObject is BananaShower || hitObject is TinyDroplet) continue; - } - switch (hitObject) - { - // We want to only consider fruits that contribute to the combo. Droplets are addressed as accuracy and spinners are not relevant for "skill" calculations. - case Fruit fruit: - yield return new CatchDifficultyHitObject(fruit, lastObject, clockRate, halfCatchWidth); + if (lastObject != null) + yield return new CatchDifficultyHitObject(hitObject, lastObject, clockRate, halfCatchWidth); - lastObject = hitObject; - break; - - case JuiceStream _: - foreach (var nested in hitObject.NestedHitObjects.OfType().Where(o => !(o is TinyDroplet))) - { - yield return new CatchDifficultyHitObject(nested, lastObject, clockRate, halfCatchWidth); - - lastObject = nested; - } - - break; - } + lastObject = hitObject; } } From cb664dd183e3c111edd4a10fc2221614ea44c946 Mon Sep 17 00:00:00 2001 From: HoLLy Date: Sun, 12 May 2019 22:08:47 +0200 Subject: [PATCH 04/12] Change OfType<> to Cast<> to be more clear --- osu.Game.Rulesets.Catch/Difficulty/CatchDifficultyCalculator.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Catch/Difficulty/CatchDifficultyCalculator.cs b/osu.Game.Rulesets.Catch/Difficulty/CatchDifficultyCalculator.cs index f24e67366a..d6a1ed632b 100644 --- a/osu.Game.Rulesets.Catch/Difficulty/CatchDifficultyCalculator.cs +++ b/osu.Game.Rulesets.Catch/Difficulty/CatchDifficultyCalculator.cs @@ -60,7 +60,7 @@ protected override IEnumerable CreateDifficultyHitObjects(I // In 2B beatmaps, it is possible that a normal Fruit is placed in the middle of a JuiceStream. foreach (var hitObject in beatmap.HitObjects .SelectMany(obj => obj is JuiceStream stream ? stream.NestedHitObjects : new[] { obj }) - .OfType() + .Cast() .OrderBy(x => x.StartTime)) { // We want to only consider fruits that contribute to the combo. From 8110d6768c14ba88d2aae8d8ebd63e177fde35bf Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 13 May 2019 07:24:34 +0900 Subject: [PATCH 05/12] Inherit OsuButton --- osu.Game/Overlays/Volume/MuteButton.cs | 36 +++++++++++--------------- 1 file changed, 15 insertions(+), 21 deletions(-) diff --git a/osu.Game/Overlays/Volume/MuteButton.cs b/osu.Game/Overlays/Volume/MuteButton.cs index c87ca65dba..a4884dc2c1 100644 --- a/osu.Game/Overlays/Volume/MuteButton.cs +++ b/osu.Game/Overlays/Volume/MuteButton.cs @@ -4,21 +4,20 @@ using System; using osu.Framework.Allocation; using osu.Framework.Bindables; -using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Colour; using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.UserInterface; using osu.Framework.Input.Events; using osu.Game.Graphics; +using osu.Game.Graphics.UserInterface; using osuTK; using osuTK.Graphics; namespace osu.Game.Overlays.Volume { - public class MuteButton : Container, IHasCurrentValue + public class MuteButton : OsuButton, IHasCurrentValue { private readonly Bindable current = new Bindable(); @@ -36,32 +35,32 @@ public Bindable Current } private Color4 hoveredColour, unhoveredColour; + private const float width = 100; public const float HEIGHT = 35; public MuteButton() { - Masking = true; - BorderThickness = 3; - CornerRadius = HEIGHT / 2; + Content.BorderThickness = 3; + Content.CornerRadius = HEIGHT / 2; + Size = new Vector2(width, HEIGHT); + + Action = () => Current.Value = !Current.Value; } [BackgroundDependencyLoader] private void load(OsuColour colours) { hoveredColour = colours.YellowDark; - BorderColour = unhoveredColour = colours.Gray1.Opacity(0.9f); + + Content.BorderColour = unhoveredColour = colours.Gray1; + BackgroundColour = colours.Gray1; SpriteIcon icon; + AddRange(new Drawable[] { - new Box - { - RelativeSizeAxes = Axes.Both, - Colour = colours.Gray1, - Alpha = 0.9f, - }, icon = new SpriteIcon { Anchor = Anchor.Centre, @@ -74,24 +73,19 @@ private void load(OsuColour colours) { icon.Icon = muted.NewValue ? FontAwesome.Solid.VolumeMute : FontAwesome.Solid.VolumeUp; }; + Current.TriggerChange(); } protected override bool OnHover(HoverEvent e) { - this.TransformTo("BorderColour", hoveredColour, 500, Easing.OutQuint); + Content.TransformTo, SRGBColour>("BorderColour", hoveredColour, 500, Easing.OutQuint); return false; } protected override void OnHoverLost(HoverLostEvent e) { - this.TransformTo("BorderColour", unhoveredColour, 500, Easing.OutQuint); - } - - protected override bool OnClick(ClickEvent e) - { - Current.Value = !Current.Value; - return true; + Content.TransformTo, SRGBColour>("BorderColour", unhoveredColour, 500, Easing.OutQuint); } } } From f7806bc20538111cf2fc858d979dcc808a655e3e Mon Sep 17 00:00:00 2001 From: HoLLy Date: Mon, 13 May 2019 01:31:47 +0200 Subject: [PATCH 06/12] Add smoothing to flashlight movement --- osu.Game.Rulesets.Osu/Mods/OsuModFlashlight.cs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Osu/Mods/OsuModFlashlight.cs b/osu.Game.Rulesets.Osu/Mods/OsuModFlashlight.cs index c0332fbf60..c3c1e86c18 100644 --- a/osu.Game.Rulesets.Osu/Mods/OsuModFlashlight.cs +++ b/osu.Game.Rulesets.Osu/Mods/OsuModFlashlight.cs @@ -7,6 +7,7 @@ using osu.Framework.Graphics; using osu.Framework.Input; using osu.Framework.Input.Events; +using osu.Framework.MathUtils; using osu.Game.Rulesets.Mods; using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Rulesets.Osu.Objects; @@ -35,6 +36,9 @@ public void ApplyToDrawableHitObjects(IEnumerable drawables) private class OsuFlashlight : Flashlight, IRequireHighFrequencyMousePosition { + private const double follow_delay = 120; + private double lastPositionUpdate; + public OsuFlashlight() { FlashlightSize = new Vector2(0, getSizeFor(0)); @@ -48,7 +52,16 @@ public void OnSliderTrackingChange(ValueChangedEvent e) protected override bool OnMouseMove(MouseMoveEvent e) { - FlashlightPosition = e.MousePosition; + var position = FlashlightPosition; + var destination = e.MousePosition; + + double frameTime = Clock.CurrentTime - lastPositionUpdate; + double interp = Interpolation.ApplyEasing(Easing.Out, MathHelper.Clamp(frameTime / follow_delay, 0, 1)); + FlashlightPosition = new Vector2( + (float)Interpolation.Lerp(position.X, destination.X, interp), + (float)Interpolation.Lerp(position.Y, destination.Y, interp) + ); + lastPositionUpdate = Clock.CurrentTime; return base.OnMouseMove(e); } From 4b8a9bae346b5c40a98cf767b51632c855dcdcd9 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 13 May 2019 17:17:20 +0900 Subject: [PATCH 07/12] Remove unused test case --- osu.Game.Tests/Visual/TestCaseCharLookup.cs | 16 ---------------- 1 file changed, 16 deletions(-) delete mode 100644 osu.Game.Tests/Visual/TestCaseCharLookup.cs diff --git a/osu.Game.Tests/Visual/TestCaseCharLookup.cs b/osu.Game.Tests/Visual/TestCaseCharLookup.cs deleted file mode 100644 index 0b9413f332..0000000000 --- a/osu.Game.Tests/Visual/TestCaseCharLookup.cs +++ /dev/null @@ -1,16 +0,0 @@ -// 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.Sprites; - -namespace osu.Game.Tests.Visual -{ - public class TestCaseCharLookup : OsuTestCase - { - public TestCaseCharLookup() - { - AddStep("null", () => { }); - AddStep("display acharacter", () => Add(new OsuSpriteText { Text = "振込申請" })); - } - } -} From 1809c996bbede491ce99aea838122e589f770c3e Mon Sep 17 00:00:00 2001 From: HoLLy Date: Mon, 13 May 2019 12:09:19 +0200 Subject: [PATCH 08/12] Use Interpolation.ValueAt instead of manually interpolating FL position. --- osu.Game.Rulesets.Osu/Mods/OsuModFlashlight.cs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Mods/OsuModFlashlight.cs b/osu.Game.Rulesets.Osu/Mods/OsuModFlashlight.cs index c3c1e86c18..084959f775 100644 --- a/osu.Game.Rulesets.Osu/Mods/OsuModFlashlight.cs +++ b/osu.Game.Rulesets.Osu/Mods/OsuModFlashlight.cs @@ -37,7 +37,6 @@ public void ApplyToDrawableHitObjects(IEnumerable drawables) private class OsuFlashlight : Flashlight, IRequireHighFrequencyMousePosition { private const double follow_delay = 120; - private double lastPositionUpdate; public OsuFlashlight() { @@ -55,13 +54,8 @@ protected override bool OnMouseMove(MouseMoveEvent e) var position = FlashlightPosition; var destination = e.MousePosition; - double frameTime = Clock.CurrentTime - lastPositionUpdate; - double interp = Interpolation.ApplyEasing(Easing.Out, MathHelper.Clamp(frameTime / follow_delay, 0, 1)); - FlashlightPosition = new Vector2( - (float)Interpolation.Lerp(position.X, destination.X, interp), - (float)Interpolation.Lerp(position.Y, destination.Y, interp) - ); - lastPositionUpdate = Clock.CurrentTime; + FlashlightPosition = Interpolation.ValueAt(MathHelper.Clamp(Clock.ElapsedFrameTime, 0, follow_delay), position, destination, 0, follow_delay, Easing.Out); + return base.OnMouseMove(e); } From d18504bfe0b82e622f0eb6bcc0d8f013eefb0246 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 13 May 2019 19:23:38 +0900 Subject: [PATCH 09/12] Attempt to fix pause test failures by reducing steps --- osu.Game.Tests/Visual/Gameplay/TestCasePause.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Tests/Visual/Gameplay/TestCasePause.cs b/osu.Game.Tests/Visual/Gameplay/TestCasePause.cs index 53ac990183..1a6d58909d 100644 --- a/osu.Game.Tests/Visual/Gameplay/TestCasePause.cs +++ b/osu.Game.Tests/Visual/Gameplay/TestCasePause.cs @@ -86,8 +86,8 @@ public void TestPauseTooSoon() AddStep("move cursor outside", () => InputManager.MoveMouseTo(Player.ScreenSpaceDrawQuad.TopLeft - new Vector2(10))); pauseAndConfirm(); - resumeAndConfirm(); + resume(); pause(); confirmClockRunning(true); From 647e2c297cb91288df121bf4577a792537ce4012 Mon Sep 17 00:00:00 2001 From: Xie Yi Date: Tue, 14 May 2019 02:45:12 +0800 Subject: [PATCH 10/12] Fix iOS app entry for raw keyboard input --- osu.iOS/Application.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.iOS/Application.cs b/osu.iOS/Application.cs index cb75e5c159..30e0e15ad1 100644 --- a/osu.iOS/Application.cs +++ b/osu.iOS/Application.cs @@ -9,7 +9,7 @@ public class Application { public static void Main(string[] args) { - UIApplication.Main(args, null, "AppDelegate"); + UIApplication.Main(args, "GameUIApplication", "AppDelegate"); } } } From be6da833f822ab60ecbdd9c8f8acb7b54812aa6c Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 14 May 2019 11:11:57 +0900 Subject: [PATCH 11/12] Move constant local (and break line) --- osu.Game.Rulesets.Osu/Mods/OsuModFlashlight.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Mods/OsuModFlashlight.cs b/osu.Game.Rulesets.Osu/Mods/OsuModFlashlight.cs index 084959f775..7fa3dbe07e 100644 --- a/osu.Game.Rulesets.Osu/Mods/OsuModFlashlight.cs +++ b/osu.Game.Rulesets.Osu/Mods/OsuModFlashlight.cs @@ -36,8 +36,6 @@ public void ApplyToDrawableHitObjects(IEnumerable drawables) private class OsuFlashlight : Flashlight, IRequireHighFrequencyMousePosition { - private const double follow_delay = 120; - public OsuFlashlight() { FlashlightSize = new Vector2(0, getSizeFor(0)); @@ -51,10 +49,13 @@ public void OnSliderTrackingChange(ValueChangedEvent e) protected override bool OnMouseMove(MouseMoveEvent e) { + const double follow_delay = 120; + var position = FlashlightPosition; var destination = e.MousePosition; - FlashlightPosition = Interpolation.ValueAt(MathHelper.Clamp(Clock.ElapsedFrameTime, 0, follow_delay), position, destination, 0, follow_delay, Easing.Out); + FlashlightPosition = Interpolation.ValueAt( + MathHelper.Clamp(Clock.ElapsedFrameTime, 0, follow_delay), position, destination, 0, follow_delay, Easing.Out); return base.OnMouseMove(e); } From 4abe987e11b834380f8371ce8d35f181b133c485 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 14 May 2019 13:27:09 +0900 Subject: [PATCH 12/12] Add new colour palette --- osu.Game/Graphics/OsuColour.cs | 42 ++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/osu.Game/Graphics/OsuColour.cs b/osu.Game/Graphics/OsuColour.cs index e1e33b4c57..a73a8bcbc1 100644 --- a/osu.Game/Graphics/OsuColour.cs +++ b/osu.Game/Graphics/OsuColour.cs @@ -68,6 +68,48 @@ public static Color4 FromHex(string hex) public readonly Color4 GreenDark = FromHex(@"668800"); public readonly Color4 GreenDarker = FromHex(@"445500"); + public readonly Color4 Sky = FromHex(@"6bb5ff"); + public readonly Color4 GreySkyLighter = FromHex(@"c6e3f4"); + public readonly Color4 GreySkyLight = FromHex(@"8ab3cc"); + public readonly Color4 GreySky = FromHex(@"405461"); + public readonly Color4 GreySkyDark = FromHex(@"303d47"); + public readonly Color4 GreySkyDarker = FromHex(@"21272c"); + + public readonly Color4 Seafoam = FromHex(@"05ffa2"); + public readonly Color4 GreySeafoamLighter = FromHex(@"9ebab1"); + public readonly Color4 GreySeafoamLight = FromHex(@"4d7365"); + public readonly Color4 GreySeafoam = FromHex(@"33413c"); + public readonly Color4 GreySeafoamDark = FromHex(@"2c3532"); + public readonly Color4 GreySeafoamDarker = FromHex(@"1e2422"); + + public readonly Color4 Cyan = FromHex(@"05f4fd"); + public readonly Color4 GreyCyanLighter = FromHex(@"77b1b3"); + public readonly Color4 GreyCyanLight = FromHex(@"436d6f"); + public readonly Color4 GreyCyan = FromHex(@"293d3e"); + public readonly Color4 GreyCyanDark = FromHex(@"243536"); + public readonly Color4 GreyCyanDarker = FromHex(@"1e2929"); + + public readonly Color4 Lime = FromHex(@"82ff05"); + public readonly Color4 GreyLimeLighter = FromHex(@"deff87"); + public readonly Color4 GreyLimeLight = FromHex(@"657259"); + public readonly Color4 GreyLime = FromHex(@"3f443a"); + public readonly Color4 GreyLimeDark = FromHex(@"32352e"); + public readonly Color4 GreyLimeDarker = FromHex(@"2e302b"); + + public readonly Color4 Violet = FromHex(@"bf04ff"); + public readonly Color4 GreyVioletLighter = FromHex(@"ebb8fe"); + public readonly Color4 GreyVioletLight = FromHex(@"685370"); + public readonly Color4 GreyViolet = FromHex(@"46334d"); + public readonly Color4 GreyVioletDark = FromHex(@"2c2230"); + public readonly Color4 GreyVioletDarker = FromHex(@"201823"); + + public readonly Color4 Carmine = FromHex(@"ff0542"); + public readonly Color4 GreyCarmineLighter = FromHex(@"deaab4"); + public readonly Color4 GreyCarmineLight = FromHex(@"644f53"); + public readonly Color4 GreyCarmine = FromHex(@"342b2d"); + public readonly Color4 GreyCarmineDark = FromHex(@"302a2b"); + public readonly Color4 GreyCarmineDarker = FromHex(@"241d1e"); + public readonly Color4 Gray0 = FromHex(@"000"); public readonly Color4 Gray1 = FromHex(@"111"); public readonly Color4 Gray2 = FromHex(@"222");