From 8d790e180d8a2e221e1a691df839d48af22a017d Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 16 Mar 2018 17:02:41 +0900 Subject: [PATCH 01/19] Fix juice stream droplets spawning in incorrect locations Closes #2149. --- .../Objects/JuiceStream.cs | 75 ++++++++++--------- .../Tests/CatchBeatmapConversionTest.cs | 2 +- 2 files changed, 41 insertions(+), 36 deletions(-) diff --git a/osu.Game.Rulesets.Catch/Objects/JuiceStream.cs b/osu.Game.Rulesets.Catch/Objects/JuiceStream.cs index a3e5aba2db..e4d5ae698f 100644 --- a/osu.Game.Rulesets.Catch/Objects/JuiceStream.cs +++ b/osu.Game.Rulesets.Catch/Objects/JuiceStream.cs @@ -65,54 +65,59 @@ namespace osu.Game.Rulesets.Catch.Objects X = X }); - for (var span = 0; span < this.SpanCount(); span++) + double lastDropletTime = StartTime; + + for (int span = 0; span < this.SpanCount(); span++) { var spanStartTime = StartTime + span * spanDuration; var reversed = span % 2 == 1; - for (var d = tickDistance; d <= length; d += tickDistance) + for (double d = 0; d <= length; d += tickDistance) { - if (d > length - minDistanceFromEnd) - break; - var timeProgress = d / length; var distanceProgress = reversed ? 1 - timeProgress : timeProgress; - var lastTickTime = spanStartTime + timeProgress * spanDuration; - AddNested(new Droplet + double time = spanStartTime + timeProgress * spanDuration; + + double tinyTickInterval = time - lastDropletTime; + while (tinyTickInterval > 100) + tinyTickInterval /= 2; + + for (double t = lastDropletTime + tinyTickInterval; t < time; t += tinyTickInterval) { - StartTime = lastTickTime, - ComboColour = ComboColour, - X = X + Curve.PositionAt(distanceProgress).X / CatchPlayfield.BASE_WIDTH, - Samples = new List(Samples.Select(s => new SampleInfo + double progress = reversed ? 1 - (t - spanStartTime) / spanDuration : (t - spanStartTime) / spanDuration; + + AddNested(new TinyDroplet { - Bank = s.Bank, - Name = @"slidertick", - Volume = s.Volume - })) - }); - } + StartTime = t, + ComboColour = ComboColour, + X = X + Curve.PositionAt(progress).X / CatchPlayfield.BASE_WIDTH, + Samples = new List(Samples.Select(s => new SampleInfo + { + Bank = s.Bank, + Name = @"slidertick", + Volume = s.Volume + })) + }); + } - double tinyTickInterval = tickDistance / length * spanDuration; - while (tinyTickInterval > 100) - tinyTickInterval /= 2; - - for (double t = 0; t < spanDuration; t += tinyTickInterval) - { - double progress = reversed ? 1 - t / spanDuration : t / spanDuration; - - AddNested(new TinyDroplet + if (d > minDistanceFromEnd && Math.Abs(d - length) > minDistanceFromEnd) { - StartTime = spanStartTime + t, - ComboColour = ComboColour, - X = X + Curve.PositionAt(progress).X / CatchPlayfield.BASE_WIDTH, - Samples = new List(Samples.Select(s => new SampleInfo + AddNested(new Droplet { - Bank = s.Bank, - Name = @"slidertick", - Volume = s.Volume - })) - }); + StartTime = time, + ComboColour = ComboColour, + X = X + Curve.PositionAt(distanceProgress).X / CatchPlayfield.BASE_WIDTH, + Samples = new List(Samples.Select(s => new SampleInfo + { + Bank = s.Bank, + Name = @"slidertick", + Volume = s.Volume + })) + }); + } + + lastDropletTime = time; } AddNested(new Fruit diff --git a/osu.Game.Rulesets.Catch/Tests/CatchBeatmapConversionTest.cs b/osu.Game.Rulesets.Catch/Tests/CatchBeatmapConversionTest.cs index 826c900140..e40510b71b 100644 --- a/osu.Game.Rulesets.Catch/Tests/CatchBeatmapConversionTest.cs +++ b/osu.Game.Rulesets.Catch/Tests/CatchBeatmapConversionTest.cs @@ -18,7 +18,7 @@ namespace osu.Game.Rulesets.Catch.Tests { protected override string ResourceAssembly => "osu.Game.Rulesets.Catch"; - [TestCase("basic"), Ignore("See: https://github.com/ppy/osu/issues/2149")] + [TestCase("basic"), Ignore("See: https://github.com/ppy/osu/issues/2232")] public new void Test(string name) { base.Test(name); From 18368d2446ff66e6647cebf368efa3a68057e8fc Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 19 Mar 2018 20:15:17 +0900 Subject: [PATCH 02/19] Make import notifications fail when any imports fail --- osu.Game/Database/ArchiveModelManager.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/osu.Game/Database/ArchiveModelManager.cs b/osu.Game/Database/ArchiveModelManager.cs index a65593ff82..dac38b2405 100644 --- a/osu.Game/Database/ArchiveModelManager.cs +++ b/osu.Game/Database/ArchiveModelManager.cs @@ -88,7 +88,8 @@ namespace osu.Game.Database List imported = new List(); - int i = 0; + int success = 0; + int errors = 0; foreach (string path in paths) { if (notification.State == ProgressNotificationState.Cancelled) @@ -97,11 +98,11 @@ namespace osu.Game.Database try { - notification.Text = $"Importing ({i} of {paths.Length})\n{Path.GetFileName(path)}"; + notification.Text = $"Importing ({success} of {paths.Length})\n{Path.GetFileName(path)}"; using (ArchiveReader reader = getReaderFrom(path)) imported.Add(Import(reader)); - notification.Progress = (float)++i / paths.Length; + notification.Progress = (float)++success / paths.Length; // We may or may not want to delete the file depending on where it is stored. // e.g. reconstructing/repairing database with items from default storage. @@ -121,10 +122,11 @@ namespace osu.Game.Database { e = e.InnerException ?? e; Logger.Error(e, $@"Could not import ({Path.GetFileName(path)})"); + errors++; } } - notification.State = ProgressNotificationState.Completed; + notification.State = errors == 0 ? ProgressNotificationState.Completed : ProgressNotificationState.Cancelled; } /// From 994c7bfabdaed12ceebc16959a3c7157c43a99a9 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 19 Mar 2018 20:30:45 +0900 Subject: [PATCH 03/19] Further improvements to messaging --- osu.Game/Database/ArchiveModelManager.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/osu.Game/Database/ArchiveModelManager.cs b/osu.Game/Database/ArchiveModelManager.cs index dac38b2405..bdc7c58238 100644 --- a/osu.Game/Database/ArchiveModelManager.cs +++ b/osu.Game/Database/ArchiveModelManager.cs @@ -79,7 +79,6 @@ namespace osu.Game.Database var notification = new ProgressNotification { Text = "Import is initialising...", - CompletionText = "Import successful!", Progress = 0, State = ProgressNotificationState.Active, }; @@ -88,7 +87,7 @@ namespace osu.Game.Database List imported = new List(); - int success = 0; + int current = 0; int errors = 0; foreach (string path in paths) { @@ -98,11 +97,11 @@ namespace osu.Game.Database try { - notification.Text = $"Importing ({success} of {paths.Length})\n{Path.GetFileName(path)}"; + notification.Text = $"Importing ({++current} of {paths.Length})\n{Path.GetFileName(path)}"; using (ArchiveReader reader = getReaderFrom(path)) imported.Add(Import(reader)); - notification.Progress = (float)++success / paths.Length; + notification.Progress = (float)(current - 1) / paths.Length; // We may or may not want to delete the file depending on where it is stored. // e.g. reconstructing/repairing database with items from default storage. @@ -126,7 +125,8 @@ namespace osu.Game.Database } } - notification.State = errors == 0 ? ProgressNotificationState.Completed : ProgressNotificationState.Cancelled; + notification.Text = errors > 0 ? $"Import complete with {errors} errors" : "Import successful!"; + notification.State = ProgressNotificationState.Completed; } /// @@ -333,7 +333,7 @@ namespace osu.Game.Database { if (ZipFile.IsZipFile(path)) return new ZipArchiveReader(Files.Storage.GetStream(path), Path.GetFileName(path)); - return new LegacyFilesystemReader(path); + return new LegacyFilesystemReader(path); } } } From f565cc861d9b176d29312016ed820ce6f1b3e297 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 19 Mar 2018 20:41:12 +0900 Subject: [PATCH 04/19] Hard bail on attempting to import an invalid archive format --- osu.Game/Database/ArchiveModelManager.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/osu.Game/Database/ArchiveModelManager.cs b/osu.Game/Database/ArchiveModelManager.cs index a65593ff82..4c60db3a23 100644 --- a/osu.Game/Database/ArchiveModelManager.cs +++ b/osu.Game/Database/ArchiveModelManager.cs @@ -13,6 +13,7 @@ using osu.Game.IO; using osu.Game.IO.Archives; using osu.Game.IPC; using osu.Game.Overlays.Notifications; +using SharpCompress.Common; using FileInfo = osu.Game.IO.FileInfo; namespace osu.Game.Database @@ -331,7 +332,9 @@ namespace osu.Game.Database { if (ZipFile.IsZipFile(path)) return new ZipArchiveReader(Files.Storage.GetStream(path), Path.GetFileName(path)); - return new LegacyFilesystemReader(path); + if (Directory.Exists(path)) + return new LegacyFilesystemReader(path); + throw new InvalidFormatException($"{path} is not a valid archive"); } } } From 625e561fc8a5b0a35c92908b74eb290fee348efc Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 20 Mar 2018 18:01:09 +0900 Subject: [PATCH 05/19] Fix whitespace --- osu.Game/Database/ArchiveModelManager.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Database/ArchiveModelManager.cs b/osu.Game/Database/ArchiveModelManager.cs index bdc7c58238..78bf46eb69 100644 --- a/osu.Game/Database/ArchiveModelManager.cs +++ b/osu.Game/Database/ArchiveModelManager.cs @@ -333,7 +333,7 @@ namespace osu.Game.Database { if (ZipFile.IsZipFile(path)) return new ZipArchiveReader(Files.Storage.GetStream(path), Path.GetFileName(path)); - return new LegacyFilesystemReader(path); + return new LegacyFilesystemReader(path); } } } From 5a10270a2a6257e9d074b0bff91502d112254954 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 20 Mar 2018 20:32:32 +0900 Subject: [PATCH 06/19] return -> break no real reason but whatever works --- 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 9a881f9241..853abceddf 100644 --- a/osu.Game/Skinning/LegacySkinDecoder.cs +++ b/osu.Game/Skinning/LegacySkinDecoder.cs @@ -29,7 +29,7 @@ namespace osu.Game.Skinning break; } - return; + break; } base.ParseLine(output, section, line); From e67d8e13541c388310389a3057cf0bb134e09994 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 21 Mar 2018 22:31:52 +0900 Subject: [PATCH 07/19] Update nuspec to include humanizer localisations --- osu.Desktop/osu.nuspec | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/osu.Desktop/osu.nuspec b/osu.Desktop/osu.nuspec index bb7d382cee..316a5443ef 100644 --- a/osu.Desktop/osu.nuspec +++ b/osu.Desktop/osu.nuspec @@ -16,11 +16,9 @@ en-AU - - - - - + + + From 62229300c4b398967ea6df6953bddfe9d9102f46 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 22 Mar 2018 00:10:49 +0900 Subject: [PATCH 08/19] Fix DummyRuleset getting selected Resolves #2261. --- osu.Game/Screens/Select/SongSelect.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/osu.Game/Screens/Select/SongSelect.cs b/osu.Game/Screens/Select/SongSelect.cs index ca8a1cae41..f01616ade2 100644 --- a/osu.Game/Screens/Select/SongSelect.cs +++ b/osu.Game/Screens/Select/SongSelect.cs @@ -259,6 +259,8 @@ namespace osu.Game.Screens.Select private void workingBeatmapChanged(WorkingBeatmap beatmap) { + if (beatmap is DummyWorkingBeatmap) return; + if (IsCurrentScreen && !Carousel.SelectBeatmap(beatmap?.BeatmapInfo, false)) // If selecting new beatmap without bypassing filters failed, there's possibly a ruleset mismatch if (beatmap?.BeatmapInfo?.Ruleset != null && beatmap.BeatmapInfo.Ruleset != Ruleset.Value) From e0b74a357ab0fcc2c24647338014db2915de4e6a Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 22 Mar 2018 03:30:14 +0900 Subject: [PATCH 09/19] Fix osu! logo making hover beat sounds when not visible --- osu.Game/Screens/Menu/OsuLogo.cs | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/osu.Game/Screens/Menu/OsuLogo.cs b/osu.Game/Screens/Menu/OsuLogo.cs index 3fcb885655..b7d2ed2e1f 100644 --- a/osu.Game/Screens/Menu/OsuLogo.cs +++ b/osu.Game/Screens/Menu/OsuLogo.cs @@ -337,12 +337,10 @@ namespace osu.Game.Screens.Menu } } - private bool interactive => Action != null && Alpha > 0.2f; + public override bool HandleMouseInput => base.HandleMouseInput && Action != null && Alpha > 0.2f; protected override bool OnMouseDown(InputState state, MouseDownEventArgs args) { - if (!interactive) return false; - logoBounceContainer.ScaleTo(0.9f, 1000, Easing.Out); return true; } @@ -355,8 +353,6 @@ namespace osu.Game.Screens.Menu protected override bool OnClick(InputState state) { - if (!interactive) return false; - if (Action?.Invoke() ?? true) sampleClick.Play(); @@ -368,8 +364,6 @@ namespace osu.Game.Screens.Menu protected override bool OnHover(InputState state) { - if (!interactive) return false; - logoHoverContainer.ScaleTo(1.1f, 500, Easing.OutElastic); return true; } From 101caf3064de36bf379f59adacdc102e54744935 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 22 Mar 2018 11:28:40 +0900 Subject: [PATCH 10/19] Apply same logic fixes to delete/restore all notifications --- osu.Game/Database/ArchiveModelManager.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/osu.Game/Database/ArchiveModelManager.cs b/osu.Game/Database/ArchiveModelManager.cs index 78bf46eb69..f781beb443 100644 --- a/osu.Game/Database/ArchiveModelManager.cs +++ b/osu.Game/Database/ArchiveModelManager.cs @@ -220,8 +220,8 @@ namespace osu.Game.Database // user requested abort return; - notification.Text = $"Deleting ({i} of {items.Count})"; - notification.Progress = (float)++i / items.Count; + notification.Progress = (float)i / items.Count; + notification.Text = $"Deleting ({++i} of {items.Count})"; Delete(b); } } @@ -256,8 +256,8 @@ namespace osu.Game.Database // user requested abort return; - notification.Text = $"Restoring ({i} of {items.Count})"; - notification.Progress = (float)++i / items.Count; + notification.Progress = (float)i / items.Count; + notification.Text = $"Restoring ({++i} of {items.Count})"; Undelete(item); } } From 1a782a840cd15d5be3a1192e479d99be111c7692 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 22 Mar 2018 12:34:29 +0900 Subject: [PATCH 11/19] Fix xmldoc --- osu.Game/Rulesets/Objects/Types/IHasComboIndex.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Rulesets/Objects/Types/IHasComboIndex.cs b/osu.Game/Rulesets/Objects/Types/IHasComboIndex.cs index 68474a6e2c..dae10e4552 100644 --- a/osu.Game/Rulesets/Objects/Types/IHasComboIndex.cs +++ b/osu.Game/Rulesets/Objects/Types/IHasComboIndex.cs @@ -14,7 +14,7 @@ namespace osu.Game.Rulesets.Objects.Types int IndexInCurrentCombo { get; set; } /// - /// The offset of this hitobject in the current combo. + /// The offset of this combo in relation to the beatmap. /// int ComboIndex { get; set; } From 78a8f60b39114518f65483e47557da6625e0f22a Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 22 Mar 2018 12:35:17 +0900 Subject: [PATCH 12/19] IHasComboIndex -> IHasComboInformation --- osu.Game.Rulesets.Catch/Objects/CatchHitObject.cs | 2 +- osu.Game.Rulesets.Osu/Objects/OsuHitObject.cs | 2 +- osu.Game/Beatmaps/BeatmapProcessor.cs | 4 ++-- .../Types/{IHasComboIndex.cs => IHasComboInformation.cs} | 2 +- osu.Game/osu.Game.csproj | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) rename osu.Game/Rulesets/Objects/Types/{IHasComboIndex.cs => IHasComboInformation.cs} (91%) diff --git a/osu.Game.Rulesets.Catch/Objects/CatchHitObject.cs b/osu.Game.Rulesets.Catch/Objects/CatchHitObject.cs index a6ab18bbf7..1a0ccc9b1e 100644 --- a/osu.Game.Rulesets.Catch/Objects/CatchHitObject.cs +++ b/osu.Game.Rulesets.Catch/Objects/CatchHitObject.cs @@ -8,7 +8,7 @@ using osu.Game.Rulesets.Objects.Types; namespace osu.Game.Rulesets.Catch.Objects { - public abstract class CatchHitObject : HitObject, IHasXPosition, IHasComboIndex + public abstract class CatchHitObject : HitObject, IHasXPosition, IHasComboInformation { public const double OBJECT_RADIUS = 44; diff --git a/osu.Game.Rulesets.Osu/Objects/OsuHitObject.cs b/osu.Game.Rulesets.Osu/Objects/OsuHitObject.cs index 5d1908fa6e..c00c30ced9 100644 --- a/osu.Game.Rulesets.Osu/Objects/OsuHitObject.cs +++ b/osu.Game.Rulesets.Osu/Objects/OsuHitObject.cs @@ -10,7 +10,7 @@ using osu.Game.Beatmaps.ControlPoints; namespace osu.Game.Rulesets.Osu.Objects { - public abstract class OsuHitObject : HitObject, IHasComboIndex, IHasPosition + public abstract class OsuHitObject : HitObject, IHasComboInformation, IHasPosition { public const double OBJECT_RADIUS = 64; diff --git a/osu.Game/Beatmaps/BeatmapProcessor.cs b/osu.Game/Beatmaps/BeatmapProcessor.cs index 83b2867df7..f2cc419043 100644 --- a/osu.Game/Beatmaps/BeatmapProcessor.cs +++ b/osu.Game/Beatmaps/BeatmapProcessor.cs @@ -23,9 +23,9 @@ namespace osu.Game.Beatmaps /// The Beatmap to process. public virtual void PostProcess(Beatmap beatmap) { - IHasComboIndex lastObj = null; + IHasComboInformation lastObj = null; - foreach (var obj in beatmap.HitObjects.OfType()) + foreach (var obj in beatmap.HitObjects.OfType()) { if (obj.NewCombo) { diff --git a/osu.Game/Rulesets/Objects/Types/IHasComboIndex.cs b/osu.Game/Rulesets/Objects/Types/IHasComboInformation.cs similarity index 91% rename from osu.Game/Rulesets/Objects/Types/IHasComboIndex.cs rename to osu.Game/Rulesets/Objects/Types/IHasComboInformation.cs index dae10e4552..1d4f4e0f90 100644 --- a/osu.Game/Rulesets/Objects/Types/IHasComboIndex.cs +++ b/osu.Game/Rulesets/Objects/Types/IHasComboInformation.cs @@ -6,7 +6,7 @@ namespace osu.Game.Rulesets.Objects.Types /// /// A HitObject that is part of a combo and has extended information about its position relative to other combo objects. /// - public interface IHasComboIndex : IHasCombo + public interface IHasComboInformation : IHasCombo { /// /// The offset of this hitobject in the current combo. diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 5ece1a18ac..19914bb5cb 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -374,7 +374,7 @@ - + From c5eecae32fb7da44ccac7a921bb07398bad4f80b Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 22 Mar 2018 12:50:23 +0900 Subject: [PATCH 13/19] Improve shared code paths in legacy skins --- osu.Game/Skinning/BeatmapSkin.cs | 19 ++++--------------- osu.Game/Skinning/LegacySkin.cs | 15 +++++++-------- 2 files changed, 11 insertions(+), 23 deletions(-) diff --git a/osu.Game/Skinning/BeatmapSkin.cs b/osu.Game/Skinning/BeatmapSkin.cs index 815aac2f64..02278aa31e 100644 --- a/osu.Game/Skinning/BeatmapSkin.cs +++ b/osu.Game/Skinning/BeatmapSkin.cs @@ -1,9 +1,7 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using System.IO; using osu.Framework.Audio; -using osu.Framework.Graphics.Textures; using osu.Framework.IO.Stores; using osu.Game.Beatmaps; @@ -12,20 +10,11 @@ namespace osu.Game.Skinning public class BeatmapSkin : LegacySkin { public BeatmapSkin(BeatmapInfo beatmap, IResourceStore storage, AudioManager audioManager) - : base(new SkinInfo { Name = beatmap.ToString(), Creator = beatmap.Metadata.Author.ToString() }) + : base(createSkinInfo(beatmap), new LegacySkinResourceStore(beatmap.BeatmapSet, storage), audioManager, beatmap.Path) { - storage = new LegacySkinResourceStore(beatmap.BeatmapSet, storage); - - Samples = audioManager.GetSampleManager(storage); - - Textures = new TextureStore(new RawTextureLoaderStore(storage)); - - var decoder = new LegacySkinDecoder(); - - using (StreamReader reader = new StreamReader(storage.GetStream(beatmap.Path))) - { - Configuration = decoder.Decode(reader); - } } + + private static SkinInfo createSkinInfo(BeatmapInfo beatmap) => + new SkinInfo { Name = beatmap.ToString(), Creator = beatmap.Metadata.Author.ToString() }; } } diff --git a/osu.Game/Skinning/LegacySkin.cs b/osu.Game/Skinning/LegacySkin.cs index cfee2cfab2..64f65cd08c 100644 --- a/osu.Game/Skinning/LegacySkin.cs +++ b/osu.Game/Skinning/LegacySkin.cs @@ -21,22 +21,21 @@ namespace osu.Game.Skinning protected SampleManager Samples; public LegacySkin(SkinInfo skin, IResourceStore storage, AudioManager audioManager) - : this(skin) + : this(skin, new LegacySkinResourceStore(skin, storage), audioManager, "skin.ini") { - storage = new LegacySkinResourceStore(skin, storage); - Samples = audioManager.GetSampleManager(storage); - Textures = new TextureStore(new RawTextureLoaderStore(storage)); + } - Stream stream = storage.GetStream("skin.ini"); + protected LegacySkin(SkinInfo skin, IResourceStore storage, AudioManager audioManager, string filename) : base(skin) + { + Stream stream = storage.GetStream(filename); if (stream != null) using (StreamReader reader = new StreamReader(stream)) Configuration = new LegacySkinDecoder().Decode(reader); else Configuration = new SkinConfiguration(); - } - protected LegacySkin(SkinInfo skin) : base(skin) - { + Samples = audioManager.GetSampleManager(storage); + Textures = new TextureStore(new RawTextureLoaderStore(storage)); } public override Drawable GetDrawableComponent(string componentName) From 504c3ff0baa1f71456cdc626289a2510a114ca51 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 22 Mar 2018 12:50:48 +0900 Subject: [PATCH 14/19] BeatmapSkin -> LegacyBeatmapSkin --- osu.Game/Beatmaps/BeatmapManager_WorkingBeatmap.cs | 2 +- osu.Game/Skinning/{BeatmapSkin.cs => LegacyBeatmapSkin.cs} | 4 ++-- osu.Game/osu.Game.csproj | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) rename osu.Game/Skinning/{BeatmapSkin.cs => LegacyBeatmapSkin.cs} (77%) diff --git a/osu.Game/Beatmaps/BeatmapManager_WorkingBeatmap.cs b/osu.Game/Beatmaps/BeatmapManager_WorkingBeatmap.cs index 58b51085a4..5874314f75 100644 --- a/osu.Game/Beatmaps/BeatmapManager_WorkingBeatmap.cs +++ b/osu.Game/Beatmaps/BeatmapManager_WorkingBeatmap.cs @@ -110,7 +110,7 @@ namespace osu.Game.Beatmaps Skin skin; try { - skin = new BeatmapSkin(BeatmapInfo, store, audioManager); + skin = new LegacyBeatmapSkin(BeatmapInfo, store, audioManager); } catch (Exception e) { diff --git a/osu.Game/Skinning/BeatmapSkin.cs b/osu.Game/Skinning/LegacyBeatmapSkin.cs similarity index 77% rename from osu.Game/Skinning/BeatmapSkin.cs rename to osu.Game/Skinning/LegacyBeatmapSkin.cs index 02278aa31e..01beb8db32 100644 --- a/osu.Game/Skinning/BeatmapSkin.cs +++ b/osu.Game/Skinning/LegacyBeatmapSkin.cs @@ -7,9 +7,9 @@ using osu.Game.Beatmaps; namespace osu.Game.Skinning { - public class BeatmapSkin : LegacySkin + public class LegacyBeatmapSkin : LegacySkin { - public BeatmapSkin(BeatmapInfo beatmap, IResourceStore storage, AudioManager audioManager) + public LegacyBeatmapSkin(BeatmapInfo beatmap, IResourceStore storage, AudioManager audioManager) : base(createSkinInfo(beatmap), new LegacySkinResourceStore(beatmap.BeatmapSet, storage), audioManager, beatmap.Path) { } diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 50c272e827..3b4f46a918 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -871,7 +871,7 @@ - + From e39b7b8d354463d849de7b9d30feda00eb1a1fd4 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 22 Mar 2018 12:58:02 +0900 Subject: [PATCH 15/19] Don't hard-crash when an unknown section is encountered in a legacy file --- osu.Game/Beatmaps/Formats/LegacyDecoder.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/osu.Game/Beatmaps/Formats/LegacyDecoder.cs b/osu.Game/Beatmaps/Formats/LegacyDecoder.cs index 67d497ba83..131c010c5c 100644 --- a/osu.Game/Beatmaps/Formats/LegacyDecoder.cs +++ b/osu.Game/Beatmaps/Formats/LegacyDecoder.cs @@ -4,6 +4,7 @@ using System; using System.Collections.Generic; using System.IO; +using osu.Framework.Logging; using OpenTK.Graphics; namespace osu.Game.Beatmaps.Formats @@ -31,7 +32,11 @@ namespace osu.Game.Beatmaps.Formats if (line.StartsWith(@"[") && line.EndsWith(@"]")) { if (!Enum.TryParse(line.Substring(1, line.Length - 2), out section)) - throw new InvalidDataException($@"Unknown osu section {line}"); + { + Logger.Log($"Unknown section \"{line}\" in {beatmap}"); + section = Section.None; + } + continue; } From dc9fb84e254550c0069d61a7137f80ba96bb10d8 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 22 Mar 2018 14:46:25 +0900 Subject: [PATCH 16/19] Update progress with the current item, not the next item In the case where there is no next item, the progress will not get updated, so we'll essentially skip one element from filling the progress bar further. In the future we may/will want to not hide the notification upon completion, so this will look better in such scenarios. --- osu.Game/Database/ArchiveModelManager.cs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/osu.Game/Database/ArchiveModelManager.cs b/osu.Game/Database/ArchiveModelManager.cs index f781beb443..ef85f691d6 100644 --- a/osu.Game/Database/ArchiveModelManager.cs +++ b/osu.Game/Database/ArchiveModelManager.cs @@ -101,7 +101,7 @@ namespace osu.Game.Database using (ArchiveReader reader = getReaderFrom(path)) imported.Add(Import(reader)); - notification.Progress = (float)(current - 1) / paths.Length; + notification.Progress = (float)current / paths.Length; // We may or may not want to delete the file depending on where it is stored. // e.g. reconstructing/repairing database with items from default storage. @@ -220,9 +220,11 @@ namespace osu.Game.Database // user requested abort return; - notification.Progress = (float)i / items.Count; notification.Text = $"Deleting ({++i} of {items.Count})"; + Delete(b); + + notification.Progress = (float)i / items.Count; } } @@ -256,9 +258,11 @@ namespace osu.Game.Database // user requested abort return; - notification.Progress = (float)i / items.Count; notification.Text = $"Restoring ({++i} of {items.Count})"; + Undelete(item); + + notification.Progress = (float)i / items.Count; } } From 3f3f57e51ef6f4506666aaf9b2ca5f839b0c7acc Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 22 Mar 2018 15:13:38 +0900 Subject: [PATCH 17/19] Use cached vertexbatch add delegate --- osu.Game/Graphics/Backgrounds/Triangles.cs | 2 +- osu.Game/Screens/Menu/LogoVisualisation.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Graphics/Backgrounds/Triangles.cs b/osu.Game/Graphics/Backgrounds/Triangles.cs index 6f9d83473f..89ed8044e6 100644 --- a/osu.Game/Graphics/Backgrounds/Triangles.cs +++ b/osu.Game/Graphics/Backgrounds/Triangles.cs @@ -242,7 +242,7 @@ namespace osu.Game.Graphics.Backgrounds triangle, colourInfo, null, - Shared.VertexBatch.Add, + Shared.VertexBatch.AddAction, Vector2.Divide(localInflationAmount, size)); } diff --git a/osu.Game/Screens/Menu/LogoVisualisation.cs b/osu.Game/Screens/Menu/LogoVisualisation.cs index 3a3f3d4650..fc747acbb4 100644 --- a/osu.Game/Screens/Menu/LogoVisualisation.cs +++ b/osu.Game/Screens/Menu/LogoVisualisation.cs @@ -211,7 +211,7 @@ namespace osu.Game.Screens.Menu rectangle, colourInfo, null, - Shared.VertexBatch.Add, + Shared.VertexBatch.AddAction, //barSize by itself will make it smooth more in the X axis than in the Y axis, this reverts that. Vector2.Divide(inflation, barSize.Yx)); } From 799b7caf7e969243b493d1192c2180bcea04eb93 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 22 Mar 2018 15:20:58 +0900 Subject: [PATCH 18/19] Update framework --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index 41e2a0a430..cc39713fbf 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 41e2a0a4304544fb67779c21cad1435c105982d5 +Subproject commit cc39713fbf9427aa53df91e27ecd09d15661089f From 4ccaf143b5408d4c2cf1d01b8c0133e27e368033 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 22 Mar 2018 15:50:19 +0900 Subject: [PATCH 19/19] Give sliders a default accent colour --- osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBody.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBody.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBody.cs index 26186a0049..c59c22c771 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBody.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBody.cs @@ -42,7 +42,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces public double? SnakedStart { get; private set; } public double? SnakedEnd { get; private set; } - private Color4 accentColour; + private Color4 accentColour = Color4.White; /// /// Used to colour the path. ///