From 667eaf95d8bab97c1e7a4fc3c4a67a8ee8b02670 Mon Sep 17 00:00:00 2001 From: Dragicafit Date: Fri, 7 Dec 2018 22:16:09 +0100 Subject: [PATCH 01/99] Make comboColours skinnable --- osu.Game/Skinning/LocalSkinOverrideContainer.cs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/osu.Game/Skinning/LocalSkinOverrideContainer.cs b/osu.Game/Skinning/LocalSkinOverrideContainer.cs index 25d9442e6f..2ab22af289 100644 --- a/osu.Game/Skinning/LocalSkinOverrideContainer.cs +++ b/osu.Game/Skinning/LocalSkinOverrideContainer.cs @@ -45,20 +45,20 @@ namespace osu.Game.Skinning public TValue? GetValue(Func query) where TConfiguration : SkinConfiguration where TValue : struct { - TValue? val = null; + TValue? val; if ((source as Skin)?.Configuration is TConfiguration conf) - val = query?.Invoke(conf); - - return val ?? fallbackSource?.GetValue(query); + if (beatmapSkins && (val = query?.Invoke(conf)) != null) + return val; + return fallbackSource?.GetValue(query); } public TValue GetValue(Func query) where TConfiguration : SkinConfiguration where TValue : class { - TValue val = null; + TValue val; if ((source as Skin)?.Configuration is TConfiguration conf) - val = query?.Invoke(conf); - - return val ?? fallbackSource?.GetValue(query); + if (beatmapSkins && (val = query?.Invoke(conf)) != null) + return val; + return fallbackSource?.GetValue(query); } private readonly ISkinSource source; From 0816eaacb8443b68c10359ebe5aa616d152ae7ef Mon Sep 17 00:00:00 2001 From: Dragicafit Date: Fri, 7 Dec 2018 22:22:40 +0100 Subject: [PATCH 02/99] Make CursorExpand skinnable --- .../UI/Cursor/GameplayCursor.cs | 42 ++++++++++++------- osu.Game/Skinning/LegacySkinDecoder.cs | 3 ++ osu.Game/Skinning/SkinConfiguration.cs | 2 + 3 files changed, 31 insertions(+), 16 deletions(-) diff --git a/osu.Game.Rulesets.Osu/UI/Cursor/GameplayCursor.cs b/osu.Game.Rulesets.Osu/UI/Cursor/GameplayCursor.cs index 4aa30777e9..dede10f6b3 100644 --- a/osu.Game.Rulesets.Osu/UI/Cursor/GameplayCursor.cs +++ b/osu.Game.Rulesets.Osu/UI/Cursor/GameplayCursor.cs @@ -23,6 +23,8 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor protected override Container Content => fadeContainer; + private bool cursorExpand; + private readonly Container fadeContainer; public GameplayCursor() @@ -37,6 +39,12 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor }; } + [BackgroundDependencyLoader] + private void load(ISkinSource source) + { + cursorExpand = source.GetValue(s => s.CursorExpand).Equals("1"); + } + private int downCount; private const float pressed_scale = 1.2f; @@ -46,28 +54,30 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor public bool OnPressed(OsuAction action) { - switch (action) - { - case OsuAction.LeftButton: - case OsuAction.RightButton: - downCount++; - ActiveCursor.ScaleTo(released_scale).ScaleTo(targetScale, 100, Easing.OutQuad); - break; - } + if (cursorExpand) + switch (action) + { + case OsuAction.LeftButton: + case OsuAction.RightButton: + downCount++; + ActiveCursor.ScaleTo(released_scale).ScaleTo(targetScale, 100, Easing.OutQuad); + break; + } return false; } public bool OnReleased(OsuAction action) { - switch (action) - { - case OsuAction.LeftButton: - case OsuAction.RightButton: - if (--downCount == 0) - ActiveCursor.ScaleTo(targetScale, 200, Easing.OutQuad); - break; - } + if (cursorExpand) + switch (action) + { + case OsuAction.LeftButton: + case OsuAction.RightButton: + if (--downCount == 0) + ActiveCursor.ScaleTo(targetScale, 200, Easing.OutQuad); + break; + } return false; } diff --git a/osu.Game/Skinning/LegacySkinDecoder.cs b/osu.Game/Skinning/LegacySkinDecoder.cs index 67a031fb50..bb5ae1e310 100644 --- a/osu.Game/Skinning/LegacySkinDecoder.cs +++ b/osu.Game/Skinning/LegacySkinDecoder.cs @@ -30,6 +30,9 @@ namespace osu.Game.Skinning case @"Author": skin.SkinInfo.Creator = pair.Value; break; + case @"CursorExpand": + skin.CursorExpand = pair.Value; + break; } break; diff --git a/osu.Game/Skinning/SkinConfiguration.cs b/osu.Game/Skinning/SkinConfiguration.cs index 7d354d108c..7759bc2487 100644 --- a/osu.Game/Skinning/SkinConfiguration.cs +++ b/osu.Game/Skinning/SkinConfiguration.cs @@ -16,5 +16,7 @@ namespace osu.Game.Skinning public Dictionary CustomColours { get; set; } = new Dictionary(); public string HitCircleFont { get; set; } = "default"; + + public string CursorExpand { get; set; } = "1"; } } From ec3c87dbea9e94e7f8ca0d56fdaddd387e1c9026 Mon Sep 17 00:00:00 2001 From: Dragicafit Date: Fri, 7 Dec 2018 22:24:24 +0100 Subject: [PATCH 03/99] Make Slider's CustumColors skinnable --- .../Objects/Drawables/DrawableSlider.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs index eed9a53ad7..298729ab6e 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs @@ -14,6 +14,7 @@ using osu.Game.Configuration; using osu.Game.Rulesets.Objects; using osu.Game.Rulesets.Scoring; using osuTK.Graphics; +using osu.Game.Skinning; namespace osu.Game.Rulesets.Osu.Objects.Drawables { @@ -151,6 +152,14 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables } } + protected override void SkinChanged(ISkinSource skin, bool allowFallback) + { + base.SkinChanged(skin, allowFallback); + Body.AccentColour = skin.GetValue(s => s.CustomColours.ContainsKey("SliderTrackOverride") ? s.CustomColours["SliderTrackOverride"] : (Color4?)null) ?? Body.AccentColour; + Body.BorderColour = skin.GetValue(s => s.CustomColours.ContainsKey("SliderBorder") ? s.CustomColours["SliderBorder"] : (Color4?)null) ?? Body.BorderColour; + Ball.AccentColour = skin.GetValue(s => s.CustomColours.ContainsKey("SliderBall") ? s.CustomColours["SliderBall"] : (Color4?)null) ?? Ball.AccentColour; + } + protected override void CheckForResult(bool userTriggered, double timeOffset) { if (userTriggered || Time.Current < slider.EndTime) From 506f27a92ead81deb826a1981e7683d1f190e475 Mon Sep 17 00:00:00 2001 From: Dragicafit Date: Fri, 7 Dec 2018 23:52:57 +0100 Subject: [PATCH 04/99] cursorExpand is now a bool --- osu.Game.Rulesets.Osu/UI/Cursor/GameplayCursor.cs | 2 +- osu.Game/Skinning/LegacySkinDecoder.cs | 2 +- osu.Game/Skinning/SkinConfiguration.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/osu.Game.Rulesets.Osu/UI/Cursor/GameplayCursor.cs b/osu.Game.Rulesets.Osu/UI/Cursor/GameplayCursor.cs index dede10f6b3..9503227b4d 100644 --- a/osu.Game.Rulesets.Osu/UI/Cursor/GameplayCursor.cs +++ b/osu.Game.Rulesets.Osu/UI/Cursor/GameplayCursor.cs @@ -42,7 +42,7 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor [BackgroundDependencyLoader] private void load(ISkinSource source) { - cursorExpand = source.GetValue(s => s.CursorExpand).Equals("1"); + cursorExpand = source.GetValue(s => s.CursorExpand) ?? true; } private int downCount; diff --git a/osu.Game/Skinning/LegacySkinDecoder.cs b/osu.Game/Skinning/LegacySkinDecoder.cs index bb5ae1e310..0b860dab6c 100644 --- a/osu.Game/Skinning/LegacySkinDecoder.cs +++ b/osu.Game/Skinning/LegacySkinDecoder.cs @@ -31,7 +31,7 @@ namespace osu.Game.Skinning skin.SkinInfo.Creator = pair.Value; break; case @"CursorExpand": - skin.CursorExpand = pair.Value; + skin.CursorExpand = !pair.Value.Equals("0"); break; } diff --git a/osu.Game/Skinning/SkinConfiguration.cs b/osu.Game/Skinning/SkinConfiguration.cs index 7759bc2487..047be591e2 100644 --- a/osu.Game/Skinning/SkinConfiguration.cs +++ b/osu.Game/Skinning/SkinConfiguration.cs @@ -17,6 +17,6 @@ namespace osu.Game.Skinning public string HitCircleFont { get; set; } = "default"; - public string CursorExpand { get; set; } = "1"; + public bool? CursorExpand { get; set; } = true; } } From 9afbebf5606bb8cdbfb42c530e78dd36f95a0ab4 Mon Sep 17 00:00:00 2001 From: Dragicafit <43404588+Dragicafit@users.noreply.github.com> Date: Sun, 9 Dec 2018 13:29:14 +0100 Subject: [PATCH 05/99] Equals to == for string --- osu.Game/Skinning/LegacySkinDecoder.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Skinning/LegacySkinDecoder.cs b/osu.Game/Skinning/LegacySkinDecoder.cs index 0b860dab6c..9fbd88596d 100644 --- a/osu.Game/Skinning/LegacySkinDecoder.cs +++ b/osu.Game/Skinning/LegacySkinDecoder.cs @@ -31,7 +31,7 @@ namespace osu.Game.Skinning skin.SkinInfo.Creator = pair.Value; break; case @"CursorExpand": - skin.CursorExpand = !pair.Value.Equals("0"); + skin.CursorExpand = pair.Value != "0"; break; } From fb7d767909a78dd90c394be33f27056e5d62e30b Mon Sep 17 00:00:00 2001 From: Dragicafit Date: Tue, 11 Dec 2018 00:38:03 +0100 Subject: [PATCH 06/99] adjust if position --- .../UI/Cursor/GameplayCursor.cs | 26 +++++++++++-------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/osu.Game.Rulesets.Osu/UI/Cursor/GameplayCursor.cs b/osu.Game.Rulesets.Osu/UI/Cursor/GameplayCursor.cs index 9503227b4d..5489ccf2bd 100644 --- a/osu.Game.Rulesets.Osu/UI/Cursor/GameplayCursor.cs +++ b/osu.Game.Rulesets.Osu/UI/Cursor/GameplayCursor.cs @@ -54,8 +54,10 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor public bool OnPressed(OsuAction action) { - if (cursorExpand) - switch (action) + if (!cursorExpand) + return false; + + switch (action) { case OsuAction.LeftButton: case OsuAction.RightButton: @@ -69,15 +71,17 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor public bool OnReleased(OsuAction action) { - if (cursorExpand) - switch (action) - { - case OsuAction.LeftButton: - case OsuAction.RightButton: - if (--downCount == 0) - ActiveCursor.ScaleTo(targetScale, 200, Easing.OutQuad); - break; - } + if (!cursorExpand) + return false; + + switch (action) + { + case OsuAction.LeftButton: + case OsuAction.RightButton: + if (--downCount == 0) + ActiveCursor.ScaleTo(targetScale, 200, Easing.OutQuad); + break; + } return false; } From bfe3b039457281c803531488f60501ba4863a573 Mon Sep 17 00:00:00 2001 From: Dragicafit Date: Tue, 11 Dec 2018 18:06:41 +0100 Subject: [PATCH 07/99] using SkinReloadableDrawable --- .../UI/Cursor/GameplayCursor.cs | 34 +++++++++++++------ 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/osu.Game.Rulesets.Osu/UI/Cursor/GameplayCursor.cs b/osu.Game.Rulesets.Osu/UI/Cursor/GameplayCursor.cs index 5489ccf2bd..0d2e5c272d 100644 --- a/osu.Game.Rulesets.Osu/UI/Cursor/GameplayCursor.cs +++ b/osu.Game.Rulesets.Osu/UI/Cursor/GameplayCursor.cs @@ -27,24 +27,24 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor private readonly Container fadeContainer; + private SkinnableCursor skinnableCursor; + public GameplayCursor() { - InternalChild = fadeContainer = new Container + InternalChildren = new Drawable[] { - RelativeSizeAxes = Axes.Both, - Children = new Drawable[] + fadeContainer = new Container { - new CursorTrail { Depth = 1 } - } + RelativeSizeAxes = Axes.Both, + Children = new Drawable[] + { + new CursorTrail { Depth = 1 } + } + }, + skinnableCursor = new SkinnableCursor() }; } - [BackgroundDependencyLoader] - private void load(ISkinSource source) - { - cursorExpand = source.GetValue(s => s.CursorExpand) ?? true; - } - private int downCount; private const float pressed_scale = 1.2f; @@ -54,6 +54,8 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor public bool OnPressed(OsuAction action) { + cursorExpand = skinnableCursor.CursorExpand; + if (!cursorExpand) return false; @@ -205,4 +207,14 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor } } } + + public class SkinnableCursor : SkinReloadableDrawable + { + public bool CursorExpand { get; set; } = true; + + protected override void SkinChanged(ISkinSource skin, bool allowFallback) + { + CursorExpand = skin.GetValue(s => s.CursorExpand) ?? true; + } + } } From 4b073aed836d71537c7a3f896b19920112d5c602 Mon Sep 17 00:00:00 2001 From: Dragicafit Date: Tue, 11 Dec 2018 21:02:12 +0100 Subject: [PATCH 08/99] remove spaces --- osu.Game.Rulesets.Osu/UI/Cursor/GameplayCursor.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/osu.Game.Rulesets.Osu/UI/Cursor/GameplayCursor.cs b/osu.Game.Rulesets.Osu/UI/Cursor/GameplayCursor.cs index 0d2e5c272d..188d3eef4c 100644 --- a/osu.Game.Rulesets.Osu/UI/Cursor/GameplayCursor.cs +++ b/osu.Game.Rulesets.Osu/UI/Cursor/GameplayCursor.cs @@ -60,13 +60,13 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor return false; switch (action) - { - case OsuAction.LeftButton: - case OsuAction.RightButton: - downCount++; - ActiveCursor.ScaleTo(released_scale).ScaleTo(targetScale, 100, Easing.OutQuad); - break; - } + { + case OsuAction.LeftButton: + case OsuAction.RightButton: + downCount++; + ActiveCursor.ScaleTo(released_scale).ScaleTo(targetScale, 100, Easing.OutQuad); + break; + } return false; } From c6c4bcccc378f49b87b4ff89ca3277f0885d24fd Mon Sep 17 00:00:00 2001 From: Dragicafit Date: Wed, 12 Dec 2018 11:17:09 +0100 Subject: [PATCH 09/99] relocate SkinnableCursor --- osu.Game.Rulesets.Osu/UI/Cursor/GameplayCursor.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/osu.Game.Rulesets.Osu/UI/Cursor/GameplayCursor.cs b/osu.Game.Rulesets.Osu/UI/Cursor/GameplayCursor.cs index 188d3eef4c..94ca0d8bda 100644 --- a/osu.Game.Rulesets.Osu/UI/Cursor/GameplayCursor.cs +++ b/osu.Game.Rulesets.Osu/UI/Cursor/GameplayCursor.cs @@ -206,15 +206,15 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor cursorContainer.Scale = new Vector2(scale); } } - } - public class SkinnableCursor : SkinReloadableDrawable - { - public bool CursorExpand { get; set; } = true; - - protected override void SkinChanged(ISkinSource skin, bool allowFallback) + private class SkinnableCursor : SkinReloadableDrawable { - CursorExpand = skin.GetValue(s => s.CursorExpand) ?? true; + public bool CursorExpand { get; set; } = true; + + protected override void SkinChanged(ISkinSource skin, bool allowFallback) + { + CursorExpand = skin.GetValue(s => s.CursorExpand) ?? true; + } } } } From 3c677970cda1da0d8d2d5ea39f861e77f3ba72a5 Mon Sep 17 00:00:00 2001 From: phosphene47 Date: Thu, 27 Dec 2018 17:25:28 +0900 Subject: [PATCH 10/99] Add menu background skinning for supporters --- .../Backgrounds/BackgroundScreenDefault.cs | 45 +++++++++++++++++-- 1 file changed, 42 insertions(+), 3 deletions(-) diff --git a/osu.Game/Screens/Backgrounds/BackgroundScreenDefault.cs b/osu.Game/Screens/Backgrounds/BackgroundScreenDefault.cs index 989883c8b3..f924cf9805 100644 --- a/osu.Game/Screens/Backgrounds/BackgroundScreenDefault.cs +++ b/osu.Game/Screens/Backgrounds/BackgroundScreenDefault.cs @@ -2,10 +2,14 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; +using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Framework.MathUtils; using osu.Framework.Threading; using osu.Game.Graphics.Backgrounds; +using osu.Game.Online.API; +using osu.Game.Skinning; +using osu.Game.Users; namespace osu.Game.Screens.Backgrounds { @@ -16,11 +20,21 @@ namespace osu.Game.Screens.Backgrounds private string backgroundName => $@"Menu/menu-background-{currentDisplay % background_count + 1}"; + private Bindable user; + private Bindable skin; + [BackgroundDependencyLoader] - private void load() + private void load(IAPIProvider api, SkinManager skinManager) { + user = api.LocalUser.GetBoundCopy(); + skin = skinManager.CurrentSkin.GetBoundCopy(); + + user.ValueChanged += _ => Next(); + skin.ValueChanged += _ => Next(); + currentDisplay = RNG.Next(0, background_count); - display(new Background(backgroundName)); + + Next(); } private void display(Background newBackground) @@ -39,8 +53,33 @@ namespace osu.Game.Screens.Backgrounds nextTask?.Cancel(); nextTask = Scheduler.AddDelayed(() => { - LoadComponentAsync(new Background(backgroundName) { Depth = currentDisplay }, display); + Background background; + + if (user.Value?.IsSupporter ?? false) + background = new SkinnedBackground(skin.Value, backgroundName); + else + background = new Background(backgroundName); + + background.Depth = currentDisplay; + + LoadComponentAsync(background, display); }, 100); } + + private class SkinnedBackground : Background + { + private readonly Skin skin; + + public SkinnedBackground(Skin skin, string fallbackTextureName) : base(fallbackTextureName) + { + this.skin = skin; + } + + [BackgroundDependencyLoader] + private void load() + { + Sprite.Texture = skin.GetTexture("menu-background") ?? Sprite.Texture; + } + } } } From 850a7aa32772a3136dffed86182a8a75986050a2 Mon Sep 17 00:00:00 2001 From: Roman Kapustin Date: Sat, 29 Dec 2018 17:43:19 +0300 Subject: [PATCH 11/99] Update tab text font on activation/deactivation --- osu.Game/Graphics/UserInterface/OsuTabControl.cs | 3 ++- osu.Game/Graphics/UserInterface/PageTabControl.cs | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/osu.Game/Graphics/UserInterface/OsuTabControl.cs b/osu.Game/Graphics/UserInterface/OsuTabControl.cs index 488e16b6fb..989528e5cd 100644 --- a/osu.Game/Graphics/UserInterface/OsuTabControl.cs +++ b/osu.Game/Graphics/UserInterface/OsuTabControl.cs @@ -160,7 +160,6 @@ namespace osu.Game.Graphics.UserInterface Anchor = Anchor.BottomLeft, Text = (value as IHasDescription)?.Description ?? (value as Enum)?.GetDescription() ?? value.ToString(), TextSize = 14, - Font = @"Exo2.0-Bold", // Font should only turn bold when active? }, Bar = new Box { @@ -173,6 +172,8 @@ namespace osu.Game.Graphics.UserInterface }, new HoverClickSounds() }; + + Active.BindValueChanged(val => Text.Font = val ? @"Exo2.0-Bold" : @"Exo2.0", true); } protected override void OnActivated() => fadeActive(); diff --git a/osu.Game/Graphics/UserInterface/PageTabControl.cs b/osu.Game/Graphics/UserInterface/PageTabControl.cs index 50e4743028..15a27b1f6f 100644 --- a/osu.Game/Graphics/UserInterface/PageTabControl.cs +++ b/osu.Game/Graphics/UserInterface/PageTabControl.cs @@ -46,7 +46,6 @@ namespace osu.Game.Graphics.UserInterface Anchor = Anchor.BottomLeft, Text = (value as Enum)?.GetDescription() ?? value.ToString(), TextSize = 14, - Font = @"Exo2.0-Bold", }, box = new Box { @@ -59,6 +58,8 @@ namespace osu.Game.Graphics.UserInterface }, new HoverClickSounds() }; + + Active.BindValueChanged(val => Text.Font = val ? @"Exo2.0-Bold" : @"Exo2.0", true); } [BackgroundDependencyLoader] From 891458502127b349e46737dfc8e7bff038583003 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 7 Jan 2019 18:28:22 +0900 Subject: [PATCH 12/99] Fix implementation of conditional cursor expanding --- .../UI/Cursor/GameplayCursor.cs | 177 +++++++++--------- 1 file changed, 91 insertions(+), 86 deletions(-) diff --git a/osu.Game.Rulesets.Osu/UI/Cursor/GameplayCursor.cs b/osu.Game.Rulesets.Osu/UI/Cursor/GameplayCursor.cs index 94ca0d8bda..589f929f91 100644 --- a/osu.Game.Rulesets.Osu/UI/Cursor/GameplayCursor.cs +++ b/osu.Game.Rulesets.Osu/UI/Cursor/GameplayCursor.cs @@ -23,12 +23,8 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor protected override Container Content => fadeContainer; - private bool cursorExpand; - private readonly Container fadeContainer; - private SkinnableCursor skinnableCursor; - public GameplayCursor() { InternalChildren = new Drawable[] @@ -41,30 +37,27 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor new CursorTrail { Depth = 1 } } }, - skinnableCursor = new SkinnableCursor() }; } private int downCount; - private const float pressed_scale = 1.2f; - private const float released_scale = 1f; - - private float targetScale => downCount > 0 ? pressed_scale : released_scale; + private void updateExpandedState() + { + if (downCount > 0) + (ActiveCursor as OsuCursor)?.Expand(); + else + (ActiveCursor as OsuCursor)?.Contract(); + } public bool OnPressed(OsuAction action) { - cursorExpand = skinnableCursor.CursorExpand; - - if (!cursorExpand) - return false; - switch (action) { case OsuAction.LeftButton: case OsuAction.RightButton: downCount++; - ActiveCursor.ScaleTo(released_scale).ScaleTo(targetScale, 100, Easing.OutQuad); + updateExpandedState(); break; } @@ -73,15 +66,12 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor public bool OnReleased(OsuAction action) { - if (!cursorExpand) - return false; - switch (action) { case OsuAction.LeftButton: case OsuAction.RightButton: if (--downCount == 0) - ActiveCursor.ScaleTo(targetScale, 200, Easing.OutQuad); + updateExpandedState(); break; } @@ -93,92 +83,106 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor protected override void PopIn() { fadeContainer.FadeTo(1, 300, Easing.OutQuint); - ActiveCursor.ScaleTo(targetScale, 400, Easing.OutQuint); + ActiveCursor.ScaleTo(1, 400, Easing.OutQuint); } protected override void PopOut() { fadeContainer.FadeTo(0.05f, 450, Easing.OutQuint); - ActiveCursor.ScaleTo(targetScale * 0.8f, 450, Easing.OutQuint); + ActiveCursor.ScaleTo(0.8f, 450, Easing.OutQuint); } - public class OsuCursor : Container + public class OsuCursor : SkinReloadableDrawable { - private Drawable cursorContainer; + private bool cursorExpand; private Bindable cursorScale; private Bindable autoCursorScale; private readonly IBindable beatmap = new Bindable(); + private Container expandTarget; + private Drawable scaleTarget; + public OsuCursor() { Origin = Anchor.Centre; Size = new Vector2(42); } + protected override void SkinChanged(ISkinSource skin, bool allowFallback) + { + cursorExpand = skin.GetValue(s => s.CursorExpand) ?? true; + } + [BackgroundDependencyLoader] private void load(OsuConfigManager config, IBindableBeatmap beatmap) { - Child = cursorContainer = new SkinnableDrawable("cursor", _ => new CircularContainer + InternalChild = expandTarget = new Container { RelativeSizeAxes = Axes.Both, - Masking = true, - BorderThickness = Size.X / 6, - BorderColour = Color4.White, - EdgeEffect = new EdgeEffectParameters - { - Type = EdgeEffectType.Shadow, - Colour = Color4.Pink.Opacity(0.5f), - Radius = 5, - }, - Children = new Drawable[] - { - new Box - { - RelativeSizeAxes = Axes.Both, - Alpha = 0, - AlwaysPresent = true, - }, - new CircularContainer - { - Origin = Anchor.Centre, - Anchor = Anchor.Centre, - RelativeSizeAxes = Axes.Both, - Masking = true, - BorderThickness = Size.X / 3, - BorderColour = Color4.White.Opacity(0.5f), - Children = new Drawable[] - { - new Box - { - RelativeSizeAxes = Axes.Both, - Alpha = 0, - AlwaysPresent = true, - }, - }, - }, - new CircularContainer - { - Origin = Anchor.Centre, - Anchor = Anchor.Centre, - RelativeSizeAxes = Axes.Both, - Scale = new Vector2(0.1f), - Masking = true, - Children = new Drawable[] - { - new Box - { - RelativeSizeAxes = Axes.Both, - Colour = Color4.White, - }, - }, - }, - } - }, restrictSize: false) - { Origin = Anchor.Centre, Anchor = Anchor.Centre, - RelativeSizeAxes = Axes.Both, + Child = scaleTarget = new SkinnableDrawable("cursor", _ => new CircularContainer + { + RelativeSizeAxes = Axes.Both, + Masking = true, + BorderThickness = Size.X / 6, + BorderColour = Color4.White, + EdgeEffect = new EdgeEffectParameters + { + Type = EdgeEffectType.Shadow, + Colour = Color4.Pink.Opacity(0.5f), + Radius = 5, + }, + Children = new Drawable[] + { + new Box + { + RelativeSizeAxes = Axes.Both, + Alpha = 0, + AlwaysPresent = true, + }, + new CircularContainer + { + Origin = Anchor.Centre, + Anchor = Anchor.Centre, + RelativeSizeAxes = Axes.Both, + Masking = true, + BorderThickness = Size.X / 3, + BorderColour = Color4.White.Opacity(0.5f), + Children = new Drawable[] + { + new Box + { + RelativeSizeAxes = Axes.Both, + Alpha = 0, + AlwaysPresent = true, + }, + }, + }, + new CircularContainer + { + Origin = Anchor.Centre, + Anchor = Anchor.Centre, + RelativeSizeAxes = Axes.Both, + Scale = new Vector2(0.1f), + Masking = true, + Children = new Drawable[] + { + new Box + { + RelativeSizeAxes = Axes.Both, + Colour = Color4.White, + }, + }, + }, + } + }, restrictSize: false) + { + Origin = Anchor.Centre, + Anchor = Anchor.Centre, + RelativeSizeAxes = Axes.Both, + } }; this.beatmap.BindTo(beatmap); @@ -203,18 +207,19 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor scale *= (float)(1 - 0.7 * (1 + beatmap.Value.BeatmapInfo.BaseDifficulty.CircleSize - BeatmapDifficulty.DEFAULT_DIFFICULTY) / BeatmapDifficulty.DEFAULT_DIFFICULTY); } - cursorContainer.Scale = new Vector2(scale); + scaleTarget.Scale = new Vector2(scale); } - } - private class SkinnableCursor : SkinReloadableDrawable - { - public bool CursorExpand { get; set; } = true; + private const float pressed_scale = 1.2f; + private const float released_scale = 1f; - protected override void SkinChanged(ISkinSource skin, bool allowFallback) + public void Expand() { - CursorExpand = skin.GetValue(s => s.CursorExpand) ?? true; + if (!cursorExpand) return; + expandTarget.ScaleTo(released_scale).ScaleTo(pressed_scale, 100, Easing.OutQuad); } + + public void Contract() => expandTarget.ScaleTo(released_scale, 100, Easing.OutQuad); } } } From 4cee21f35679848e556f94f65d7889a69b65d5e9 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 7 Jan 2019 20:12:39 +0900 Subject: [PATCH 13/99] Make skinning better --- .../Drawable/DrawableCatchHitObject.cs | 2 +- .../Objects/Drawables/DrawableOsuHitObject.cs | 2 +- .../Objects/Drawables/DrawableSlider.cs | 7 ++-- .../UI/Cursor/GameplayCursor.cs | 2 +- osu.Game/Skinning/ISkinSource.cs | 4 +-- .../Skinning/LocalSkinOverrideContainer.cs | 32 ++++++++++++------- osu.Game/Skinning/Skin.cs | 15 ++++++--- osu.Game/Skinning/SkinManager.cs | 4 +-- 8 files changed, 42 insertions(+), 26 deletions(-) diff --git a/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableCatchHitObject.cs b/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableCatchHitObject.cs index 2db252ebc6..4c65dbc9e1 100644 --- a/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableCatchHitObject.cs +++ b/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableCatchHitObject.cs @@ -65,7 +65,7 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable base.SkinChanged(skin, allowFallback); if (HitObject is IHasComboInformation combo) - AccentColour = skin.GetValue(s => s.ComboColours.Count > 0 ? s.ComboColours[combo.ComboIndex % s.ComboColours.Count] : (Color4?)null) ?? Color4.White; + AccentColour = skin.GetValue(s => s.ComboColours.Count > 0 ? s.ComboColours[combo.ComboIndex % s.ComboColours.Count] : Color4.White); } private const float preempt = 1000; diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuHitObject.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuHitObject.cs index 56c4ea639b..8293d56620 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuHitObject.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuHitObject.cs @@ -58,7 +58,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables base.SkinChanged(skin, allowFallback); if (HitObject is IHasComboInformation combo) - AccentColour = skin.GetValue(s => s.ComboColours.Count > 0 ? s.ComboColours[combo.ComboIndex % s.ComboColours.Count] : (Color4?)null) ?? Color4.White; + AccentColour = skin.GetValue(s => s.ComboColours.Count > 0 ? s.ComboColours[combo.ComboIndex % s.ComboColours.Count] : Color4.White); } protected virtual void UpdatePreemptState() => this.FadeIn(HitObject.TimeFadeIn); diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs index 298729ab6e..60377e373a 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs @@ -155,9 +155,10 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables protected override void SkinChanged(ISkinSource skin, bool allowFallback) { base.SkinChanged(skin, allowFallback); - Body.AccentColour = skin.GetValue(s => s.CustomColours.ContainsKey("SliderTrackOverride") ? s.CustomColours["SliderTrackOverride"] : (Color4?)null) ?? Body.AccentColour; - Body.BorderColour = skin.GetValue(s => s.CustomColours.ContainsKey("SliderBorder") ? s.CustomColours["SliderBorder"] : (Color4?)null) ?? Body.BorderColour; - Ball.AccentColour = skin.GetValue(s => s.CustomColours.ContainsKey("SliderBall") ? s.CustomColours["SliderBall"] : (Color4?)null) ?? Ball.AccentColour; + + Body.AccentColour = skin.GetValue(s => s.CustomColours.ContainsKey("SliderTrackOverride") ? s.CustomColours["SliderTrackOverride"] : Body.AccentColour); + Body.BorderColour = skin.GetValue(s => s.CustomColours.ContainsKey("SliderBorder") ? s.CustomColours["SliderBorder"] : Body.BorderColour); + Ball.AccentColour = skin.GetValue(s => s.CustomColours.ContainsKey("SliderBall") ? s.CustomColours["SliderBall"] : Ball.AccentColour); } protected override void CheckForResult(bool userTriggered, double timeOffset) diff --git a/osu.Game.Rulesets.Osu/UI/Cursor/GameplayCursor.cs b/osu.Game.Rulesets.Osu/UI/Cursor/GameplayCursor.cs index 589f929f91..332d6d4860 100644 --- a/osu.Game.Rulesets.Osu/UI/Cursor/GameplayCursor.cs +++ b/osu.Game.Rulesets.Osu/UI/Cursor/GameplayCursor.cs @@ -111,7 +111,7 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor protected override void SkinChanged(ISkinSource skin, bool allowFallback) { - cursorExpand = skin.GetValue(s => s.CursorExpand) ?? true; + cursorExpand = skin.GetValue(s => s.CursorExpand ?? true); } [BackgroundDependencyLoader] diff --git a/osu.Game/Skinning/ISkinSource.cs b/osu.Game/Skinning/ISkinSource.cs index 609f8e4ac4..8ec8db6b64 100644 --- a/osu.Game/Skinning/ISkinSource.cs +++ b/osu.Game/Skinning/ISkinSource.cs @@ -21,8 +21,8 @@ namespace osu.Game.Skinning SampleChannel GetSample(string sampleName); - TValue GetValue(Func query) where TConfiguration : SkinConfiguration where TValue : class; + TValue GetValue(Func query) where TConfiguration : SkinConfiguration; - TValue? GetValue(Func query) where TConfiguration : SkinConfiguration where TValue : struct; + bool TryGetValue(Func query, out TValue val) where TConfiguration : SkinConfiguration; } } diff --git a/osu.Game/Skinning/LocalSkinOverrideContainer.cs b/osu.Game/Skinning/LocalSkinOverrideContainer.cs index e555a53453..78e9822fb6 100644 --- a/osu.Game/Skinning/LocalSkinOverrideContainer.cs +++ b/osu.Game/Skinning/LocalSkinOverrideContainer.cs @@ -43,22 +43,30 @@ namespace osu.Game.Skinning return fallbackSource?.GetSample(sampleName); } - public TValue? GetValue(Func query) where TConfiguration : SkinConfiguration where TValue : struct - { - TValue? val; - if ((source as Skin)?.Configuration is TConfiguration conf) - if (beatmapSkins && (val = query?.Invoke(conf)) != null) - return val; - return fallbackSource?.GetValue(query); - } - - public TValue GetValue(Func query) where TConfiguration : SkinConfiguration where TValue : class + public TValue GetValue(Func query) where TConfiguration : SkinConfiguration { TValue val; if ((source as Skin)?.Configuration is TConfiguration conf) - if (beatmapSkins && (val = query?.Invoke(conf)) != null) + if (beatmapSkins && (val = query.Invoke(conf)) != null) return val; - return fallbackSource?.GetValue(query); + + return fallbackSource == null ? default : fallbackSource.GetValue(query); + } + + public bool TryGetValue(Func query, out TValue val) where TConfiguration : SkinConfiguration + { + val = default; + + if ((source as Skin)?.Configuration is TConfiguration conf) + if (beatmapSkins && query(conf, val)) + return true; + + if (fallbackSource == null) + { + return false; + } + + return fallbackSource.TryGetValue(query, out val); } private readonly ISkinSource source; diff --git a/osu.Game/Skinning/Skin.cs b/osu.Game/Skinning/Skin.cs index 29130f45df..a4c99a8b95 100644 --- a/osu.Game/Skinning/Skin.cs +++ b/osu.Game/Skinning/Skin.cs @@ -22,11 +22,18 @@ namespace osu.Game.Skinning public abstract Texture GetTexture(string componentName); - public TValue GetValue(Func query) where TConfiguration : SkinConfiguration where TValue : class - => Configuration is TConfiguration conf ? query?.Invoke(conf) : null; + public TValue GetValue(Func query) where TConfiguration : SkinConfiguration + => Configuration is TConfiguration conf ? query.Invoke(conf) : default; - public TValue? GetValue(Func query) where TConfiguration : SkinConfiguration where TValue : struct - => Configuration is TConfiguration conf ? query?.Invoke(conf) : null; + public bool TryGetValue(Func query, out TValue val) where TConfiguration : SkinConfiguration + { + val = default; + + if (Configuration is TConfiguration conf) + return query(conf, val); + + return false; + } protected Skin(SkinInfo skin) { diff --git a/osu.Game/Skinning/SkinManager.cs b/osu.Game/Skinning/SkinManager.cs index ce179d43ef..b3b2521489 100644 --- a/osu.Game/Skinning/SkinManager.cs +++ b/osu.Game/Skinning/SkinManager.cs @@ -116,8 +116,8 @@ namespace osu.Game.Skinning public SampleChannel GetSample(string sampleName) => CurrentSkin.Value.GetSample(sampleName); - public TValue GetValue(Func query) where TConfiguration : SkinConfiguration where TValue : class => CurrentSkin.Value.GetValue(query); + public TValue GetValue(Func query) where TConfiguration : SkinConfiguration => CurrentSkin.Value.GetValue(query); - public TValue? GetValue(Func query) where TConfiguration : SkinConfiguration where TValue : struct => CurrentSkin.Value.GetValue(query); + public bool TryGetValue(Func query, out TValue val) where TConfiguration : SkinConfiguration => CurrentSkin.Value.TryGetValue(query, out val); } } From b17b88d071ded055c0aa65b2118692ae90fb74cf Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Tue, 8 Jan 2019 18:06:46 +0900 Subject: [PATCH 14/99] Fix null beatmap possibly being selected --- osu.Game/Screens/Select/SongSelect.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/osu.Game/Screens/Select/SongSelect.cs b/osu.Game/Screens/Select/SongSelect.cs index f65cc0e49d..2f212a2564 100644 --- a/osu.Game/Screens/Select/SongSelect.cs +++ b/osu.Game/Screens/Select/SongSelect.cs @@ -297,14 +297,14 @@ namespace osu.Game.Screens.Select /// Whether to trigger . public void FinaliseSelection(BeatmapInfo beatmap = null, bool performStartAction = true) { - // avoid attempting to continue before a selection has been obtained. - // this could happen via a user interaction while the carousel is still in a loading state. - if (Carousel.SelectedBeatmap == null) return; - // if we have a pending filter operation, we want to run it now. // it could change selection (ie. if the ruleset has been changed). Carousel.FlushPendingFilterOperations(); + // avoid attempting to continue before a selection has been obtained. + // this could happen via a user interaction while the carousel is still in a loading state. + if (Carousel.SelectedBeatmap == null) return; + if (beatmap != null) Carousel.SelectBeatmap(beatmap); From da98915c0c4c3cf64ab647327612bc7acde43b72 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Tue, 8 Jan 2019 18:58:44 +0900 Subject: [PATCH 15/99] Fix links not working in partially masked text flow --- osu.Game/Graphics/Containers/LinkFlowContainer.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/osu.Game/Graphics/Containers/LinkFlowContainer.cs b/osu.Game/Graphics/Containers/LinkFlowContainer.cs index 74315d2522..7646ff723e 100644 --- a/osu.Game/Graphics/Containers/LinkFlowContainer.cs +++ b/osu.Game/Graphics/Containers/LinkFlowContainer.cs @@ -79,6 +79,7 @@ namespace osu.Game.Graphics.Containers { AddInternal(new DrawableLinkCompiler(drawables.OfType().ToList()) { + RelativeSizeAxes = Axes.Both, TooltipText = tooltipText ?? (url != text ? url : string.Empty), Action = action ?? (() => { @@ -122,5 +123,7 @@ namespace osu.Game.Graphics.Containers }), }); } + + public override IEnumerable FlowingChildren => base.FlowingChildren.Where(c => !(c is DrawableLinkCompiler)); } } From 122fc2de582d496a3f98f70f13f57b587f32cc14 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Tue, 8 Jan 2019 19:24:55 +0900 Subject: [PATCH 16/99] Show room leaderboard instead in the lounge --- .../Visual/TestCaseMatchLeaderboard.cs | 3 +- .../Multi/Lounge/Components/RoomInspector.cs | 28 ++++++------------- .../Match/Components/MatchLeaderboard.cs | 15 +++++----- .../Screens/Multi/Match/MatchSubScreen.cs | 5 ++-- .../Ranking/Pages/RoomLeaderboardPage.cs | 2 +- osu.Game/Screens/Multi/RoomBindings.cs | 3 ++ 6 files changed, 25 insertions(+), 31 deletions(-) diff --git a/osu.Game.Tests/Visual/TestCaseMatchLeaderboard.cs b/osu.Game.Tests/Visual/TestCaseMatchLeaderboard.cs index cf475de1f0..821bf84047 100644 --- a/osu.Game.Tests/Visual/TestCaseMatchLeaderboard.cs +++ b/osu.Game.Tests/Visual/TestCaseMatchLeaderboard.cs @@ -17,12 +17,13 @@ namespace osu.Game.Tests.Visual { public TestCaseMatchLeaderboard() { - Add(new MatchLeaderboard(new Room { RoomID = { Value = 3 } }) + Add(new MatchLeaderboard { Origin = Anchor.Centre, Anchor = Anchor.Centre, Size = new Vector2(550f, 450f), Scope = MatchLeaderboardScope.Overall, + Room = new Room { RoomID = { Value = 3 } } }); } diff --git a/osu.Game/Screens/Multi/Lounge/Components/RoomInspector.cs b/osu.Game/Screens/Multi/Lounge/Components/RoomInspector.cs index 47f5182c39..ef80499884 100644 --- a/osu.Game/Screens/Multi/Lounge/Components/RoomInspector.cs +++ b/osu.Game/Screens/Multi/Lounge/Components/RoomInspector.cs @@ -1,7 +1,7 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using System.Linq; +using System.Threading; using osu.Framework.Allocation; using osu.Framework.Configuration; using osu.Framework.Extensions.Color4Extensions; @@ -13,10 +13,10 @@ using osu.Framework.Graphics.Shapes; using osu.Game.Beatmaps; using osu.Game.Beatmaps.Drawables; using osu.Game.Graphics; -using osu.Game.Graphics.Containers; using osu.Game.Graphics.Sprites; using osu.Game.Online.Multiplayer; using osu.Game.Screens.Multi.Components; +using osu.Game.Screens.Multi.Match.Components; using osu.Game.Users; using osuTK; using osuTK.Graphics; @@ -37,11 +37,11 @@ namespace osu.Game.Screens.Multi.Lounge.Components private Box statusStrip; private UpdateableBeatmapBackgroundSprite background; private ParticipantCountDisplay participantCount; - private FillFlowContainer topFlow, participantsFlow; + private FillFlowContainer topFlow; private OsuSpriteText name, status; private BeatmapTypeInfo beatmapTypeInfo; - private ScrollContainer participantsScroll; private ParticipantInfo participantInfo; + private MatchLeaderboard leaderboard; [Resolved] private BeatmapManager beatmaps { get; set; } @@ -147,23 +147,13 @@ namespace osu.Game.Screens.Multi.Lounge.Components }, }, }, - participantsScroll = new OsuScrollContainer + leaderboard = new MatchLeaderboard { Anchor = Anchor.BottomLeft, Origin = Anchor.BottomLeft, RelativeSizeAxes = Axes.X, Padding = new MarginPadding { Top = contentPadding.Top, Left = 38, Right = 37 }, - Children = new[] - { - participantsFlow = new FillFlowContainer - { - RelativeSizeAxes = Axes.X, - AutoSizeAxes = Axes.Y, - LayoutDuration = transition_duration, - Spacing = new Vector2(5f), - }, - }, - }, + } }; participantInfo.Host.BindTo(bindings.Host); @@ -180,7 +170,6 @@ namespace osu.Game.Screens.Multi.Lounge.Components background.Beatmap.BindTo(bindings.CurrentBeatmap); bindings.Status.BindValueChanged(displayStatus); - bindings.Participants.BindValueChanged(p => participantsFlow.ChildrenEnumerable = p.Select(u => new UserTile(u))); bindings.Name.BindValueChanged(n => name.Text = n); Room.BindValueChanged(updateRoom, true); @@ -189,10 +178,10 @@ namespace osu.Game.Screens.Multi.Lounge.Components private void updateRoom(Room room) { bindings.Room = room; + leaderboard.Room = room; if (room != null) { - participantsFlow.FadeIn(transition_duration); participantCount.FadeIn(transition_duration); beatmapTypeInfo.FadeIn(transition_duration); name.FadeIn(transition_duration); @@ -200,7 +189,6 @@ namespace osu.Game.Screens.Multi.Lounge.Components } else { - participantsFlow.FadeOut(transition_duration); participantCount.FadeOut(transition_duration); beatmapTypeInfo.FadeOut(transition_duration); name.FadeOut(transition_duration); @@ -214,7 +202,7 @@ namespace osu.Game.Screens.Multi.Lounge.Components { base.UpdateAfterChildren(); - participantsScroll.Height = DrawHeight - topFlow.DrawHeight; + leaderboard.Height = DrawHeight - topFlow.DrawHeight; } private void displayStatus(RoomStatus s) diff --git a/osu.Game/Screens/Multi/Match/Components/MatchLeaderboard.cs b/osu.Game/Screens/Multi/Match/Components/MatchLeaderboard.cs index 864191105f..5ac0453373 100644 --- a/osu.Game/Screens/Multi/Match/Components/MatchLeaderboard.cs +++ b/osu.Game/Screens/Multi/Match/Components/MatchLeaderboard.cs @@ -16,17 +16,18 @@ namespace osu.Game.Screens.Multi.Match.Components { public Action> ScoresLoaded; - private readonly Room room; - - public MatchLeaderboard(Room room) + public Room Room { - this.room = room; + get => bindings.Room; + set => bindings.Room = value; } + private readonly RoomBindings bindings = new RoomBindings(); + [BackgroundDependencyLoader] private void load() { - room.RoomID.BindValueChanged(id => + bindings.RoomID.BindValueChanged(id => { if (id == null) return; @@ -38,10 +39,10 @@ namespace osu.Game.Screens.Multi.Match.Components protected override APIRequest FetchScores(Action> scoresCallback) { - if (room.RoomID == null) + if (bindings.RoomID.Value == null) return null; - var req = new GetRoomScoresRequest(room.RoomID.Value ?? 0); + var req = new GetRoomScoresRequest(bindings.RoomID.Value ?? 0); req.Success += r => { diff --git a/osu.Game/Screens/Multi/Match/MatchSubScreen.cs b/osu.Game/Screens/Multi/Match/MatchSubScreen.cs index 55a5a2c85e..14cdd90128 100644 --- a/osu.Game/Screens/Multi/Match/MatchSubScreen.cs +++ b/osu.Game/Screens/Multi/Match/MatchSubScreen.cs @@ -71,10 +71,11 @@ namespace osu.Game.Screens.Multi.Match { new Drawable[] { - leaderboard = new MatchLeaderboard(room) + leaderboard = new MatchLeaderboard { Padding = new MarginPadding(10), - RelativeSizeAxes = Axes.Both + RelativeSizeAxes = Axes.Both, + Room = room }, new Container { diff --git a/osu.Game/Screens/Multi/Ranking/Pages/RoomLeaderboardPage.cs b/osu.Game/Screens/Multi/Ranking/Pages/RoomLeaderboardPage.cs index 54528e5503..44f5f11c93 100644 --- a/osu.Game/Screens/Multi/Ranking/Pages/RoomLeaderboardPage.cs +++ b/osu.Game/Screens/Multi/Ranking/Pages/RoomLeaderboardPage.cs @@ -103,8 +103,8 @@ namespace osu.Game.Screens.Multi.Ranking.Pages public class ResultsMatchLeaderboard : MatchLeaderboard { public ResultsMatchLeaderboard(Room room) - : base(room) { + Room = room; } protected override bool FadeTop => true; diff --git a/osu.Game/Screens/Multi/RoomBindings.cs b/osu.Game/Screens/Multi/RoomBindings.cs index cdbb6dbea6..30e2918b69 100644 --- a/osu.Game/Screens/Multi/RoomBindings.cs +++ b/osu.Game/Screens/Multi/RoomBindings.cs @@ -39,6 +39,7 @@ namespace osu.Game.Screens.Multi if (room != null) { + RoomID.UnbindFrom(room.RoomID); Name.UnbindFrom(room.Name); Host.UnbindFrom(room.Host); Status.UnbindFrom(room.Status); @@ -56,6 +57,7 @@ namespace osu.Game.Screens.Multi if (room != null) { + RoomID.BindTo(room.RoomID); Name.BindTo(room.Name); Host.BindTo(room.Host); Status.BindTo(room.Status); @@ -82,6 +84,7 @@ namespace osu.Game.Screens.Multi currentRuleset.Value = playlistItem?.Ruleset; } + public readonly Bindable RoomID = new Bindable(); public readonly Bindable Name = new Bindable(); public readonly Bindable Host = new Bindable(); public readonly Bindable Status = new Bindable(); From 2a4c91a6ab7a1d25a15ba61ad4581b48de13ab6e Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Tue, 8 Jan 2019 19:26:24 +0900 Subject: [PATCH 17/99] Remove unused using --- osu.Game/Screens/Multi/Lounge/Components/RoomInspector.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/osu.Game/Screens/Multi/Lounge/Components/RoomInspector.cs b/osu.Game/Screens/Multi/Lounge/Components/RoomInspector.cs index ef80499884..e8be62e28c 100644 --- a/osu.Game/Screens/Multi/Lounge/Components/RoomInspector.cs +++ b/osu.Game/Screens/Multi/Lounge/Components/RoomInspector.cs @@ -1,7 +1,6 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using System.Threading; using osu.Framework.Allocation; using osu.Framework.Configuration; using osu.Framework.Extensions.Color4Extensions; From 2dc185f249bfc4766d9fad8703af999406a5331d Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 9 Jan 2019 15:15:54 +0900 Subject: [PATCH 18/99] Display avatars rather than full scores --- .../Multi/Lounge/Components/RoomInspector.cs | 351 +++++++++++------- 1 file changed, 215 insertions(+), 136 deletions(-) diff --git a/osu.Game/Screens/Multi/Lounge/Components/RoomInspector.cs b/osu.Game/Screens/Multi/Lounge/Components/RoomInspector.cs index e8be62e28c..63730ff635 100644 --- a/osu.Game/Screens/Multi/Lounge/Components/RoomInspector.cs +++ b/osu.Game/Screens/Multi/Lounge/Components/RoomInspector.cs @@ -1,6 +1,7 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using System; using osu.Framework.Allocation; using osu.Framework.Configuration; using osu.Framework.Extensions.Color4Extensions; @@ -13,9 +14,10 @@ using osu.Game.Beatmaps; using osu.Game.Beatmaps.Drawables; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; +using osu.Game.Online.API; +using osu.Game.Online.API.Requests; using osu.Game.Online.Multiplayer; using osu.Game.Screens.Multi.Components; -using osu.Game.Screens.Multi.Match.Components; using osu.Game.Users; using osuTK; using osuTK.Graphics; @@ -36,11 +38,10 @@ namespace osu.Game.Screens.Multi.Lounge.Components private Box statusStrip; private UpdateableBeatmapBackgroundSprite background; private ParticipantCountDisplay participantCount; - private FillFlowContainer topFlow; private OsuSpriteText name, status; private BeatmapTypeInfo beatmapTypeInfo; private ParticipantInfo participantInfo; - private MatchLeaderboard leaderboard; + private MatchParticipants participants; [Resolved] private BeatmapManager beatmaps { get; set; } @@ -57,127 +58,138 @@ namespace osu.Game.Screens.Multi.Lounge.Components RelativeSizeAxes = Axes.Both, Colour = OsuColour.FromHex(@"343138"), }, - topFlow = new FillFlowContainer + new GridContainer { - RelativeSizeAxes = Axes.X, - AutoSizeAxes = Axes.Y, - Direction = FillDirection.Vertical, - Children = new Drawable[] + RelativeSizeAxes = Axes.Both, + RowDimensions = new[] { - new Container - { - RelativeSizeAxes = Axes.X, - Height = 200, - Masking = true, - Children = new Drawable[] - { - background = new UpdateableBeatmapBackgroundSprite { RelativeSizeAxes = Axes.Both }, - new Box - { - RelativeSizeAxes = Axes.Both, - Colour = ColourInfo.GradientVertical(Color4.Black.Opacity(0.5f), Color4.Black.Opacity(0)), - }, - new Container - { - RelativeSizeAxes = Axes.Both, - Padding = new MarginPadding(20), - Children = new Drawable[] - { - participantCount = new ParticipantCountDisplay - { - Anchor = Anchor.TopRight, - Origin = Anchor.TopRight, - }, - name = new OsuSpriteText - { - Anchor = Anchor.BottomLeft, - Origin = Anchor.BottomLeft, - TextSize = 30, - }, - }, - }, - }, - }, - statusStrip = new Box - { - RelativeSizeAxes = Axes.X, - Height = 5, - }, - new Container - { - RelativeSizeAxes = Axes.X, - AutoSizeAxes = Axes.Y, - Children = new Drawable[] - { - new Box - { - RelativeSizeAxes = Axes.Both, - Colour = OsuColour.FromHex(@"28242d"), - }, - new FillFlowContainer - { - RelativeSizeAxes = Axes.X, - AutoSizeAxes = Axes.Y, - Direction = FillDirection.Vertical, - LayoutDuration = transition_duration, - Padding = contentPadding, - Spacing = new Vector2(0f, 5f), - Children = new Drawable[] - { - status = new OsuSpriteText - { - TextSize = 14, - Font = @"Exo2.0-Bold", - }, - beatmapTypeInfo = new BeatmapTypeInfo(), - }, - }, - }, - }, - new Container - { - RelativeSizeAxes = Axes.X, - AutoSizeAxes = Axes.Y, - Padding = contentPadding, - Children = new Drawable[] - { - participantInfo = new ParticipantInfo(), - }, - }, + new Dimension(GridSizeMode.AutoSize), + new Dimension(GridSizeMode.Distributed), }, - }, - leaderboard = new MatchLeaderboard - { - Anchor = Anchor.BottomLeft, - Origin = Anchor.BottomLeft, - RelativeSizeAxes = Axes.X, - Padding = new MarginPadding { Top = contentPadding.Top, Left = 38, Right = 37 }, + Content = new[] + { + new Drawable[] + { + new FillFlowContainer + { + RelativeSizeAxes = Axes.X, + AutoSizeAxes = Axes.Y, + Direction = FillDirection.Vertical, + Children = new Drawable[] + { + new Container + { + RelativeSizeAxes = Axes.X, + Height = 200, + Masking = true, + Children = new Drawable[] + { + background = new UpdateableBeatmapBackgroundSprite { RelativeSizeAxes = Axes.Both }, + new Box + { + RelativeSizeAxes = Axes.Both, + Colour = ColourInfo.GradientVertical(Color4.Black.Opacity(0.5f), Color4.Black.Opacity(0)), + }, + new Container + { + RelativeSizeAxes = Axes.Both, + Padding = new MarginPadding(20), + Children = new Drawable[] + { + participantCount = new ParticipantCountDisplay + { + Anchor = Anchor.TopRight, + Origin = Anchor.TopRight, + }, + name = new OsuSpriteText + { + Anchor = Anchor.BottomLeft, + Origin = Anchor.BottomLeft, + TextSize = 30, + }, + }, + }, + }, + }, + statusStrip = new Box + { + RelativeSizeAxes = Axes.X, + Height = 5, + }, + new Container + { + RelativeSizeAxes = Axes.X, + AutoSizeAxes = Axes.Y, + Children = new Drawable[] + { + new Box + { + RelativeSizeAxes = Axes.Both, + Colour = OsuColour.FromHex(@"28242d"), + }, + new FillFlowContainer + { + RelativeSizeAxes = Axes.X, + AutoSizeAxes = Axes.Y, + Direction = FillDirection.Vertical, + LayoutDuration = transition_duration, + Padding = contentPadding, + Spacing = new Vector2(0f, 5f), + Children = new Drawable[] + { + status = new OsuSpriteText + { + TextSize = 14, + Font = @"Exo2.0-Bold", + }, + beatmapTypeInfo = new BeatmapTypeInfo(), + }, + }, + }, + }, + new Container + { + RelativeSizeAxes = Axes.X, + AutoSizeAxes = Axes.Y, + Padding = contentPadding, + Children = new Drawable[] + { + participantInfo = new ParticipantInfo(), + }, + }, + }, + }, + }, + new Drawable[] + { + participants = new MatchParticipants + { + RelativeSizeAxes = Axes.Both, + } + } + } } }; participantInfo.Host.BindTo(bindings.Host); participantInfo.ParticipantCount.BindTo(bindings.ParticipantCount); participantInfo.Participants.BindTo(bindings.Participants); - participantCount.Participants.BindTo(bindings.Participants); participantCount.ParticipantCount.BindTo(bindings.ParticipantCount); participantCount.MaxParticipants.BindTo(bindings.MaxParticipants); - beatmapTypeInfo.Beatmap.BindTo(bindings.CurrentBeatmap); beatmapTypeInfo.Ruleset.BindTo(bindings.CurrentRuleset); beatmapTypeInfo.Type.BindTo(bindings.Type); background.Beatmap.BindTo(bindings.CurrentBeatmap); - bindings.Status.BindValueChanged(displayStatus); bindings.Name.BindValueChanged(n => name.Text = n); - Room.BindValueChanged(updateRoom, true); } private void updateRoom(Room room) { bindings.Room = room; - leaderboard.Room = room; + participants.Room = room; if (room != null) { @@ -197,13 +209,6 @@ namespace osu.Game.Screens.Multi.Lounge.Components } } - protected override void UpdateAfterChildren() - { - base.UpdateAfterChildren(); - - leaderboard.Height = DrawHeight - topFlow.DrawHeight; - } - private void displayStatus(RoomStatus s) { status.Text = s.Message; @@ -213,39 +218,113 @@ namespace osu.Game.Screens.Multi.Lounge.Components status.FadeColour(c, transition_duration); } - private class UserTile : Container, IHasTooltip - { - private readonly User user; - - public string TooltipText => user.Username; - - public UserTile(User user) - { - this.user = user; - Size = new Vector2(70f); - CornerRadius = 5f; - Masking = true; - - Children = new Drawable[] - { - new Box - { - RelativeSizeAxes = Axes.Both, - Colour = OsuColour.FromHex(@"27252d"), - }, - new UpdateableAvatar - { - RelativeSizeAxes = Axes.Both, - User = user, - }, - }; - } - } - private class RoomStatusNoneSelected : RoomStatus { public override string Message => @"No Room Selected"; public override Color4 GetAppropriateColour(OsuColour colours) => colours.Gray8; } + + private class MatchParticipants : CompositeDrawable + { + private Room room; + private readonly FillFlowContainer fill; + + public Room Room + { + get { return room; } + set + { + if (room == value) + return; + + room = value; + updateParticipants(); + } + } + + public MatchParticipants() + { + Padding = new MarginPadding { Horizontal = 10 }; + + InternalChild = new ScrollContainer + { + RelativeSizeAxes = Axes.Both, + Child = fill = new FillFlowContainer + { + Spacing = new Vector2(10), + RelativeSizeAxes = Axes.X, + AutoSizeAxes = Axes.Y, + Direction = FillDirection.Full, + } + }; + } + + [Resolved] + private APIAccess api { get; set; } + + private GetRoomScoresRequest request; + + private void updateParticipants() + { + var roomId = room.RoomID.Value ?? 0; + + request?.Cancel(); + + // nice little progressive fade + int time = 500; + foreach (var c in fill.Children) + { + c.Delay(500 - time).FadeOut(time, Easing.Out); + time = Math.Max(20, time - 20); + c.Expire(); + } + + if (roomId == 0) return; + + request = new GetRoomScoresRequest(roomId); + request.Success += scores => + { + if (roomId != room.RoomID.Value) + return; + + fill.Clear(); + foreach (var s in scores) + fill.Add(new UserTile(s.User)); + + fill.FadeInFromZero(1000, Easing.OutQuint); + }; + + api.Queue(request); + } + + private class UserTile : CompositeDrawable, IHasTooltip + { + private readonly User user; + + public string TooltipText => user.Username; + + public UserTile(User user) + { + this.user = user; + Size = new Vector2(70f); + CornerRadius = 5f; + Masking = true; + + InternalChildren = new Drawable[] + { + new Box + { + RelativeSizeAxes = Axes.Both, + Colour = OsuColour.FromHex(@"27252d"), + }, + new UpdateableAvatar + { + RelativeSizeAxes = Axes.Both, + User = user, + }, + }; + } + } + } } } From 045ed741b0a253352f82b5a7806d942f1565dced Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 9 Jan 2019 15:29:27 +0900 Subject: [PATCH 19/99] Fix API getting stuck in eternal failing state if login request fails --- osu.Game/Online/API/APIAccess.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/osu.Game/Online/API/APIAccess.cs b/osu.Game/Online/API/APIAccess.cs index 10b4e73419..db273dd00a 100644 --- a/osu.Game/Online/API/APIAccess.cs +++ b/osu.Game/Online/API/APIAccess.cs @@ -101,6 +101,9 @@ namespace osu.Game.Online.API //todo: replace this with a ping request. log.Add(@"In a failing state, waiting a bit before we try again..."); Thread.Sleep(5000); + + if (!IsLoggedIn) goto case APIState.Connecting; + if (queue.Count == 0) { log.Add(@"Queueing a ping request"); From dfe35f850c2575c1e9a10563cac4e600755acae3 Mon Sep 17 00:00:00 2001 From: VINXIS Date: Wed, 9 Jan 2019 01:42:48 -0700 Subject: [PATCH 20/99] Add rebalances to lazer performance calc --- .../Difficulty/OsuPerformanceCalculator.cs | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Difficulty/OsuPerformanceCalculator.cs b/osu.Game.Rulesets.Osu/Difficulty/OsuPerformanceCalculator.cs index 16f0af9875..5f061d0954 100644 --- a/osu.Game.Rulesets.Osu/Difficulty/OsuPerformanceCalculator.cs +++ b/osu.Game.Rulesets.Osu/Difficulty/OsuPerformanceCalculator.cs @@ -105,13 +105,9 @@ namespace osu.Game.Rulesets.Osu.Difficulty double approachRateFactor = 1.0f; if (Attributes.ApproachRate > 10.33f) - approachRateFactor += 0.45f * (Attributes.ApproachRate - 10.33f); + approachRateFactor += 0.3f * (Attributes.ApproachRate - 10.33f); else if (Attributes.ApproachRate < 8.0f) { - // HD is worth more with lower ar! - if (mods.Any(h => h is OsuModHidden)) - approachRateFactor += 0.02f * (8.0f - Attributes.ApproachRate); - else approachRateFactor += 0.01f * (8.0f - Attributes.ApproachRate); } @@ -119,7 +115,7 @@ namespace osu.Game.Rulesets.Osu.Difficulty // We want to give more reward for lower AR when it comes to aim and HD. This nerfs high AR and buffs lower AR. if (mods.Any(h => h is OsuModHidden)) - aimValue *= 1.02 + (11.0f - Attributes.ApproachRate) / 50.0; // Gives a 1.04 bonus for AR10, a 1.06 bonus for AR9, a 1.02 bonus for AR11. + aimValue *= 1.0f + 0.04f * (12.0f - Attributes.ApproachRate); if (mods.Any(h => h is OsuModFlashlight)) { @@ -151,14 +147,20 @@ namespace osu.Game.Rulesets.Osu.Difficulty // Combo scaling if (beatmapMaxCombo > 0) speedValue *= Math.Min(Math.Pow(scoreMaxCombo, 0.8f) / Math.Pow(beatmapMaxCombo, 0.8f), 1.0f); + + double approachRateFactor = 1.0f; + if (Attributes.ApproachRate > 10.33f) + approachRateFactor += 0.3f * (Attributes.ApproachRate - 10.33f); + + speedValue *= approachRateFactor; if (mods.Any(m => m is OsuModHidden)) - speedValue *= 1.18f; + speedValue *= 1.0f + 0.04f * (12.0f - Attributes.ApproachRate); // Scale the speed value with accuracy _slightly_ - speedValue *= 0.5f + accuracy / 2.0f; + speedValue *= 0.02f + accuracy; // It is important to also consider accuracy difficulty when doing that - speedValue *= 0.98f + Math.Pow(Attributes.OverallDifficulty, 2) / 2500; + speedValue *= 0.96f + Math.Pow(Attributes.OverallDifficulty, 2) / 1600; return speedValue; } @@ -186,7 +188,7 @@ namespace osu.Game.Rulesets.Osu.Difficulty accuracyValue *= Math.Min(1.15f, Math.Pow(amountHitObjectsWithAccuracy / 1000.0f, 0.3f)); if (mods.Any(m => m is OsuModHidden)) - accuracyValue *= 1.02f; + accuracyValue *= 1.08f; if (mods.Any(m => m is OsuModFlashlight)) accuracyValue *= 1.02f; From a09615144ecd86876879e52841c12dcff09eb2b5 Mon Sep 17 00:00:00 2001 From: VINXIS Date: Wed, 9 Jan 2019 01:47:39 -0700 Subject: [PATCH 21/99] Kill White Space --- osu.Game.Rulesets.Osu/Difficulty/OsuPerformanceCalculator.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Osu/Difficulty/OsuPerformanceCalculator.cs b/osu.Game.Rulesets.Osu/Difficulty/OsuPerformanceCalculator.cs index 5f061d0954..efa23f1a26 100644 --- a/osu.Game.Rulesets.Osu/Difficulty/OsuPerformanceCalculator.cs +++ b/osu.Game.Rulesets.Osu/Difficulty/OsuPerformanceCalculator.cs @@ -147,7 +147,7 @@ namespace osu.Game.Rulesets.Osu.Difficulty // Combo scaling if (beatmapMaxCombo > 0) speedValue *= Math.Min(Math.Pow(scoreMaxCombo, 0.8f) / Math.Pow(beatmapMaxCombo, 0.8f), 1.0f); - + double approachRateFactor = 1.0f; if (Attributes.ApproachRate > 10.33f) approachRateFactor += 0.3f * (Attributes.ApproachRate - 10.33f); From 4f5c208672802bc3cf24a922e807e554774f9689 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 9 Jan 2019 19:01:33 +0900 Subject: [PATCH 22/99] Add UI scale Limited to (relatively) sane values until we eventually get around to adjusting UI to allow higher extermities. --- osu.Game/Configuration/OsuConfigManager.cs | 5 +++- .../Graphics/Containers/ScalingContainer.cs | 29 ++++++++++++++++++- osu.Game/OsuGame.cs | 5 +++- .../Sections/Graphics/LayoutSettings.cs | 15 +++++++++- 4 files changed, 50 insertions(+), 4 deletions(-) diff --git a/osu.Game/Configuration/OsuConfigManager.cs b/osu.Game/Configuration/OsuConfigManager.cs index 8df286ffb2..1b279eee44 100644 --- a/osu.Game/Configuration/OsuConfigManager.cs +++ b/osu.Game/Configuration/OsuConfigManager.cs @@ -105,6 +105,8 @@ namespace osu.Game.Configuration Set(OsuSetting.ScalingPositionX, 0.5f, 0f, 1f); Set(OsuSetting.ScalingPositionY, 0.5f, 0f, 1f); + + Set(OsuSetting.UIScale, 1f, 0.8f, 1.6f, 0.01f); } public OsuConfigManager(Storage storage) @@ -167,6 +169,7 @@ namespace osu.Game.Configuration ScalingPositionX, ScalingPositionY, ScalingSizeX, - ScalingSizeY + ScalingSizeY, + UIScale } } diff --git a/osu.Game/Graphics/Containers/ScalingContainer.cs b/osu.Game/Graphics/Containers/ScalingContainer.cs index ff7a1cdacf..8d21d6de10 100644 --- a/osu.Game/Graphics/Containers/ScalingContainer.cs +++ b/osu.Game/Graphics/Containers/ScalingContainer.cs @@ -46,10 +46,37 @@ namespace osu.Game.Graphics.Containers RelativeSizeAxes = Axes.Both, RelativePositionAxes = Axes.Both, CornerRadius = 10, - Child = content = new DrawSizePreservingFillContainer() + Child = content = new ScalingDrawSizePreservingFillContainer(targetMode != ScalingMode.Gameplay) }; } + private class ScalingDrawSizePreservingFillContainer : DrawSizePreservingFillContainer + { + private readonly bool applyUIScale; + private Bindable uiScale; + + public ScalingDrawSizePreservingFillContainer(bool applyUIScale) + { + this.applyUIScale = applyUIScale; + } + + [BackgroundDependencyLoader] + private void load(OsuConfigManager osuConfig) + { + if (applyUIScale) + { + uiScale = osuConfig.GetBindable(OsuSetting.UIScale); + uiScale.BindValueChanged(scaleChanged, true); + } + } + + private void scaleChanged(float value) + { + this.ScaleTo(new Vector2(value), 500, Easing.Out); + this.ResizeTo(new Vector2(1 / value), 500, Easing.Out); + } + } + [BackgroundDependencyLoader] private void load(OsuConfigManager config) { diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index bb356ce7f0..58af93a88b 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -359,7 +359,10 @@ namespace osu.Game { RelativeSizeAxes = Axes.Both, }, - mainContent = new DrawSizePreservingFillContainer(), + mainContent = new Container + { + RelativeSizeAxes = Axes.Both, + }, overlayContent = new Container { RelativeSizeAxes = Axes.Both, Depth = float.MinValue }, idleTracker = new IdleTracker(6000) }); diff --git a/osu.Game/Overlays/Settings/Sections/Graphics/LayoutSettings.cs b/osu.Game/Overlays/Settings/Sections/Graphics/LayoutSettings.cs index 3fa4276616..b336dec848 100644 --- a/osu.Game/Overlays/Settings/Sections/Graphics/LayoutSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/Graphics/LayoutSettings.cs @@ -63,9 +63,16 @@ namespace osu.Game.Overlays.Settings.Sections.Graphics RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y }, + new SettingsSlider + { + LabelText = "UI Scaling", + TransferValueOnCommit = true, + Bindable = osuConfig.GetBindable(OsuSetting.UIScale), + KeyboardStep = 0.01f + }, new SettingsEnumDropdown { - LabelText = "Scaling", + LabelText = "Screen Scaling", Bindable = osuConfig.GetBindable(OsuSetting.Scaling), }, scalingSettings = new FillFlowContainer> @@ -141,6 +148,7 @@ namespace osu.Game.Overlays.Settings.Sections.Graphics scalingSettings.ResizeHeightTo(0, transition_duration, Easing.OutQuint); scalingSettings.ForEach(s => s.TransferValueOnCommit = mode == ScalingMode.Everything); + }, true); } @@ -202,6 +210,11 @@ namespace osu.Game.Overlays.Settings.Sections.Graphics } } + private class UIScaleSlider : OsuSliderBar + { + public override string TooltipText => base.TooltipText + "x"; + } + private class ResolutionSettingsDropdown : SettingsDropdown { protected override OsuDropdown CreateDropdown() => new ResolutionDropdownControl { Items = Items }; From 5e4bea9d99e5bc422227f2e512a5a74203fd7a5b Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 10 Jan 2019 12:11:14 +0900 Subject: [PATCH 23/99] Fix extra newline --- osu.Game/Overlays/Settings/Sections/Graphics/LayoutSettings.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/osu.Game/Overlays/Settings/Sections/Graphics/LayoutSettings.cs b/osu.Game/Overlays/Settings/Sections/Graphics/LayoutSettings.cs index b336dec848..d59e2e033e 100644 --- a/osu.Game/Overlays/Settings/Sections/Graphics/LayoutSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/Graphics/LayoutSettings.cs @@ -148,7 +148,6 @@ namespace osu.Game.Overlays.Settings.Sections.Graphics scalingSettings.ResizeHeightTo(0, transition_duration, Easing.OutQuint); scalingSettings.ForEach(s => s.TransferValueOnCommit = mode == ScalingMode.Everything); - }, true); } From 4578d36a67bd5817f642029c98b4e108b546332e Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 10 Jan 2019 14:55:36 +0900 Subject: [PATCH 24/99] Add comment --- osu.Game/Graphics/Containers/LinkFlowContainer.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/osu.Game/Graphics/Containers/LinkFlowContainer.cs b/osu.Game/Graphics/Containers/LinkFlowContainer.cs index 7646ff723e..e4c18dfb3d 100644 --- a/osu.Game/Graphics/Containers/LinkFlowContainer.cs +++ b/osu.Game/Graphics/Containers/LinkFlowContainer.cs @@ -124,6 +124,9 @@ namespace osu.Game.Graphics.Containers }); } + // We want the compilers to always be visible no matter where they are, so RelativeSizeAxes is used. + // However due to https://github.com/ppy/osu-framework/issues/2073, it's possible for the compilers to be relative size in the flow's auto-size axes - an unsupported operation. + // Since the compilers don't display any content and don't affect the layout, it's simplest to exclude them from the flow. public override IEnumerable FlowingChildren => base.FlowingChildren.Where(c => !(c is DrawableLinkCompiler)); } } From 3dc3d4cb40dcbfc253ef5b59f1ecaf24d5064f37 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 10 Jan 2019 15:25:07 +0900 Subject: [PATCH 25/99] Add test --- .../Visual/TestCasePlaySongSelect.cs | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/osu.Game.Tests/Visual/TestCasePlaySongSelect.cs b/osu.Game.Tests/Visual/TestCasePlaySongSelect.cs index 29060ceb12..369d28fc91 100644 --- a/osu.Game.Tests/Visual/TestCasePlaySongSelect.cs +++ b/osu.Game.Tests/Visual/TestCasePlaySongSelect.cs @@ -57,11 +57,19 @@ namespace osu.Game.Tests.Visual private class TestSongSelect : PlaySongSelect { + public Action StartRequested; + public new Bindable Ruleset => base.Ruleset; public WorkingBeatmap CurrentBeatmap => Beatmap.Value; public WorkingBeatmap CurrentBeatmapDetailsBeatmap => BeatmapDetails.Beatmap; public new BeatmapCarousel Carousel => base.Carousel; + + protected override bool OnStart() + { + StartRequested?.Invoke(); + return base.OnStart(); + } } private TestSongSelect songSelect; @@ -182,6 +190,27 @@ namespace osu.Game.Tests.Visual void onRulesetChange(RulesetInfo ruleset) => rulesetChangeIndex = actionIndex--; } + [Test] + public void TestStartAfterUnMatchingFilterDoesNotStart() + { + addManyTestMaps(); + AddUntilStep(() => songSelect.Carousel.SelectedBeatmap != null, "has selection"); + + bool startRequested = false; + + AddStep("set filter and finalize", () => + { + songSelect.StartRequested = () => startRequested = true; + + songSelect.Carousel.Filter(new FilterCriteria { SearchText = "somestringthatshouldn'tbematchable" }); + songSelect.FinaliseSelection(); + + songSelect.StartRequested = null; + }); + + AddAssert("start not requested", () => !startRequested); + } + private void importForRuleset(int id) => AddStep($"import test map for ruleset {id}", () => manager.Import(createTestBeatmapSet(getImportId(), rulesets.AvailableRulesets.Where(r => r.ID == id).ToArray()))); private static int importId; From 17bc933db2409d8b34f4a93442e2ad1e8a08476b Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 10 Jan 2019 14:20:44 +0900 Subject: [PATCH 26/99] Revert unnecessary changes --- osu.Game.Rulesets.Osu/UI/Cursor/GameplayCursor.cs | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/osu.Game.Rulesets.Osu/UI/Cursor/GameplayCursor.cs b/osu.Game.Rulesets.Osu/UI/Cursor/GameplayCursor.cs index 332d6d4860..80beb62d6c 100644 --- a/osu.Game.Rulesets.Osu/UI/Cursor/GameplayCursor.cs +++ b/osu.Game.Rulesets.Osu/UI/Cursor/GameplayCursor.cs @@ -27,16 +27,13 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor public GameplayCursor() { - InternalChildren = new Drawable[] + InternalChild = fadeContainer = new Container { - fadeContainer = new Container + RelativeSizeAxes = Axes.Both, + Children = new Drawable[] { - RelativeSizeAxes = Axes.Both, - Children = new Drawable[] - { - new CursorTrail { Depth = 1 } - } - }, + new CursorTrail { Depth = 1 } + } }; } From 0a24d188b43aabaf63b8736c97c1a2763da7912e Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 10 Jan 2019 14:32:16 +0900 Subject: [PATCH 27/99] Remove TryGetValue as it won't work --- osu.Game/Skinning/ISkinSource.cs | 2 -- osu.Game/Skinning/LocalSkinOverrideContainer.cs | 16 ---------------- osu.Game/Skinning/Skin.cs | 10 ---------- osu.Game/Skinning/SkinManager.cs | 2 -- 4 files changed, 30 deletions(-) diff --git a/osu.Game/Skinning/ISkinSource.cs b/osu.Game/Skinning/ISkinSource.cs index 8ec8db6b64..53ac4c3454 100644 --- a/osu.Game/Skinning/ISkinSource.cs +++ b/osu.Game/Skinning/ISkinSource.cs @@ -22,7 +22,5 @@ namespace osu.Game.Skinning SampleChannel GetSample(string sampleName); TValue GetValue(Func query) where TConfiguration : SkinConfiguration; - - bool TryGetValue(Func query, out TValue val) where TConfiguration : SkinConfiguration; } } diff --git a/osu.Game/Skinning/LocalSkinOverrideContainer.cs b/osu.Game/Skinning/LocalSkinOverrideContainer.cs index 78e9822fb6..2dab671936 100644 --- a/osu.Game/Skinning/LocalSkinOverrideContainer.cs +++ b/osu.Game/Skinning/LocalSkinOverrideContainer.cs @@ -53,22 +53,6 @@ namespace osu.Game.Skinning return fallbackSource == null ? default : fallbackSource.GetValue(query); } - public bool TryGetValue(Func query, out TValue val) where TConfiguration : SkinConfiguration - { - val = default; - - if ((source as Skin)?.Configuration is TConfiguration conf) - if (beatmapSkins && query(conf, val)) - return true; - - if (fallbackSource == null) - { - return false; - } - - return fallbackSource.TryGetValue(query, out val); - } - private readonly ISkinSource source; private ISkinSource fallbackSource; diff --git a/osu.Game/Skinning/Skin.cs b/osu.Game/Skinning/Skin.cs index a4c99a8b95..21027ff4ab 100644 --- a/osu.Game/Skinning/Skin.cs +++ b/osu.Game/Skinning/Skin.cs @@ -25,16 +25,6 @@ namespace osu.Game.Skinning public TValue GetValue(Func query) where TConfiguration : SkinConfiguration => Configuration is TConfiguration conf ? query.Invoke(conf) : default; - public bool TryGetValue(Func query, out TValue val) where TConfiguration : SkinConfiguration - { - val = default; - - if (Configuration is TConfiguration conf) - return query(conf, val); - - return false; - } - protected Skin(SkinInfo skin) { SkinInfo = skin; diff --git a/osu.Game/Skinning/SkinManager.cs b/osu.Game/Skinning/SkinManager.cs index b3b2521489..454e80d8c6 100644 --- a/osu.Game/Skinning/SkinManager.cs +++ b/osu.Game/Skinning/SkinManager.cs @@ -117,7 +117,5 @@ namespace osu.Game.Skinning public SampleChannel GetSample(string sampleName) => CurrentSkin.Value.GetSample(sampleName); public TValue GetValue(Func query) where TConfiguration : SkinConfiguration => CurrentSkin.Value.GetValue(query); - - public bool TryGetValue(Func query, out TValue val) where TConfiguration : SkinConfiguration => CurrentSkin.Value.TryGetValue(query, out val); } } From c1656a7608b50215b64bb6bee960b4fcce9235da Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 10 Jan 2019 20:06:12 +0900 Subject: [PATCH 28/99] Update framework --- osu.Game/osu.Game.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 8f00e81237..6e2fa41d77 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -18,7 +18,7 @@ - + From e2dd0252259219db31c034637ad9032906718ca0 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 11 Jan 2019 16:54:42 +0900 Subject: [PATCH 29/99] Fix scaling of SkipOverlay when UI scale is adjusted Closes #4040. --- .../Visual/{TestCaseSkipButton.cs => TestCaseSkipOverlay.cs} | 2 +- osu.Game/Screens/Play/SkipOverlay.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) rename osu.Game.Tests/Visual/{TestCaseSkipButton.cs => TestCaseSkipOverlay.cs} (89%) diff --git a/osu.Game.Tests/Visual/TestCaseSkipButton.cs b/osu.Game.Tests/Visual/TestCaseSkipOverlay.cs similarity index 89% rename from osu.Game.Tests/Visual/TestCaseSkipButton.cs rename to osu.Game.Tests/Visual/TestCaseSkipOverlay.cs index 4f381fd7a8..62fb78b4ea 100644 --- a/osu.Game.Tests/Visual/TestCaseSkipButton.cs +++ b/osu.Game.Tests/Visual/TestCaseSkipOverlay.cs @@ -7,7 +7,7 @@ using osu.Game.Screens.Play; namespace osu.Game.Tests.Visual { [TestFixture] - public class TestCaseSkipButton : OsuTestCase + public class TestCaseSkipOverlay : OsuTestCase { protected override void LoadComplete() { diff --git a/osu.Game/Screens/Play/SkipOverlay.cs b/osu.Game/Screens/Play/SkipOverlay.cs index e5a6dd2db1..577a1325a9 100644 --- a/osu.Game/Screens/Play/SkipOverlay.cs +++ b/osu.Game/Screens/Play/SkipOverlay.cs @@ -46,10 +46,10 @@ namespace osu.Game.Screens.Play State = Visibility.Visible; RelativePositionAxes = Axes.Both; - RelativeSizeAxes = Axes.Both; + RelativeSizeAxes = Axes.X; Position = new Vector2(0.5f, 0.7f); - Size = new Vector2(1, 0.14f); + Size = new Vector2(1, 100); Origin = Anchor.Centre; } From 6eff79913bc508df42c3df14446a45f1784cc446 Mon Sep 17 00:00:00 2001 From: Unknown Date: Fri, 11 Jan 2019 10:34:56 +0100 Subject: [PATCH 30/99] remove blank lines --- osu.Game.Rulesets.Catch.Tests/TestCaseCatchStacker.cs | 1 - osu.Game.Rulesets.Catch.Tests/TestCaseHyperDash.cs | 1 - osu.Game.Rulesets.Catch/Difficulty/CatchDifficultyCalculator.cs | 1 - osu.Game.Rulesets.Mania/Beatmaps/ManiaBeatmapConverter.cs | 1 - osu.Game.Rulesets.Mania/Difficulty/ManiaDifficultyCalculator.cs | 1 - osu.Game.Rulesets.Mania/Objects/ManiaHitObjectDifficulty.cs | 1 - osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs | 1 - osu.Game.Tests/Beatmaps/Formats/OsuJsonDecoderTest.cs | 1 - osu.Game.Tests/Visual/TestCaseBeatmapCarousel.cs | 1 - osu.Game.Tests/Visual/TestCaseBeatmapScoresContainer.cs | 1 - osu.Game.Tests/Visual/TestCaseBreadcrumbs.cs | 1 - osu.Game.Tests/Visual/TestCaseKeyCounter.cs | 1 - osu.Game.Tests/Visual/TestCasePlayerLoader.cs | 1 - osu.Game/Online/Chat/Channel.cs | 1 - osu.Game/Overlays/Chat/Tabs/PrivateChannelTabItem.cs | 1 - osu.Game/Overlays/KeyBinding/GlobalKeyBindingsSection.cs | 1 - osu.Game/Overlays/Mods/ModSelectOverlay.cs | 1 - .../Sections/Historical/PaginatedMostPlayedBeatmapContainer.cs | 1 - osu.Game/Rulesets/Objects/Legacy/ConvertHitObjectParser.cs | 1 - osu.Game/Screens/Edit/Components/TimeInfoContainer.cs | 1 - osu.Game/Screens/Select/BeatmapCarousel.cs | 1 - osu.Game/Users/UserStatistics.cs | 1 - 22 files changed, 22 deletions(-) diff --git a/osu.Game.Rulesets.Catch.Tests/TestCaseCatchStacker.cs b/osu.Game.Rulesets.Catch.Tests/TestCaseCatchStacker.cs index 8a90b48180..baa317c759 100644 --- a/osu.Game.Rulesets.Catch.Tests/TestCaseCatchStacker.cs +++ b/osu.Game.Rulesets.Catch.Tests/TestCaseCatchStacker.cs @@ -26,7 +26,6 @@ namespace osu.Game.Rulesets.Catch.Tests } }; - for (int i = 0; i < 512; i++) beatmap.HitObjects.Add(new Fruit { X = 0.5f + i / 2048f * (i % 10 - 5), StartTime = i * 100, NewCombo = i % 8 == 0 }); diff --git a/osu.Game.Rulesets.Catch.Tests/TestCaseHyperDash.cs b/osu.Game.Rulesets.Catch.Tests/TestCaseHyperDash.cs index 14487b2c7f..3e322d485f 100644 --- a/osu.Game.Rulesets.Catch.Tests/TestCaseHyperDash.cs +++ b/osu.Game.Rulesets.Catch.Tests/TestCaseHyperDash.cs @@ -19,7 +19,6 @@ namespace osu.Game.Rulesets.Catch.Tests { var beatmap = new Beatmap { BeatmapInfo = { Ruleset = ruleset.RulesetInfo } }; - for (int i = 0; i < 512; i++) if (i % 5 < 3) beatmap.HitObjects.Add(new Fruit { X = i % 10 < 5 ? 0.02f : 0.98f, StartTime = i * 100, NewCombo = i % 8 == 0 }); diff --git a/osu.Game.Rulesets.Catch/Difficulty/CatchDifficultyCalculator.cs b/osu.Game.Rulesets.Catch/Difficulty/CatchDifficultyCalculator.cs index a763989750..b082497e5e 100644 --- a/osu.Game.Rulesets.Catch/Difficulty/CatchDifficultyCalculator.cs +++ b/osu.Game.Rulesets.Catch/Difficulty/CatchDifficultyCalculator.cs @@ -14,7 +14,6 @@ namespace osu.Game.Rulesets.Catch.Difficulty { public class CatchDifficultyCalculator : DifficultyCalculator { - /// /// In milliseconds. For difficulty calculation we will only look at the highest strain value in each time interval of size STRAIN_STEP. /// This is to eliminate higher influence of stream over aim by simply having more HitObjects with high strain. diff --git a/osu.Game.Rulesets.Mania/Beatmaps/ManiaBeatmapConverter.cs b/osu.Game.Rulesets.Mania/Beatmaps/ManiaBeatmapConverter.cs index 2770a6ff5b..1a0cfa7fbb 100644 --- a/osu.Game.Rulesets.Mania/Beatmaps/ManiaBeatmapConverter.cs +++ b/osu.Game.Rulesets.Mania/Beatmaps/ManiaBeatmapConverter.cs @@ -180,7 +180,6 @@ namespace osu.Game.Rulesets.Mania.Beatmaps foreach (var obj in newPattern.HitObjects) yield return obj; - } } diff --git a/osu.Game.Rulesets.Mania/Difficulty/ManiaDifficultyCalculator.cs b/osu.Game.Rulesets.Mania/Difficulty/ManiaDifficultyCalculator.cs index 7b4d4b12ed..133c96b16e 100644 --- a/osu.Game.Rulesets.Mania/Difficulty/ManiaDifficultyCalculator.cs +++ b/osu.Game.Rulesets.Mania/Difficulty/ManiaDifficultyCalculator.cs @@ -53,7 +53,6 @@ namespace osu.Game.Rulesets.Mania.Difficulty if (!calculateStrainValues(difficultyHitObjects, timeRate)) return new DifficultyAttributes(mods, 0); - double starRating = calculateDifficulty(difficultyHitObjects, timeRate) * star_scaling_factor; return new ManiaDifficultyAttributes(mods, starRating) diff --git a/osu.Game.Rulesets.Mania/Objects/ManiaHitObjectDifficulty.cs b/osu.Game.Rulesets.Mania/Objects/ManiaHitObjectDifficulty.cs index 390d2b0218..e191a6b1c4 100644 --- a/osu.Game.Rulesets.Mania/Objects/ManiaHitObjectDifficulty.cs +++ b/osu.Game.Rulesets.Mania/Objects/ManiaHitObjectDifficulty.cs @@ -21,7 +21,6 @@ namespace osu.Game.Rulesets.Mania.Objects private readonly int beatmapColumnCount; - private readonly double endTime; private readonly double[] heldUntil; diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs index 8c9252a2da..542b8cc3bc 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs @@ -101,7 +101,6 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables break; } - float aimRotation = MathHelper.RadiansToDegrees((float)Math.Atan2(aimRotationVector.Y - Position.Y, aimRotationVector.X - Position.X)); while (Math.Abs(aimRotation - Rotation) > 180) aimRotation += aimRotation < Rotation ? 360 : -360; diff --git a/osu.Game.Tests/Beatmaps/Formats/OsuJsonDecoderTest.cs b/osu.Game.Tests/Beatmaps/Formats/OsuJsonDecoderTest.cs index f7e1653cdd..5d45072fd2 100644 --- a/osu.Game.Tests/Beatmaps/Formats/OsuJsonDecoderTest.cs +++ b/osu.Game.Tests/Beatmaps/Formats/OsuJsonDecoderTest.cs @@ -149,7 +149,6 @@ namespace osu.Game.Tests.Beatmaps.Formats using (var stream = Resource.OpenResource(filename)) using (var sr = new StreamReader(stream)) { - var legacyDecoded = new LegacyBeatmapDecoder { ApplyOffsets = false }.Decode(sr); using (var ms = new MemoryStream()) using (var sw = new StreamWriter(ms)) diff --git a/osu.Game.Tests/Visual/TestCaseBeatmapCarousel.cs b/osu.Game.Tests/Visual/TestCaseBeatmapCarousel.cs index f156728981..bfd24f4f34 100644 --- a/osu.Game.Tests/Visual/TestCaseBeatmapCarousel.cs +++ b/osu.Game.Tests/Visual/TestCaseBeatmapCarousel.cs @@ -40,7 +40,6 @@ namespace osu.Game.Tests.Visual typeof(DrawableCarouselBeatmapSet), }; - private readonly Stack selectedSets = new Stack(); private readonly HashSet eagerSelectedIDs = new HashSet(); diff --git a/osu.Game.Tests/Visual/TestCaseBeatmapScoresContainer.cs b/osu.Game.Tests/Visual/TestCaseBeatmapScoresContainer.cs index ec85b33919..02d3acb7f4 100644 --- a/osu.Game.Tests/Visual/TestCaseBeatmapScoresContainer.cs +++ b/osu.Game.Tests/Visual/TestCaseBeatmapScoresContainer.cs @@ -55,7 +55,6 @@ namespace osu.Game.Tests.Visual AddStep("resize to normal", () => container.ResizeWidthTo(0.8f, 300)); AddStep("online scores", () => scoresContainer.Beatmap = new BeatmapInfo { OnlineBeatmapID = 75, Ruleset = new OsuRuleset().RulesetInfo }); - scores = new[] { new APIScoreInfo diff --git a/osu.Game.Tests/Visual/TestCaseBreadcrumbs.cs b/osu.Game.Tests/Visual/TestCaseBreadcrumbs.cs index 73a97c6269..678acc6130 100644 --- a/osu.Game.Tests/Visual/TestCaseBreadcrumbs.cs +++ b/osu.Game.Tests/Visual/TestCaseBreadcrumbs.cs @@ -16,7 +16,6 @@ namespace osu.Game.Tests.Visual public TestCaseBreadcrumbs() { - Add(breadcrumbs = new BreadcrumbControl { Anchor = Anchor.Centre, diff --git a/osu.Game.Tests/Visual/TestCaseKeyCounter.cs b/osu.Game.Tests/Visual/TestCaseKeyCounter.cs index 465b943651..bccc27418c 100644 --- a/osu.Game.Tests/Visual/TestCaseKeyCounter.cs +++ b/osu.Game.Tests/Visual/TestCaseKeyCounter.cs @@ -39,7 +39,6 @@ namespace osu.Game.Tests.Visual }, }; - AddStep("Add random", () => { Key key = (Key)((int)Key.A + RNG.Next(26)); diff --git a/osu.Game.Tests/Visual/TestCasePlayerLoader.cs b/osu.Game.Tests/Visual/TestCasePlayerLoader.cs index 6ec3bd108b..2240af39be 100644 --- a/osu.Game.Tests/Visual/TestCasePlayerLoader.cs +++ b/osu.Game.Tests/Visual/TestCasePlayerLoader.cs @@ -57,5 +57,4 @@ namespace osu.Game.Tests.Visual } } } - } diff --git a/osu.Game/Online/Chat/Channel.cs b/osu.Game/Online/Chat/Channel.cs index 9dc357c403..982009ed88 100644 --- a/osu.Game/Online/Chat/Channel.cs +++ b/osu.Game/Online/Chat/Channel.cs @@ -41,7 +41,6 @@ namespace osu.Game.Online.Chat /// private readonly List pendingMessages = new List(); - /// /// An event that fires when new messages arrived. /// diff --git a/osu.Game/Overlays/Chat/Tabs/PrivateChannelTabItem.cs b/osu.Game/Overlays/Chat/Tabs/PrivateChannelTabItem.cs index 804ddeabb4..d4f3e1b0ac 100644 --- a/osu.Game/Overlays/Chat/Tabs/PrivateChannelTabItem.cs +++ b/osu.Game/Overlays/Chat/Tabs/PrivateChannelTabItem.cs @@ -77,7 +77,6 @@ namespace osu.Game.Overlays.Chat.Tabs CloseButton.FadeIn(TRANSITION_LENGTH, Easing.OutQuint); } - protected override void FadeInactive() { base.FadeInactive(); diff --git a/osu.Game/Overlays/KeyBinding/GlobalKeyBindingsSection.cs b/osu.Game/Overlays/KeyBinding/GlobalKeyBindingsSection.cs index b939483cd8..a645dd86bd 100644 --- a/osu.Game/Overlays/KeyBinding/GlobalKeyBindingsSection.cs +++ b/osu.Game/Overlays/KeyBinding/GlobalKeyBindingsSection.cs @@ -18,7 +18,6 @@ namespace osu.Game.Overlays.KeyBinding Add(new InGameKeyBindingsSubsection(manager)); } - private class DefaultBindingsSubsection : KeyBindingsSubsection { protected override string Header => string.Empty; diff --git a/osu.Game/Overlays/Mods/ModSelectOverlay.cs b/osu.Game/Overlays/Mods/ModSelectOverlay.cs index 742a3830b4..915e96c0fa 100644 --- a/osu.Game/Overlays/Mods/ModSelectOverlay.cs +++ b/osu.Game/Overlays/Mods/ModSelectOverlay.cs @@ -176,7 +176,6 @@ namespace osu.Game.Overlays.Mods section.DeselectTypes(modTypes, immediate); } - private SampleChannel sampleOn, sampleOff; private void modButtonPressed(Mod selectedMod) diff --git a/osu.Game/Overlays/Profile/Sections/Historical/PaginatedMostPlayedBeatmapContainer.cs b/osu.Game/Overlays/Profile/Sections/Historical/PaginatedMostPlayedBeatmapContainer.cs index ad886c363b..41a4977a5a 100644 --- a/osu.Game/Overlays/Profile/Sections/Historical/PaginatedMostPlayedBeatmapContainer.cs +++ b/osu.Game/Overlays/Profile/Sections/Historical/PaginatedMostPlayedBeatmapContainer.cs @@ -49,7 +49,6 @@ namespace osu.Game.Overlays.Profile.Sections.Historical Api.Queue(request); } - protected override void Dispose(bool isDisposing) { base.Dispose(isDisposing); diff --git a/osu.Game/Rulesets/Objects/Legacy/ConvertHitObjectParser.cs b/osu.Game/Rulesets/Objects/Legacy/ConvertHitObjectParser.cs index 85eb29033e..7b6c89f0f5 100644 --- a/osu.Game/Rulesets/Objects/Legacy/ConvertHitObjectParser.cs +++ b/osu.Game/Rulesets/Objects/Legacy/ConvertHitObjectParser.cs @@ -124,7 +124,6 @@ namespace osu.Game.Rulesets.Objects.Legacy // osu-stable treated the first span of the slider as a repeat, but no repeats are happening repeatCount = Math.Max(0, repeatCount - 1); - if (split.Length > 7) length = Convert.ToDouble(split[7], CultureInfo.InvariantCulture); diff --git a/osu.Game/Screens/Edit/Components/TimeInfoContainer.cs b/osu.Game/Screens/Edit/Components/TimeInfoContainer.cs index 129ea2bf7d..48ef27add3 100644 --- a/osu.Game/Screens/Edit/Components/TimeInfoContainer.cs +++ b/osu.Game/Screens/Edit/Components/TimeInfoContainer.cs @@ -17,7 +17,6 @@ namespace osu.Game.Screens.Edit.Components public TimeInfoContainer() { - Children = new Drawable[] { trackTimer = new OsuSpriteText diff --git a/osu.Game/Screens/Select/BeatmapCarousel.cs b/osu.Game/Screens/Select/BeatmapCarousel.cs index 348394c1f5..63c97f9bd5 100644 --- a/osu.Game/Screens/Select/BeatmapCarousel.cs +++ b/osu.Game/Screens/Select/BeatmapCarousel.cs @@ -101,7 +101,6 @@ namespace osu.Game.Screens.Select private readonly Container scrollableContent; - public Bindable RightClickScrollingEnabled = new Bindable(); public Bindable RandomAlgorithm = new Bindable(); diff --git a/osu.Game/Users/UserStatistics.cs b/osu.Game/Users/UserStatistics.cs index f04bfb62bb..8af270454c 100644 --- a/osu.Game/Users/UserStatistics.cs +++ b/osu.Game/Users/UserStatistics.cs @@ -78,6 +78,5 @@ namespace osu.Game.Users [JsonProperty(@"country")] public int? Country; } - } } From 88d80016aa72499ec90e1d85ced314a9ad805cfe Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Tue, 15 Jan 2019 10:40:03 +0900 Subject: [PATCH 31/99] Fix out of bounds exception during indexing --- osu.Game/Beatmaps/ControlPoints/ControlPointInfo.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/osu.Game/Beatmaps/ControlPoints/ControlPointInfo.cs b/osu.Game/Beatmaps/ControlPoints/ControlPointInfo.cs index f064d53358..41056a2536 100644 --- a/osu.Game/Beatmaps/ControlPoints/ControlPointInfo.cs +++ b/osu.Game/Beatmaps/ControlPoints/ControlPointInfo.cs @@ -122,8 +122,14 @@ namespace osu.Game.Beatmaps.ControlPoints return list[pivot]; } - // l will be the first control point with Time > time, but we want the one before it - return list[l - 1]; + if (l > 0) + { + // l will be the first control point with Time > time, but we want the one before it + return list[l - 1]; + } + + // If the binary search failed, l will be unaffected + return list[l]; } } } From 117c514479bda0f92be4e430ec7a2887bb548edf Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Tue, 15 Jan 2019 19:07:25 +0900 Subject: [PATCH 32/99] Fix lazy slider calculation inaccuracy What were we doing... On /b/1221540 stable's repeat points happen 90% through the length of each span! We should use lazer's more accurate calculations. --- .../Difficulty/Preprocessing/OsuDifficultyHitObject.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Difficulty/Preprocessing/OsuDifficultyHitObject.cs b/osu.Game.Rulesets.Osu/Difficulty/Preprocessing/OsuDifficultyHitObject.cs index d8e3b340c9..1752caf74b 100644 --- a/osu.Game.Rulesets.Osu/Difficulty/Preprocessing/OsuDifficultyHitObject.cs +++ b/osu.Game.Rulesets.Osu/Difficulty/Preprocessing/OsuDifficultyHitObject.cs @@ -101,8 +101,8 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Preprocessing float approxFollowCircleRadius = (float)(slider.Radius * 3); var computeVertex = new Action(t => { - double progress = ((int)t - (int)slider.StartTime) / (float)(int)slider.SpanDuration; - if (progress % 2 > 1) + double progress = (t - slider.StartTime) / slider.SpanDuration; + if (progress % 2 >= 1) progress = 1 - progress % 1; else progress = progress % 1; From e44bc57a3da642d24f1e576953cc24b5ea234a15 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Tue, 15 Jan 2019 19:15:52 +0900 Subject: [PATCH 33/99] Fix minDistanceFromEnd using seconds rather than milliseconds Velocity in stable is defined as distance per SECOND, while lazer defines it as distance per MILLISECOND. --- osu.Game.Rulesets.Osu/Objects/Slider.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Osu/Objects/Slider.cs b/osu.Game.Rulesets.Osu/Objects/Slider.cs index 44185fb83a..69da1bef6f 100644 --- a/osu.Game.Rulesets.Osu/Objects/Slider.cs +++ b/osu.Game.Rulesets.Osu/Objects/Slider.cs @@ -198,7 +198,7 @@ namespace osu.Game.Rulesets.Osu.Objects if (tickDistance == 0) return; - var minDistanceFromEnd = Velocity * 0.01; + var minDistanceFromEnd = Velocity * 10; var spanCount = this.SpanCount(); From bfb18b4ffb85ba33a4c1d2269f7dc0e12783e3f3 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 16 Jan 2019 10:00:30 +0900 Subject: [PATCH 34/99] Update framework and other nuget packages --- osu.Desktop/OsuGameDesktop.cs | 2 +- osu.Desktop/osu.Desktop.csproj | 4 ++-- .../osu.Game.Rulesets.Catch.Tests.csproj | 2 +- .../osu.Game.Rulesets.Mania.Tests.csproj | 2 +- .../osu.Game.Rulesets.Osu.Tests.csproj | 2 +- .../osu.Game.Rulesets.Taiko.Tests.csproj | 2 +- osu.Game.Tests/osu.Game.Tests.csproj | 2 +- osu.Game/osu.Game.csproj | 5 ++--- 8 files changed, 10 insertions(+), 11 deletions(-) diff --git a/osu.Desktop/OsuGameDesktop.cs b/osu.Desktop/OsuGameDesktop.cs index 2eeb112450..0b50db1f72 100644 --- a/osu.Desktop/OsuGameDesktop.cs +++ b/osu.Desktop/OsuGameDesktop.cs @@ -97,7 +97,7 @@ namespace osu.Desktop private void fileDrop(object sender, FileDropEventArgs e) { - var filePaths = new[] { e.FileName }; + var filePaths = e.FileNames; var firstExtension = Path.GetExtension(filePaths.First()); diff --git a/osu.Desktop/osu.Desktop.csproj b/osu.Desktop/osu.Desktop.csproj index ad08f57c3a..4f0ae3d65d 100644 --- a/osu.Desktop/osu.Desktop.csproj +++ b/osu.Desktop/osu.Desktop.csproj @@ -28,8 +28,8 @@ - - + + diff --git a/osu.Game.Rulesets.Catch.Tests/osu.Game.Rulesets.Catch.Tests.csproj b/osu.Game.Rulesets.Catch.Tests/osu.Game.Rulesets.Catch.Tests.csproj index e875af5a30..feab3ed81c 100644 --- a/osu.Game.Rulesets.Catch.Tests/osu.Game.Rulesets.Catch.Tests.csproj +++ b/osu.Game.Rulesets.Catch.Tests/osu.Game.Rulesets.Catch.Tests.csproj @@ -4,7 +4,7 @@ - + diff --git a/osu.Game.Rulesets.Mania.Tests/osu.Game.Rulesets.Mania.Tests.csproj b/osu.Game.Rulesets.Mania.Tests/osu.Game.Rulesets.Mania.Tests.csproj index 0c6fbfa7d3..e26d2433f9 100644 --- a/osu.Game.Rulesets.Mania.Tests/osu.Game.Rulesets.Mania.Tests.csproj +++ b/osu.Game.Rulesets.Mania.Tests/osu.Game.Rulesets.Mania.Tests.csproj @@ -4,7 +4,7 @@ - + diff --git a/osu.Game.Rulesets.Osu.Tests/osu.Game.Rulesets.Osu.Tests.csproj b/osu.Game.Rulesets.Osu.Tests/osu.Game.Rulesets.Osu.Tests.csproj index 35f137572d..273d29c3de 100644 --- a/osu.Game.Rulesets.Osu.Tests/osu.Game.Rulesets.Osu.Tests.csproj +++ b/osu.Game.Rulesets.Osu.Tests/osu.Game.Rulesets.Osu.Tests.csproj @@ -4,7 +4,7 @@ - + diff --git a/osu.Game.Rulesets.Taiko.Tests/osu.Game.Rulesets.Taiko.Tests.csproj b/osu.Game.Rulesets.Taiko.Tests/osu.Game.Rulesets.Taiko.Tests.csproj index 0fc01deed6..fade054382 100644 --- a/osu.Game.Rulesets.Taiko.Tests/osu.Game.Rulesets.Taiko.Tests.csproj +++ b/osu.Game.Rulesets.Taiko.Tests/osu.Game.Rulesets.Taiko.Tests.csproj @@ -4,7 +4,7 @@ - + diff --git a/osu.Game.Tests/osu.Game.Tests.csproj b/osu.Game.Tests/osu.Game.Tests.csproj index e6786dfd15..b22c1aed99 100644 --- a/osu.Game.Tests/osu.Game.Tests.csproj +++ b/osu.Game.Tests/osu.Game.Tests.csproj @@ -5,7 +5,7 @@ - + diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 6e2fa41d77..2d81a9657b 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -15,10 +15,9 @@ - - + + - From bd6c845fc83c99bb5fea95643f92e16722f575df Mon Sep 17 00:00:00 2001 From: Kyle Chang Date: Tue, 15 Jan 2019 22:40:56 -0500 Subject: [PATCH 35/99] Use IApplicableToBeatmap for mirror and random mania mods --- osu.Game.Rulesets.Mania/Mods/ManiaModMirror.cs | 12 ++++++------ osu.Game.Rulesets.Mania/Mods/ManiaModRandom.cs | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/osu.Game.Rulesets.Mania/Mods/ManiaModMirror.cs b/osu.Game.Rulesets.Mania/Mods/ManiaModMirror.cs index 68325b40bf..34e65e8b02 100644 --- a/osu.Game.Rulesets.Mania/Mods/ManiaModMirror.cs +++ b/osu.Game.Rulesets.Mania/Mods/ManiaModMirror.cs @@ -3,14 +3,14 @@ using osu.Framework.Extensions.IEnumerableExtensions; using osu.Game.Rulesets.Mania.Objects; -using osu.Game.Rulesets.Mania.UI; using osu.Game.Rulesets.Mods; -using osu.Game.Rulesets.UI; using System.Linq; +using osu.Game.Beatmaps; +using osu.Game.Rulesets.Mania.Beatmaps; namespace osu.Game.Rulesets.Mania.Mods { - public class ManiaModMirror : Mod, IApplicableToRulesetContainer + public class ManiaModMirror : Mod, IApplicableToBeatmap { public override string Name => "Mirror"; public override string Acronym => "MR"; @@ -18,11 +18,11 @@ namespace osu.Game.Rulesets.Mania.Mods public override double ScoreMultiplier => 1; public override bool Ranked => true; - public void ApplyToRulesetContainer(RulesetContainer rulesetContainer) + public void ApplyToBeatmap(Beatmap beatmap) { - var availableColumns = ((ManiaRulesetContainer)rulesetContainer).Beatmap.TotalColumns; + var availableColumns = ((ManiaBeatmap)beatmap).TotalColumns; - rulesetContainer.Objects.OfType().ForEach(h => h.Column = availableColumns - 1 - h.Column); + beatmap.HitObjects.OfType().ForEach(h => h.Column = availableColumns - 1 - h.Column); } } } diff --git a/osu.Game.Rulesets.Mania/Mods/ManiaModRandom.cs b/osu.Game.Rulesets.Mania/Mods/ManiaModRandom.cs index b3a3d4280b..4454012d01 100644 --- a/osu.Game.Rulesets.Mania/Mods/ManiaModRandom.cs +++ b/osu.Game.Rulesets.Mania/Mods/ManiaModRandom.cs @@ -4,15 +4,15 @@ using System.Linq; using osu.Framework.Extensions.IEnumerableExtensions; using osu.Framework.MathUtils; +using osu.Game.Beatmaps; using osu.Game.Graphics; +using osu.Game.Rulesets.Mania.Beatmaps; using osu.Game.Rulesets.Mania.Objects; -using osu.Game.Rulesets.Mania.UI; using osu.Game.Rulesets.Mods; -using osu.Game.Rulesets.UI; namespace osu.Game.Rulesets.Mania.Mods { - public class ManiaModRandom : Mod, IApplicableToRulesetContainer + public class ManiaModRandom : Mod, IApplicableToBeatmap { public override string Name => "Random"; public override string Acronym => "RD"; @@ -21,12 +21,12 @@ namespace osu.Game.Rulesets.Mania.Mods public override string Description => @"Shuffle around the keys!"; public override double ScoreMultiplier => 1; - public void ApplyToRulesetContainer(RulesetContainer rulesetContainer) + public void ApplyToBeatmap(Beatmap beatmap) { - var availableColumns = ((ManiaRulesetContainer)rulesetContainer).Beatmap.TotalColumns; + var availableColumns = ((ManiaBeatmap)beatmap).TotalColumns; var shuffledColumns = Enumerable.Range(0, availableColumns).OrderBy(item => RNG.Next()).ToList(); - rulesetContainer.Objects.OfType().ForEach(h => h.Column = shuffledColumns[h.Column]); + beatmap.HitObjects.OfType().ForEach(h => h.Column = shuffledColumns[h.Column]); } } } From 3abfaea7acef21fafb3d283e2a024432b05c2ce4 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 16 Jan 2019 17:21:26 +0900 Subject: [PATCH 36/99] Stop cursor from sticking to edges of scaled game window --- osu.Game/Graphics/Containers/ScalingContainer.cs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/osu.Game/Graphics/Containers/ScalingContainer.cs b/osu.Game/Graphics/Containers/ScalingContainer.cs index 8d21d6de10..62760b39ea 100644 --- a/osu.Game/Graphics/Containers/ScalingContainer.cs +++ b/osu.Game/Graphics/Containers/ScalingContainer.cs @@ -28,6 +28,8 @@ namespace osu.Game.Graphics.Containers private readonly Container content; protected override Container Content => content; + public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => true; + private readonly Container sizableContainer; private Drawable backgroundLayer; @@ -41,7 +43,7 @@ namespace osu.Game.Graphics.Containers this.targetMode = targetMode; RelativeSizeAxes = Axes.Both; - InternalChild = sizableContainer = new Container + InternalChild = sizableContainer = new AlwaysInputContainer { RelativeSizeAxes = Axes.Both, RelativePositionAxes = Axes.Both, @@ -55,6 +57,8 @@ namespace osu.Game.Graphics.Containers private readonly bool applyUIScale; private Bindable uiScale; + public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => true; + public ScalingDrawSizePreservingFillContainer(bool applyUIScale) { this.applyUIScale = applyUIScale; @@ -143,5 +147,15 @@ namespace osu.Game.Graphics.Containers sizableContainer.MoveTo(targetPosition, 500, Easing.OutQuart); sizableContainer.ResizeTo(targetSize, 500, Easing.OutQuart).OnComplete(_ => { sizableContainer.Masking = requiresMasking; }); } + + private class AlwaysInputContainer : Container + { + public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => true; + + public AlwaysInputContainer() + { + RelativeSizeAxes = Axes.Both; + } + } } } From 5ff58870b8bdcf5113e0417f8b483c0288dc0606 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 16 Jan 2019 19:05:46 +0900 Subject: [PATCH 37/99] Update framework --- osu.Game/osu.Game.csproj | 1 + 1 file changed, 1 insertion(+) diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 2d81a9657b..344667c41a 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -18,6 +18,7 @@ + From a8e9adafdb0c35b567fba55b39ed82e7836fc5f2 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Wed, 16 Jan 2019 19:58:01 +0900 Subject: [PATCH 38/99] Fix final section not being saved --- osu.Game.Rulesets.Osu/Difficulty/OsuDifficultyCalculator.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/osu.Game.Rulesets.Osu/Difficulty/OsuDifficultyCalculator.cs b/osu.Game.Rulesets.Osu/Difficulty/OsuDifficultyCalculator.cs index 8fc2b69267..4f01dbe2f3 100644 --- a/osu.Game.Rulesets.Osu/Difficulty/OsuDifficultyCalculator.cs +++ b/osu.Game.Rulesets.Osu/Difficulty/OsuDifficultyCalculator.cs @@ -57,6 +57,10 @@ namespace osu.Game.Rulesets.Osu.Difficulty s.Process(h); } + // The peak strain will not be saved for the last section in the above loop + foreach (Skill s in skills) + s.SaveCurrentPeak(); + double aimRating = Math.Sqrt(skills[0].DifficultyValue()) * difficulty_multiplier; double speedRating = Math.Sqrt(skills[1].DifficultyValue()) * difficulty_multiplier; double starRating = aimRating + speedRating + Math.Abs(aimRating - speedRating) / 2; From b6fb3a5c05ae4511b4b36e26b1a51fddfffbac6a Mon Sep 17 00:00:00 2001 From: ekrctb Date: Thu, 17 Jan 2019 15:14:30 +0900 Subject: [PATCH 39/99] Cancel request on disposal for RoomInspector --- osu.Game/Screens/Multi/Lounge/Components/RoomInspector.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/osu.Game/Screens/Multi/Lounge/Components/RoomInspector.cs b/osu.Game/Screens/Multi/Lounge/Components/RoomInspector.cs index 63730ff635..2d523aa82b 100644 --- a/osu.Game/Screens/Multi/Lounge/Components/RoomInspector.cs +++ b/osu.Game/Screens/Multi/Lounge/Components/RoomInspector.cs @@ -297,6 +297,12 @@ namespace osu.Game.Screens.Multi.Lounge.Components api.Queue(request); } + protected override void Dispose(bool isDisposing) + { + request?.Cancel(); + base.Dispose(isDisposing); + } + private class UserTile : CompositeDrawable, IHasTooltip { private readonly User user; From f982b6da55f3108ce53b67935757941792dae122 Mon Sep 17 00:00:00 2001 From: ekrctb Date: Thu, 17 Jan 2019 16:00:11 +0900 Subject: [PATCH 40/99] Don't hide 'hold for menu' even hud is hidden --- osu.Game/Screens/Play/HUDOverlay.cs | 52 ++++++++++++++--------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/osu.Game/Screens/Play/HUDOverlay.cs b/osu.Game/Screens/Play/HUDOverlay.cs index 11cee98bdf..cc665d99a1 100644 --- a/osu.Game/Screens/Play/HUDOverlay.cs +++ b/osu.Game/Screens/Play/HUDOverlay.cs @@ -24,8 +24,6 @@ namespace osu.Game.Screens.Play { private const int duration = 100; - private readonly Container content; - public readonly KeyCounterCollection KeyCounter; public readonly RollingCounter ComboCounter; public readonly ScoreCounter ScoreCounter; @@ -37,6 +35,7 @@ namespace osu.Game.Screens.Play public readonly PlayerSettingsOverlay PlayerSettingsOverlay; private Bindable showHud; + private readonly Container visibilityContainer; private readonly BindableBool replayLoaded = new BindableBool(); private static bool hasShownNotificationOnce; @@ -45,34 +44,35 @@ namespace osu.Game.Screens.Play { RelativeSizeAxes = Axes.Both; - Add(content = new Container + Children = new Drawable[] { - RelativeSizeAxes = Axes.Both, - AlwaysPresent = true, // The hud may be hidden but certain elements may need to still be updated - Children = new Drawable[] + visibilityContainer = new Container { + RelativeSizeAxes = Axes.Both, + AlwaysPresent = true, // The hud may be hidden but certain elements may need to still be updated + Children = new Drawable[] { + ComboCounter = CreateComboCounter(), + ScoreCounter = CreateScoreCounter(), + AccuracyCounter = CreateAccuracyCounter(), + HealthDisplay = CreateHealthDisplay(), + Progress = CreateProgress(), + ModDisplay = CreateModsContainer(), + PlayerSettingsOverlay = CreatePlayerSettingsOverlay(), + } + }, + new FillFlowContainer { - ComboCounter = CreateComboCounter(), - ScoreCounter = CreateScoreCounter(), - AccuracyCounter = CreateAccuracyCounter(), - HealthDisplay = CreateHealthDisplay(), - Progress = CreateProgress(), - ModDisplay = CreateModsContainer(), - PlayerSettingsOverlay = CreatePlayerSettingsOverlay(), - new FillFlowContainer + Anchor = Anchor.BottomRight, + Origin = Anchor.BottomRight, + Position = -new Vector2(5, TwoLayerButton.SIZE_RETRACTED.Y), + AutoSizeAxes = Axes.Both, + Direction = FillDirection.Vertical, + Children = new Drawable[] { - Anchor = Anchor.BottomRight, - Origin = Anchor.BottomRight, - Position = -new Vector2(5, TwoLayerButton.SIZE_RETRACTED.Y), - AutoSizeAxes = Axes.Both, - Direction = FillDirection.Vertical, - Children = new Drawable[] - { - KeyCounter = CreateKeyCounter(adjustableClock as IFrameBasedClock), - HoldToQuit = CreateHoldForMenuButton(), - } + KeyCounter = CreateKeyCounter(adjustableClock as IFrameBasedClock), + HoldToQuit = CreateHoldForMenuButton(), } } - }); + }; BindProcessor(scoreProcessor); BindRulesetContainer(rulesetContainer); @@ -91,7 +91,7 @@ namespace osu.Game.Screens.Play private void load(OsuConfigManager config, NotificationOverlay notificationOverlay) { showHud = config.GetBindable(OsuSetting.ShowInterface); - showHud.ValueChanged += hudVisibility => content.FadeTo(hudVisibility ? 1 : 0, duration); + showHud.ValueChanged += hudVisibility => visibilityContainer.FadeTo(hudVisibility ? 1 : 0, duration); showHud.TriggerChange(); if (!showHud && !hasShownNotificationOnce) From 6bfae52305c759ded078d53f2dd93d38c196ac36 Mon Sep 17 00:00:00 2001 From: ekrctb Date: Thu, 17 Jan 2019 17:03:53 +0900 Subject: [PATCH 41/99] Fix sliders don't show tooltip until first change --- osu.Game/Graphics/UserInterface/OsuSliderBar.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/osu.Game/Graphics/UserInterface/OsuSliderBar.cs b/osu.Game/Graphics/UserInterface/OsuSliderBar.cs index 2bd84ab2b4..e0f38a13d0 100644 --- a/osu.Game/Graphics/UserInterface/OsuSliderBar.cs +++ b/osu.Game/Graphics/UserInterface/OsuSliderBar.cs @@ -92,6 +92,12 @@ namespace osu.Game.Graphics.UserInterface AccentColour = colours.Pink; } + protected override void LoadComplete() + { + updateTooltipText(Current.Value); + base.LoadComplete(); + } + protected override bool OnHover(HoverEvent e) { Nub.Glowing = true; From 2bc3464802c75a45ee5cfc852de2acd0e618d8fb Mon Sep 17 00:00:00 2001 From: ekrctb Date: Thu, 17 Jan 2019 17:27:34 +0900 Subject: [PATCH 42/99] Hide Room tab when Settings tab is active --- osu.Game/Screens/Multi/Match/MatchSubScreen.cs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/osu.Game/Screens/Multi/Match/MatchSubScreen.cs b/osu.Game/Screens/Multi/Match/MatchSubScreen.cs index 14cdd90128..bc3b2c74d4 100644 --- a/osu.Game/Screens/Multi/Match/MatchSubScreen.cs +++ b/osu.Game/Screens/Multi/Match/MatchSubScreen.cs @@ -51,6 +51,8 @@ namespace osu.Game.Screens.Multi.Match MatchChatDisplay chat; Components.Header header; + Info info; + GridContainer bottomRow; MatchSettingsOverlay settings; Children = new Drawable[] @@ -61,10 +63,10 @@ namespace osu.Game.Screens.Multi.Match Content = new[] { new Drawable[] { header = new Components.Header(room) { Depth = -1 } }, - new Drawable[] { new Info(room) { OnStart = onStart } }, + new Drawable[] { info = new Info(room) { OnStart = onStart } }, new Drawable[] { - new GridContainer + bottomRow = new GridContainer { RelativeSizeAxes = Axes.Both, Content = new[] @@ -110,9 +112,17 @@ namespace osu.Game.Screens.Multi.Match header.Tabs.Current.ValueChanged += t => { if (t is SettingsMatchPage) + { settings.Show(); + info.Hide(); + bottomRow.Hide(); + } else + { settings.Hide(); + info.Show(); + bottomRow.Show(); + } }; chat.Exit += Exit; From 491537b8ba7c9e2a5fc408a56f931d7937c5de69 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 17 Jan 2019 18:13:05 +0900 Subject: [PATCH 43/99] Add fade duration Not really visible in the existing usage, but once we enable the settings tab it will be required. Tested by manually enabling it. --- osu.Game/Screens/Multi/Match/MatchSubScreen.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/osu.Game/Screens/Multi/Match/MatchSubScreen.cs b/osu.Game/Screens/Multi/Match/MatchSubScreen.cs index bc3b2c74d4..a7932e1131 100644 --- a/osu.Game/Screens/Multi/Match/MatchSubScreen.cs +++ b/osu.Game/Screens/Multi/Match/MatchSubScreen.cs @@ -111,17 +111,18 @@ namespace osu.Game.Screens.Multi.Match header.OnRequestSelectBeatmap = () => Push(new MatchSongSelect { Selected = addPlaylistItem }); header.Tabs.Current.ValueChanged += t => { + const float fade_duration = 500; if (t is SettingsMatchPage) { settings.Show(); - info.Hide(); - bottomRow.Hide(); + info.FadeOut(fade_duration, Easing.OutQuint); + bottomRow.FadeOut(fade_duration, Easing.OutQuint); } else { settings.Hide(); - info.Show(); - bottomRow.Show(); + info.FadeIn(fade_duration, Easing.OutQuint); + bottomRow.FadeIn(fade_duration, Easing.OutQuint); } }; From ba9cdf2ce2706794f3481679cfe853b8d3650f99 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 17 Jan 2019 18:17:47 +0900 Subject: [PATCH 44/99] Add null check to fix crash on deselecting multiplayer room --- osu.Game/Screens/Multi/Lounge/Components/RoomInspector.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Screens/Multi/Lounge/Components/RoomInspector.cs b/osu.Game/Screens/Multi/Lounge/Components/RoomInspector.cs index 2d523aa82b..665481934e 100644 --- a/osu.Game/Screens/Multi/Lounge/Components/RoomInspector.cs +++ b/osu.Game/Screens/Multi/Lounge/Components/RoomInspector.cs @@ -266,7 +266,7 @@ namespace osu.Game.Screens.Multi.Lounge.Components private void updateParticipants() { - var roomId = room.RoomID.Value ?? 0; + var roomId = room?.RoomID.Value ?? 0; request?.Cancel(); From 59f7c5a26e466d06070610ff0dfd14740e0914dd Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 17 Jan 2019 18:44:22 +0900 Subject: [PATCH 45/99] Fix room inspector cover not resetting when no room selected --- .../Lounge/Components/ParticipantInfo.cs | 10 +++++-- osu.Game/Screens/Multi/RoomBindings.cs | 29 +++++++++---------- 2 files changed, 20 insertions(+), 19 deletions(-) diff --git a/osu.Game/Screens/Multi/Lounge/Components/ParticipantInfo.cs b/osu.Game/Screens/Multi/Lounge/Components/ParticipantInfo.cs index 34fc7fe886..228bacf3f3 100644 --- a/osu.Game/Screens/Multi/Lounge/Components/ParticipantInfo.cs +++ b/osu.Game/Screens/Multi/Lounge/Components/ParticipantInfo.cs @@ -93,10 +93,14 @@ namespace osu.Game.Screens.Multi.Lounge.Components Host.BindValueChanged(v => { hostText.Clear(); - hostText.AddText("hosted by "); - hostText.AddLink(v.Username, null, LinkAction.OpenUserProfile, v.Id.ToString(), "Open profile", s => s.Font = "Exo2.0-BoldItalic"); + flagContainer.Clear(); - flagContainer.Child = new DrawableFlag(v.Country) { RelativeSizeAxes = Axes.Both }; + if (v != null) + { + hostText.AddText("hosted by "); + hostText.AddLink(v.Username, null, LinkAction.OpenUserProfile, v.Id.ToString(), "Open profile", s => s.Font = "Exo2.0-BoldItalic"); + flagContainer.Child = new DrawableFlag(v.Country) { RelativeSizeAxes = Axes.Both }; + } }); ParticipantCount.BindValueChanged(v => summary.Text = $"{v:#,0}{" participant".Pluralize(v == 1)}"); diff --git a/osu.Game/Screens/Multi/RoomBindings.cs b/osu.Game/Screens/Multi/RoomBindings.cs index 30e2918b69..e7f9e323bc 100644 --- a/osu.Game/Screens/Multi/RoomBindings.cs +++ b/osu.Game/Screens/Multi/RoomBindings.cs @@ -53,23 +53,20 @@ namespace osu.Game.Screens.Multi Duration.UnbindFrom(room.Duration); } - room = value; + room = value ?? new Room(); - if (room != null) - { - RoomID.BindTo(room.RoomID); - Name.BindTo(room.Name); - Host.BindTo(room.Host); - Status.BindTo(room.Status); - Type.BindTo(room.Type); - Playlist.BindTo(room.Playlist); - Participants.BindTo(room.Participants); - ParticipantCount.BindTo(room.ParticipantCount); - MaxParticipants.BindTo(room.MaxParticipants); - EndDate.BindTo(room.EndDate); - Availability.BindTo(room.Availability); - Duration.BindTo(room.Duration); - } + RoomID.BindTo(room.RoomID); + Name.BindTo(room.Name); + Host.BindTo(room.Host); + Status.BindTo(room.Status); + Type.BindTo(room.Type); + Playlist.BindTo(room.Playlist); + Participants.BindTo(room.Participants); + ParticipantCount.BindTo(room.ParticipantCount); + MaxParticipants.BindTo(room.MaxParticipants); + EndDate.BindTo(room.EndDate); + Availability.BindTo(room.Availability); + Duration.BindTo(room.Duration); } } From d16f4af92b35692caa3f43c0a4b3934cd39618d7 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 17 Jan 2019 19:18:40 +0900 Subject: [PATCH 46/99] Use TransferValueOnCommit for mouse sensitivity --- .../Settings/Sections/Input/MouseSettings.cs | 53 +------------------ 1 file changed, 1 insertion(+), 52 deletions(-) diff --git a/osu.Game/Overlays/Settings/Sections/Input/MouseSettings.cs b/osu.Game/Overlays/Settings/Sections/Input/MouseSettings.cs index c4d180790c..be264e8cdf 100644 --- a/osu.Game/Overlays/Settings/Sections/Input/MouseSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/Input/MouseSettings.cs @@ -78,66 +78,15 @@ namespace osu.Game.Overlays.Settings.Sections.Input private class SensitivitySetting : SettingsSlider { - public override Bindable Bindable - { - get { return ((SensitivitySlider)Control).Sensitivity; } - - set - { - BindableDouble doubleValue = (BindableDouble)value; - - // create a second layer of bindable so we can only handle state changes when not being dragged. - ((SensitivitySlider)Control).Sensitivity = doubleValue; - - // this bindable will still act as the "interactive" bindable displayed during a drag. - base.Bindable = new BindableDouble(doubleValue.Value) - { - Default = doubleValue.Default, - MinValue = doubleValue.MinValue, - MaxValue = doubleValue.MaxValue - }; - - // one-way binding to update the sliderbar with changes from external actions. - doubleValue.DisabledChanged += disabled => base.Bindable.Disabled = disabled; - doubleValue.ValueChanged += newValue => base.Bindable.Value = newValue; - } - } - public SensitivitySetting() { KeyboardStep = 0.01f; + TransferValueOnCommit = true; } } private class SensitivitySlider : OsuSliderBar { - public Bindable Sensitivity; - - public SensitivitySlider() - { - Current.ValueChanged += newValue => - { - if (!isDragging && Sensitivity != null) - Sensitivity.Value = newValue; - }; - } - - private bool isDragging; - - protected override bool OnDragStart(DragStartEvent e) - { - isDragging = true; - return base.OnDragStart(e); - } - - protected override bool OnDragEnd(DragEndEvent e) - { - isDragging = false; - Current.TriggerChange(); - - return base.OnDragEnd(e); - } - public override string TooltipText => Current.Disabled ? "Enable raw input to adjust sensitivity" : Current.Value.ToString(@"0.##x"); } } From 93a08bdb2384ef078197b49506cf1a701c2e063c Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 17 Jan 2019 20:23:15 +0900 Subject: [PATCH 47/99] Remove stray using --- osu.Game/Overlays/Settings/Sections/Input/MouseSettings.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/osu.Game/Overlays/Settings/Sections/Input/MouseSettings.cs b/osu.Game/Overlays/Settings/Sections/Input/MouseSettings.cs index be264e8cdf..e5cde37254 100644 --- a/osu.Game/Overlays/Settings/Sections/Input/MouseSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/Input/MouseSettings.cs @@ -5,7 +5,6 @@ using osu.Framework.Allocation; using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Framework.Input; -using osu.Framework.Input.Events; using osu.Game.Configuration; using osu.Game.Graphics.UserInterface; From b904bd9e8f2fd02bc45cae0c2bb219cf6285415b Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 17 Jan 2019 22:13:41 +0900 Subject: [PATCH 48/99] Update framework --- osu.Game/osu.Game.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 344667c41a..9365169873 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -18,7 +18,7 @@ - + From 2f0abeb4e9f0176af4daa1376cc14cc86462614e Mon Sep 17 00:00:00 2001 From: Llaurence Date: Thu, 17 Jan 2019 18:19:30 +0100 Subject: [PATCH 49/99] Update 'Building and Running' in README.md --- README.md | 65 ++++++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 55 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index a2f6472371..3dd96773f2 100644 --- a/README.md +++ b/README.md @@ -13,23 +13,68 @@ We are accepting bug reports (please report with as much detail as possible). Fe - A desktop platform with the [.NET Core SDK 2.2](https://www.microsoft.com/net/learn/get-started) or higher installed. - When working with the codebase, we recommend using an IDE with intellisense and syntax highlighting, such as [Visual Studio Community Edition](https://www.visualstudio.com/) (Windows), [Visual Studio Code](https://code.visualstudio.com/) (with the C# plugin installed) or [Jetbrains Rider](https://www.jetbrains.com/rider/) (commercial). -# Building and running +# Running osu! -If you are not interested in developing the game, please head over to the [releases](https://github.com/ppy/osu/releases) to download a precompiled build with automatic updating enabled (download and run the install executable for your platform). +## Releases -Clone the repository including submodules +If you are not interested in developing the game, please head over to the [releases](https://github.com/ppy/osu/releases) to download a precompiled build with automatic updating enabled. -`git clone --recurse-submodules https://github.com/ppy/osu` +- Windows 64 bit users should download and run `install.exe`. +- MacOS users should download and run `osu.app.zip`. -Build and run +There is currently no release for Windows 32 bit, Linux, or any other platform. If you are not running Windows 64 bit or MacOS, you should build osu! from the source code (see bellow). -- Using Visual Studio 2017, Rider or Visual Studio Code (configurations are included) -- From command line using `dotnet run --project osu.Desktop`. When building for non-development purposes, add `-c Release` to gain higher performance. -- To run with code analysis, instead use `powershell ./build.ps1` or `build.sh`. This is currently only supported under windows due to [resharper cli shortcomings](https://youtrack.jetbrains.com/issue/RSRP-410004). Alternative, you can install resharper or use rider to get inline support in your IDE of choice. +## Downloading the source code -Note: If you run from command line under linux, you will need to prefix the output folder to your `LD_LIBRARY_PATH`. See `.vscode/launch.json` for an example +Clone the repository **including submodules**: -If you run into issues building you may need to restore nuget packages (commonly via `dotnet restore`). Visual Studio Code users must run `Restore` task from debug tab before attempt to build. +``` +git clone --recurse-submodules https://github.com/ppy/osu +cd osu +``` + +> If you forgot the `--recurse-submodules` option, run this command inside the `osu` directory: +> +> `git submodule update --init --recursive` + +To update the source code to the latest commit, run the following command inside the `osu` directory: + +``` +git pull --recurse-submodules +``` + +## Building + +Configuration for Visual Studio 2017, Rider and Visual Studio Code is included in the source code. + +> Visual Studio Code users must run the `Restore` task before any build attempt. + +You can also build osu! from the command-line, with `dotnet`: + +``` +dotnet restore +dotnet run --project osu.Desktop -c Release +``` + +The `-c Release` option **must be omitted** when building for development purposes. + +### A note for Linux users + +On Linux, the environment variable `LD_LIBRARY_PATH` must point to the build directory (replace `Release` with `Debug` in the following paths if you do not want to include the `-c Release` flag). + +The build directory is located at `osu.Desktop/bin/Release/netcoreappX.X`, where `X.X` is the version of the .NET Core SDK (see Requirements). The required value can be found in `osu.Desktop/osu.Desktop.csproj`, look for a line starting with "TargetFramework". + +For example, you can run osu! with the following commands: + +``` +export NETCORE_VERSION="$(grep TargetFramework osu.Desktop/osu.Desktop.csproj | sed -r 's/.*>(.*)<\/.*/\1/')" +export LD_LIBRARY_PATH="$(pwd)/osu.Desktop/bin/Release/$NETCORE_VERSION" +dotnet run --project osu.Desktop -c Release +``` + +## Code analysis + +Code analysis can be run with `powershell ./build.ps1` or `build.sh`. This is currently only supported under windows due to [resharper cli shortcomings](https://youtrack.jetbrains.com/issue/RSRP-410004). Alternative, you can install resharper or use rider to get inline support in your IDE of choice. # Contributing From 0c26145fd105fff9470fa46dc9455f9b00ece4e8 Mon Sep 17 00:00:00 2001 From: Yusuf Bera Ertan Date: Thu, 17 Jan 2019 19:23:44 +0000 Subject: [PATCH 50/99] bellow -> below Co-Authored-By: Llaurence <40535137+Llaurence@users.noreply.github.com> --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3dd96773f2..36dfe4fc7c 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ If you are not interested in developing the game, please head over to the [relea - Windows 64 bit users should download and run `install.exe`. - MacOS users should download and run `osu.app.zip`. -There is currently no release for Windows 32 bit, Linux, or any other platform. If you are not running Windows 64 bit or MacOS, you should build osu! from the source code (see bellow). +There is currently no release for Windows 32 bit, Linux, or any other platform. If you are not running Windows 64 bit or MacOS, you should build osu! from the source code (see below). ## Downloading the source code From 42fa04beee4fddcc9ccaeda52870e53064d0f781 Mon Sep 17 00:00:00 2001 From: nwabear <35433620+nwabear@users.noreply.github.com> Date: Thu, 17 Jan 2019 14:40:22 -0600 Subject: [PATCH 51/99] Update SkinSection.cs Added "Use beatmap skins" button to general settings --- osu.Game/Overlays/Settings/Sections/SkinSection.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/osu.Game/Overlays/Settings/Sections/SkinSection.cs b/osu.Game/Overlays/Settings/Sections/SkinSection.cs index e259996b7f..2fa23e175d 100644 --- a/osu.Game/Overlays/Settings/Sections/SkinSection.cs +++ b/osu.Game/Overlays/Settings/Sections/SkinSection.cs @@ -48,6 +48,11 @@ namespace osu.Game.Overlays.Settings.Sections KeyboardStep = 0.01f }, new SettingsCheckbox + { + LabelText = "Use beatmap skins", + Bindable = config.GetBindable(OsuSetting.BeatmapSkins) + }, + new SettingsCheckbox { LabelText = "Adjust gameplay cursor size based on current beatmap", Bindable = config.GetBindable(OsuSetting.AutoCursorSize) From 209deb842af7769308f7de07e691fe1a48bb0419 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 18 Jan 2019 16:14:52 +0900 Subject: [PATCH 52/99] Add note about iOS --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 36dfe4fc7c..9c484503fe 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,7 @@ If you are not interested in developing the game, please head over to the [relea - Windows 64 bit users should download and run `install.exe`. - MacOS users should download and run `osu.app.zip`. +- iOS users can join the [TestFlight beta program](https://t.co/xQJmHkfC18). There is currently no release for Windows 32 bit, Linux, or any other platform. If you are not running Windows 64 bit or MacOS, you should build osu! from the source code (see below). From 858541bcf41552f3b4cb98da851f934a31111fee Mon Sep 17 00:00:00 2001 From: Bear Daniel Date: Fri, 18 Jan 2019 02:33:39 -0600 Subject: [PATCH 53/99] Added "Use beatmap hitsounds" button to volume section of settings --- osu.Game/Overlays/Settings/Sections/Audio/VolumeSettings.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/osu.Game/Overlays/Settings/Sections/Audio/VolumeSettings.cs b/osu.Game/Overlays/Settings/Sections/Audio/VolumeSettings.cs index fa4a714ba3..57afe0334c 100644 --- a/osu.Game/Overlays/Settings/Sections/Audio/VolumeSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/Audio/VolumeSettings.cs @@ -21,6 +21,7 @@ namespace osu.Game.Overlays.Settings.Sections.Audio new SettingsSlider { LabelText = "Master (window inactive)", Bindable = config.GetBindable(OsuSetting.VolumeInactive), KeyboardStep = 0.01f }, new SettingsSlider { LabelText = "Effect", Bindable = audio.VolumeSample, KeyboardStep = 0.01f }, new SettingsSlider { LabelText = "Music", Bindable = audio.VolumeTrack, KeyboardStep = 0.01f }, + new SettingsCheckbox { LabelText = "Use beatmap hitsounds", Bindable = config.GetBindable(OsuSetting.BeatmapHitsounds) }, }; } } From 32940074afe8ed640a67809bb1fa080d62f71c5c Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 18 Jan 2019 08:50:36 +0000 Subject: [PATCH 54/99] Windows 64 bit -> Windows (x64) Co-Authored-By: Llaurence <40535137+Llaurence@users.noreply.github.com> --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9c484503fe..955c38d0b4 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ We are accepting bug reports (please report with as much detail as possible). Fe If you are not interested in developing the game, please head over to the [releases](https://github.com/ppy/osu/releases) to download a precompiled build with automatic updating enabled. -- Windows 64 bit users should download and run `install.exe`. +- Windows (x64) users should download and run `install.exe`. - MacOS users should download and run `osu.app.zip`. - iOS users can join the [TestFlight beta program](https://t.co/xQJmHkfC18). From 55286922602ef99c5dd3b68e2260ef2014a11d0b Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 18 Jan 2019 08:51:06 +0000 Subject: [PATCH 55/99] Specify macOS version Co-Authored-By: Llaurence <40535137+Llaurence@users.noreply.github.com> --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 955c38d0b4..59a2f821c6 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ We are accepting bug reports (please report with as much detail as possible). Fe If you are not interested in developing the game, please head over to the [releases](https://github.com/ppy/osu/releases) to download a precompiled build with automatic updating enabled. - Windows (x64) users should download and run `install.exe`. -- MacOS users should download and run `osu.app.zip`. +- macOS users (10.12 "Sierra" and higher) should download and run `osu.app.zip`. - iOS users can join the [TestFlight beta program](https://t.co/xQJmHkfC18). There is currently no release for Windows 32 bit, Linux, or any other platform. If you are not running Windows 64 bit or MacOS, you should build osu! from the source code (see below). From 6aaedb880837fdb82991a0622ae0be2cab97e597 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 18 Jan 2019 08:51:57 +0000 Subject: [PATCH 56/99] Reword the "other platforms have no prebuilt binaries" sentence Co-Authored-By: Llaurence <40535137+Llaurence@users.noreply.github.com> --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 59a2f821c6..c6fd17ad2d 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ If you are not interested in developing the game, please head over to the [relea - macOS users (10.12 "Sierra" and higher) should download and run `osu.app.zip`. - iOS users can join the [TestFlight beta program](https://t.co/xQJmHkfC18). -There is currently no release for Windows 32 bit, Linux, or any other platform. If you are not running Windows 64 bit or MacOS, you should build osu! from the source code (see below). +If your platform is not listed above, there is still a chance you can manually build it by following the instructions below. ## Downloading the source code From 94648658f79af3c576f2dbb29b86f0999e8995cf Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 18 Jan 2019 08:52:31 +0000 Subject: [PATCH 57/99] Links to ides sites Co-Authored-By: Llaurence <40535137+Llaurence@users.noreply.github.com> --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c6fd17ad2d..cd813704d4 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ git pull --recurse-submodules ## Building -Configuration for Visual Studio 2017, Rider and Visual Studio Code is included in the source code. +Build configurations for [Visual Studio 2017+](https://visualstudio.microsoft.com/vs/), [Jetbrains Rider](https://www.jetbrains.com/rider/) and [Visual Studio Code](https://code.visualstudio.com/) are included in the source code. > Visual Studio Code users must run the `Restore` task before any build attempt. From 2db28468821b747f83845b1287ece0956f834d44 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 18 Jan 2019 08:52:52 +0000 Subject: [PATCH 58/99] Remove "with dotnet" Co-Authored-By: Llaurence <40535137+Llaurence@users.noreply.github.com> --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index cd813704d4..8faf83786f 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,7 @@ Build configurations for [Visual Studio 2017+](https://visualstudio.microsoft.co > Visual Studio Code users must run the `Restore` task before any build attempt. -You can also build osu! from the command-line, with `dotnet`: +You can also build osu! from the command-line: ``` dotnet restore From c3c1e1930148ecc6efffef6e85090ea126775608 Mon Sep 17 00:00:00 2001 From: Llaurence Date: Fri, 18 Jan 2019 10:07:42 +0100 Subject: [PATCH 59/99] Release -> Debug by default, linux note rewrite --- README.md | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 8faf83786f..1961f59ef5 100644 --- a/README.md +++ b/README.md @@ -53,24 +53,23 @@ Build configurations for [Visual Studio 2017+](https://visualstudio.microsoft.co You can also build osu! from the command-line: ``` -dotnet restore -dotnet run --project osu.Desktop -c Release +dotnet run --project osu.Desktop ``` -The `-c Release` option **must be omitted** when building for development purposes. +If you are not interested in debugging osu!, you can add `-c Release` to gain performance. In this case, you must replace `Debug` with `Release` in the following section. + +If the build fails, try to restore nuget packages with `dotnet restore`. ### A note for Linux users -On Linux, the environment variable `LD_LIBRARY_PATH` must point to the build directory (replace `Release` with `Debug` in the following paths if you do not want to include the `-c Release` flag). +On Linux, the environment variable `LD_LIBRARY_PATH` must point to the build directory, located at `osu.Desktop/bin/Debug/$NETCORE_VERSION`. -The build directory is located at `osu.Desktop/bin/Release/netcoreappX.X`, where `X.X` is the version of the .NET Core SDK (see Requirements). The required value can be found in `osu.Desktop/osu.Desktop.csproj`, look for a line starting with "TargetFramework". +`$NETCORE_VERSION` is the version of .NET Core SDK. You can have it with `grep TargetFramework osu.Desktop/osu.Desktop.csproj | sed -r 's/.*>(.*)<\/.*/\1/'`. -For example, you can run osu! with the following commands: +For example, you can run osu! with the following command: ``` -export NETCORE_VERSION="$(grep TargetFramework osu.Desktop/osu.Desktop.csproj | sed -r 's/.*>(.*)<\/.*/\1/')" -export LD_LIBRARY_PATH="$(pwd)/osu.Desktop/bin/Release/$NETCORE_VERSION" -dotnet run --project osu.Desktop -c Release +LD_LIBRARY_PATH="$(pwd)/osu.Desktop/bin/Debug/netcoreapp2.2" dotnet run --project osu.Desktop ``` ## Code analysis From e5610b61eb7ab130eaacb2c36d2cb6968660de0e Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 20 Jan 2019 11:13:15 +0900 Subject: [PATCH 60/99] Final pass --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 1961f59ef5..c031b10ccd 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ We are accepting bug reports (please report with as much detail as possible). Fe # Requirements - A desktop platform with the [.NET Core SDK 2.2](https://www.microsoft.com/net/learn/get-started) or higher installed. -- When working with the codebase, we recommend using an IDE with intellisense and syntax highlighting, such as [Visual Studio Community Edition](https://www.visualstudio.com/) (Windows), [Visual Studio Code](https://code.visualstudio.com/) (with the C# plugin installed) or [Jetbrains Rider](https://www.jetbrains.com/rider/) (commercial). +- When working with the codebase, we recommend using an IDE with intellisense and syntax highlighting, such as [Visual Studio 2017+](https://visualstudio.microsoft.com/vs/), [Jetbrains Rider](https://www.jetbrains.com/rider/) or [Visual Studio Code](https://code.visualstudio.com/). # Running osu! @@ -29,7 +29,7 @@ If your platform is not listed above, there is still a chance you can manually b Clone the repository **including submodules**: -``` +```shell git clone --recurse-submodules https://github.com/ppy/osu cd osu ``` @@ -40,19 +40,19 @@ cd osu To update the source code to the latest commit, run the following command inside the `osu` directory: -``` +```shell git pull --recurse-submodules ``` ## Building -Build configurations for [Visual Studio 2017+](https://visualstudio.microsoft.com/vs/), [Jetbrains Rider](https://www.jetbrains.com/rider/) and [Visual Studio Code](https://code.visualstudio.com/) are included in the source code. +Build configurations for the recommended IDEs (listed above) are included. You should use the provided Build/Run functionality of your IDE to get things going. When testing or building new components, it's highly encouraged you use the `VisualTests` project/configuration. More information on this provided below. > Visual Studio Code users must run the `Restore` task before any build attempt. You can also build osu! from the command-line: -``` +```shell dotnet run --project osu.Desktop ``` @@ -68,7 +68,7 @@ On Linux, the environment variable `LD_LIBRARY_PATH` must point to the build dir For example, you can run osu! with the following command: -``` +```shell LD_LIBRARY_PATH="$(pwd)/osu.Desktop/bin/Debug/netcoreapp2.2" dotnet run --project osu.Desktop ``` From ffed411eafe2263ba71f3d3ad4314c304ded9676 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 20 Jan 2019 11:23:33 +0900 Subject: [PATCH 61/99] Minor fixes --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c031b10ccd..fc9ef51c6b 100644 --- a/README.md +++ b/README.md @@ -50,13 +50,13 @@ Build configurations for the recommended IDEs (listed above) are included. You s > Visual Studio Code users must run the `Restore` task before any build attempt. -You can also build osu! from the command-line: +You can also build and run osu! from the command-line with a single command: ```shell dotnet run --project osu.Desktop ``` -If you are not interested in debugging osu!, you can add `-c Release` to gain performance. In this case, you must replace `Debug` with `Release` in the following section. +If you are not interested in debugging osu!, you can add `-c Release` to gain performance. In this case, you must replace `Debug` with `Release` in any commands mentioned in this document. If the build fails, try to restore nuget packages with `dotnet restore`. From 5ecc07b729803c0c101c2a3783aa07995668837a Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Sun, 20 Jan 2019 12:05:08 +0900 Subject: [PATCH 62/99] Revert "Fix out of bounds exception during indexing" This reverts commit 88d80016aa72499ec90e1d85ced314a9ad805cfe. --- osu.Game/Beatmaps/ControlPoints/ControlPointInfo.cs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/osu.Game/Beatmaps/ControlPoints/ControlPointInfo.cs b/osu.Game/Beatmaps/ControlPoints/ControlPointInfo.cs index 41056a2536..f064d53358 100644 --- a/osu.Game/Beatmaps/ControlPoints/ControlPointInfo.cs +++ b/osu.Game/Beatmaps/ControlPoints/ControlPointInfo.cs @@ -122,14 +122,8 @@ namespace osu.Game.Beatmaps.ControlPoints return list[pivot]; } - if (l > 0) - { - // l will be the first control point with Time > time, but we want the one before it - return list[l - 1]; - } - - // If the binary search failed, l will be unaffected - return list[l]; + // l will be the first control point with Time > time, but we want the one before it + return list[l - 1]; } } } From 521b11dfcbb57eda7b5eb59f3a62676b4cad5e9c Mon Sep 17 00:00:00 2001 From: Shane Woolcock Date: Sun, 20 Jan 2019 18:51:17 +1030 Subject: [PATCH 63/99] Use QuadBatch rather than LinearBatch of quads for LogoVisualisation GL_QUADS is deprecated, and is not supported at all on OpenGL ES. This fixes the logo visualisation not drawing on iOS. --- osu.Game/Screens/Menu/LogoVisualisation.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Screens/Menu/LogoVisualisation.cs b/osu.Game/Screens/Menu/LogoVisualisation.cs index 70a01a5c9f..d991e6e1df 100644 --- a/osu.Game/Screens/Menu/LogoVisualisation.cs +++ b/osu.Game/Screens/Menu/LogoVisualisation.cs @@ -150,7 +150,7 @@ namespace osu.Game.Screens.Menu private class VisualiserSharedData { - public readonly LinearBatch VertexBatch = new LinearBatch(100 * 4, 10, PrimitiveType.Quads); + public readonly QuadBatch VertexBatch = new QuadBatch(100, 10); } private class VisualisationDrawNode : DrawNode From fa6dd8c99efc305d9a1e0333eb1b8241a3768cb2 Mon Sep 17 00:00:00 2001 From: Shane Woolcock Date: Sun, 20 Jan 2019 19:03:06 +1030 Subject: [PATCH 64/99] Code sanity --- osu.Game/Screens/Menu/LogoVisualisation.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/osu.Game/Screens/Menu/LogoVisualisation.cs b/osu.Game/Screens/Menu/LogoVisualisation.cs index d991e6e1df..8bc9a1f59a 100644 --- a/osu.Game/Screens/Menu/LogoVisualisation.cs +++ b/osu.Game/Screens/Menu/LogoVisualisation.cs @@ -3,7 +3,6 @@ using osuTK; using osuTK.Graphics; -using osuTK.Graphics.ES30; using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Framework.Graphics.Batches; From 0573c1c9231a8a53e826e4fb4f77bea924aa4567 Mon Sep 17 00:00:00 2001 From: ekrctb Date: Mon, 21 Jan 2019 14:20:37 +0900 Subject: [PATCH 65/99] Fix taiko namespace ignored --- osu.Game/Skinning/LegacySkin.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/osu.Game/Skinning/LegacySkin.cs b/osu.Game/Skinning/LegacySkin.cs index 23367c58c9..1ed6c4b42a 100644 --- a/osu.Game/Skinning/LegacySkin.cs +++ b/osu.Game/Skinning/LegacySkin.cs @@ -101,9 +101,10 @@ namespace osu.Game.Skinning bool hasExtension = filename.Contains('.'); string lastPiece = filename.Split('/').Last(); + var legacyName = filename.StartsWith("Gameplay/taiko/") ? "taiko-" + lastPiece : lastPiece; var file = source.Files.Find(f => - string.Equals(hasExtension ? f.Filename : Path.ChangeExtension(f.Filename, null), lastPiece, StringComparison.InvariantCultureIgnoreCase)); + string.Equals(hasExtension ? f.Filename : Path.ChangeExtension(f.Filename, null), legacyName, StringComparison.InvariantCultureIgnoreCase)); return file?.FileInfo.StoragePath; } From e74f0057bdaa55eb54817a96b0dd41dff3b1dac0 Mon Sep 17 00:00:00 2001 From: ekrctb Date: Mon, 21 Jan 2019 17:03:06 +0900 Subject: [PATCH 66/99] Automatically layout based on score display width --- osu.Game/Screens/Play/HUDOverlay.cs | 45 +++++++++++++++++------------ 1 file changed, 26 insertions(+), 19 deletions(-) diff --git a/osu.Game/Screens/Play/HUDOverlay.cs b/osu.Game/Screens/Play/HUDOverlay.cs index cc665d99a1..9b5329a3ea 100644 --- a/osu.Game/Screens/Play/HUDOverlay.cs +++ b/osu.Game/Screens/Play/HUDOverlay.cs @@ -50,9 +50,17 @@ namespace osu.Game.Screens.Play RelativeSizeAxes = Axes.Both, AlwaysPresent = true, // The hud may be hidden but certain elements may need to still be updated Children = new Drawable[] { - ComboCounter = CreateComboCounter(), - ScoreCounter = CreateScoreCounter(), - AccuracyCounter = CreateAccuracyCounter(), + new Container { + Anchor = Anchor.TopCentre, + Origin = Anchor.TopCentre, + Y = 30, + AutoSizeAxes = Axes.Both, + Children = new Drawable[] { + AccuracyCounter = CreateAccuracyCounter(), + ScoreCounter = CreateScoreCounter(), + ComboCounter = CreateComboCounter(), + }, + }, HealthDisplay = CreateHealthDisplay(), Progress = CreateProgress(), ModDisplay = CreateModsContainer(), @@ -159,20 +167,27 @@ namespace osu.Game.Screens.Play protected virtual RollingCounter CreateAccuracyCounter() => new PercentageCounter { - Anchor = Anchor.TopCentre, - Origin = Anchor.TopRight, - Position = new Vector2(0, 35), TextSize = 20, - Margin = new MarginPadding { Right = 140 }, + BypassAutoSizeAxes = Axes.X, + Anchor = Anchor.TopLeft, + Origin = Anchor.TopRight, + Margin = new MarginPadding { Top = 5, Right = 20 }, + }; + + protected virtual ScoreCounter CreateScoreCounter() => new ScoreCounter(6) + { + TextSize = 40, + Anchor = Anchor.TopCentre, + Origin = Anchor.TopCentre, }; protected virtual RollingCounter CreateComboCounter() => new SimpleComboCounter { - Anchor = Anchor.TopCentre, - Origin = Anchor.TopLeft, - Position = new Vector2(0, 35), - Margin = new MarginPadding { Left = 140 }, TextSize = 20, + BypassAutoSizeAxes = Axes.X, + Anchor = Anchor.TopRight, + Origin = Anchor.TopLeft, + Margin = new MarginPadding { Top = 5, Left = 20 }, }; protected virtual HealthDisplay CreateHealthDisplay() => new StandardHealthDisplay @@ -191,14 +206,6 @@ namespace osu.Game.Screens.Play AudioClock = offsetClock }; - protected virtual ScoreCounter CreateScoreCounter() => new ScoreCounter(6) - { - Anchor = Anchor.TopCentre, - Origin = Anchor.TopCentre, - TextSize = 40, - Position = new Vector2(0, 30), - }; - protected virtual SongProgress CreateProgress() => new SongProgress { Anchor = Anchor.BottomLeft, From 1d1f8762c5963c38ec51b9453291fda6652cd670 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 21 Jan 2019 19:09:24 +0900 Subject: [PATCH 67/99] Add win7 & 8.1 requirements to readme --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index fc9ef51c6b..a92c0fa4a6 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,8 @@ We are accepting bug reports (please report with as much detail as possible). Fe - A desktop platform with the [.NET Core SDK 2.2](https://www.microsoft.com/net/learn/get-started) or higher installed. - When working with the codebase, we recommend using an IDE with intellisense and syntax highlighting, such as [Visual Studio 2017+](https://visualstudio.microsoft.com/vs/), [Jetbrains Rider](https://www.jetbrains.com/rider/) or [Visual Studio Code](https://code.visualstudio.com/). +[There are additional requirements for Windows 7 and Windows 8.1](https://docs.microsoft.com/en-us/dotnet/core/windows-prerequisites?tabs=netcore2x) + # Running osu! ## Releases From 4eb5e67075d1a100db4e597c56b15c890a9bf5eb Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 21 Jan 2019 19:34:35 +0900 Subject: [PATCH 68/99] Fix overlays not being correctly offset by toolbar padding --- osu.Game/OsuGame.cs | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index 58af93a88b..f0a8d6ab56 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -359,11 +359,11 @@ namespace osu.Game { RelativeSizeAxes = Axes.Both, }, - mainContent = new Container + overlayContent = new Container { RelativeSizeAxes = Axes.Both, }, - overlayContent = new Container { RelativeSizeAxes = Axes.Both, Depth = float.MinValue }, + floatingOverlayContent = new Container { RelativeSizeAxes = Axes.Both, Depth = float.MinValue }, idleTracker = new IdleTracker(6000) }); @@ -382,32 +382,32 @@ namespace osu.Game CloseAllOverlays(false); intro?.ChildScreen?.MakeCurrent(); }, - }, overlayContent.Add); + }, floatingOverlayContent.Add); - loadComponentSingleFile(volume = new VolumeOverlay(), overlayContent.Add); + loadComponentSingleFile(volume = new VolumeOverlay(), floatingOverlayContent.Add); loadComponentSingleFile(onscreenDisplay = new OnScreenDisplay(), Add); loadComponentSingleFile(screenshotManager, Add); //overlay elements - loadComponentSingleFile(direct = new DirectOverlay { Depth = -1 }, mainContent.Add); - loadComponentSingleFile(social = new SocialOverlay { Depth = -1 }, mainContent.Add); + loadComponentSingleFile(direct = new DirectOverlay { Depth = -1 }, overlayContent.Add); + loadComponentSingleFile(social = new SocialOverlay { Depth = -1 }, overlayContent.Add); loadComponentSingleFile(channelManager = new ChannelManager(), AddInternal); - loadComponentSingleFile(chatOverlay = new ChatOverlay { Depth = -1 }, mainContent.Add); + loadComponentSingleFile(chatOverlay = new ChatOverlay { Depth = -1 }, overlayContent.Add); loadComponentSingleFile(settings = new MainSettings { GetToolbarHeight = () => ToolbarOffset, Depth = -1 - }, overlayContent.Add); - loadComponentSingleFile(userProfile = new UserProfileOverlay { Depth = -2 }, mainContent.Add); - loadComponentSingleFile(beatmapSetOverlay = new BeatmapSetOverlay { Depth = -3 }, mainContent.Add); + }, floatingOverlayContent.Add); + loadComponentSingleFile(userProfile = new UserProfileOverlay { Depth = -2 }, overlayContent.Add); + loadComponentSingleFile(beatmapSetOverlay = new BeatmapSetOverlay { Depth = -3 }, overlayContent.Add); loadComponentSingleFile(musicController = new MusicController { Depth = -5, Position = new Vector2(0, Toolbar.HEIGHT), Anchor = Anchor.TopRight, Origin = Anchor.TopRight, - }, overlayContent.Add); + }, floatingOverlayContent.Add); loadComponentSingleFile(notifications = new NotificationOverlay { @@ -415,22 +415,22 @@ namespace osu.Game Depth = -4, Anchor = Anchor.TopRight, Origin = Anchor.TopRight, - }, overlayContent.Add); + }, floatingOverlayContent.Add); loadComponentSingleFile(accountCreation = new AccountCreationOverlay { Depth = -6, - }, overlayContent.Add); + }, floatingOverlayContent.Add); loadComponentSingleFile(dialogOverlay = new DialogOverlay { Depth = -7, - }, overlayContent.Add); + }, floatingOverlayContent.Add); loadComponentSingleFile(externalLinkOpener = new ExternalLinkOpener { Depth = -8, - }, overlayContent.Add); + }, floatingOverlayContent.Add); dependencies.Cache(idleTracker); dependencies.Cache(settings); @@ -649,10 +649,10 @@ namespace osu.Game public bool OnReleased(GlobalAction action) => false; - private Container mainContent; - private Container overlayContent; + private Container floatingOverlayContent; + private OsuScreen currentScreen; private FrameworkConfigManager frameworkConfig; private ScalingContainer screenContainer; @@ -696,6 +696,7 @@ namespace osu.Game Beatmap.Disabled = applyBeatmapRulesetRestrictions; screenContainer.Padding = new MarginPadding { Top = ToolbarOffset }; + overlayContent.Padding = new MarginPadding { Top = ToolbarOffset }; MenuCursorContainer.CanShowCursor = currentScreen?.CursorVisible ?? false; } From e6a3de8652776b82e5399ec6062e1467f34fffb2 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 21 Jan 2019 20:15:53 +0900 Subject: [PATCH 69/99] Format better --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index a92c0fa4a6..a54b28b74a 100644 --- a/README.md +++ b/README.md @@ -12,8 +12,7 @@ We are accepting bug reports (please report with as much detail as possible). Fe - A desktop platform with the [.NET Core SDK 2.2](https://www.microsoft.com/net/learn/get-started) or higher installed. - When working with the codebase, we recommend using an IDE with intellisense and syntax highlighting, such as [Visual Studio 2017+](https://visualstudio.microsoft.com/vs/), [Jetbrains Rider](https://www.jetbrains.com/rider/) or [Visual Studio Code](https://code.visualstudio.com/). - -[There are additional requirements for Windows 7 and Windows 8.1](https://docs.microsoft.com/en-us/dotnet/core/windows-prerequisites?tabs=netcore2x) +- Note that there are **[additional requirements for Windows 7 and Windows 8.1](https://docs.microsoft.com/en-us/dotnet/core/windows-prerequisites?tabs=netcore2x)** which you may need to manually install if your operating system is not up-to-date. # Running osu! From 7cdb823c874f4bbc7106ca0e05a686df01a02291 Mon Sep 17 00:00:00 2001 From: Bear Daniel Date: Mon, 21 Jan 2019 08:04:06 -0600 Subject: [PATCH 70/99] Moved "Use beatmap hitsounds" button --- osu.Game/Overlays/Settings/Sections/Audio/VolumeSettings.cs | 1 - osu.Game/Overlays/Settings/Sections/SkinSection.cs | 5 +++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/osu.Game/Overlays/Settings/Sections/Audio/VolumeSettings.cs b/osu.Game/Overlays/Settings/Sections/Audio/VolumeSettings.cs index 57afe0334c..fa4a714ba3 100644 --- a/osu.Game/Overlays/Settings/Sections/Audio/VolumeSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/Audio/VolumeSettings.cs @@ -21,7 +21,6 @@ namespace osu.Game.Overlays.Settings.Sections.Audio new SettingsSlider { LabelText = "Master (window inactive)", Bindable = config.GetBindable(OsuSetting.VolumeInactive), KeyboardStep = 0.01f }, new SettingsSlider { LabelText = "Effect", Bindable = audio.VolumeSample, KeyboardStep = 0.01f }, new SettingsSlider { LabelText = "Music", Bindable = audio.VolumeTrack, KeyboardStep = 0.01f }, - new SettingsCheckbox { LabelText = "Use beatmap hitsounds", Bindable = config.GetBindable(OsuSetting.BeatmapHitsounds) }, }; } } diff --git a/osu.Game/Overlays/Settings/Sections/SkinSection.cs b/osu.Game/Overlays/Settings/Sections/SkinSection.cs index 2fa23e175d..bec8688aa9 100644 --- a/osu.Game/Overlays/Settings/Sections/SkinSection.cs +++ b/osu.Game/Overlays/Settings/Sections/SkinSection.cs @@ -53,6 +53,11 @@ namespace osu.Game.Overlays.Settings.Sections Bindable = config.GetBindable(OsuSetting.BeatmapSkins) }, new SettingsCheckbox + { + LabelText = "Use beatmap hitsounds", + Bindable = config.GetBindable(OsuSetting.BeatmapHitsounds) + }, + new SettingsCheckbox { LabelText = "Adjust gameplay cursor size based on current beatmap", Bindable = config.GetBindable(OsuSetting.AutoCursorSize) From fb51578df39172fd9df7b6dbe5adda4f5e941ed5 Mon Sep 17 00:00:00 2001 From: chrisny286 Date: Mon, 21 Jan 2019 17:19:40 +0100 Subject: [PATCH 71/99] Update PlayerSettingsOverlay.cs Framework renamed this variable so it needs to be renamed here too. --- osu.Game/Screens/Play/HUD/PlayerSettingsOverlay.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Screens/Play/HUD/PlayerSettingsOverlay.cs b/osu.Game/Screens/Play/HUD/PlayerSettingsOverlay.cs index 2249e743e6..478a99a2eb 100644 --- a/osu.Game/Screens/Play/HUD/PlayerSettingsOverlay.cs +++ b/osu.Game/Screens/Play/HUD/PlayerSettingsOverlay.cs @@ -50,7 +50,7 @@ namespace osu.Game.Screens.Play.HUD protected override void PopOut() => this.FadeOut(fade_duration); //We want to handle keyboard inputs all the time in order to trigger ToggleVisibility() when not visible - public override bool HandleNonPositionalInput => true; + public override bool PropagateNonPositionalInputSubTree => true; protected override bool OnKeyDown(KeyDownEvent e) { From 65fd69c817d47f35e78d60f23676dbe03f364641 Mon Sep 17 00:00:00 2001 From: chrisny286 Date: Mon, 21 Jan 2019 19:10:29 +0100 Subject: [PATCH 72/99] Update HUDOverlay.cs separate PlayerSettingsOverlay from the other HUD elements in the Visibility Container --- osu.Game/Screens/Play/HUDOverlay.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Screens/Play/HUDOverlay.cs b/osu.Game/Screens/Play/HUDOverlay.cs index cc665d99a1..7abcca146c 100644 --- a/osu.Game/Screens/Play/HUDOverlay.cs +++ b/osu.Game/Screens/Play/HUDOverlay.cs @@ -56,10 +56,10 @@ namespace osu.Game.Screens.Play HealthDisplay = CreateHealthDisplay(), Progress = CreateProgress(), ModDisplay = CreateModsContainer(), - PlayerSettingsOverlay = CreatePlayerSettingsOverlay(), } }, - new FillFlowContainer + PlayerSettingsOverlay = CreatePlayerSettingsOverlay(), + new FillFlowContainer { Anchor = Anchor.BottomRight, Origin = Anchor.BottomRight, From d7d2e2fe447d69974a105f5f7fe240f8da6a9bcb Mon Sep 17 00:00:00 2001 From: chrisny286 Date: Mon, 21 Jan 2019 19:22:19 +0100 Subject: [PATCH 73/99] trimmed whitespace --- osu.Game/Screens/Play/HUDOverlay.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Screens/Play/HUDOverlay.cs b/osu.Game/Screens/Play/HUDOverlay.cs index 7abcca146c..910707915b 100644 --- a/osu.Game/Screens/Play/HUDOverlay.cs +++ b/osu.Game/Screens/Play/HUDOverlay.cs @@ -58,8 +58,8 @@ namespace osu.Game.Screens.Play ModDisplay = CreateModsContainer(), } }, - PlayerSettingsOverlay = CreatePlayerSettingsOverlay(), - new FillFlowContainer + PlayerSettingsOverlay = CreatePlayerSettingsOverlay(), + new FillFlowContainer { Anchor = Anchor.BottomRight, Origin = Anchor.BottomRight, From b373d78143838d797b808665087fea78768e50a8 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 22 Jan 2019 09:47:51 +0900 Subject: [PATCH 74/99] Add slight easing --- osu.Game/Screens/Play/HUDOverlay.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/osu.Game/Screens/Play/HUDOverlay.cs b/osu.Game/Screens/Play/HUDOverlay.cs index 963ae19b46..dac05c23b1 100644 --- a/osu.Game/Screens/Play/HUDOverlay.cs +++ b/osu.Game/Screens/Play/HUDOverlay.cs @@ -55,6 +55,8 @@ namespace osu.Game.Screens.Play Origin = Anchor.TopCentre, Y = 30, AutoSizeAxes = Axes.Both, + AutoSizeDuration = 200, + AutoSizeEasing = Easing.Out, Children = new Drawable[] { AccuracyCounter = CreateAccuracyCounter(), ScoreCounter = CreateScoreCounter(), From 7baff750deaa7f9358e2b1406d290d5ed77ae88f Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 22 Jan 2019 10:06:30 +0900 Subject: [PATCH 75/99] Consolidate layout, wording and ordering with VisualSettings --- osu.Game/Overlays/Settings/Sections/SkinSection.cs | 14 +++++++------- .../Screens/Play/PlayerSettings/VisualSettings.cs | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/osu.Game/Overlays/Settings/Sections/SkinSection.cs b/osu.Game/Overlays/Settings/Sections/SkinSection.cs index bec8688aa9..2cce47b593 100644 --- a/osu.Game/Overlays/Settings/Sections/SkinSection.cs +++ b/osu.Game/Overlays/Settings/Sections/SkinSection.cs @@ -49,19 +49,19 @@ namespace osu.Game.Overlays.Settings.Sections }, new SettingsCheckbox { - LabelText = "Use beatmap skins", + LabelText = "Adjust gameplay cursor size based on current beatmap", + Bindable = config.GetBindable(OsuSetting.AutoCursorSize) + }, + new SettingsCheckbox + { + LabelText = "Beatmap skins", Bindable = config.GetBindable(OsuSetting.BeatmapSkins) }, new SettingsCheckbox { - LabelText = "Use beatmap hitsounds", + LabelText = "Beatmap hitsounds", Bindable = config.GetBindable(OsuSetting.BeatmapHitsounds) }, - new SettingsCheckbox - { - LabelText = "Adjust gameplay cursor size based on current beatmap", - Bindable = config.GetBindable(OsuSetting.AutoCursorSize) - }, }; skins.ItemAdded += itemAdded; diff --git a/osu.Game/Screens/Play/PlayerSettings/VisualSettings.cs b/osu.Game/Screens/Play/PlayerSettings/VisualSettings.cs index f762597e81..439e344020 100644 --- a/osu.Game/Screens/Play/PlayerSettings/VisualSettings.cs +++ b/osu.Game/Screens/Play/PlayerSettings/VisualSettings.cs @@ -38,7 +38,7 @@ namespace osu.Game.Screens.Play.PlayerSettings }, showStoryboardToggle = new PlayerCheckbox { LabelText = "Storyboards" }, beatmapSkinsToggle = new PlayerCheckbox { LabelText = "Beatmap skins" }, - beatmapHitsoundsToggle = new PlayerCheckbox { LabelText = "Beatmap hit sounds" } + beatmapHitsoundsToggle = new PlayerCheckbox { LabelText = "Beatmap hitsounds" } }; } From 5ea6e8e247a27c4df8a754ecc65a52ee2c33be20 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 22 Jan 2019 14:22:38 +0900 Subject: [PATCH 76/99] Allow full osu!direct usage regardless of supporter status for now --- osu.Game/Beatmaps/BeatmapManager.cs | 11 ---- .../Graphics/Containers/LinkFlowContainer.cs | 12 ++-- .../Containers/OsuTextFlowContainer.cs | 3 +- osu.Game/Screens/Menu/Disclaimer.cs | 63 +++++++++++++++---- 4 files changed, 60 insertions(+), 29 deletions(-) diff --git a/osu.Game/Beatmaps/BeatmapManager.cs b/osu.Game/Beatmaps/BeatmapManager.cs index 73fd5da22c..bcf6a95e70 100644 --- a/osu.Game/Beatmaps/BeatmapManager.cs +++ b/osu.Game/Beatmaps/BeatmapManager.cs @@ -17,7 +17,6 @@ using osu.Framework.Logging; using osu.Framework.Platform; using osu.Game.Beatmaps.Formats; using osu.Game.Database; -using osu.Game.Graphics; using osu.Game.IO.Archives; using osu.Game.Online.API; using osu.Game.Online.API.Requests; @@ -147,16 +146,6 @@ namespace osu.Game.Beatmaps if (existing != null || api == null) return false; - if (!api.LocalUser.Value.IsSupporter) - { - PostNotification?.Invoke(new SimpleNotification - { - Icon = FontAwesome.fa_superpowers, - Text = "You gotta be an osu!supporter to download for now 'yo" - }); - return false; - } - var downloadNotification = new DownloadNotification { CompletionText = $"Imported {beatmapSetInfo.Metadata.Artist} - {beatmapSetInfo.Metadata.Title}!", diff --git a/osu.Game/Graphics/Containers/LinkFlowContainer.cs b/osu.Game/Graphics/Containers/LinkFlowContainer.cs index e4c18dfb3d..f794dedcab 100644 --- a/osu.Game/Graphics/Containers/LinkFlowContainer.cs +++ b/osu.Game/Graphics/Containers/LinkFlowContainer.cs @@ -61,21 +61,21 @@ namespace osu.Game.Graphics.Containers AddText(text.Substring(previousLinkEnd)); } - public void AddLink(string text, string url, LinkAction linkType = LinkAction.External, string linkArgument = null, string tooltipText = null, Action creationParameters = null) + public IEnumerable AddLink(string text, string url, LinkAction linkType = LinkAction.External, string linkArgument = null, string tooltipText = null, Action creationParameters = null) => createLink(AddText(text, creationParameters), text, url, linkType, linkArgument, tooltipText); - public void AddLink(string text, Action action, string tooltipText = null, Action creationParameters = null) + public IEnumerable AddLink(string text, Action action, string tooltipText = null, Action creationParameters = null) => createLink(AddText(text, creationParameters), text, tooltipText: tooltipText, action: action); - public void AddLink(IEnumerable text, string url, LinkAction linkType = LinkAction.External, string linkArgument = null, string tooltipText = null) + public IEnumerable AddLink(IEnumerable text, string url, LinkAction linkType = LinkAction.External, string linkArgument = null, string tooltipText = null) { foreach (var t in text) AddArbitraryDrawable(t); - createLink(text, null, url, linkType, linkArgument, tooltipText); + return createLink(text, null, url, linkType, linkArgument, tooltipText); } - private void createLink(IEnumerable drawables, string text, string url = null, LinkAction linkType = LinkAction.External, string linkArgument = null, string tooltipText = null, Action action = null) + private IEnumerable createLink(IEnumerable drawables, string text, string url = null, LinkAction linkType = LinkAction.External, string linkArgument = null, string tooltipText = null, Action action = null) { AddInternal(new DrawableLinkCompiler(drawables.OfType().ToList()) { @@ -122,6 +122,8 @@ namespace osu.Game.Graphics.Containers } }), }); + + return drawables; } // We want the compilers to always be visible no matter where they are, so RelativeSizeAxes is used. diff --git a/osu.Game/Graphics/Containers/OsuTextFlowContainer.cs b/osu.Game/Graphics/Containers/OsuTextFlowContainer.cs index e77e075fe2..004c49adb8 100644 --- a/osu.Game/Graphics/Containers/OsuTextFlowContainer.cs +++ b/osu.Game/Graphics/Containers/OsuTextFlowContainer.cs @@ -2,6 +2,7 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; +using System.Collections.Generic; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Sprites; @@ -19,6 +20,6 @@ namespace osu.Game.Graphics.Containers public void AddArbitraryDrawable(Drawable drawable) => AddInternal(drawable); - public void AddIcon(FontAwesome icon, Action creationParameters = null) => AddText(((char)icon).ToString(), creationParameters); + public IEnumerable AddIcon(FontAwesome icon, Action creationParameters = null) => AddText(((char)icon).ToString(), creationParameters); } } diff --git a/osu.Game/Screens/Menu/Disclaimer.cs b/osu.Game/Screens/Menu/Disclaimer.cs index c9ad519897..22261f328a 100644 --- a/osu.Game/Screens/Menu/Disclaimer.cs +++ b/osu.Game/Screens/Menu/Disclaimer.cs @@ -1,8 +1,12 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using System; +using System.Collections.Generic; +using System.Linq; using osu.Framework.Allocation; using osu.Framework.Graphics; +using osu.Framework.Graphics.Sprites; using osu.Framework.Screens; using osu.Game.Graphics; using osu.Game.Graphics.Containers; @@ -24,7 +28,10 @@ namespace osu.Game.Screens.Menu public override bool CursorVisible => false; - private const float icon_y = -0.09f; + private readonly List supporterDrawables = new List(); + private Drawable heart; + + private const float icon_y = -85; public Disclaimer() { @@ -42,7 +49,6 @@ namespace osu.Game.Screens.Menu Origin = Anchor.Centre, Icon = FontAwesome.fa_warning, Size = new Vector2(30), - RelativePositionAxes = Axes.Both, Y = icon_y, }, textFlow = new LinkFlowContainer @@ -51,8 +57,9 @@ namespace osu.Game.Screens.Menu AutoSizeAxes = Axes.Y, Padding = new MarginPadding(50), TextAnchor = Anchor.TopCentre, + Y = -110, Anchor = Anchor.Centre, - Origin = Anchor.Centre, + Origin = Anchor.TopCentre, Spacing = new Vector2(0, 2), } }; @@ -68,14 +75,37 @@ namespace osu.Game.Screens.Menu t.Font = @"Exo2.0-SemiBold"; }); - textFlow.AddParagraph("Don't expect everything to work perfectly."); - textFlow.AddParagraph(""); - textFlow.AddParagraph("Detailed bug reports are welcomed via github issues."); - textFlow.AddParagraph(""); + textFlow.AddParagraph("Things may not work as expected", t => t.TextSize = 20); + textFlow.NewParagraph(); - textFlow.AddText("Visit "); - textFlow.AddLink("discord.gg/ppy", "https://discord.gg/ppy"); - textFlow.AddText(" if you want to help out or follow progress!"); + Action format = t => + { + t.TextSize = 15; + t.Font = @"Exo2.0-SemiBold"; + }; + + textFlow.AddParagraph("Detailed bug reports are welcomed via github issues.", format); + textFlow.NewParagraph(); + + textFlow.AddText("Visit ", format); + textFlow.AddLink("discord.gg/ppy", "https://discord.gg/ppy", creationParameters:format); + textFlow.AddText(" to help out or follow progress!", format); + + textFlow.NewParagraph(); + textFlow.NewParagraph(); + textFlow.NewParagraph(); + + supporterDrawables.AddRange(textFlow.AddText("Consider becoming an ", format)); + supporterDrawables.AddRange(textFlow.AddLink("osu!supporter", "https://osu.ppy.sh/home/support", creationParameters: format)); + supporterDrawables.AddRange(textFlow.AddText(" to help support the game", format)); + + supporterDrawables.Add(heart = textFlow.AddIcon(FontAwesome.fa_heart, t => + { + t.Padding = new MarginPadding { Left = 5 }; + t.TextSize = 12; + t.Colour = colours.Pink; + t.Origin = Anchor.Centre; + }).First()); iconColour = colours.Yellow; } @@ -90,8 +120,15 @@ namespace osu.Game.Screens.Menu { base.OnEntering(last); - icon.Delay(1500).FadeColour(iconColour, 200, Easing.OutQuint); - icon.Delay(1500).MoveToY(icon_y * 1.1f, 100, Easing.OutCirc).Then().MoveToY(icon_y, 100, Easing.InCirc); + icon.Delay(1000).FadeColour(iconColour, 200, Easing.OutQuint); + icon.Delay(1000) + .MoveToY(icon_y * 1.1f, 160, Easing.OutCirc) + .RotateTo(-10, 160, Easing.OutCirc) + .Then() + .MoveToY(icon_y, 160, Easing.InCirc) + .RotateTo(0, 160, Easing.InCirc); + + supporterDrawables.ForEach(d => d.FadeOut().Delay(2000).FadeIn(500)); Content .FadeInFromZero(500) @@ -99,6 +136,8 @@ namespace osu.Game.Screens.Menu .FadeOut(250) .ScaleTo(0.9f, 250, Easing.InQuint) .Finally(d => Push(intro)); + + heart.FlashColour(Color4.White, 750, Easing.OutQuint).Loop(); } } } From 1d5f5865aa7a6e87606feef62fb5f6fccbb8d4aa Mon Sep 17 00:00:00 2001 From: ekrctb Date: Tue, 22 Jan 2019 15:19:42 +0900 Subject: [PATCH 77/99] Fix PresentBeatmap not working for unsubmitted beatmap set --- osu.Game/OsuGame.cs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index 58af93a88b..739bc4232b 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -221,13 +221,16 @@ namespace osu.Game return; } - var databasedSet = BeatmapManager.QueryBeatmapSet(s => s.OnlineBeatmapSetID == beatmap.OnlineBeatmapSetID); + var databasedSet = BeatmapManager.QueryBeatmapSet(s => s.Hash == beatmap.Hash); - // Use first beatmap available for current ruleset, else switch ruleset. - var first = databasedSet.Beatmaps.Find(b => b.Ruleset == ruleset.Value) ?? databasedSet.Beatmaps.First(); + if (databasedSet != null) + { + // Use first beatmap available for current ruleset, else switch ruleset. + var first = databasedSet.Beatmaps.Find(b => b.Ruleset == ruleset.Value) ?? databasedSet.Beatmaps.First(); - ruleset.Value = first.Ruleset; - Beatmap.Value = BeatmapManager.GetWorkingBeatmap(first); + ruleset.Value = first.Ruleset; + Beatmap.Value = BeatmapManager.GetWorkingBeatmap(first); + } } switch (currentScreen) From 0095521fc2d314e0344b7c11ec664d9f6963bc40 Mon Sep 17 00:00:00 2001 From: ekrctb <32995012+ekrctb@users.noreply.github.com> Date: Tue, 22 Jan 2019 16:10:04 +0900 Subject: [PATCH 78/99] Use both OnlineBeatmapSetID and Hash --- osu.Game/OsuGame.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index 739bc4232b..8c9f08fa6d 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -221,7 +221,9 @@ namespace osu.Game return; } - var databasedSet = BeatmapManager.QueryBeatmapSet(s => s.Hash == beatmap.Hash); + var databasedSet = + BeatmapManager.QueryBeatmapSet(s => s.OnlineBeatmapSetID == beatmap.OnlineBeatmapSetID) ?? + BeatmapManager.QueryBeatmapSet(s => s.Hash == beatmap.Hash); if (databasedSet != null) { From fe2b83279e2f13b177d18cf7124f45c803e228a6 Mon Sep 17 00:00:00 2001 From: ekrctb <32995012+ekrctb@users.noreply.github.com> Date: Tue, 22 Jan 2019 16:40:32 +0900 Subject: [PATCH 79/99] Correct wrong logic `OnlineBeatmapSetID == null` was the problem --- osu.Game/OsuGame.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index 8c9f08fa6d..2dbf7989d7 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -221,8 +221,8 @@ namespace osu.Game return; } - var databasedSet = - BeatmapManager.QueryBeatmapSet(s => s.OnlineBeatmapSetID == beatmap.OnlineBeatmapSetID) ?? + var databasedSet = beatmap.OnlineBeatmapSetID != null ? + BeatmapManager.QueryBeatmapSet(s => s.OnlineBeatmapSetID == beatmap.OnlineBeatmapSetID) : BeatmapManager.QueryBeatmapSet(s => s.Hash == beatmap.Hash); if (databasedSet != null) From 828b9451e580e5675cf296d887a851a80217d761 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 22 Jan 2019 16:48:32 +0900 Subject: [PATCH 80/99] Update framework --- osu.Game/osu.Game.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 9365169873..1abd17e056 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -18,7 +18,7 @@ - + From 09553550a33848156d3ac1369f0c82d8561e1794 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 23 Jan 2019 00:19:39 +0900 Subject: [PATCH 81/99] Remove remaining supporter check --- osu.Game/Overlays/BeatmapSet/Buttons/DownloadButton.cs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/osu.Game/Overlays/BeatmapSet/Buttons/DownloadButton.cs b/osu.Game/Overlays/BeatmapSet/Buttons/DownloadButton.cs index 8406dada44..658287eb71 100644 --- a/osu.Game/Overlays/BeatmapSet/Buttons/DownloadButton.cs +++ b/osu.Game/Overlays/BeatmapSet/Buttons/DownloadButton.cs @@ -19,7 +19,7 @@ namespace osu.Game.Overlays.BeatmapSet.Buttons { public class DownloadButton : HeaderButton, IHasTooltip { - public string TooltipText => Enabled ? null : "You gotta be an osu!supporter to download for now 'yo"; + public string TooltipText => "Download this beatmap"; private readonly IBindable localUser = new Bindable(); @@ -101,12 +101,9 @@ namespace osu.Game.Overlays.BeatmapSet.Buttons private void load(APIAccess api) { localUser.BindTo(api.LocalUser); - localUser.BindValueChanged(userChanged, true); Enabled.BindValueChanged(enabledChanged, true); } - private void userChanged(User user) => Enabled.Value = user.IsSupporter; - private void enabledChanged(bool enabled) => this.FadeColour(enabled ? Color4.White : Color4.Gray, 200, Easing.OutQuint); } } From 09a2b287f9a227aa07b89463ac8c9948af6f9660 Mon Sep 17 00:00:00 2001 From: chrisny286 Date: Tue, 22 Jan 2019 18:29:30 +0100 Subject: [PATCH 82/99] Fix Tooltip not updating in special case When the Bindvalue of the Sliderbar gets changed by a line like "Bindable.Value = ..." the sliderbar will only update the nubs but wont run any methods which contain the updateToolTipText(T value) function. Example scenario: Two interlinked sliderbars which change the value of each other in certain cases. --- osu.Game/Graphics/UserInterface/OsuSliderBar.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Graphics/UserInterface/OsuSliderBar.cs b/osu.Game/Graphics/UserInterface/OsuSliderBar.cs index e0f38a13d0..23766e22a1 100644 --- a/osu.Game/Graphics/UserInterface/OsuSliderBar.cs +++ b/osu.Game/Graphics/UserInterface/OsuSliderBar.cs @@ -96,6 +96,7 @@ namespace osu.Game.Graphics.UserInterface { updateTooltipText(Current.Value); base.LoadComplete(); + CurrentNumber.ValueChanged += _ => updateTooltipText(_); } protected override bool OnHover(HoverEvent e) @@ -126,7 +127,6 @@ namespace osu.Game.Graphics.UserInterface { base.OnUserChange(value); playSample(value); - updateTooltipText(value); } private void playSample(T value) From 3f96231b2f65fa700bb33c7363f7897fb294ee66 Mon Sep 17 00:00:00 2001 From: chrisny286 Date: Tue, 22 Jan 2019 19:34:26 +0100 Subject: [PATCH 83/99] convert to method group --- osu.Game/Graphics/UserInterface/OsuSliderBar.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Graphics/UserInterface/OsuSliderBar.cs b/osu.Game/Graphics/UserInterface/OsuSliderBar.cs index 23766e22a1..84e1882dea 100644 --- a/osu.Game/Graphics/UserInterface/OsuSliderBar.cs +++ b/osu.Game/Graphics/UserInterface/OsuSliderBar.cs @@ -96,7 +96,7 @@ namespace osu.Game.Graphics.UserInterface { updateTooltipText(Current.Value); base.LoadComplete(); - CurrentNumber.ValueChanged += _ => updateTooltipText(_); + CurrentNumber.ValueChanged += updateTooltipText; } protected override bool OnHover(HoverEvent e) From cabcfffdeb2960df5cb1fc4b0fee19e26253350b Mon Sep 17 00:00:00 2001 From: chrisny286 Date: Wed, 23 Jan 2019 01:16:37 +0100 Subject: [PATCH 84/99] Fix autoplay rewind/skip usable when UI hidden --- osu.Game/Screens/Play/HUDOverlay.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/osu.Game/Screens/Play/HUDOverlay.cs b/osu.Game/Screens/Play/HUDOverlay.cs index dac05c23b1..8d50b58c3b 100644 --- a/osu.Game/Screens/Play/HUDOverlay.cs +++ b/osu.Game/Screens/Play/HUDOverlay.cs @@ -102,6 +102,7 @@ namespace osu.Game.Screens.Play { showHud = config.GetBindable(OsuSetting.ShowInterface); showHud.ValueChanged += hudVisibility => visibilityContainer.FadeTo(hudVisibility ? 1 : 0, duration); + showHud.ValueChanged += v => Progress.AllowSeeking = v; showHud.TriggerChange(); if (!showHud && !hasShownNotificationOnce) From f01ba17d1f3ee0f73666a63ce315d3fe1cd78646 Mon Sep 17 00:00:00 2001 From: chrisny286 Date: Wed, 23 Jan 2019 02:12:40 +0100 Subject: [PATCH 85/99] add check if replay is loaded before allowseeking can be overwitten --- osu.Game/Screens/Play/SongProgress.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Screens/Play/SongProgress.cs b/osu.Game/Screens/Play/SongProgress.cs index 336f9cc430..a892b9afd6 100644 --- a/osu.Game/Screens/Play/SongProgress.cs +++ b/osu.Game/Screens/Play/SongProgress.cs @@ -125,7 +125,7 @@ namespace osu.Game.Screens.Play set { if (allowSeeking == value) return; - + if (!replayLoaded) return; allowSeeking = value; updateBarVisibility(); } From 12503b4d074b1243a4fb986a0db87918c1106571 Mon Sep 17 00:00:00 2001 From: chrisny286 Date: Wed, 23 Jan 2019 02:37:17 +0100 Subject: [PATCH 86/99] revert and make VisibilityContainer not AlwaysPresent --- osu.Game/Screens/Play/HUDOverlay.cs | 2 -- osu.Game/Screens/Play/SongProgress.cs | 1 - 2 files changed, 3 deletions(-) diff --git a/osu.Game/Screens/Play/HUDOverlay.cs b/osu.Game/Screens/Play/HUDOverlay.cs index 8d50b58c3b..cbd36d75c6 100644 --- a/osu.Game/Screens/Play/HUDOverlay.cs +++ b/osu.Game/Screens/Play/HUDOverlay.cs @@ -48,7 +48,6 @@ namespace osu.Game.Screens.Play { visibilityContainer = new Container { RelativeSizeAxes = Axes.Both, - AlwaysPresent = true, // The hud may be hidden but certain elements may need to still be updated Children = new Drawable[] { new Container { Anchor = Anchor.TopCentre, @@ -102,7 +101,6 @@ namespace osu.Game.Screens.Play { showHud = config.GetBindable(OsuSetting.ShowInterface); showHud.ValueChanged += hudVisibility => visibilityContainer.FadeTo(hudVisibility ? 1 : 0, duration); - showHud.ValueChanged += v => Progress.AllowSeeking = v; showHud.TriggerChange(); if (!showHud && !hasShownNotificationOnce) diff --git a/osu.Game/Screens/Play/SongProgress.cs b/osu.Game/Screens/Play/SongProgress.cs index a892b9afd6..328f54423d 100644 --- a/osu.Game/Screens/Play/SongProgress.cs +++ b/osu.Game/Screens/Play/SongProgress.cs @@ -125,7 +125,6 @@ namespace osu.Game.Screens.Play set { if (allowSeeking == value) return; - if (!replayLoaded) return; allowSeeking = value; updateBarVisibility(); } From 13ba9d64d09a8fa2a8aa28bce02691368c23a655 Mon Sep 17 00:00:00 2001 From: chrisny286 Date: Wed, 23 Jan 2019 02:56:00 +0100 Subject: [PATCH 87/99] revert empty line --- osu.Game/Screens/Play/SongProgress.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/osu.Game/Screens/Play/SongProgress.cs b/osu.Game/Screens/Play/SongProgress.cs index 328f54423d..336f9cc430 100644 --- a/osu.Game/Screens/Play/SongProgress.cs +++ b/osu.Game/Screens/Play/SongProgress.cs @@ -125,6 +125,7 @@ namespace osu.Game.Screens.Play set { if (allowSeeking == value) return; + allowSeeking = value; updateBarVisibility(); } From 47181cf5d76c42904e7eb01653b960e36d57e94e Mon Sep 17 00:00:00 2001 From: chrisny286 Date: Wed, 23 Jan 2019 03:21:09 +0100 Subject: [PATCH 88/99] add back update in onUserChange --- osu.Game/Graphics/UserInterface/OsuSliderBar.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/osu.Game/Graphics/UserInterface/OsuSliderBar.cs b/osu.Game/Graphics/UserInterface/OsuSliderBar.cs index 84e1882dea..294d7da40f 100644 --- a/osu.Game/Graphics/UserInterface/OsuSliderBar.cs +++ b/osu.Game/Graphics/UserInterface/OsuSliderBar.cs @@ -127,6 +127,7 @@ namespace osu.Game.Graphics.UserInterface { base.OnUserChange(value); playSample(value); + updateTooltipText(value); } private void playSample(T value) From fe5d34a6573895d70184fa96079eddbfa2508e61 Mon Sep 17 00:00:00 2001 From: chrisny286 Date: Wed, 23 Jan 2019 03:25:56 +0100 Subject: [PATCH 89/99] replace as requested --- osu.Game/Graphics/UserInterface/OsuSliderBar.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Graphics/UserInterface/OsuSliderBar.cs b/osu.Game/Graphics/UserInterface/OsuSliderBar.cs index 294d7da40f..9db7af48b2 100644 --- a/osu.Game/Graphics/UserInterface/OsuSliderBar.cs +++ b/osu.Game/Graphics/UserInterface/OsuSliderBar.cs @@ -96,7 +96,7 @@ namespace osu.Game.Graphics.UserInterface { updateTooltipText(Current.Value); base.LoadComplete(); - CurrentNumber.ValueChanged += updateTooltipText; + CurrentNumber.BindValueChanged(updateTooltipText, true); } protected override bool OnHover(HoverEvent e) From 260011fc13a4066584ca834e1a994905aa4bae22 Mon Sep 17 00:00:00 2001 From: chrisny286 Date: Wed, 23 Jan 2019 04:05:03 +0100 Subject: [PATCH 90/99] remove manual update misunderstood that earlier --- osu.Game/Graphics/UserInterface/OsuSliderBar.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/osu.Game/Graphics/UserInterface/OsuSliderBar.cs b/osu.Game/Graphics/UserInterface/OsuSliderBar.cs index 9db7af48b2..26a5c11d5d 100644 --- a/osu.Game/Graphics/UserInterface/OsuSliderBar.cs +++ b/osu.Game/Graphics/UserInterface/OsuSliderBar.cs @@ -94,7 +94,6 @@ namespace osu.Game.Graphics.UserInterface protected override void LoadComplete() { - updateTooltipText(Current.Value); base.LoadComplete(); CurrentNumber.BindValueChanged(updateTooltipText, true); } From f107a922b42593148ddc12885ac6b6ecf23dd110 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 23 Jan 2019 14:43:23 +0900 Subject: [PATCH 91/99] Add tests for key counter inside player heirarchy --- osu.Game.Tests/Visual/TestCaseAutoplay.cs | 9 ++++++++- osu.Game/Screens/Play/Player.cs | 8 ++++---- osu.Game/Tests/Visual/TestCasePlayer.cs | 9 ++++++--- 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/osu.Game.Tests/Visual/TestCaseAutoplay.cs b/osu.Game.Tests/Visual/TestCaseAutoplay.cs index 4abfec4371..d81dcb3799 100644 --- a/osu.Game.Tests/Visual/TestCaseAutoplay.cs +++ b/osu.Game.Tests/Visual/TestCaseAutoplay.cs @@ -1,6 +1,7 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using System; using System.ComponentModel; using System.Linq; using osu.Game.Rulesets; @@ -23,11 +24,17 @@ namespace osu.Game.Tests.Visual }; } - protected override bool ContinueCondition(Player player) => base.ContinueCondition(player) && ((ScoreAccessiblePlayer)player).ScoreProcessor.TotalScore > 0; + protected override void AddCheckSteps(Func player) + { + base.AddCheckSteps(player); + AddUntilStep(() => ((ScoreAccessiblePlayer)player()).ScoreProcessor.TotalScore > 0, "score above zero"); + AddUntilStep(() => ((ScoreAccessiblePlayer)player()).HUDOverlay.KeyCounter.Children.Any(kc => kc.CountPresses > 0), "key counter counted keys"); + } private class ScoreAccessiblePlayer : Player { public new ScoreProcessor ScoreProcessor => base.ScoreProcessor; + public new HUDOverlay HUDOverlay => base.HUDOverlay; } } } diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index d5c99f5729..5ae50adb72 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -82,7 +82,7 @@ namespace osu.Game.Screens.Play protected ScoreProcessor ScoreProcessor; protected RulesetContainer RulesetContainer; - private HUDOverlay hudOverlay; + protected HUDOverlay HUDOverlay; private FailOverlay failOverlay; private DrawableStoryboard storyboard; @@ -199,7 +199,7 @@ namespace osu.Game.Screens.Play { Child = RulesetContainer.Cursor?.CreateProxy() ?? new Container(), }, - hudOverlay = new HUDOverlay(ScoreProcessor, RulesetContainer, working, offsetClock, adjustableClock) + HUDOverlay = new HUDOverlay(ScoreProcessor, RulesetContainer, working, offsetClock, adjustableClock) { Clock = Clock, // hud overlay doesn't want to use the audio clock directly ProcessCustomClock = false, @@ -232,8 +232,8 @@ namespace osu.Game.Screens.Play } }; - hudOverlay.HoldToQuit.Action = performUserRequestedExit; - hudOverlay.KeyCounter.Visible.BindTo(RulesetContainer.HasReplayLoaded); + HUDOverlay.HoldToQuit.Action = performUserRequestedExit; + HUDOverlay.KeyCounter.Visible.BindTo(RulesetContainer.HasReplayLoaded); RulesetContainer.IsPaused.BindTo(pauseContainer.IsPaused); diff --git a/osu.Game/Tests/Visual/TestCasePlayer.cs b/osu.Game/Tests/Visual/TestCasePlayer.cs index 47bf787bb5..d52a406915 100644 --- a/osu.Game/Tests/Visual/TestCasePlayer.cs +++ b/osu.Game/Tests/Visual/TestCasePlayer.cs @@ -44,7 +44,7 @@ namespace osu.Game.Tests.Visual { Player p = null; AddStep(ruleset.RulesetInfo.Name, () => p = loadPlayerFor(ruleset)); - AddUntilStep(() => ContinueCondition(p)); + AddCheckSteps(() => p); } else { @@ -52,7 +52,7 @@ namespace osu.Game.Tests.Visual { Player p = null; AddStep(r.Name, () => p = loadPlayerFor(r)); - AddUntilStep(() => ContinueCondition(p)); + AddCheckSteps(() => p); AddUntilStep(() => { @@ -79,7 +79,10 @@ namespace osu.Game.Tests.Visual } } - protected virtual bool ContinueCondition(Player player) => player.IsLoaded; + protected virtual void AddCheckSteps(Func player) + { + AddUntilStep(() => player().IsLoaded, "player loaded"); + } protected virtual IBeatmap CreateBeatmap(Ruleset ruleset) => new TestBeatmap(ruleset.RulesetInfo); From 49633b3394cca135abadd6393dabd97ebc64a7d1 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 23 Jan 2019 14:51:06 +0900 Subject: [PATCH 92/99] Fix key counter receptor getting overwritten by async load drawables --- osu.Game/Rulesets/UI/RulesetContainer.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Rulesets/UI/RulesetContainer.cs b/osu.Game/Rulesets/UI/RulesetContainer.cs index c8c7f3154b..0ea3377952 100644 --- a/osu.Game/Rulesets/UI/RulesetContainer.cs +++ b/osu.Game/Rulesets/UI/RulesetContainer.cs @@ -250,14 +250,14 @@ namespace osu.Game.Rulesets.UI [BackgroundDependencyLoader] private void load(OsuConfigManager config) { - KeyBindingInputManager.Children = new Drawable[] + KeyBindingInputManager.AddRange(new Drawable[] { content = new Container { RelativeSizeAxes = Axes.Both, }, Playfield - }; + }); if (Cursor != null) KeyBindingInputManager.Add(Cursor); From c18ce2c23a773d34db552cd226e1d29464b9570c Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 23 Jan 2019 14:51:13 +0900 Subject: [PATCH 93/99] Formatting fixes --- osu.Game/Rulesets/UI/RulesetInputManager.cs | 16 ++++++++-------- osu.Game/Screens/Play/HUDOverlay.cs | 12 ++++++++---- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/osu.Game/Rulesets/UI/RulesetInputManager.cs b/osu.Game/Rulesets/UI/RulesetInputManager.cs index a76942e3fa..e85a048c34 100644 --- a/osu.Game/Rulesets/UI/RulesetInputManager.cs +++ b/osu.Game/Rulesets/UI/RulesetInputManager.cs @@ -27,14 +27,6 @@ namespace osu.Game.Rulesets.UI public abstract class RulesetInputManager : PassThroughInputManager, ICanAttachKeyCounter, IHasReplayHandler where T : struct { - public class RulesetKeyBindingContainer : DatabasedKeyBindingContainer - { - public RulesetKeyBindingContainer(RulesetInfo ruleset, int variant, SimultaneousBindingMode unique) - : base(ruleset, variant, unique) - { - } - } - protected override InputState CreateInitialState() { var state = base.CreateInitialState(); @@ -251,6 +243,14 @@ namespace osu.Game.Rulesets.UI protected virtual RulesetKeyBindingContainer CreateKeyBindingContainer(RulesetInfo ruleset, int variant, SimultaneousBindingMode unique) => new RulesetKeyBindingContainer(ruleset, variant, unique); + + public class RulesetKeyBindingContainer : DatabasedKeyBindingContainer + { + public RulesetKeyBindingContainer(RulesetInfo ruleset, int variant, SimultaneousBindingMode unique) + : base(ruleset, variant, unique) + { + } + } } /// diff --git a/osu.Game/Screens/Play/HUDOverlay.cs b/osu.Game/Screens/Play/HUDOverlay.cs index cbd36d75c6..2fef8dc4f4 100644 --- a/osu.Game/Screens/Play/HUDOverlay.cs +++ b/osu.Game/Screens/Play/HUDOverlay.cs @@ -46,17 +46,21 @@ namespace osu.Game.Screens.Play Children = new Drawable[] { - visibilityContainer = new Container { + visibilityContainer = new Container + { RelativeSizeAxes = Axes.Both, - Children = new Drawable[] { - new Container { + Children = new Drawable[] + { + new Container + { Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, Y = 30, AutoSizeAxes = Axes.Both, AutoSizeDuration = 200, AutoSizeEasing = Easing.Out, - Children = new Drawable[] { + Children = new Drawable[] + { AccuracyCounter = CreateAccuracyCounter(), ScoreCounter = CreateScoreCounter(), ComboCounter = CreateComboCounter(), From f4ebab2d3ace823dc7c251136c7dc4ceeed54e7b Mon Sep 17 00:00:00 2001 From: chrisny286 Date: Wed, 23 Jan 2019 08:52:25 +0100 Subject: [PATCH 94/99] Fix backgrounds being transparent in some scaling modes by replacing `.FadeTo` at the necessary places with `.FadeColour`. restoring the `.FadeColour` in `fadeOut` of the Player Screen which is ran in every exit scenario. --- osu.Game/Screens/Play/Player.cs | 3 ++- osu.Game/Screens/Play/ScreenWithBeatmapBackground.cs | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index d5c99f5729..d833a8f83d 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -401,6 +401,7 @@ namespace osu.Game.Screens.Play { float fadeOutDuration = instant ? 0 : 250; Content.FadeOut(fadeOutDuration); + Background?.FadeColour(OsuColour.Gray(1f), fadeOutDuration, Easing.OutQuint); } protected override bool OnScroll(ScrollEvent e) => mouseWheelDisabled.Value && !pauseContainer.IsPaused; @@ -438,7 +439,7 @@ namespace osu.Game.Screens.Play .FadeTo(storyboardVisible && BackgroundOpacity > 0 ? 1 : 0, BACKGROUND_FADE_DURATION, Easing.OutQuint); if (storyboardVisible && beatmap.Storyboard.ReplacesBackground) - Background?.FadeTo(0, BACKGROUND_FADE_DURATION, Easing.OutQuint); + Background?.FadeColour(OsuColour.Gray(0f), BACKGROUND_FADE_DURATION, Easing.OutQuint); } protected virtual Results CreateResults(ScoreInfo score) => new SoloResults(score); diff --git a/osu.Game/Screens/Play/ScreenWithBeatmapBackground.cs b/osu.Game/Screens/Play/ScreenWithBeatmapBackground.cs index 3846b45d2f..890103485a 100644 --- a/osu.Game/Screens/Play/ScreenWithBeatmapBackground.cs +++ b/osu.Game/Screens/Play/ScreenWithBeatmapBackground.cs @@ -6,6 +6,7 @@ using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Framework.Screens; using osu.Game.Configuration; +using osu.Game.Graphics; using osu.Game.Screens.Backgrounds; using osuTK; @@ -67,7 +68,7 @@ namespace osu.Game.Screens.Play { if (!IsCurrentScreen) return; - Background?.FadeTo(BackgroundOpacity, BACKGROUND_FADE_DURATION, Easing.OutQuint); + Background?.FadeColour(OsuColour.Gray(BackgroundOpacity), BACKGROUND_FADE_DURATION, Easing.OutQuint); Background?.BlurTo(new Vector2((float)BlurLevel.Value * 25), BACKGROUND_FADE_DURATION, Easing.OutQuint); } } From bb56c4a1a79e8f16adb210ae2a2b6b052dbf9441 Mon Sep 17 00:00:00 2001 From: chrisny286 Date: Wed, 23 Jan 2019 09:08:34 +0100 Subject: [PATCH 95/99] use Color4.Black and White + using osuTK.Graphics --- osu.Game/Screens/Play/Player.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index d833a8f83d..f243f1016d 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -32,6 +32,7 @@ using osu.Game.Scoring; using osu.Game.Screens.Ranking; using osu.Game.Skinning; using osu.Game.Storyboards.Drawables; +using osuTK.Graphics; namespace osu.Game.Screens.Play { @@ -401,7 +402,7 @@ namespace osu.Game.Screens.Play { float fadeOutDuration = instant ? 0 : 250; Content.FadeOut(fadeOutDuration); - Background?.FadeColour(OsuColour.Gray(1f), fadeOutDuration, Easing.OutQuint); + Background?.FadeColour(Color4.White, fadeOutDuration, Easing.OutQuint); } protected override bool OnScroll(ScrollEvent e) => mouseWheelDisabled.Value && !pauseContainer.IsPaused; @@ -439,7 +440,7 @@ namespace osu.Game.Screens.Play .FadeTo(storyboardVisible && BackgroundOpacity > 0 ? 1 : 0, BACKGROUND_FADE_DURATION, Easing.OutQuint); if (storyboardVisible && beatmap.Storyboard.ReplacesBackground) - Background?.FadeColour(OsuColour.Gray(0f), BACKGROUND_FADE_DURATION, Easing.OutQuint); + Background?.FadeColour(Color4.Black, BACKGROUND_FADE_DURATION, Easing.OutQuint); } protected virtual Results CreateResults(ScoreInfo score) => new SoloResults(score); From 4180ca75bca22e452a1d2de6083a39024dfdd4f9 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 23 Jan 2019 17:14:08 +0900 Subject: [PATCH 96/99] Fix typo in comment --- osu.Game/Screens/Play/ScreenWithBeatmapBackground.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Screens/Play/ScreenWithBeatmapBackground.cs b/osu.Game/Screens/Play/ScreenWithBeatmapBackground.cs index 890103485a..61dc70c4ae 100644 --- a/osu.Game/Screens/Play/ScreenWithBeatmapBackground.cs +++ b/osu.Game/Screens/Play/ScreenWithBeatmapBackground.cs @@ -61,7 +61,7 @@ namespace osu.Game.Screens.Play protected virtual void InitializeBackgroundElements() => UpdateBackgroundElements(); /// - /// Called wen background elements require updates, usually due to a user changing a setting. + /// Called when background elements require updates, usually due to a user changing a setting. /// /// protected virtual void UpdateBackgroundElements() From 1025c51e0de90c64ec8a6276414878f31610df22 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 23 Jan 2019 17:30:05 +0900 Subject: [PATCH 97/99] Allow filtering settings matching based on dropdown content --- osu.Game/Overlays/Settings/SettingsDropdown.cs | 2 ++ osu.Game/Overlays/Settings/SettingsItem.cs | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/osu.Game/Overlays/Settings/SettingsDropdown.cs b/osu.Game/Overlays/Settings/SettingsDropdown.cs index 1c3eb6c245..864147c21d 100644 --- a/osu.Game/Overlays/Settings/SettingsDropdown.cs +++ b/osu.Game/Overlays/Settings/SettingsDropdown.cs @@ -26,6 +26,8 @@ namespace osu.Game.Overlays.Settings } } + public override IEnumerable FilterTerms => base.FilterTerms.Concat(Control.Items.Select(i => i.ToString())); + protected sealed override Drawable CreateControl() => CreateDropdown(); protected virtual OsuDropdown CreateDropdown() => new DropdownControl { Items = Items }; diff --git a/osu.Game/Overlays/Settings/SettingsItem.cs b/osu.Game/Overlays/Settings/SettingsItem.cs index 1d7e6350ae..cf25e80820 100644 --- a/osu.Game/Overlays/Settings/SettingsItem.cs +++ b/osu.Game/Overlays/Settings/SettingsItem.cs @@ -72,7 +72,7 @@ namespace osu.Game.Overlays.Settings } } - public IEnumerable FilterTerms => new[] { LabelText }; + public virtual IEnumerable FilterTerms => new[] { LabelText }; public bool MatchingFilter { From 03e3247bafe8bdbf03b414f128d8642bd5a58fa1 Mon Sep 17 00:00:00 2001 From: chrisny286 Date: Wed, 23 Jan 2019 09:40:38 +0100 Subject: [PATCH 98/99] replace FadeTo in PlayerLoader didnt notice that interaction yet. yes this makes it neccessary. --- osu.Game/Screens/Play/PlayerLoader.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Screens/Play/PlayerLoader.cs b/osu.Game/Screens/Play/PlayerLoader.cs index ded25f013a..44866846d2 100644 --- a/osu.Game/Screens/Play/PlayerLoader.cs +++ b/osu.Game/Screens/Play/PlayerLoader.cs @@ -164,7 +164,7 @@ namespace osu.Game.Screens.Play protected override void InitializeBackgroundElements() { - Background?.FadeTo(1, BACKGROUND_FADE_DURATION, Easing.OutQuint); + Background?.FadeColour(Color4.White, BACKGROUND_FADE_DURATION, Easing.OutQuint); Background?.BlurTo(background_blur, BACKGROUND_FADE_DURATION, Easing.OutQuint); } From 484268f1f206c670c05d1598c99115a6d4d1b5f4 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 23 Jan 2019 20:30:32 +0900 Subject: [PATCH 99/99] Expose CalculateAccuracy for performance tools --- osu.Game/Scoring/Legacy/LegacyScoreParser.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Scoring/Legacy/LegacyScoreParser.cs b/osu.Game/Scoring/Legacy/LegacyScoreParser.cs index 3184f776a7..87411a95c8 100644 --- a/osu.Game/Scoring/Legacy/LegacyScoreParser.cs +++ b/osu.Game/Scoring/Legacy/LegacyScoreParser.cs @@ -109,12 +109,12 @@ namespace osu.Game.Scoring.Legacy } } - calculateAccuracy(score.ScoreInfo); + CalculateAccuracy(score.ScoreInfo); return score; } - private void calculateAccuracy(ScoreInfo score) + protected void CalculateAccuracy(ScoreInfo score) { int countMiss = score.Statistics[HitResult.Miss]; int count50 = score.Statistics[HitResult.Meh];