From 606e08871330d7a7718bacb49fc1721d86bca293 Mon Sep 17 00:00:00 2001 From: TocoToucan Date: Fri, 20 Apr 2018 18:17:57 +0300 Subject: [PATCH 01/12] Visual settings: Ignore beatmap skin --- osu.Game/Configuration/OsuConfigManager.cs | 4 ++- .../Play/PlayerSettings/VisualSettings.cs | 5 +++- .../Skinning/LocalSkinOverrideContainer.cs | 28 +++++++++++++++++-- 3 files changed, 33 insertions(+), 4 deletions(-) diff --git a/osu.Game/Configuration/OsuConfigManager.cs b/osu.Game/Configuration/OsuConfigManager.cs index 3efaa02a31..6785b53cdd 100644 --- a/osu.Game/Configuration/OsuConfigManager.cs +++ b/osu.Game/Configuration/OsuConfigManager.cs @@ -15,6 +15,7 @@ namespace osu.Game.Configuration // UI/selection defaults Set(OsuSetting.Ruleset, 0, 0, int.MaxValue); Set(OsuSetting.Skin, 0, 0, int.MaxValue); + Set(OsuSetting.IgnoreBeatmapSkin, false); Set(OsuSetting.BeatmapDetailTab, BeatmapDetailTab.Details); @@ -133,6 +134,7 @@ namespace osu.Game.Configuration Skin, ScreenshotFormat, ScreenshotCaptureMenuCursor, - SongSelectRightMouseScroll + SongSelectRightMouseScroll, + IgnoreBeatmapSkin } } diff --git a/osu.Game/Screens/Play/PlayerSettings/VisualSettings.cs b/osu.Game/Screens/Play/PlayerSettings/VisualSettings.cs index 92d069a224..8a2a8ac773 100644 --- a/osu.Game/Screens/Play/PlayerSettings/VisualSettings.cs +++ b/osu.Game/Screens/Play/PlayerSettings/VisualSettings.cs @@ -15,6 +15,7 @@ namespace osu.Game.Screens.Play.PlayerSettings private readonly PlayerSliderBar dimSliderBar; private readonly PlayerSliderBar blurSliderBar; private readonly PlayerCheckbox showStoryboardToggle; + private readonly PlayerCheckbox ignoreBeatmapSkinToggle; public VisualSettings() { @@ -34,7 +35,8 @@ namespace osu.Game.Screens.Play.PlayerSettings { Text = "Toggles:" }, - showStoryboardToggle = new PlayerCheckbox { LabelText = "Storyboards" } + showStoryboardToggle = new PlayerCheckbox { LabelText = "Storyboards" }, + ignoreBeatmapSkinToggle = new PlayerCheckbox { LabelText = "Ignore beatmap skin" } }; } @@ -44,6 +46,7 @@ namespace osu.Game.Screens.Play.PlayerSettings dimSliderBar.Bindable = config.GetBindable(OsuSetting.DimLevel); blurSliderBar.Bindable = config.GetBindable(OsuSetting.BlurLevel); showStoryboardToggle.Bindable = config.GetBindable(OsuSetting.ShowStoryboard); + ignoreBeatmapSkinToggle.Bindable = config.GetBindable(OsuSetting.IgnoreBeatmapSkin); } } } diff --git a/osu.Game/Skinning/LocalSkinOverrideContainer.cs b/osu.Game/Skinning/LocalSkinOverrideContainer.cs index bfbb1719df..3332f73ac7 100644 --- a/osu.Game/Skinning/LocalSkinOverrideContainer.cs +++ b/osu.Game/Skinning/LocalSkinOverrideContainer.cs @@ -4,9 +4,11 @@ using System; using osu.Framework.Allocation; using osu.Framework.Audio.Sample; +using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Textures; +using osu.Game.Configuration; namespace osu.Game.Skinning { @@ -14,9 +16,21 @@ namespace osu.Game.Skinning { public event Action SourceChanged; - public Drawable GetDrawableComponent(string componentName) => source.GetDrawableComponent(componentName) ?? fallbackSource?.GetDrawableComponent(componentName); + public Drawable GetDrawableComponent(string componentName) + { + Drawable sourceDrawable; + if (!ignoreBeatmapSkin && (sourceDrawable = source.GetDrawableComponent(componentName)) != null) + return sourceDrawable; + return fallbackSource?.GetDrawableComponent(componentName); + } - public Texture GetTexture(string componentName) => source.GetTexture(componentName) ?? fallbackSource.GetTexture(componentName); + public Texture GetTexture(string componentName) + { + Texture sourceTexture; + if (!ignoreBeatmapSkin && (sourceTexture = source.GetTexture(componentName)) != null) + return sourceTexture; + return fallbackSource.GetTexture(componentName); + } public SampleChannel GetSample(string sampleName) => source.GetSample(sampleName) ?? fallbackSource?.GetSample(sampleName); @@ -60,6 +74,16 @@ namespace osu.Game.Skinning return dependencies; } + private Bindable ignoreBeatmapSkin = new Bindable(); + + [BackgroundDependencyLoader] + private void load(OsuConfigManager config) + { + ignoreBeatmapSkin = config.GetBindable(OsuSetting.IgnoreBeatmapSkin); + ignoreBeatmapSkin.ValueChanged += val => onSourceChanged(); + ignoreBeatmapSkin.TriggerChange(); + } + protected override void LoadComplete() { base.LoadComplete(); From 1ce38c7fc6fb3cb76957dc0f9ec5d8ddcfd9f9e0 Mon Sep 17 00:00:00 2001 From: TocoToucan Date: Fri, 20 Apr 2018 18:30:41 +0300 Subject: [PATCH 02/12] Visual settings: Ignore beatmap hitsounds --- osu.Game/Configuration/OsuConfigManager.cs | 4 +++- .../Screens/Play/PlayerSettings/VisualSettings.cs | 5 ++++- osu.Game/Skinning/LocalSkinOverrideContainer.cs | 13 ++++++++++++- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/osu.Game/Configuration/OsuConfigManager.cs b/osu.Game/Configuration/OsuConfigManager.cs index 6785b53cdd..a7dcaef500 100644 --- a/osu.Game/Configuration/OsuConfigManager.cs +++ b/osu.Game/Configuration/OsuConfigManager.cs @@ -16,6 +16,7 @@ namespace osu.Game.Configuration Set(OsuSetting.Ruleset, 0, 0, int.MaxValue); Set(OsuSetting.Skin, 0, 0, int.MaxValue); Set(OsuSetting.IgnoreBeatmapSkin, false); + Set(OsuSetting.IgnoreBeatmapHitsounds, false); Set(OsuSetting.BeatmapDetailTab, BeatmapDetailTab.Details); @@ -135,6 +136,7 @@ namespace osu.Game.Configuration ScreenshotFormat, ScreenshotCaptureMenuCursor, SongSelectRightMouseScroll, - IgnoreBeatmapSkin + IgnoreBeatmapSkin, + IgnoreBeatmapHitsounds } } diff --git a/osu.Game/Screens/Play/PlayerSettings/VisualSettings.cs b/osu.Game/Screens/Play/PlayerSettings/VisualSettings.cs index 8a2a8ac773..66d2d413fa 100644 --- a/osu.Game/Screens/Play/PlayerSettings/VisualSettings.cs +++ b/osu.Game/Screens/Play/PlayerSettings/VisualSettings.cs @@ -16,6 +16,7 @@ namespace osu.Game.Screens.Play.PlayerSettings private readonly PlayerSliderBar blurSliderBar; private readonly PlayerCheckbox showStoryboardToggle; private readonly PlayerCheckbox ignoreBeatmapSkinToggle; + private readonly PlayerCheckbox ignoreBeatmapHitsoundsToggle; public VisualSettings() { @@ -36,7 +37,8 @@ namespace osu.Game.Screens.Play.PlayerSettings Text = "Toggles:" }, showStoryboardToggle = new PlayerCheckbox { LabelText = "Storyboards" }, - ignoreBeatmapSkinToggle = new PlayerCheckbox { LabelText = "Ignore beatmap skin" } + ignoreBeatmapSkinToggle = new PlayerCheckbox { LabelText = "Ignore beatmap skin" }, + ignoreBeatmapHitsoundsToggle = new PlayerCheckbox { LabelText = "Ignore beatmap hitsounds" } }; } @@ -47,6 +49,7 @@ namespace osu.Game.Screens.Play.PlayerSettings blurSliderBar.Bindable = config.GetBindable(OsuSetting.BlurLevel); showStoryboardToggle.Bindable = config.GetBindable(OsuSetting.ShowStoryboard); ignoreBeatmapSkinToggle.Bindable = config.GetBindable(OsuSetting.IgnoreBeatmapSkin); + ignoreBeatmapHitsoundsToggle.Bindable = config.GetBindable(OsuSetting.IgnoreBeatmapHitsounds); } } } diff --git a/osu.Game/Skinning/LocalSkinOverrideContainer.cs b/osu.Game/Skinning/LocalSkinOverrideContainer.cs index 3332f73ac7..f4476eb3a6 100644 --- a/osu.Game/Skinning/LocalSkinOverrideContainer.cs +++ b/osu.Game/Skinning/LocalSkinOverrideContainer.cs @@ -32,7 +32,13 @@ namespace osu.Game.Skinning return fallbackSource.GetTexture(componentName); } - public SampleChannel GetSample(string sampleName) => source.GetSample(sampleName) ?? fallbackSource?.GetSample(sampleName); + public SampleChannel GetSample(string sampleName) + { + SampleChannel sourceChannel; + if (!ignoreBeatmapHitsounds && (sourceChannel = source.GetSample(sampleName)) != null) + return sourceChannel; + return fallbackSource?.GetSample(sampleName); + } public TValue? GetValue(Func query) where TConfiguration : SkinConfiguration where TValue : struct { @@ -75,6 +81,7 @@ namespace osu.Game.Skinning } private Bindable ignoreBeatmapSkin = new Bindable(); + private Bindable ignoreBeatmapHitsounds = new Bindable(); [BackgroundDependencyLoader] private void load(OsuConfigManager config) @@ -82,6 +89,10 @@ namespace osu.Game.Skinning ignoreBeatmapSkin = config.GetBindable(OsuSetting.IgnoreBeatmapSkin); ignoreBeatmapSkin.ValueChanged += val => onSourceChanged(); ignoreBeatmapSkin.TriggerChange(); + + ignoreBeatmapHitsounds = config.GetBindable(OsuSetting.IgnoreBeatmapHitsounds); + ignoreBeatmapHitsounds.ValueChanged += val => onSourceChanged(); + ignoreBeatmapHitsounds.TriggerChange(); } protected override void LoadComplete() From f4c2d6b1a384afd98eb4d9f76f30d0cbc45724c1 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 24 Apr 2018 00:51:33 +0900 Subject: [PATCH 03/12] Fix wedge load test again Initial load was not being waited on for long enough. --- .../Visual/TestCaseBeatmapInfoWedge.cs | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/osu.Game.Tests/Visual/TestCaseBeatmapInfoWedge.cs b/osu.Game.Tests/Visual/TestCaseBeatmapInfoWedge.cs index 51a8bacd2e..642acacefa 100644 --- a/osu.Game.Tests/Visual/TestCaseBeatmapInfoWedge.cs +++ b/osu.Game.Tests/Visual/TestCaseBeatmapInfoWedge.cs @@ -52,6 +52,9 @@ namespace osu.Game.Tests.Visual infoWedge.UpdateBeatmap(beatmap); }); + // select part is redundant, but wait for load isn't + selectBeatmap(beatmap.Value.Beatmap); + AddWaitStep(3); AddStep("hide", () => { infoWedge.State = Visibility.Hidden; }); @@ -63,10 +66,11 @@ namespace osu.Game.Tests.Visual foreach (var rulesetInfo in rulesets.AvailableRulesets) { var ruleset = rulesetInfo.CreateInstance(); - beatmaps.Add(createTestBeatmap(rulesetInfo)); + var beatmap = createTestBeatmap(rulesetInfo); - var name = rulesetInfo.ShortName; - selectBeatmap(name); + beatmaps.Add(beatmap); + + selectBeatmap(beatmap); // TODO: adjust cases once more info is shown for other gamemodes switch (ruleset) @@ -108,16 +112,14 @@ namespace osu.Game.Tests.Visual AddAssert("check no infolabels", () => !infoWedge.Info.InfoLabelContainer.Children.Any()); } - private void selectBeatmap(string name) + private void selectBeatmap(Beatmap b) { BeatmapInfoWedge.BufferedWedgeInfo infoBefore = null; - AddStep($"select {name} beatmap", () => + AddStep($"select {b.Metadata.Title} beatmap", () => { infoBefore = infoWedge.Info; - WorkingBeatmap bm = new TestWorkingBeatmap(beatmaps.First(b => b.BeatmapInfo.Ruleset.ShortName == name)); - beatmap.Value = bm; - infoWedge.UpdateBeatmap(beatmap); + infoWedge.UpdateBeatmap(beatmap.Value = new TestWorkingBeatmap(b)); }); AddUntilStep(() => infoWedge.Info != infoBefore, "wait for async load"); From 3886e75959d1c8c0d8b6760f13d8c51467d764a5 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 24 Apr 2018 01:52:25 +0900 Subject: [PATCH 04/12] Fix potentially missing group headers in beatmap carousel --- osu.Game/Screens/Select/Carousel/CarouselGroup.cs | 5 +++++ osu.Game/Screens/Select/Carousel/CarouselItem.cs | 9 ++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/osu.Game/Screens/Select/Carousel/CarouselGroup.cs b/osu.Game/Screens/Select/Carousel/CarouselGroup.cs index a1f44763d6..2118cfdc78 100644 --- a/osu.Game/Screens/Select/Carousel/CarouselGroup.cs +++ b/osu.Game/Screens/Select/Carousel/CarouselGroup.cs @@ -27,6 +27,11 @@ namespace osu.Game.Screens.Select.Carousel get { var drawables = base.Drawables; + + // if we are explicitly not present, don't ever present children. + // without this check, children drawables can potentially be presented without their group header. + if (DrawableRepresentation.Value?.IsPresent == false) return drawables; + foreach (var c in InternalChildren) drawables.AddRange(c.Drawables); return drawables; diff --git a/osu.Game/Screens/Select/Carousel/CarouselItem.cs b/osu.Game/Screens/Select/Carousel/CarouselItem.cs index 0de32c12f1..c0781f09c0 100644 --- a/osu.Game/Screens/Select/Carousel/CarouselItem.cs +++ b/osu.Game/Screens/Select/Carousel/CarouselItem.cs @@ -24,7 +24,7 @@ namespace osu.Game.Screens.Select.Carousel { var items = new List(); - var self = drawableRepresentation.Value; + var self = DrawableRepresentation.Value; if (self?.IsPresent == true) items.Add(self); return items; @@ -35,7 +35,7 @@ namespace osu.Game.Screens.Select.Carousel protected CarouselItem() { - drawableRepresentation = new Lazy(CreateDrawableRepresentation); + DrawableRepresentation = new Lazy(CreateDrawableRepresentation); Filtered.ValueChanged += v => { @@ -44,13 +44,16 @@ namespace osu.Game.Screens.Select.Carousel }; } - private readonly Lazy drawableRepresentation; + protected readonly Lazy DrawableRepresentation; /// /// Used as a default sort method for s of differing types. /// internal ulong ChildID; + /// + /// Create a fresh drawable version of this item. If you wish to consume the current representation, use instead. + /// protected abstract DrawableCarouselItem CreateDrawableRepresentation(); public virtual void Filter(FilterCriteria criteria) From 57219ae9c64cb4f1b47ca3591c0f71363dc6f0e1 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 24 Apr 2018 02:07:16 +0900 Subject: [PATCH 05/12] Fix clashing variable name --- osu.Game.Tests/Visual/TestCaseBeatmapInfoWedge.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/osu.Game.Tests/Visual/TestCaseBeatmapInfoWedge.cs b/osu.Game.Tests/Visual/TestCaseBeatmapInfoWedge.cs index 642acacefa..886c1120d4 100644 --- a/osu.Game.Tests/Visual/TestCaseBeatmapInfoWedge.cs +++ b/osu.Game.Tests/Visual/TestCaseBeatmapInfoWedge.cs @@ -66,11 +66,11 @@ namespace osu.Game.Tests.Visual foreach (var rulesetInfo in rulesets.AvailableRulesets) { var ruleset = rulesetInfo.CreateInstance(); - var beatmap = createTestBeatmap(rulesetInfo); + var testBeatmap = createTestBeatmap(rulesetInfo); - beatmaps.Add(beatmap); + beatmaps.Add(testBeatmap); - selectBeatmap(beatmap); + selectBeatmap(testBeatmap); // TODO: adjust cases once more info is shown for other gamemodes switch (ruleset) From 84bda7d23fdc2945b6cefc9417f319195f34b274 Mon Sep 17 00:00:00 2001 From: Shane Woolcock Date: Tue, 24 Apr 2018 20:46:44 +0930 Subject: [PATCH 06/12] Update framework and ensure the add channel button is not switchable --- osu-framework | 2 +- osu.Game/Overlays/Chat/ChatTabControl.cs | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index 61e676094d..df4e92bbcb 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 61e676094d25436bb9e8858946f65c43d15d8e01 +Subproject commit df4e92bbcb3ece05c7245aab2caacc0953ca6b55 diff --git a/osu.Game/Overlays/Chat/ChatTabControl.cs b/osu.Game/Overlays/Chat/ChatTabControl.cs index 77a30e6389..91b790ece4 100644 --- a/osu.Game/Overlays/Chat/ChatTabControl.cs +++ b/osu.Game/Overlays/Chat/ChatTabControl.cs @@ -307,6 +307,8 @@ namespace osu.Game.Overlays.Chat { public override bool IsRemovable => false; + public override bool IsSwitchable => false; + public ChannelSelectorTabItem(Channel value) : base(value) { Depth = float.MaxValue; From 7388984d5fbdf19538d6e29fe2b46c700a5480a9 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 25 Apr 2018 14:57:08 +0900 Subject: [PATCH 07/12] Update framework --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index df4e92bbcb..0773d895d9 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit df4e92bbcb3ece05c7245aab2caacc0953ca6b55 +Subproject commit 0773d895d9aa0729995cd4a23efc28238e35ceed From 4f53185d436c6e8fc4d69ff914e340084aa392bc Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 25 Apr 2018 16:15:23 +0900 Subject: [PATCH 08/12] Invert logic to match existing toggles --- osu.Game/Configuration/OsuConfigManager.cs | 9 +++---- .../Play/PlayerSettings/VisualSettings.cs | 12 +++++----- .../Skinning/LocalSkinOverrideContainer.cs | 24 +++++++++---------- 3 files changed, 23 insertions(+), 22 deletions(-) diff --git a/osu.Game/Configuration/OsuConfigManager.cs b/osu.Game/Configuration/OsuConfigManager.cs index a7dcaef500..509622c2fe 100644 --- a/osu.Game/Configuration/OsuConfigManager.cs +++ b/osu.Game/Configuration/OsuConfigManager.cs @@ -15,8 +15,6 @@ namespace osu.Game.Configuration // UI/selection defaults Set(OsuSetting.Ruleset, 0, 0, int.MaxValue); Set(OsuSetting.Skin, 0, 0, int.MaxValue); - Set(OsuSetting.IgnoreBeatmapSkin, false); - Set(OsuSetting.IgnoreBeatmapHitsounds, false); Set(OsuSetting.BeatmapDetailTab, BeatmapDetailTab.Details); @@ -62,6 +60,9 @@ namespace osu.Game.Configuration Set(OsuSetting.ShowFpsDisplay, false); Set(OsuSetting.ShowStoryboard, true); + Set(OsuSetting.BeatmapSkins, true); + Set(OsuSetting.BeatmapHitsounds, true); + Set(OsuSetting.CursorRotation, true); Set(OsuSetting.MenuParallax, true); @@ -136,7 +137,7 @@ namespace osu.Game.Configuration ScreenshotFormat, ScreenshotCaptureMenuCursor, SongSelectRightMouseScroll, - IgnoreBeatmapSkin, - IgnoreBeatmapHitsounds + BeatmapSkins, + BeatmapHitsounds } } diff --git a/osu.Game/Screens/Play/PlayerSettings/VisualSettings.cs b/osu.Game/Screens/Play/PlayerSettings/VisualSettings.cs index 66d2d413fa..439e344020 100644 --- a/osu.Game/Screens/Play/PlayerSettings/VisualSettings.cs +++ b/osu.Game/Screens/Play/PlayerSettings/VisualSettings.cs @@ -15,8 +15,8 @@ namespace osu.Game.Screens.Play.PlayerSettings private readonly PlayerSliderBar dimSliderBar; private readonly PlayerSliderBar blurSliderBar; private readonly PlayerCheckbox showStoryboardToggle; - private readonly PlayerCheckbox ignoreBeatmapSkinToggle; - private readonly PlayerCheckbox ignoreBeatmapHitsoundsToggle; + private readonly PlayerCheckbox beatmapSkinsToggle; + private readonly PlayerCheckbox beatmapHitsoundsToggle; public VisualSettings() { @@ -37,8 +37,8 @@ namespace osu.Game.Screens.Play.PlayerSettings Text = "Toggles:" }, showStoryboardToggle = new PlayerCheckbox { LabelText = "Storyboards" }, - ignoreBeatmapSkinToggle = new PlayerCheckbox { LabelText = "Ignore beatmap skin" }, - ignoreBeatmapHitsoundsToggle = new PlayerCheckbox { LabelText = "Ignore beatmap hitsounds" } + beatmapSkinsToggle = new PlayerCheckbox { LabelText = "Beatmap skins" }, + beatmapHitsoundsToggle = new PlayerCheckbox { LabelText = "Beatmap hitsounds" } }; } @@ -48,8 +48,8 @@ namespace osu.Game.Screens.Play.PlayerSettings dimSliderBar.Bindable = config.GetBindable(OsuSetting.DimLevel); blurSliderBar.Bindable = config.GetBindable(OsuSetting.BlurLevel); showStoryboardToggle.Bindable = config.GetBindable(OsuSetting.ShowStoryboard); - ignoreBeatmapSkinToggle.Bindable = config.GetBindable(OsuSetting.IgnoreBeatmapSkin); - ignoreBeatmapHitsoundsToggle.Bindable = config.GetBindable(OsuSetting.IgnoreBeatmapHitsounds); + beatmapSkinsToggle.Bindable = config.GetBindable(OsuSetting.BeatmapSkins); + beatmapHitsoundsToggle.Bindable = config.GetBindable(OsuSetting.BeatmapHitsounds); } } } diff --git a/osu.Game/Skinning/LocalSkinOverrideContainer.cs b/osu.Game/Skinning/LocalSkinOverrideContainer.cs index f4476eb3a6..bab2a956be 100644 --- a/osu.Game/Skinning/LocalSkinOverrideContainer.cs +++ b/osu.Game/Skinning/LocalSkinOverrideContainer.cs @@ -16,10 +16,13 @@ namespace osu.Game.Skinning { public event Action SourceChanged; + private Bindable beatmapSkins = new Bindable(); + private Bindable beatmapHitsounds = new Bindable(); + public Drawable GetDrawableComponent(string componentName) { Drawable sourceDrawable; - if (!ignoreBeatmapSkin && (sourceDrawable = source.GetDrawableComponent(componentName)) != null) + if (beatmapSkins && (sourceDrawable = source.GetDrawableComponent(componentName)) != null) return sourceDrawable; return fallbackSource?.GetDrawableComponent(componentName); } @@ -27,7 +30,7 @@ namespace osu.Game.Skinning public Texture GetTexture(string componentName) { Texture sourceTexture; - if (!ignoreBeatmapSkin && (sourceTexture = source.GetTexture(componentName)) != null) + if (beatmapSkins && (sourceTexture = source.GetTexture(componentName)) != null) return sourceTexture; return fallbackSource.GetTexture(componentName); } @@ -35,7 +38,7 @@ namespace osu.Game.Skinning public SampleChannel GetSample(string sampleName) { SampleChannel sourceChannel; - if (!ignoreBeatmapHitsounds && (sourceChannel = source.GetSample(sampleName)) != null) + if (beatmapHitsounds && (sourceChannel = source.GetSample(sampleName)) != null) return sourceChannel; return fallbackSource?.GetSample(sampleName); } @@ -80,19 +83,16 @@ namespace osu.Game.Skinning return dependencies; } - private Bindable ignoreBeatmapSkin = new Bindable(); - private Bindable ignoreBeatmapHitsounds = new Bindable(); - [BackgroundDependencyLoader] private void load(OsuConfigManager config) { - ignoreBeatmapSkin = config.GetBindable(OsuSetting.IgnoreBeatmapSkin); - ignoreBeatmapSkin.ValueChanged += val => onSourceChanged(); - ignoreBeatmapSkin.TriggerChange(); + beatmapSkins = config.GetBindable(OsuSetting.BeatmapSkins); + beatmapSkins.ValueChanged += val => onSourceChanged(); + beatmapSkins.TriggerChange(); - ignoreBeatmapHitsounds = config.GetBindable(OsuSetting.IgnoreBeatmapHitsounds); - ignoreBeatmapHitsounds.ValueChanged += val => onSourceChanged(); - ignoreBeatmapHitsounds.TriggerChange(); + beatmapHitsounds = config.GetBindable(OsuSetting.BeatmapHitsounds); + beatmapHitsounds.ValueChanged += val => onSourceChanged(); + beatmapHitsounds.TriggerChange(); } protected override void LoadComplete() From 6e6586909bc25bccc0380afa6c8f90a8e1d83272 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 25 Apr 2018 16:32:06 +0900 Subject: [PATCH 09/12] User pattern matching --- osu.Game/Skinning/LocalSkinOverrideContainer.cs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/osu.Game/Skinning/LocalSkinOverrideContainer.cs b/osu.Game/Skinning/LocalSkinOverrideContainer.cs index bab2a956be..ad6a033936 100644 --- a/osu.Game/Skinning/LocalSkinOverrideContainer.cs +++ b/osu.Game/Skinning/LocalSkinOverrideContainer.cs @@ -46,8 +46,7 @@ namespace osu.Game.Skinning public TValue? GetValue(Func query) where TConfiguration : SkinConfiguration where TValue : struct { TValue? val = null; - var conf = (source as Skin)?.Configuration as TConfiguration; - if (conf != null) + if ((source as Skin)?.Configuration is TConfiguration conf) val = query?.Invoke(conf); return val ?? fallbackSource?.GetValue(query); @@ -56,8 +55,7 @@ namespace osu.Game.Skinning public TValue GetValue(Func query) where TConfiguration : SkinConfiguration where TValue : class { TValue val = null; - var conf = (source as Skin)?.Configuration as TConfiguration; - if (conf != null) + if ((source as Skin)?.Configuration is TConfiguration conf) val = query?.Invoke(conf); return val ?? fallbackSource?.GetValue(query); From ad8ba37ee370bd81464756c71d40e546af7ea4f4 Mon Sep 17 00:00:00 2001 From: Nobbele <4ppleCracker@gmail.com> Date: Thu, 26 Apr 2018 12:57:24 +0200 Subject: [PATCH 10/12] Updated UserStatus.cs to make more sense(UNTESTED) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Untested code, on my ipad in school so i can’t compile the code or check for refrences to stuff Modding, playing multiplayer/singleplayer, Busy, etc are all done when user is online so they may just be a class of type UserStatusOnline(used to be UserStatusAvailable but since available and online are basically the same i just made available be online). I don’t know how PM’s are handled but i assume that the client recieves the PM and then decides what to do based on your status. By doing this you can interupt the user with the message if typeof(status) != typeof(UserStatusBusy), making multiplaying, solo game, etc not interupt the user, but when typeof(status) == typeof(UserStatusBusy) show a less intrusive message box to not interupt the user --- osu.Game/Users/UserStatus.cs | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/osu.Game/Users/UserStatus.cs b/osu.Game/Users/UserStatus.cs index 22bc9ed1a0..1584605166 100644 --- a/osu.Game/Users/UserStatus.cs +++ b/osu.Game/Users/UserStatus.cs @@ -12,12 +12,13 @@ namespace osu.Game.Users public abstract Color4 GetAppropriateColour(OsuColour colours); } - public abstract class UserStatusAvailable : UserStatus + public class UserStatusOnline : UserStatus { + public override string Message => @"Online"; public override Color4 GetAppropriateColour(OsuColour colours) => colours.BlueDarker; } - public abstract class UserStatusBusy : UserStatus + public abstract class UserStatusBusy : UserStatusOnline { public override Color4 GetAppropriateColour(OsuColour colours) => colours.YellowDark; } @@ -28,17 +29,12 @@ namespace osu.Game.Users public override Color4 GetAppropriateColour(OsuColour colours) => colours.Gray7; } - public class UserStatusOnline : UserStatusAvailable - { - public override string Message => @"Online"; - } - - public class UserStatusSpectating : UserStatusAvailable + public class UserStatusSpectating : UserStatusOnline { public override string Message => @"Spectating a game"; } - public class UserStatusInLobby : UserStatusAvailable + public class UserStatusInLobby : UserStatusOnline { public override string Message => @"in Multiplayer Lobby"; } @@ -53,13 +49,13 @@ namespace osu.Game.Users public override string Message => @"Multiplaying"; } - public class UserStatusModding : UserStatus + public class UserStatusModding : UserStatusOnline { public override string Message => @"Modding a map"; public override Color4 GetAppropriateColour(OsuColour colours) => colours.PurpleDark; } - public class UserStatusDoNotDisturb : UserStatus + public class UserStatusDoNotDisturb : UserStatusBusy { public override string Message => @"Do not disturb"; public override Color4 GetAppropriateColour(OsuColour colours) => colours.RedDark; From 8de05450c4eb99c6d993d193b3c87ede35301a62 Mon Sep 17 00:00:00 2001 From: TocoToucan Date: Sun, 29 Apr 2018 17:53:38 +0300 Subject: [PATCH 11/12] Cleanup UserProfileOverlay during PopOut --- osu.Game/Overlays/UserProfileOverlay.cs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/osu.Game/Overlays/UserProfileOverlay.cs b/osu.Game/Overlays/UserProfileOverlay.cs index a4dd0c9ec3..d8f858b95e 100644 --- a/osu.Game/Overlays/UserProfileOverlay.cs +++ b/osu.Game/Overlays/UserProfileOverlay.cs @@ -71,6 +71,7 @@ namespace osu.Game.Overlays { base.PopOut(); FadeEdgeEffectTo(0, WaveContainer.DISAPPEAR_DURATION, Easing.Out); + cleanup(); } public void ShowUser(long userId) @@ -83,9 +84,7 @@ namespace osu.Game.Overlays public void ShowUser(User user, bool fetchOnline = true) { - userReq?.Cancel(); - Clear(); - lastSection = null; + cleanup(); sections = new ProfileSection[] { @@ -165,6 +164,13 @@ namespace osu.Game.Overlays sectionsContainer.ScrollToTop(); } + private void cleanup() + { + userReq?.Cancel(); + Clear(); + lastSection = null; + } + private void userLoadComplete(User user) { Header.User = user; From 06c6f55995993a72842f15f775afec30556e7d11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adonais=20Romero=20Gonz=C3=A1lez?= Date: Mon, 30 Apr 2018 00:43:32 -0700 Subject: [PATCH 12/12] Apply offset to end times on legacy converter --- osu.Game/Beatmaps/Formats/LegacyBeatmapDecoder.cs | 5 +++-- .../Rulesets/Objects/Legacy/ConvertHitObjectParser.cs | 11 ++++++++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/osu.Game/Beatmaps/Formats/LegacyBeatmapDecoder.cs b/osu.Game/Beatmaps/Formats/LegacyBeatmapDecoder.cs index 366b4f163f..655355913c 100644 --- a/osu.Game/Beatmaps/Formats/LegacyBeatmapDecoder.cs +++ b/osu.Game/Beatmaps/Formats/LegacyBeatmapDecoder.cs @@ -373,17 +373,18 @@ namespace osu.Game.Beatmaps.Formats if (parser == null) parser = new Rulesets.Objects.Legacy.Osu.ConvertHitObjectParser(); - var obj = parser.Parse(line); + var obj = parser.Parse(line, getOffsetTime()); if (obj != null) { - obj.StartTime = getOffsetTime(obj.StartTime); beatmap.HitObjects.Add(obj); } } private int getOffsetTime(int time) => time + (ApplyOffsets ? offset : 0); + private double getOffsetTime() => ApplyOffsets ? offset : 0; + private double getOffsetTime(double time) => time + (ApplyOffsets ? offset : 0); } } diff --git a/osu.Game/Rulesets/Objects/Legacy/ConvertHitObjectParser.cs b/osu.Game/Rulesets/Objects/Legacy/ConvertHitObjectParser.cs index 95abc4edb3..9edd0f1f34 100644 --- a/osu.Game/Rulesets/Objects/Legacy/ConvertHitObjectParser.cs +++ b/osu.Game/Rulesets/Objects/Legacy/ConvertHitObjectParser.cs @@ -19,6 +19,11 @@ namespace osu.Game.Rulesets.Objects.Legacy public abstract class ConvertHitObjectParser : HitObjectParser { public override HitObject Parse(string text) + { + return Parse(text, 0); + } + + public HitObject Parse(string text, double offset) { try { @@ -146,7 +151,7 @@ namespace osu.Game.Rulesets.Objects.Legacy } else if ((type & ConvertHitObjectType.Spinner) > 0) { - result = CreateSpinner(new Vector2(512, 384) / 2, Convert.ToDouble(split[5], CultureInfo.InvariantCulture)); + result = CreateSpinner(new Vector2(512, 384) / 2, Convert.ToDouble(split[5], CultureInfo.InvariantCulture) + offset); if (split.Length > 6) readCustomSampleBanks(split[6], bankInfo); @@ -164,13 +169,13 @@ namespace osu.Game.Rulesets.Objects.Legacy readCustomSampleBanks(string.Join(":", ss.Skip(1)), bankInfo); } - result = CreateHold(new Vector2(int.Parse(split[0]), int.Parse(split[1])), combo, endTime); + result = CreateHold(new Vector2(int.Parse(split[0]), int.Parse(split[1])), combo, endTime + offset); } if (result == null) throw new InvalidOperationException($@"Unknown hit object type {type}."); - result.StartTime = Convert.ToDouble(split[2], CultureInfo.InvariantCulture); + result.StartTime = Convert.ToDouble(split[2], CultureInfo.InvariantCulture) + offset; result.Samples = convertSoundType(soundType, bankInfo); return result;