From 6c40cf08cce811707cadc5c8e68c6e7d4fe3bc60 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 16 Nov 2017 21:29:07 +0900 Subject: [PATCH 01/35] Optimise leaderboard display Adds async loading support and cleans up the code quite a bit in the process. --- .../Graphics/Containers/OsuScrollContainer.cs | 2 +- .../Select/Leaderboards/Leaderboard.cs | 62 +++++---- .../Select/Leaderboards/LeaderboardScore.cs | 130 +++++++----------- 3 files changed, 87 insertions(+), 107 deletions(-) diff --git a/osu.Game/Graphics/Containers/OsuScrollContainer.cs b/osu.Game/Graphics/Containers/OsuScrollContainer.cs index e395f1b7bd..3fc9f439fa 100644 --- a/osu.Game/Graphics/Containers/OsuScrollContainer.cs +++ b/osu.Game/Graphics/Containers/OsuScrollContainer.cs @@ -7,7 +7,7 @@ using OpenTK.Input; namespace osu.Game.Graphics.Containers { - internal class OsuScrollContainer : ScrollContainer + public class OsuScrollContainer : ScrollContainer { /// /// Allows controlling the scroll bar from any position in the container using the right mouse button. diff --git a/osu.Game/Screens/Select/Leaderboards/Leaderboard.cs b/osu.Game/Screens/Select/Leaderboards/Leaderboard.cs index 7d65b8b648..4b1070f236 100644 --- a/osu.Game/Screens/Select/Leaderboards/Leaderboard.cs +++ b/osu.Game/Screens/Select/Leaderboards/Leaderboard.cs @@ -17,19 +17,21 @@ using osu.Game.Graphics.UserInterface; using osu.Game.Rulesets.Scoring; using osu.Game.Online.API; using osu.Game.Online.API.Requests; +using System.Linq; namespace osu.Game.Screens.Select.Leaderboards { public class Leaderboard : Container { private readonly ScrollContainer scrollContainer; - private readonly FillFlowContainer scrollFlow; + private FillFlowContainer scrollFlow; public Action ScoreSelected; private readonly LoadingAnimation loading; private IEnumerable scores; + public IEnumerable Scores { get { return scores; } @@ -41,33 +43,43 @@ namespace osu.Game.Screens.Select.Leaderboards int i = 150; if (scores == null) { - foreach (var c in scrollFlow.Children) - c.FadeOut(i += 10); + if (scrollFlow != null) + { + foreach (var c in scrollFlow.Children) + c.FadeOut(i += 10); - foreach (var c in scrollFlow.Children) - c.LifetimeEnd = Time.Current + i; + foreach (var c in scrollFlow.Children) + c.LifetimeEnd = Time.Current + i; + } return; } - scrollFlow.Clear(); - - i = 0; - foreach (var s in scores) + // schedule because we may not be loaded yet (LoadComponentAsync complains). + Schedule(() => { - var ls = new LeaderboardScore(s, 1 + i) + LoadComponentAsync(new FillFlowContainer { - AlwaysPresent = true, - Action = () => ScoreSelected?.Invoke(s), - State = Visibility.Hidden, - }; - scrollFlow.Add(ls); + RelativeSizeAxes = Axes.X, + AutoSizeAxes = Axes.Y, + Spacing = new Vector2(0f, 5f), + Padding = new MarginPadding { Top = 10, Bottom = 5 }, + ChildrenEnumerable = scores.Select(s => new LeaderboardScore(s, 1 + i) { Action = () => ScoreSelected?.Invoke(s) }) + }, f => + { + scrollFlow?.Expire(); + scrollContainer.Add(scrollFlow = f); - using (BeginDelayedSequence(i++ * 50, true)) - ls.Show(); - } + i = 0; + foreach (var s in f.Children) + { + using (s.BeginDelayedSequence(i++ * 50, true)) + s.Show(); + } - scrollContainer.ScrollTo(0f, false); + scrollContainer.ScrollTo(0f, false); + }); + }); } } @@ -79,16 +91,6 @@ namespace osu.Game.Screens.Select.Leaderboards { RelativeSizeAxes = Axes.Both, ScrollbarVisible = false, - Children = new Drawable[] - { - scrollFlow = new FillFlowContainer - { - RelativeSizeAxes = Axes.X, - AutoSizeAxes = Axes.Y, - Spacing = new Vector2(0f, 5f), - Padding = new MarginPadding { Top = 10, Bottom = 5 }, - }, - }, }, loading = new LoadingAnimation() }; @@ -152,6 +154,8 @@ namespace osu.Game.Screens.Select.Leaderboards if (!scrollContainer.IsScrolledToEnd()) fadeStart -= LeaderboardScore.HEIGHT; + if (scrollFlow == null) return; + foreach (var c in scrollFlow.Children) { var topY = c.ToSpaceOfOtherDrawable(Vector2.Zero, scrollFlow).Y; diff --git a/osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs b/osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs index 9044938a75..e9de3fb672 100644 --- a/osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs +++ b/osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs @@ -2,9 +2,10 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; +using System.Linq; using OpenTK; using OpenTK.Graphics; -using osu.Framework; +using osu.Framework.Allocation; using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; @@ -13,14 +14,13 @@ using osu.Framework.Input; using osu.Game.Graphics; using osu.Game.Graphics.Containers; using osu.Game.Graphics.Sprites; -using osu.Game.Rulesets.Mods; using osu.Game.Rulesets.Scoring; using osu.Game.Rulesets.UI; using osu.Game.Users; namespace osu.Game.Screens.Select.Leaderboards { - public class LeaderboardScore : OsuClickableContainer, IStateful + public class LeaderboardScore : OsuClickableContainer { public static readonly float HEIGHT = 60; @@ -34,72 +34,16 @@ namespace osu.Game.Screens.Select.Leaderboards private const float background_alpha = 0.25f; private const float rank_width = 30; - private readonly Box background; - private readonly Container content; - private readonly Container avatar; - private readonly DrawableRank scoreRank; - private readonly OsuSpriteText nameLabel; - private readonly GlowingSpriteText scoreLabel; - private readonly ScoreComponentLabel maxCombo; - private readonly ScoreComponentLabel accuracy; - private readonly Container flagBadgeContainer; - private readonly FillFlowContainer modsContainer; - - private Visibility state; - - public Visibility State - { - get { return state; } - set - { - if (state == value) - return; - state = value; - - switch (state) - { - case Visibility.Hidden: - foreach (var d in new Drawable[] { avatar, nameLabel, scoreLabel, scoreRank, flagBadgeContainer, maxCombo, accuracy, modsContainer }) - d.FadeOut(); - - Alpha = 0; - - content.MoveToY(75); - avatar.MoveToX(75); - nameLabel.MoveToX(150); - break; - case Visibility.Visible: - this.FadeIn(200); - content.MoveToY(0, 800, Easing.OutQuint); - - using (BeginDelayedSequence(100, true)) - { - avatar.FadeIn(300, Easing.OutQuint); - nameLabel.FadeIn(350, Easing.OutQuint); - - avatar.MoveToX(0, 300, Easing.OutQuint); - nameLabel.MoveToX(0, 350, Easing.OutQuint); - - using (BeginDelayedSequence(250, true)) - { - scoreLabel.FadeIn(200); - scoreRank.FadeIn(200); - - using (BeginDelayedSequence(50, true)) - { - var drawables = new Drawable[] { flagBadgeContainer, maxCombo, accuracy, modsContainer, }; - for (int i = 0; i < drawables.Length; i++) - drawables[i].FadeIn(100 + i * 50); - } - } - } - - break; - } - - StateChanged?.Invoke(State); - } - } + private Box background; + private Container content; + private Container avatar; + private DrawableRank scoreRank; + private OsuSpriteText nameLabel; + private GlowingSpriteText scoreLabel; + private ScoreComponentLabel maxCombo; + private ScoreComponentLabel accuracy; + private Container flagBadgeContainer; + private FillFlowContainer modsContainer; public LeaderboardScore(Score score, int rank) { @@ -108,7 +52,11 @@ namespace osu.Game.Screens.Select.Leaderboards RelativeSizeAxes = Axes.X; Height = HEIGHT; + } + [BackgroundDependencyLoader] + private void load() + { Children = new Drawable[] { new Container @@ -255,23 +203,51 @@ namespace osu.Game.Screens.Select.Leaderboards Origin = Anchor.BottomRight, AutoSizeAxes = Axes.Both, Direction = FillDirection.Horizontal, + ChildrenEnumerable = Score.Mods.Select(mod => new ModIcon(mod) { Scale = new Vector2(0.375f) }) }, }, }, }, }, }; - - foreach (Mod mod in Score.Mods) - { - modsContainer.Add(new ModIcon(mod) { Scale = new Vector2(0.375f) }); - } } - public void ToggleVisibility() => State = State == Visibility.Visible ? Visibility.Hidden : Visibility.Visible; + public override void Show() + { + foreach (var d in new Drawable[] { avatar, nameLabel, scoreLabel, scoreRank, flagBadgeContainer, maxCombo, accuracy, modsContainer }) + d.FadeOut(); - public override void Hide() => State = Visibility.Hidden; - public override void Show() => State = Visibility.Visible; + Alpha = 0; + + content.MoveToY(75); + avatar.MoveToX(75); + nameLabel.MoveToX(150); + + this.FadeIn(200); + content.MoveToY(0, 800, Easing.OutQuint); + + using (BeginDelayedSequence(100, true)) + { + avatar.FadeIn(300, Easing.OutQuint); + nameLabel.FadeIn(350, Easing.OutQuint); + + avatar.MoveToX(0, 300, Easing.OutQuint); + nameLabel.MoveToX(0, 350, Easing.OutQuint); + + using (BeginDelayedSequence(250, true)) + { + scoreLabel.FadeIn(200); + scoreRank.FadeIn(200); + + using (BeginDelayedSequence(50, true)) + { + var drawables = new Drawable[] { flagBadgeContainer, maxCombo, accuracy, modsContainer, }; + for (int i = 0; i < drawables.Length; i++) + drawables[i].FadeIn(100 + i * 50); + } + } + } + } protected override bool OnHover(InputState state) { From 62155e6dd53820d2d5454150ba51f7a6566a9f21 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 16 Nov 2017 20:06:32 +0900 Subject: [PATCH 02/35] Make DifficultyCalculator support mod applications Fixes https://github.com/ppy/osu/issues/476. --- .../CatchDifficultyCalculator.cs | 7 +--- osu.Game.Rulesets.Catch/CatchRuleset.cs | 2 +- .../ManiaDifficultyCalculator.cs | 5 +-- osu.Game.Rulesets.Mania/ManiaRuleset.cs | 2 +- .../OsuDifficulty/OsuDifficultyCalculator.cs | 2 +- osu.Game.Rulesets.Osu/OsuRuleset.cs | 3 +- .../TaikoDifficultyCalculator.cs | 2 +- osu.Game.Rulesets.Taiko/TaikoRuleset.cs | 2 +- osu.Game/Beatmaps/DifficultyCalculator.cs | 37 +++++++++++-------- osu.Game/Beatmaps/DummyWorkingBeatmap.cs | 2 +- osu.Game/Rulesets/Ruleset.cs | 3 +- 11 files changed, 35 insertions(+), 32 deletions(-) diff --git a/osu.Game.Rulesets.Catch/CatchDifficultyCalculator.cs b/osu.Game.Rulesets.Catch/CatchDifficultyCalculator.cs index 3c6cc4b1a3..127fde74ef 100644 --- a/osu.Game.Rulesets.Catch/CatchDifficultyCalculator.cs +++ b/osu.Game.Rulesets.Catch/CatchDifficultyCalculator.cs @@ -14,11 +14,8 @@ namespace osu.Game.Rulesets.Catch { } - protected override double CalculateInternal(Dictionary categoryDifficulty) - { - return 0; - } + public override double Calculate(Dictionary categoryDifficulty) => 0; protected override BeatmapConverter CreateBeatmapConverter() => new CatchBeatmapConverter(); } -} \ No newline at end of file +} diff --git a/osu.Game.Rulesets.Catch/CatchRuleset.cs b/osu.Game.Rulesets.Catch/CatchRuleset.cs index 1a9b034cf2..1d5fc0545e 100644 --- a/osu.Game.Rulesets.Catch/CatchRuleset.cs +++ b/osu.Game.Rulesets.Catch/CatchRuleset.cs @@ -95,7 +95,7 @@ namespace osu.Game.Rulesets.Catch public override Drawable CreateIcon() => new SpriteIcon { Icon = FontAwesome.fa_osu_fruits_o }; - public override DifficultyCalculator CreateDifficultyCalculator(Beatmap beatmap) => new CatchDifficultyCalculator(beatmap); + public override DifficultyCalculator CreateDifficultyCalculator(Beatmap beatmap, Mod[] mods = null) => new CatchDifficultyCalculator(beatmap); public override int LegacyID => 2; diff --git a/osu.Game.Rulesets.Mania/ManiaDifficultyCalculator.cs b/osu.Game.Rulesets.Mania/ManiaDifficultyCalculator.cs index 784df1f293..d5c6d21131 100644 --- a/osu.Game.Rulesets.Mania/ManiaDifficultyCalculator.cs +++ b/osu.Game.Rulesets.Mania/ManiaDifficultyCalculator.cs @@ -16,10 +16,7 @@ namespace osu.Game.Rulesets.Mania { } - protected override double CalculateInternal(Dictionary categoryDifficulty) - { - return 0; - } + public override double Calculate(Dictionary categoryDifficulty) => 0; protected override BeatmapConverter CreateBeatmapConverter() => new ManiaBeatmapConverter(true, (int)Math.Max(1, Math.Round(Beatmap.BeatmapInfo.BaseDifficulty.CircleSize))); } diff --git a/osu.Game.Rulesets.Mania/ManiaRuleset.cs b/osu.Game.Rulesets.Mania/ManiaRuleset.cs index c0996cadf9..4eea884891 100644 --- a/osu.Game.Rulesets.Mania/ManiaRuleset.cs +++ b/osu.Game.Rulesets.Mania/ManiaRuleset.cs @@ -107,7 +107,7 @@ namespace osu.Game.Rulesets.Mania public override Drawable CreateIcon() => new SpriteIcon { Icon = FontAwesome.fa_osu_mania_o }; - public override DifficultyCalculator CreateDifficultyCalculator(Beatmap beatmap) => new ManiaDifficultyCalculator(beatmap); + public override DifficultyCalculator CreateDifficultyCalculator(Beatmap beatmap, Mod[] mods = null) => new ManiaDifficultyCalculator(beatmap); public override int LegacyID => 3; diff --git a/osu.Game.Rulesets.Osu/OsuDifficulty/OsuDifficultyCalculator.cs b/osu.Game.Rulesets.Osu/OsuDifficulty/OsuDifficultyCalculator.cs index 457466fd86..6ed45e1f03 100644 --- a/osu.Game.Rulesets.Osu/OsuDifficulty/OsuDifficultyCalculator.cs +++ b/osu.Game.Rulesets.Osu/OsuDifficulty/OsuDifficultyCalculator.cs @@ -26,7 +26,7 @@ namespace osu.Game.Rulesets.Osu.OsuDifficulty (h as Slider)?.Curve?.Calculate(); } - protected override double CalculateInternal(Dictionary categoryDifficulty) + public override double Calculate(Dictionary categoryDifficulty) { OsuDifficultyBeatmap beatmap = new OsuDifficultyBeatmap(Objects); Skill[] skills = diff --git a/osu.Game.Rulesets.Osu/OsuRuleset.cs b/osu.Game.Rulesets.Osu/OsuRuleset.cs index 7650a91d7a..a4828319d1 100644 --- a/osu.Game.Rulesets.Osu/OsuRuleset.cs +++ b/osu.Game.Rulesets.Osu/OsuRuleset.cs @@ -14,6 +14,7 @@ using System.Linq; using osu.Framework.Graphics; using osu.Game.Overlays.Settings; using osu.Framework.Input.Bindings; +using osu.Game.Rulesets.Scoring; namespace osu.Game.Rulesets.Osu { @@ -112,7 +113,7 @@ namespace osu.Game.Rulesets.Osu public override Drawable CreateIcon() => new SpriteIcon { Icon = FontAwesome.fa_osu_osu_o }; - public override DifficultyCalculator CreateDifficultyCalculator(Beatmap beatmap) => new OsuDifficultyCalculator(beatmap); + public override DifficultyCalculator CreateDifficultyCalculator(Beatmap beatmap, Mod[] mods = null) => new OsuDifficultyCalculator(beatmap); public override string Description => "osu!"; diff --git a/osu.Game.Rulesets.Taiko/TaikoDifficultyCalculator.cs b/osu.Game.Rulesets.Taiko/TaikoDifficultyCalculator.cs index de97658e35..57986cd198 100644 --- a/osu.Game.Rulesets.Taiko/TaikoDifficultyCalculator.cs +++ b/osu.Game.Rulesets.Taiko/TaikoDifficultyCalculator.cs @@ -36,7 +36,7 @@ namespace osu.Game.Rulesets.Taiko { } - protected override double CalculateInternal(Dictionary categoryDifficulty) + public override double Calculate(Dictionary categoryDifficulty) { // Fill our custom DifficultyHitObject class, that carries additional information difficultyHitObjects.Clear(); diff --git a/osu.Game.Rulesets.Taiko/TaikoRuleset.cs b/osu.Game.Rulesets.Taiko/TaikoRuleset.cs index ea0f0eae1a..99ae36967a 100644 --- a/osu.Game.Rulesets.Taiko/TaikoRuleset.cs +++ b/osu.Game.Rulesets.Taiko/TaikoRuleset.cs @@ -97,7 +97,7 @@ namespace osu.Game.Rulesets.Taiko public override Drawable CreateIcon() => new SpriteIcon { Icon = FontAwesome.fa_osu_taiko_o }; - public override DifficultyCalculator CreateDifficultyCalculator(Beatmap beatmap) => new TaikoDifficultyCalculator(beatmap); + public override DifficultyCalculator CreateDifficultyCalculator(Beatmap beatmap, Mod[] mods = null) => new TaikoDifficultyCalculator(beatmap); public override int LegacyID => 1; diff --git a/osu.Game/Beatmaps/DifficultyCalculator.cs b/osu.Game/Beatmaps/DifficultyCalculator.cs index bb6a292d9d..f6cc535aca 100644 --- a/osu.Game/Beatmaps/DifficultyCalculator.cs +++ b/osu.Game/Beatmaps/DifficultyCalculator.cs @@ -3,6 +3,10 @@ using osu.Game.Rulesets.Objects; using System.Collections.Generic; +using osu.Game.Rulesets.Mods; +using osu.Framework.Timing; +using System.Linq; +using osu.Framework.Extensions.IEnumerableExtensions; namespace osu.Game.Beatmaps { @@ -10,41 +14,44 @@ namespace osu.Game.Beatmaps { protected double TimeRate = 1; - protected abstract double CalculateInternal(Dictionary categoryDifficulty); - - private void loadTiming() - { - // TODO: Handle mods - const int audio_rate = 100; - TimeRate = audio_rate / 100.0; - } - - public double Calculate(Dictionary categoryDifficulty = null) - { - loadTiming(); - double difficulty = CalculateInternal(categoryDifficulty); - return difficulty; - } + public abstract double Calculate(Dictionary categoryDifficulty = null); } public abstract class DifficultyCalculator : DifficultyCalculator where T : HitObject { protected readonly Beatmap Beatmap; + protected readonly Mod[] Mods; protected List Objects; protected DifficultyCalculator(Beatmap beatmap) + : this(beatmap, null) + { + } + + protected DifficultyCalculator(Beatmap beatmap, Mod[] mods) { Beatmap = beatmap; + Mods = mods ?? new Mod[0]; Objects = CreateBeatmapConverter().Convert(beatmap).HitObjects; foreach (var h in Objects) h.ApplyDefaults(beatmap.ControlPointInfo, beatmap.BeatmapInfo.BaseDifficulty); + ApplyMods(mods); + PreprocessHitObjects(); } + protected virtual void ApplyMods(Mod[] mods) + { + var clock = new StopwatchClock(); + mods.OfType().ForEach(m => m.ApplyToClock(clock)); + + TimeRate = clock.Rate; + } + protected virtual void PreprocessHitObjects() { } diff --git a/osu.Game/Beatmaps/DummyWorkingBeatmap.cs b/osu.Game/Beatmaps/DummyWorkingBeatmap.cs index b9376849c1..c15d585eb2 100644 --- a/osu.Game/Beatmaps/DummyWorkingBeatmap.cs +++ b/osu.Game/Beatmaps/DummyWorkingBeatmap.cs @@ -59,7 +59,7 @@ namespace osu.Game.Beatmaps throw new NotImplementedException(); } - public override DifficultyCalculator CreateDifficultyCalculator(Beatmap beatmap) => null; + public override DifficultyCalculator CreateDifficultyCalculator(Beatmap beatmap, Mod[] mods = null) => null; public override string Description => "dummy"; diff --git a/osu.Game/Rulesets/Ruleset.cs b/osu.Game/Rulesets/Ruleset.cs index 587c2fc659..e8919c4bda 100644 --- a/osu.Game/Rulesets/Ruleset.cs +++ b/osu.Game/Rulesets/Ruleset.cs @@ -10,6 +10,7 @@ using osu.Game.Beatmaps; using osu.Game.Graphics; using osu.Game.Overlays.Settings; using osu.Game.Rulesets.Mods; +using osu.Game.Rulesets.Scoring; using osu.Game.Rulesets.UI; namespace osu.Game.Rulesets @@ -47,7 +48,7 @@ namespace osu.Game.Rulesets /// public abstract RulesetContainer CreateRulesetContainerWith(WorkingBeatmap beatmap, bool isForCurrentRuleset); - public abstract DifficultyCalculator CreateDifficultyCalculator(Beatmap beatmap); + public abstract DifficultyCalculator CreateDifficultyCalculator(Beatmap beatmap, Mod[] mods = null); public virtual Drawable CreateIcon() => new SpriteIcon { Icon = FontAwesome.fa_question_circle }; From 18f2e92a48b4ba9e044143d04972470980666fc4 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 16 Nov 2017 20:35:57 +0900 Subject: [PATCH 03/35] Rework mod applications to hitobject/rulesetcontainer for DifficultyCalculator --- osu.Game.Rulesets.Mania/Mods/ManiaMod.cs | 6 ++--- osu.Game.Rulesets.Osu/Mods/OsuMod.cs | 27 ++++++++++++------- osu.Game/Beatmaps/DifficultyCalculator.cs | 4 +++ osu.Game/Rulesets/Mods/IApplicableMod.cs | 22 --------------- .../Rulesets/Mods/IApplicableToHitObject.cs | 20 ++++++++++++++ .../Mods/IApplicableToRulesetContainer.cs | 21 +++++++++++++++ osu.Game/Rulesets/Mods/ModAutoplay.cs | 4 +-- osu.Game/Rulesets/UI/RulesetContainer.cs | 6 ++++- osu.Game/osu.Game.csproj | 3 ++- 9 files changed, 74 insertions(+), 39 deletions(-) delete mode 100644 osu.Game/Rulesets/Mods/IApplicableMod.cs create mode 100644 osu.Game/Rulesets/Mods/IApplicableToHitObject.cs create mode 100644 osu.Game/Rulesets/Mods/IApplicableToRulesetContainer.cs diff --git a/osu.Game.Rulesets.Mania/Mods/ManiaMod.cs b/osu.Game.Rulesets.Mania/Mods/ManiaMod.cs index 037c3bd567..164309c227 100644 --- a/osu.Game.Rulesets.Mania/Mods/ManiaMod.cs +++ b/osu.Game.Rulesets.Mania/Mods/ManiaMod.cs @@ -86,18 +86,17 @@ namespace osu.Game.Rulesets.Mania.Mods public override Type[] IncompatibleMods => new[] { typeof(ModFlashlight) }; } - public class ManiaModRandom : Mod, IApplicableMod + public class ManiaModRandom : Mod, IApplicableToRulesetContainer { public override string Name => "Random"; public override string ShortenedName => "RD"; - public override FontAwesome Icon => FontAwesome.fa_osu_dice; + public override FontAwesome Icon => FontAwesome.fa_osu_dice; public override string Description => @"Shuffle around the notes!"; public override double ScoreMultiplier => 1; public void ApplyToRulesetContainer(RulesetContainer rulesetContainer) { int availableColumns = ((ManiaRulesetContainer)rulesetContainer).AvailableColumns; - var shuffledColumns = Enumerable.Range(0, availableColumns).OrderBy(item => RNG.Next()).ToList(); rulesetContainer.Objects.OfType().ForEach(h => h.Column = shuffledColumns[h.Column]); @@ -188,6 +187,7 @@ namespace osu.Game.Rulesets.Mania.Mods base.ApplyToRulesetContainer(rulesetContainer); } + protected override Score CreateReplayScore(Beatmap beatmap) => new Score { User = new User { Username = "osu!topus!" }, diff --git a/osu.Game.Rulesets.Osu/Mods/OsuMod.cs b/osu.Game.Rulesets.Osu/Mods/OsuMod.cs index 2970055bff..596fe27504 100644 --- a/osu.Game.Rulesets.Osu/Mods/OsuMod.cs +++ b/osu.Game.Rulesets.Osu/Mods/OsuMod.cs @@ -33,22 +33,29 @@ namespace osu.Game.Rulesets.Osu.Mods public override double ScoreMultiplier => 1.06; } - public class OsuModHardRock : ModHardRock, IApplicableMod + public class OsuModHardRock : ModHardRock, IApplicableToHitObject { public override double ScoreMultiplier => 1.06; public override bool Ranked => true; - public void ApplyToRulesetContainer(RulesetContainer rulesetContainer) + public void ApplyToHitObject(OsuHitObject hitObject) + { + hitObject.Position = new Vector2(hitObject.Position.X, OsuPlayfield.BASE_SIZE.Y - hitObject.Y); + + var slider = hitObject as Slider; + if (slider == null) + return; + + var newControlPoints = new List(); + slider.ControlPoints.ForEach(c => newControlPoints.Add(new Vector2(c.X, OsuPlayfield.BASE_SIZE.Y - c.Y))); + + slider.ControlPoints = newControlPoints; + slider.Curve?.Calculate(); // Recalculate the slider curve + } + + public void ApplyToHitObjects(RulesetContainer rulesetContainer) { - rulesetContainer.Objects.OfType().ForEach(h => h.Position = new Vector2(h.Position.X, OsuPlayfield.BASE_SIZE.Y - h.Y)); - rulesetContainer.Objects.OfType().ForEach(s => - { - var newControlPoints = new List(); - s.ControlPoints.ForEach(c => newControlPoints.Add(new Vector2(c.X, OsuPlayfield.BASE_SIZE.Y - c.Y))); - s.ControlPoints = newControlPoints; - s.Curve?.Calculate(); // Recalculate the slider curve - }); } } diff --git a/osu.Game/Beatmaps/DifficultyCalculator.cs b/osu.Game/Beatmaps/DifficultyCalculator.cs index f6cc535aca..54dab07b31 100644 --- a/osu.Game/Beatmaps/DifficultyCalculator.cs +++ b/osu.Game/Beatmaps/DifficultyCalculator.cs @@ -49,6 +49,10 @@ namespace osu.Game.Beatmaps var clock = new StopwatchClock(); mods.OfType().ForEach(m => m.ApplyToClock(clock)); + foreach (var mod in mods.OfType>()) + foreach (var obj in Objects) + mod.ApplyToHitObject(obj); + TimeRate = clock.Rate; } diff --git a/osu.Game/Rulesets/Mods/IApplicableMod.cs b/osu.Game/Rulesets/Mods/IApplicableMod.cs deleted file mode 100644 index 1957952720..0000000000 --- a/osu.Game/Rulesets/Mods/IApplicableMod.cs +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE - -using osu.Game.Rulesets.Objects; -using osu.Game.Rulesets.UI; - -namespace osu.Game.Rulesets.Mods -{ - /// - /// An interface for mods that are applied to a RulesetContainer. - /// - /// The type of HitObject the RulesetContainer contains. - public interface IApplicableMod - where TObject : HitObject - { - /// - /// Applies the mod to a RulesetContainer. - /// - /// The RulesetContainer to apply the mod to. - void ApplyToRulesetContainer(RulesetContainer rulesetContainer); - } -} diff --git a/osu.Game/Rulesets/Mods/IApplicableToHitObject.cs b/osu.Game/Rulesets/Mods/IApplicableToHitObject.cs new file mode 100644 index 0000000000..099234d9c1 --- /dev/null +++ b/osu.Game/Rulesets/Mods/IApplicableToHitObject.cs @@ -0,0 +1,20 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Game.Rulesets.Objects; + +namespace osu.Game.Rulesets.Mods +{ + /// + /// An interface for s that can be applied to s. + /// + public interface IApplicableToHitObject + where TObject : HitObject + { + /// + /// Applies this to a . + /// + /// The to apply to. + void ApplyToHitObject(TObject hitObject); + } +} diff --git a/osu.Game/Rulesets/Mods/IApplicableToRulesetContainer.cs b/osu.Game/Rulesets/Mods/IApplicableToRulesetContainer.cs new file mode 100644 index 0000000000..9b23dd58f9 --- /dev/null +++ b/osu.Game/Rulesets/Mods/IApplicableToRulesetContainer.cs @@ -0,0 +1,21 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Game.Rulesets.Objects; +using osu.Game.Rulesets.UI; + +namespace osu.Game.Rulesets.Mods +{ + /// + /// An interface for s that can be applied to s. + /// + public interface IApplicableToRulesetContainer + where TObject : HitObject + { + /// + /// Applies this to a . + /// + /// The to apply to. + void ApplyToRulesetContainer(RulesetContainer rulesetContainer); + } +} diff --git a/osu.Game/Rulesets/Mods/ModAutoplay.cs b/osu.Game/Rulesets/Mods/ModAutoplay.cs index ece0deba84..d94d4ba0db 100644 --- a/osu.Game/Rulesets/Mods/ModAutoplay.cs +++ b/osu.Game/Rulesets/Mods/ModAutoplay.cs @@ -10,7 +10,7 @@ using osu.Game.Rulesets.UI; namespace osu.Game.Rulesets.Mods { - public abstract class ModAutoplay : ModAutoplay, IApplicableMod + public abstract class ModAutoplay : ModAutoplay, IApplicableToRulesetContainer where T : HitObject { protected abstract Score CreateReplayScore(Beatmap beatmap); @@ -30,4 +30,4 @@ namespace osu.Game.Rulesets.Mods public override double ScoreMultiplier => 0; public override Type[] IncompatibleMods => new[] { typeof(ModRelax), typeof(ModSuddenDeath), typeof(ModNoFail) }; } -} \ No newline at end of file +} diff --git a/osu.Game/Rulesets/UI/RulesetContainer.cs b/osu.Game/Rulesets/UI/RulesetContainer.cs index 278814ea7e..6726d94995 100644 --- a/osu.Game/Rulesets/UI/RulesetContainer.cs +++ b/osu.Game/Rulesets/UI/RulesetContainer.cs @@ -212,7 +212,11 @@ namespace osu.Game.Rulesets.UI if (mods == null) return; - foreach (var mod in mods.OfType>()) + foreach (var mod in mods.OfType>()) + foreach (var obj in Beatmap.HitObjects) + mod.ApplyToHitObject(obj); + + foreach (var mod in mods.OfType>()) mod.ApplyToRulesetContainer(this); } diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index ac1498c9d9..7b479bdba2 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -549,9 +549,10 @@ - + + From 5781b45b3903393570025c567a7071446b08f9f5 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 16 Nov 2017 20:41:26 +0900 Subject: [PATCH 04/35] Set TimeRate after mod application --- osu.Game/Beatmaps/DifficultyCalculator.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/osu.Game/Beatmaps/DifficultyCalculator.cs b/osu.Game/Beatmaps/DifficultyCalculator.cs index 54dab07b31..f101cfbfb8 100644 --- a/osu.Game/Beatmaps/DifficultyCalculator.cs +++ b/osu.Game/Beatmaps/DifficultyCalculator.cs @@ -48,12 +48,11 @@ namespace osu.Game.Beatmaps { var clock = new StopwatchClock(); mods.OfType().ForEach(m => m.ApplyToClock(clock)); + TimeRate = clock.Rate; foreach (var mod in mods.OfType>()) foreach (var obj in Objects) mod.ApplyToHitObject(obj); - - TimeRate = clock.Rate; } protected virtual void PreprocessHitObjects() From cc1720241e8d63fb3d9d56333eb348d89933eafb Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Fri, 17 Nov 2017 12:35:03 +0900 Subject: [PATCH 05/35] Fix DifficultyCalculator using incorrect mods --- osu.Game/Beatmaps/DifficultyCalculator.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Beatmaps/DifficultyCalculator.cs b/osu.Game/Beatmaps/DifficultyCalculator.cs index f101cfbfb8..34c6bb95ff 100644 --- a/osu.Game/Beatmaps/DifficultyCalculator.cs +++ b/osu.Game/Beatmaps/DifficultyCalculator.cs @@ -39,7 +39,7 @@ namespace osu.Game.Beatmaps foreach (var h in Objects) h.ApplyDefaults(beatmap.ControlPointInfo, beatmap.BeatmapInfo.BaseDifficulty); - ApplyMods(mods); + ApplyMods(Mods); PreprocessHitObjects(); } From 7892eefd6899bf6c0a64d397f300d77bc3576e92 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Fri, 17 Nov 2017 14:23:52 +0900 Subject: [PATCH 06/35] Fix up mod application + beatmap/hitobject references --- .../OsuDifficulty/OsuDifficultyCalculator.cs | 13 ++++++++++--- osu.Game.Rulesets.Osu/OsuRuleset.cs | 2 +- .../TaikoDifficultyCalculator.cs | 2 +- osu.Game/Beatmaps/DifficultyCalculator.cs | 18 +++++++++--------- 4 files changed, 21 insertions(+), 14 deletions(-) diff --git a/osu.Game.Rulesets.Osu/OsuDifficulty/OsuDifficultyCalculator.cs b/osu.Game.Rulesets.Osu/OsuDifficulty/OsuDifficultyCalculator.cs index 6ed45e1f03..9f279ccae4 100644 --- a/osu.Game.Rulesets.Osu/OsuDifficulty/OsuDifficultyCalculator.cs +++ b/osu.Game.Rulesets.Osu/OsuDifficulty/OsuDifficultyCalculator.cs @@ -4,6 +4,7 @@ using System; using System.Collections.Generic; using osu.Game.Beatmaps; +using osu.Game.Rulesets.Mods; using osu.Game.Rulesets.Osu.Beatmaps; using osu.Game.Rulesets.Osu.Objects; using osu.Game.Rulesets.Osu.OsuDifficulty.Preprocessing; @@ -16,19 +17,25 @@ namespace osu.Game.Rulesets.Osu.OsuDifficulty private const int section_length = 400; private const double difficulty_multiplier = 0.0675; - public OsuDifficultyCalculator(Beatmap beatmap) : base(beatmap) + public OsuDifficultyCalculator(Beatmap beatmap) + : base(beatmap) + { + } + + public OsuDifficultyCalculator(Beatmap beatmap, Mod[] mods) + : base(beatmap, mods) { } protected override void PreprocessHitObjects() { - foreach (OsuHitObject h in Objects) + foreach (OsuHitObject h in Beatmap.HitObjects) (h as Slider)?.Curve?.Calculate(); } public override double Calculate(Dictionary categoryDifficulty) { - OsuDifficultyBeatmap beatmap = new OsuDifficultyBeatmap(Objects); + OsuDifficultyBeatmap beatmap = new OsuDifficultyBeatmap(Beatmap.HitObjects); Skill[] skills = { new Aim(), diff --git a/osu.Game.Rulesets.Osu/OsuRuleset.cs b/osu.Game.Rulesets.Osu/OsuRuleset.cs index a4828319d1..8b7a014ea8 100644 --- a/osu.Game.Rulesets.Osu/OsuRuleset.cs +++ b/osu.Game.Rulesets.Osu/OsuRuleset.cs @@ -113,7 +113,7 @@ namespace osu.Game.Rulesets.Osu public override Drawable CreateIcon() => new SpriteIcon { Icon = FontAwesome.fa_osu_osu_o }; - public override DifficultyCalculator CreateDifficultyCalculator(Beatmap beatmap, Mod[] mods = null) => new OsuDifficultyCalculator(beatmap); + public override DifficultyCalculator CreateDifficultyCalculator(Beatmap beatmap, Mod[] mods = null) => new OsuDifficultyCalculator(beatmap, mods); public override string Description => "osu!"; diff --git a/osu.Game.Rulesets.Taiko/TaikoDifficultyCalculator.cs b/osu.Game.Rulesets.Taiko/TaikoDifficultyCalculator.cs index 57986cd198..adb7ace5f9 100644 --- a/osu.Game.Rulesets.Taiko/TaikoDifficultyCalculator.cs +++ b/osu.Game.Rulesets.Taiko/TaikoDifficultyCalculator.cs @@ -41,7 +41,7 @@ namespace osu.Game.Rulesets.Taiko // Fill our custom DifficultyHitObject class, that carries additional information difficultyHitObjects.Clear(); - foreach (var hitObject in Objects) + foreach (var hitObject in Beatmap.HitObjects) difficultyHitObjects.Add(new TaikoHitObjectDifficulty(hitObject)); // Sort DifficultyHitObjects by StartTime of the HitObjects - just to make sure. diff --git a/osu.Game/Beatmaps/DifficultyCalculator.cs b/osu.Game/Beatmaps/DifficultyCalculator.cs index 34c6bb95ff..3c32b718bc 100644 --- a/osu.Game/Beatmaps/DifficultyCalculator.cs +++ b/osu.Game/Beatmaps/DifficultyCalculator.cs @@ -19,11 +19,9 @@ namespace osu.Game.Beatmaps public abstract class DifficultyCalculator : DifficultyCalculator where T : HitObject { - protected readonly Beatmap Beatmap; + protected readonly Beatmap Beatmap; protected readonly Mod[] Mods; - protected List Objects; - protected DifficultyCalculator(Beatmap beatmap) : this(beatmap, null) { @@ -31,13 +29,9 @@ namespace osu.Game.Beatmaps protected DifficultyCalculator(Beatmap beatmap, Mod[] mods) { - Beatmap = beatmap; + Beatmap = CreateBeatmapConverter().Convert(beatmap); Mods = mods ?? new Mod[0]; - Objects = CreateBeatmapConverter().Convert(beatmap).HitObjects; - - foreach (var h in Objects) - h.ApplyDefaults(beatmap.ControlPointInfo, beatmap.BeatmapInfo.BaseDifficulty); ApplyMods(Mods); @@ -50,9 +44,15 @@ namespace osu.Game.Beatmaps mods.OfType().ForEach(m => m.ApplyToClock(clock)); TimeRate = clock.Rate; + foreach (var mod in Mods.OfType()) + mod.ApplyToDifficulty(Beatmap.BeatmapInfo.BaseDifficulty); + foreach (var mod in mods.OfType>()) - foreach (var obj in Objects) + foreach (var obj in Beatmap.HitObjects) mod.ApplyToHitObject(obj); + + foreach (var h in Beatmap.HitObjects) + h.ApplyDefaults(Beatmap.ControlPointInfo, Beatmap.BeatmapInfo.BaseDifficulty); } protected virtual void PreprocessHitObjects() From ac6213d1fadd8362580b482de0b1355981a25c8e Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Fri, 17 Nov 2017 14:26:33 +0900 Subject: [PATCH 07/35] CI fixes --- osu.Game.Rulesets.Catch/CatchDifficultyCalculator.cs | 2 +- osu.Game.Rulesets.Mania/ManiaDifficultyCalculator.cs | 2 +- osu.Game.Rulesets.Osu/Mods/OsuMod.cs | 1 - osu.Game.Rulesets.Osu/OsuDifficulty/OsuDifficultyCalculator.cs | 2 +- osu.Game.Rulesets.Osu/OsuRuleset.cs | 1 - osu.Game.Rulesets.Taiko/TaikoDifficultyCalculator.cs | 2 +- osu.Game/Beatmaps/DifficultyCalculator.cs | 2 +- osu.Game/Rulesets/Mods/IApplicableToHitObject.cs | 2 +- osu.Game/Rulesets/Ruleset.cs | 1 - 9 files changed, 6 insertions(+), 9 deletions(-) diff --git a/osu.Game.Rulesets.Catch/CatchDifficultyCalculator.cs b/osu.Game.Rulesets.Catch/CatchDifficultyCalculator.cs index 127fde74ef..db88e04dd0 100644 --- a/osu.Game.Rulesets.Catch/CatchDifficultyCalculator.cs +++ b/osu.Game.Rulesets.Catch/CatchDifficultyCalculator.cs @@ -14,7 +14,7 @@ namespace osu.Game.Rulesets.Catch { } - public override double Calculate(Dictionary categoryDifficulty) => 0; + public override double Calculate(Dictionary categoryDifficulty = null) => 0; protected override BeatmapConverter CreateBeatmapConverter() => new CatchBeatmapConverter(); } diff --git a/osu.Game.Rulesets.Mania/ManiaDifficultyCalculator.cs b/osu.Game.Rulesets.Mania/ManiaDifficultyCalculator.cs index d5c6d21131..070fc2b4dd 100644 --- a/osu.Game.Rulesets.Mania/ManiaDifficultyCalculator.cs +++ b/osu.Game.Rulesets.Mania/ManiaDifficultyCalculator.cs @@ -16,7 +16,7 @@ namespace osu.Game.Rulesets.Mania { } - public override double Calculate(Dictionary categoryDifficulty) => 0; + public override double Calculate(Dictionary categoryDifficulty = null) => 0; protected override BeatmapConverter CreateBeatmapConverter() => new ManiaBeatmapConverter(true, (int)Math.Max(1, Math.Round(Beatmap.BeatmapInfo.BaseDifficulty.CircleSize))); } diff --git a/osu.Game.Rulesets.Osu/Mods/OsuMod.cs b/osu.Game.Rulesets.Osu/Mods/OsuMod.cs index 596fe27504..71349285b3 100644 --- a/osu.Game.Rulesets.Osu/Mods/OsuMod.cs +++ b/osu.Game.Rulesets.Osu/Mods/OsuMod.cs @@ -9,7 +9,6 @@ using osu.Game.Rulesets.Osu.Objects; using System; using System.Collections.Generic; using System.Linq; -using osu.Framework.Extensions.IEnumerableExtensions; using osu.Game.Rulesets.Osu.UI; using osu.Game.Rulesets.Scoring; using osu.Game.Rulesets.UI; diff --git a/osu.Game.Rulesets.Osu/OsuDifficulty/OsuDifficultyCalculator.cs b/osu.Game.Rulesets.Osu/OsuDifficulty/OsuDifficultyCalculator.cs index 9f279ccae4..f7909f8335 100644 --- a/osu.Game.Rulesets.Osu/OsuDifficulty/OsuDifficultyCalculator.cs +++ b/osu.Game.Rulesets.Osu/OsuDifficulty/OsuDifficultyCalculator.cs @@ -33,7 +33,7 @@ namespace osu.Game.Rulesets.Osu.OsuDifficulty (h as Slider)?.Curve?.Calculate(); } - public override double Calculate(Dictionary categoryDifficulty) + public override double Calculate(Dictionary categoryDifficulty = null) { OsuDifficultyBeatmap beatmap = new OsuDifficultyBeatmap(Beatmap.HitObjects); Skill[] skills = diff --git a/osu.Game.Rulesets.Osu/OsuRuleset.cs b/osu.Game.Rulesets.Osu/OsuRuleset.cs index 8b7a014ea8..9c11474f97 100644 --- a/osu.Game.Rulesets.Osu/OsuRuleset.cs +++ b/osu.Game.Rulesets.Osu/OsuRuleset.cs @@ -14,7 +14,6 @@ using System.Linq; using osu.Framework.Graphics; using osu.Game.Overlays.Settings; using osu.Framework.Input.Bindings; -using osu.Game.Rulesets.Scoring; namespace osu.Game.Rulesets.Osu { diff --git a/osu.Game.Rulesets.Taiko/TaikoDifficultyCalculator.cs b/osu.Game.Rulesets.Taiko/TaikoDifficultyCalculator.cs index adb7ace5f9..e06582500f 100644 --- a/osu.Game.Rulesets.Taiko/TaikoDifficultyCalculator.cs +++ b/osu.Game.Rulesets.Taiko/TaikoDifficultyCalculator.cs @@ -36,7 +36,7 @@ namespace osu.Game.Rulesets.Taiko { } - public override double Calculate(Dictionary categoryDifficulty) + public override double Calculate(Dictionary categoryDifficulty = null) { // Fill our custom DifficultyHitObject class, that carries additional information difficultyHitObjects.Clear(); diff --git a/osu.Game/Beatmaps/DifficultyCalculator.cs b/osu.Game/Beatmaps/DifficultyCalculator.cs index 3c32b718bc..351154623e 100644 --- a/osu.Game/Beatmaps/DifficultyCalculator.cs +++ b/osu.Game/Beatmaps/DifficultyCalculator.cs @@ -27,7 +27,7 @@ namespace osu.Game.Beatmaps { } - protected DifficultyCalculator(Beatmap beatmap, Mod[] mods) + protected DifficultyCalculator(Beatmap beatmap, Mod[] mods = null) { Beatmap = CreateBeatmapConverter().Convert(beatmap); Mods = mods ?? new Mod[0]; diff --git a/osu.Game/Rulesets/Mods/IApplicableToHitObject.cs b/osu.Game/Rulesets/Mods/IApplicableToHitObject.cs index 099234d9c1..7f39def343 100644 --- a/osu.Game/Rulesets/Mods/IApplicableToHitObject.cs +++ b/osu.Game/Rulesets/Mods/IApplicableToHitObject.cs @@ -8,7 +8,7 @@ namespace osu.Game.Rulesets.Mods /// /// An interface for s that can be applied to s. /// - public interface IApplicableToHitObject + public interface IApplicableToHitObject where TObject : HitObject { /// diff --git a/osu.Game/Rulesets/Ruleset.cs b/osu.Game/Rulesets/Ruleset.cs index e8919c4bda..ed2fdf4157 100644 --- a/osu.Game/Rulesets/Ruleset.cs +++ b/osu.Game/Rulesets/Ruleset.cs @@ -10,7 +10,6 @@ using osu.Game.Beatmaps; using osu.Game.Graphics; using osu.Game.Overlays.Settings; using osu.Game.Rulesets.Mods; -using osu.Game.Rulesets.Scoring; using osu.Game.Rulesets.UI; namespace osu.Game.Rulesets From 95fd323c6b122cd768a31a889eaa464319390212 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Fri, 17 Nov 2017 14:37:06 +0900 Subject: [PATCH 08/35] Fix ManiaDifficultyCalculator possibly failing due to nullref --- osu.Game.Rulesets.Catch/CatchDifficultyCalculator.cs | 2 +- osu.Game.Rulesets.Mania/ManiaDifficultyCalculator.cs | 2 +- .../OsuDifficulty/OsuDifficultyCalculator.cs | 2 +- osu.Game.Rulesets.Taiko/TaikoDifficultyCalculator.cs | 2 +- osu.Game/Beatmaps/DifficultyCalculator.cs | 9 ++------- 5 files changed, 6 insertions(+), 11 deletions(-) diff --git a/osu.Game.Rulesets.Catch/CatchDifficultyCalculator.cs b/osu.Game.Rulesets.Catch/CatchDifficultyCalculator.cs index db88e04dd0..b77be9d1f0 100644 --- a/osu.Game.Rulesets.Catch/CatchDifficultyCalculator.cs +++ b/osu.Game.Rulesets.Catch/CatchDifficultyCalculator.cs @@ -16,6 +16,6 @@ namespace osu.Game.Rulesets.Catch public override double Calculate(Dictionary categoryDifficulty = null) => 0; - protected override BeatmapConverter CreateBeatmapConverter() => new CatchBeatmapConverter(); + protected override BeatmapConverter CreateBeatmapConverter(Beatmap beatmap) => new CatchBeatmapConverter(); } } diff --git a/osu.Game.Rulesets.Mania/ManiaDifficultyCalculator.cs b/osu.Game.Rulesets.Mania/ManiaDifficultyCalculator.cs index 070fc2b4dd..67bc347535 100644 --- a/osu.Game.Rulesets.Mania/ManiaDifficultyCalculator.cs +++ b/osu.Game.Rulesets.Mania/ManiaDifficultyCalculator.cs @@ -18,6 +18,6 @@ namespace osu.Game.Rulesets.Mania public override double Calculate(Dictionary categoryDifficulty = null) => 0; - protected override BeatmapConverter CreateBeatmapConverter() => new ManiaBeatmapConverter(true, (int)Math.Max(1, Math.Round(Beatmap.BeatmapInfo.BaseDifficulty.CircleSize))); + protected override BeatmapConverter CreateBeatmapConverter(Beatmap beatmap) => new ManiaBeatmapConverter(true, (int)Math.Max(1, Math.Round(beatmap.BeatmapInfo.BaseDifficulty.CircleSize))); } } diff --git a/osu.Game.Rulesets.Osu/OsuDifficulty/OsuDifficultyCalculator.cs b/osu.Game.Rulesets.Osu/OsuDifficulty/OsuDifficultyCalculator.cs index f7909f8335..537874f643 100644 --- a/osu.Game.Rulesets.Osu/OsuDifficulty/OsuDifficultyCalculator.cs +++ b/osu.Game.Rulesets.Osu/OsuDifficulty/OsuDifficultyCalculator.cs @@ -74,6 +74,6 @@ namespace osu.Game.Rulesets.Osu.OsuDifficulty return starRating; } - protected override BeatmapConverter CreateBeatmapConverter() => new OsuBeatmapConverter(); + protected override BeatmapConverter CreateBeatmapConverter(Beatmap beatmap) => new OsuBeatmapConverter(); } } diff --git a/osu.Game.Rulesets.Taiko/TaikoDifficultyCalculator.cs b/osu.Game.Rulesets.Taiko/TaikoDifficultyCalculator.cs index e06582500f..e881942fbf 100644 --- a/osu.Game.Rulesets.Taiko/TaikoDifficultyCalculator.cs +++ b/osu.Game.Rulesets.Taiko/TaikoDifficultyCalculator.cs @@ -134,6 +134,6 @@ namespace osu.Game.Rulesets.Taiko return difficulty; } - protected override BeatmapConverter CreateBeatmapConverter() => new TaikoBeatmapConverter(true); + protected override BeatmapConverter CreateBeatmapConverter(Beatmap beatmap) => new TaikoBeatmapConverter(true); } } diff --git a/osu.Game/Beatmaps/DifficultyCalculator.cs b/osu.Game/Beatmaps/DifficultyCalculator.cs index 351154623e..f58f433cb2 100644 --- a/osu.Game/Beatmaps/DifficultyCalculator.cs +++ b/osu.Game/Beatmaps/DifficultyCalculator.cs @@ -22,14 +22,9 @@ namespace osu.Game.Beatmaps protected readonly Beatmap Beatmap; protected readonly Mod[] Mods; - protected DifficultyCalculator(Beatmap beatmap) - : this(beatmap, null) - { - } - protected DifficultyCalculator(Beatmap beatmap, Mod[] mods = null) { - Beatmap = CreateBeatmapConverter().Convert(beatmap); + Beatmap = CreateBeatmapConverter(beatmap).Convert(beatmap); Mods = mods ?? new Mod[0]; @@ -59,6 +54,6 @@ namespace osu.Game.Beatmaps { } - protected abstract BeatmapConverter CreateBeatmapConverter(); + protected abstract BeatmapConverter CreateBeatmapConverter(Beatmap beatmap); } } From 8bd59ff0b3614f1a39e33e8e0309246e7ca6c0b4 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 17 Nov 2017 17:40:10 +0900 Subject: [PATCH 09/35] Fix osu! logo occasionally being in the wrong state on entering the main menu --- osu.Game/Screens/Menu/ButtonSystem.cs | 60 +++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/osu.Game/Screens/Menu/ButtonSystem.cs b/osu.Game/Screens/Menu/ButtonSystem.cs index af16fbd71c..ac597cd9d7 100644 --- a/osu.Game/Screens/Menu/ButtonSystem.cs +++ b/osu.Game/Screens/Menu/ButtonSystem.cs @@ -55,6 +55,8 @@ namespace osu.Game.Screens.Menu // osuLogo.SizeForFlow relies on loading to be complete. buttonFlow.Position = new Vector2(WEDGE_WIDTH * 2 - (BUTTON_WIDTH + this.logo.SizeForFlow / 4), 0); + + updateLogoState(); } } @@ -217,6 +219,8 @@ namespace osu.Game.Screens.Menu if (state == MenuState.TopLevel) buttonArea.FinishTransforms(true); + updateLogoState(lastState); + using (buttonArea.BeginDelayedSequence(lastState == MenuState.Initial ? 150 : 0, true)) { switch (state) @@ -320,6 +324,62 @@ namespace osu.Game.Screens.Menu } } + private void updateLogoState(MenuState lastState = MenuState.Initial) + { + switch (state) + { + case MenuState.Exit: + case MenuState.Initial: + trackingPosition = false; + + logo?.Delay(150) + .Schedule(() => + { + toolbar?.Hide(); + + logo.ClearTransforms(targetMember: nameof(Position)); + logo.RelativePositionAxes = Axes.Both; + + logo.MoveTo(new Vector2(0.5f), 800, Easing.OutExpo); + logo.ScaleTo(1, 800, Easing.OutExpo); + }); + + break; + case MenuState.TopLevel: + case MenuState.Play: + logo.ClearTransforms(targetMember: nameof(Position)); + logo.RelativePositionAxes = Axes.None; + + trackingPosition = true; + + switch (lastState) + { + case MenuState.Initial: + logo.ScaleTo(0.5f, 200, Easing.In); + + trackingPosition = false; + + logo + .MoveTo(iconTrackingPosition, lastState == MenuState.EnteringMode ? 0 : 200, Easing.In) + .OnComplete(o => + { + trackingPosition = true; + + o.Impact(); + toolbar?.Show(); + }); + break; + default: + logo.ScaleTo(0.5f, 200, Easing.OutQuint); + break; + } + break; + case MenuState.EnteringMode: + trackingPosition = true; + break; + } + } + private Vector2 iconTrackingPosition => logo.Parent.ToLocalSpace(iconFacade.ScreenSpaceDrawQuad.Centre); private bool trackingPosition; From d75e3d8e818e68f8b6e2f6024fcc41a4f37dca32 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 17 Nov 2017 18:35:54 +0900 Subject: [PATCH 10/35] Use lazy for WorkingBeatmap component loading --- osu.Game/Beatmaps/WorkingBeatmap.cs | 129 +++++++++++----------------- 1 file changed, 50 insertions(+), 79 deletions(-) diff --git a/osu.Game/Beatmaps/WorkingBeatmap.cs b/osu.Game/Beatmaps/WorkingBeatmap.cs index 959e71d48d..9ae87bc0a7 100644 --- a/osu.Game/Beatmaps/WorkingBeatmap.cs +++ b/osu.Game/Beatmaps/WorkingBeatmap.cs @@ -28,16 +28,10 @@ namespace osu.Game.Beatmaps Metadata = beatmapInfo.Metadata ?? BeatmapSetInfo?.Metadata ?? new BeatmapMetadata(); Mods.ValueChanged += mods => applyRateAdjustments(); - } - private void applyRateAdjustments() - { - var t = track; - if (t == null) return; - - t.ResetSpeedAdjustments(); - foreach (var mod in Mods.Value.OfType()) - mod.ApplyToClock(t); + beatmap = new Lazy(populateBeatmap); + background = new Lazy(populateBackground); + track = new Lazy(populateTrack); } protected abstract Beatmap GetBeatmap(); @@ -45,98 +39,75 @@ namespace osu.Game.Beatmaps protected abstract Track GetTrack(); protected virtual Waveform GetWaveform() => new Waveform(); - private Beatmap beatmap; - private readonly object beatmapLock = new object(); - public Beatmap Beatmap + public bool BeatmapLoaded => beatmap.IsValueCreated; + public Beatmap Beatmap => beatmap.Value; + private readonly Lazy beatmap; + + private Beatmap populateBeatmap() { - get - { - lock (beatmapLock) - { - if (beatmap != null) return beatmap; + var b = GetBeatmap() ?? new Beatmap(); - beatmap = GetBeatmap() ?? new Beatmap(); + // use the database-backed info. + b.BeatmapInfo = BeatmapInfo; - // use the database-backed info. - beatmap.BeatmapInfo = BeatmapInfo; - - return beatmap; - } - } + return b; } - private readonly object backgroundLock = new object(); - private Texture background; - public Texture Background + public bool BackgroundLoaded => background.IsValueCreated; + public Texture Background => background.Value; + private Lazy background; + + private Texture populateBackground() => GetBackground(); + + public bool TrackLoaded => track.IsValueCreated; + public Track Track => track.Value; + private Lazy track; + + private Track populateTrack() { - get - { - lock (backgroundLock) - { - return background ?? (background = GetBackground()); - } - } + // we want to ensure that we always have a track, even if it's a fake one. + var t = GetTrack() ?? new TrackVirtual(); + applyRateAdjustments(t); + return t; } - private Track track; - private readonly object trackLock = new object(); - public Track Track - { - get - { - lock (trackLock) - { - if (track != null) return track; + public bool WaveformLoaded => waveform.IsValueCreated; + public Waveform Waveform => waveform.Value; + private Lazy waveform; - // we want to ensure that we always have a track, even if it's a fake one. - track = GetTrack() ?? new TrackVirtual(); - - applyRateAdjustments(); - return track; - } - } - } - - private Waveform waveform; - private readonly object waveformLock = new object(); - public Waveform Waveform - { - get - { - lock (waveformLock) - return waveform ?? (waveform = GetWaveform()); - } - } - - public bool TrackLoaded => track != null; + private Waveform populateWaveform() => GetWaveform(); public void TransferTo(WorkingBeatmap other) { - lock (trackLock) - { - if (track != null && BeatmapInfo.AudioEquals(other.BeatmapInfo)) - other.track = track; - } + if (track.IsValueCreated && track.Value != null && BeatmapInfo.AudioEquals(other.BeatmapInfo)) + other.track = track; - if (background != null && BeatmapInfo.BackgroundEquals(other.BeatmapInfo)) + if (background.IsValueCreated && background.Value != null && BeatmapInfo.BackgroundEquals(other.BeatmapInfo)) other.background = background; } public virtual void Dispose() { - background?.Dispose(); - background = null; - - waveform?.Dispose(); + if (BackgroundLoaded) Background.Dispose(); + if (WaveformLoaded) Waveform.Dispose(); } public void DisposeTrack() { - lock (trackLock) - { - track?.Dispose(); - track = null; - } + if (!track.IsValueCreated) return; + + track.Value?.Dispose(); + track = null; + } + + private void applyRateAdjustments(Track t = null) + { + if (t == null && track.IsValueCreated) t = track.Value; + if (t == null) return; + + t.ResetSpeedAdjustments(); + foreach (var mod in Mods.Value.OfType()) + mod.ApplyToClock(t); } } } From b3aae2340b7dcd4816efe7c860b7ac7725c5f054 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 17 Nov 2017 18:36:24 +0900 Subject: [PATCH 11/35] Avoid accessing beatmaps from BeatSyncedContainer until they are loaded --- osu.Game/Graphics/Containers/BeatSyncedContainer.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/osu.Game/Graphics/Containers/BeatSyncedContainer.cs b/osu.Game/Graphics/Containers/BeatSyncedContainer.cs index 123ef0662d..fb85af12cb 100644 --- a/osu.Game/Graphics/Containers/BeatSyncedContainer.cs +++ b/osu.Game/Graphics/Containers/BeatSyncedContainer.cs @@ -35,9 +35,12 @@ namespace osu.Game.Graphics.Containers protected override void Update() { - var track = Beatmap.Value.Track; + if (!Beatmap.Value.TrackLoaded || !Beatmap.Value.BeatmapLoaded) return; - if (track == null) + var track = Beatmap.Value.Track; + var beatmap = Beatmap.Value.Beatmap; + + if (track == null || beatmap == null) return; double currentTrackTime = track.Length > 0 ? track.CurrentTime + EarlyActivationMilliseconds : Clock.CurrentTime; From 6b591ac77f4d4f2c4c173fcf41248f18ef76c183 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 17 Nov 2017 19:12:30 +0900 Subject: [PATCH 12/35] Add missing initialisation --- osu.Game/Beatmaps/WorkingBeatmap.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/osu.Game/Beatmaps/WorkingBeatmap.cs b/osu.Game/Beatmaps/WorkingBeatmap.cs index 9ae87bc0a7..c9acbefd87 100644 --- a/osu.Game/Beatmaps/WorkingBeatmap.cs +++ b/osu.Game/Beatmaps/WorkingBeatmap.cs @@ -32,6 +32,7 @@ namespace osu.Game.Beatmaps beatmap = new Lazy(populateBeatmap); background = new Lazy(populateBackground); track = new Lazy(populateTrack); + waveform = new Lazy(populateWaveform); } protected abstract Beatmap GetBeatmap(); @@ -73,7 +74,7 @@ namespace osu.Game.Beatmaps public bool WaveformLoaded => waveform.IsValueCreated; public Waveform Waveform => waveform.Value; - private Lazy waveform; + private readonly Lazy waveform; private Waveform populateWaveform() => GetWaveform(); From 1a6b0f5b3f235ef02340a072fdc717d5101587bf Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Fri, 17 Nov 2017 21:46:43 +0900 Subject: [PATCH 13/35] Update framework --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index c95b9350ed..887db793c7 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit c95b9350edb6305cfefdf08f902f6f73d336736b +Subproject commit 887db793c705b45071aea5e0c1cc931a7887165f From 4ced1b64906507ae871753cc55f63542e4970671 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Fri, 17 Nov 2017 22:10:24 +0900 Subject: [PATCH 14/35] Use more of the properties --- osu.Game/Beatmaps/WorkingBeatmap.cs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/osu.Game/Beatmaps/WorkingBeatmap.cs b/osu.Game/Beatmaps/WorkingBeatmap.cs index c9acbefd87..cd080b7bbe 100644 --- a/osu.Game/Beatmaps/WorkingBeatmap.cs +++ b/osu.Game/Beatmaps/WorkingBeatmap.cs @@ -80,10 +80,10 @@ namespace osu.Game.Beatmaps public void TransferTo(WorkingBeatmap other) { - if (track.IsValueCreated && track.Value != null && BeatmapInfo.AudioEquals(other.BeatmapInfo)) + if (track.IsValueCreated && Track != null && BeatmapInfo.AudioEquals(other.BeatmapInfo)) other.track = track; - if (background.IsValueCreated && background.Value != null && BeatmapInfo.BackgroundEquals(other.BeatmapInfo)) + if (background.IsValueCreated && Background != null && BeatmapInfo.BackgroundEquals(other.BeatmapInfo)) other.background = background; } @@ -95,15 +95,12 @@ namespace osu.Game.Beatmaps public void DisposeTrack() { - if (!track.IsValueCreated) return; - - track.Value?.Dispose(); - track = null; + if (TrackLoaded) Track.Dispose(); } private void applyRateAdjustments(Track t = null) { - if (t == null && track.IsValueCreated) t = track.Value; + if (t == null && track.IsValueCreated) t = Track; if (t == null) return; t.ResetSpeedAdjustments(); From ddf402d9486bc4632bdee6b21216ad9262c6b1dd Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Fri, 17 Nov 2017 22:14:28 +0900 Subject: [PATCH 15/35] Add nullchecks in Disposal where population methods return nulls --- osu.Game/Beatmaps/WorkingBeatmap.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/osu.Game/Beatmaps/WorkingBeatmap.cs b/osu.Game/Beatmaps/WorkingBeatmap.cs index cd080b7bbe..1d4ed75688 100644 --- a/osu.Game/Beatmaps/WorkingBeatmap.cs +++ b/osu.Game/Beatmaps/WorkingBeatmap.cs @@ -89,13 +89,13 @@ namespace osu.Game.Beatmaps public virtual void Dispose() { - if (BackgroundLoaded) Background.Dispose(); - if (WaveformLoaded) Waveform.Dispose(); + if (BackgroundLoaded) Background?.Dispose(); + if (WaveformLoaded) Waveform?.Dispose(); } public void DisposeTrack() { - if (TrackLoaded) Track.Dispose(); + if (TrackLoaded) Track?.Dispose(); } private void applyRateAdjustments(Track t = null) From f6ea5b0590a6033ce15ce10e4a374eadf2e31463 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 18 Nov 2017 10:34:17 +0900 Subject: [PATCH 16/35] Remove duplicated code --- osu.Game/Screens/Menu/ButtonSystem.cs | 43 --------------------------- 1 file changed, 43 deletions(-) diff --git a/osu.Game/Screens/Menu/ButtonSystem.cs b/osu.Game/Screens/Menu/ButtonSystem.cs index ac597cd9d7..2a0666ade5 100644 --- a/osu.Game/Screens/Menu/ButtonSystem.cs +++ b/osu.Game/Screens/Menu/ButtonSystem.cs @@ -227,23 +227,9 @@ namespace osu.Game.Screens.Menu { case MenuState.Exit: case MenuState.Initial: - trackingPosition = false; - buttonAreaBackground.ScaleTo(Vector2.One, 500, Easing.Out); buttonArea.FadeOut(300); - logo?.Delay(150) - .Schedule(() => - { - toolbar?.Hide(); - - logo.ClearTransforms(targetMember: nameof(Position)); - logo.RelativePositionAxes = Axes.Both; - - logo.MoveTo(new Vector2(0.5f), 800, Easing.OutExpo); - logo.ScaleTo(1, 800, Easing.OutExpo); - }); - foreach (Button b in buttonsTopLevel) b.State = ButtonState.Contracted; @@ -256,33 +242,6 @@ namespace osu.Game.Screens.Menu case MenuState.TopLevel: buttonAreaBackground.ScaleTo(Vector2.One, 200, Easing.Out); - logo.ClearTransforms(targetMember: nameof(Position)); - logo.RelativePositionAxes = Axes.None; - - trackingPosition = true; - - switch (lastState) - { - case MenuState.Initial: - logo.ScaleTo(0.5f, 200, Easing.In); - - trackingPosition = false; - - logo - .MoveTo(iconTrackingPosition, lastState == MenuState.EnteringMode ? 0 : 200, Easing.In) - .OnComplete(o => - { - trackingPosition = true; - - o.Impact(); - toolbar?.Show(); - }); - break; - default: - logo.ScaleTo(0.5f, 200, Easing.OutQuint); - break; - } - buttonArea.FadeIn(300); foreach (Button b in buttonsTopLevel) @@ -301,8 +260,6 @@ namespace osu.Game.Screens.Menu case MenuState.EnteringMode: buttonAreaBackground.ScaleTo(new Vector2(2, 0), 300, Easing.InSine); - trackingPosition = true; - buttonsTopLevel.ForEach(b => b.ContractStyle = 1); buttonsPlay.ForEach(b => b.ContractStyle = 1); backButton.ContractStyle = 1; From 322dd1bd05ac899c4210969dc8c5c699456ae698 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 18 Nov 2017 10:35:17 +0900 Subject: [PATCH 17/35] Rename variables to make more sense --- osu.Game/Screens/Menu/ButtonSystem.cs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/osu.Game/Screens/Menu/ButtonSystem.cs b/osu.Game/Screens/Menu/ButtonSystem.cs index 2a0666ade5..1b2b6a4d11 100644 --- a/osu.Game/Screens/Menu/ButtonSystem.cs +++ b/osu.Game/Screens/Menu/ButtonSystem.cs @@ -287,7 +287,7 @@ namespace osu.Game.Screens.Menu { case MenuState.Exit: case MenuState.Initial: - trackingPosition = false; + logoTracking = false; logo?.Delay(150) .Schedule(() => @@ -307,20 +307,20 @@ namespace osu.Game.Screens.Menu logo.ClearTransforms(targetMember: nameof(Position)); logo.RelativePositionAxes = Axes.None; - trackingPosition = true; + logoTracking = true; switch (lastState) { case MenuState.Initial: logo.ScaleTo(0.5f, 200, Easing.In); - trackingPosition = false; + logoTracking = false; logo - .MoveTo(iconTrackingPosition, lastState == MenuState.EnteringMode ? 0 : 200, Easing.In) + .MoveTo(logoTrackingPosition, lastState == MenuState.EnteringMode ? 0 : 200, Easing.In) .OnComplete(o => { - trackingPosition = true; + logoTracking = true; o.Impact(); toolbar?.Show(); @@ -332,14 +332,14 @@ namespace osu.Game.Screens.Menu } break; case MenuState.EnteringMode: - trackingPosition = true; + logoTracking = true; break; } } - private Vector2 iconTrackingPosition => logo.Parent.ToLocalSpace(iconFacade.ScreenSpaceDrawQuad.Centre); + private Vector2 logoTrackingPosition => logo.Parent.ToLocalSpace(iconFacade.ScreenSpaceDrawQuad.Centre); - private bool trackingPosition; + private bool logoTracking; protected override void Update() { @@ -350,8 +350,8 @@ namespace osu.Game.Screens.Menu if (logo != null) { - if (trackingPosition) - logo.Position = iconTrackingPosition; + if (logoTracking) + logo.Position = logoTrackingPosition; iconFacade.Width = logo.SizeForFlow * 0.5f; } From a741d6cea72bed93900cdc5e585ce032a7f97a01 Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Sat, 18 Nov 2017 04:46:02 +0300 Subject: [PATCH 18/35] Fix incorrect score indexes in leaderboard --- osu.Game/Screens/Select/Leaderboards/Leaderboard.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Screens/Select/Leaderboards/Leaderboard.cs b/osu.Game/Screens/Select/Leaderboards/Leaderboard.cs index 4b1070f236..6b421ed433 100644 --- a/osu.Game/Screens/Select/Leaderboards/Leaderboard.cs +++ b/osu.Game/Screens/Select/Leaderboards/Leaderboard.cs @@ -64,7 +64,7 @@ namespace osu.Game.Screens.Select.Leaderboards AutoSizeAxes = Axes.Y, Spacing = new Vector2(0f, 5f), Padding = new MarginPadding { Top = 10, Bottom = 5 }, - ChildrenEnumerable = scores.Select(s => new LeaderboardScore(s, 1 + i) { Action = () => ScoreSelected?.Invoke(s) }) + ChildrenEnumerable = scores.Select((s, index) => new LeaderboardScore(s, index + 1) { Action = () => ScoreSelected?.Invoke(s) }) }, f => { scrollFlow?.Expire(); From c2d1de34fccff8b98bff003662a907c89df99796 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 18 Nov 2017 11:19:15 +0900 Subject: [PATCH 19/35] Fix logo not always returning to the correct state when rapidly changing menus Fixes #1005 for real --- osu.Game/Screens/Menu/ButtonSystem.cs | 44 +++++++++++++++------------ 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/osu.Game/Screens/Menu/ButtonSystem.cs b/osu.Game/Screens/Menu/ButtonSystem.cs index 1b2b6a4d11..844b1e1819 100644 --- a/osu.Game/Screens/Menu/ButtonSystem.cs +++ b/osu.Game/Screens/Menu/ButtonSystem.cs @@ -17,6 +17,7 @@ using OpenTK.Graphics; using OpenTK.Input; using osu.Framework.Audio.Sample; using osu.Framework.Audio; +using osu.Framework.Threading; namespace osu.Game.Screens.Menu { @@ -281,25 +282,30 @@ namespace osu.Game.Screens.Menu } } + private ScheduledDelegate logoDelayedAction; + private void updateLogoState(MenuState lastState = MenuState.Initial) { + if (logo == null) return; + + logoDelayedAction?.Cancel(); + switch (state) { case MenuState.Exit: case MenuState.Initial: logoTracking = false; - logo?.Delay(150) - .Schedule(() => - { - toolbar?.Hide(); + logoDelayedAction = Scheduler.AddDelayed(() => + { + toolbar?.Hide(); - logo.ClearTransforms(targetMember: nameof(Position)); - logo.RelativePositionAxes = Axes.Both; + logo.ClearTransforms(targetMember: nameof(Position)); + logo.RelativePositionAxes = Axes.Both; - logo.MoveTo(new Vector2(0.5f), 800, Easing.OutExpo); - logo.ScaleTo(1, 800, Easing.OutExpo); - }); + logo.MoveTo(new Vector2(0.5f), 800, Easing.OutExpo); + logo.ScaleTo(1, 800, Easing.OutExpo); + }, 150); break; case MenuState.TopLevel: @@ -307,26 +313,24 @@ namespace osu.Game.Screens.Menu logo.ClearTransforms(targetMember: nameof(Position)); logo.RelativePositionAxes = Axes.None; - logoTracking = true; - switch (lastState) { case MenuState.Initial: + logoTracking = false; logo.ScaleTo(0.5f, 200, Easing.In); - logoTracking = false; + logo.MoveTo(logoTrackingPosition, lastState == MenuState.EnteringMode ? 0 : 200, Easing.In); - logo - .MoveTo(logoTrackingPosition, lastState == MenuState.EnteringMode ? 0 : 200, Easing.In) - .OnComplete(o => - { - logoTracking = true; + logoDelayedAction = Scheduler.AddDelayed(() => + { + logoTracking = true; - o.Impact(); - toolbar?.Show(); - }); + logo.Impact(); + toolbar?.Show(); + }, 200); break; default: + logoTracking = true; logo.ScaleTo(0.5f, 200, Easing.OutQuint); break; } From 68d4e420dde4b189a0d00a7c458f1a2c8c672c13 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 18 Nov 2017 12:18:55 +0900 Subject: [PATCH 20/35] Update framework --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index 887db793c7..f27e36d405 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 887db793c705b45071aea5e0c1cc931a7887165f +Subproject commit f27e36d405dd3f041e19defd59ecbb389ba84617 From 60778593c34ec95f7432d924e218daf91ccf1437 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 18 Nov 2017 22:24:42 +0900 Subject: [PATCH 21/35] Make pressing space twice at main menu a bit smoother --- osu.Game/Screens/Menu/ButtonSystem.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/osu.Game/Screens/Menu/ButtonSystem.cs b/osu.Game/Screens/Menu/ButtonSystem.cs index 844b1e1819..c3bd7c1f37 100644 --- a/osu.Game/Screens/Menu/ButtonSystem.cs +++ b/osu.Game/Screens/Menu/ButtonSystem.cs @@ -315,6 +315,7 @@ namespace osu.Game.Screens.Menu switch (lastState) { + case MenuState.TopLevel: // coming from toplevel to play case MenuState.Initial: logoTracking = false; logo.ScaleTo(0.5f, 200, Easing.In); From 9325730f5da306916c4270a9eea14f1f975732b1 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 19 Nov 2017 00:53:59 +0900 Subject: [PATCH 22/35] Fix leaderboard fadeout causing constant flow changes Also cleans up logic significantly. --- .../Select/Leaderboards/Leaderboard.cs | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/osu.Game/Screens/Select/Leaderboards/Leaderboard.cs b/osu.Game/Screens/Select/Leaderboards/Leaderboard.cs index 6b421ed433..d896da5319 100644 --- a/osu.Game/Screens/Select/Leaderboards/Leaderboard.cs +++ b/osu.Game/Screens/Select/Leaderboards/Leaderboard.cs @@ -40,20 +40,12 @@ namespace osu.Game.Screens.Select.Leaderboards scores = value; getScoresRequest?.Cancel(); - int i = 150; + scrollFlow?.FadeOut(200); + scrollFlow?.Expire(); + scrollFlow = null; + if (scores == null) - { - if (scrollFlow != null) - { - foreach (var c in scrollFlow.Children) - c.FadeOut(i += 10); - - foreach (var c in scrollFlow.Children) - c.LifetimeEnd = Time.Current + i; - } - return; - } // schedule because we may not be loaded yet (LoadComponentAsync complains). Schedule(() => @@ -67,10 +59,9 @@ namespace osu.Game.Screens.Select.Leaderboards ChildrenEnumerable = scores.Select((s, index) => new LeaderboardScore(s, index + 1) { Action = () => ScoreSelected?.Invoke(s) }) }, f => { - scrollFlow?.Expire(); scrollContainer.Add(scrollFlow = f); - i = 0; + int i = 0; foreach (var s in f.Children) { using (s.BeginDelayedSequence(i++ * 50, true)) From 7d2bbc50a365ba8f864443bbdec238fb69d6bf27 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 19 Nov 2017 01:42:13 +0900 Subject: [PATCH 23/35] Add unique constraint on OnlineBeatmapID --- osu.Game/Database/OsuDbContext.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/osu.Game/Database/OsuDbContext.cs b/osu.Game/Database/OsuDbContext.cs index 928c355696..9c1413b93b 100644 --- a/osu.Game/Database/OsuDbContext.cs +++ b/osu.Game/Database/OsuDbContext.cs @@ -78,6 +78,7 @@ namespace osu.Game.Database { base.OnModelCreating(modelBuilder); + modelBuilder.Entity().HasIndex(b => b.OnlineBeatmapID).IsUnique(); modelBuilder.Entity().HasIndex(b => b.MD5Hash).IsUnique(); modelBuilder.Entity().HasIndex(b => b.Hash).IsUnique(); From d704e9cf7e12d784a23adb72b50ff4ce64004b98 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 19 Nov 2017 01:45:07 +0900 Subject: [PATCH 24/35] Ensure we correctly handle importing beatmaps/sets when the onlineID already exists locally --- osu.Game/Beatmaps/BeatmapManager.cs | 39 ++++++++++++++++++----------- 1 file changed, 25 insertions(+), 14 deletions(-) diff --git a/osu.Game/Beatmaps/BeatmapManager.cs b/osu.Game/Beatmaps/BeatmapManager.cs index ff0abd3d78..2e74adbf45 100644 --- a/osu.Game/Beatmaps/BeatmapManager.cs +++ b/osu.Game/Beatmaps/BeatmapManager.cs @@ -483,14 +483,20 @@ namespace osu.Game.Beatmaps using (var stream = new StreamReader(reader.GetStream(mapName))) metadata = BeatmapDecoder.GetDecoder(stream).Decode(stream).Metadata; - beatmapSet = new BeatmapSetInfo + // check if a set already exists with the same online id. + beatmapSet = beatmaps.BeatmapSets.FirstOrDefault(b => b.OnlineBeatmapSetID == metadata.OnlineBeatmapSetID); + + if (beatmapSet == null) { - OnlineBeatmapSetID = metadata.OnlineBeatmapSetID, - Beatmaps = new List(), - Hash = hash, - Files = fileInfos, - Metadata = metadata - }; + beatmapSet = new BeatmapSetInfo + { + OnlineBeatmapSetID = metadata.OnlineBeatmapSetID, + Beatmaps = new List(), + Hash = hash, + Files = fileInfos, + Metadata = metadata + }; + } var mapNames = reader.Filenames.Where(f => f.EndsWith(".osu")); @@ -510,16 +516,21 @@ namespace osu.Game.Beatmaps beatmap.BeatmapInfo.Hash = ms.ComputeSHA2Hash(); beatmap.BeatmapInfo.MD5Hash = ms.ComputeMD5Hash(); - // TODO: Diff beatmap metadata with set metadata and leave it here if necessary - beatmap.BeatmapInfo.Metadata = null; + var existing = beatmaps.Beatmaps.FirstOrDefault(b => b.Hash == beatmap.BeatmapInfo.Hash || b.OnlineBeatmapID == beatmap.BeatmapInfo.OnlineBeatmapID); - RulesetInfo ruleset = rulesets.GetRuleset(beatmap.BeatmapInfo.RulesetID); + if (existing == null) + { + // TODO: Diff beatmap metadata with set metadata and leave it here if necessary + beatmap.BeatmapInfo.Metadata = null; - // TODO: this should be done in a better place once we actually need to dynamically update it. - beatmap.BeatmapInfo.Ruleset = ruleset; - beatmap.BeatmapInfo.StarDifficulty = ruleset?.CreateInstance()?.CreateDifficultyCalculator(beatmap).Calculate() ?? 0; + RulesetInfo ruleset = rulesets.GetRuleset(beatmap.BeatmapInfo.RulesetID); - beatmapSet.Beatmaps.Add(beatmap.BeatmapInfo); + // TODO: this should be done in a better place once we actually need to dynamically update it. + beatmap.BeatmapInfo.Ruleset = ruleset; + beatmap.BeatmapInfo.StarDifficulty = ruleset?.CreateInstance()?.CreateDifficultyCalculator(beatmap).Calculate() ?? 0; + + beatmapSet.Beatmaps.Add(beatmap.BeatmapInfo); + } } } From 42646413038e1c19b1ed489b5bf2ac35c28f9192 Mon Sep 17 00:00:00 2001 From: jorolf Date: Sat, 18 Nov 2017 18:27:30 +0100 Subject: [PATCH 25/35] fix missing text appearing when request returns nothing but beatmaps are already there --- .../Profile/Sections/Beatmaps/PaginatedBeatmapContainer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Overlays/Profile/Sections/Beatmaps/PaginatedBeatmapContainer.cs b/osu.Game/Overlays/Profile/Sections/Beatmaps/PaginatedBeatmapContainer.cs index 834328ca0e..4bfb8107b4 100644 --- a/osu.Game/Overlays/Profile/Sections/Beatmaps/PaginatedBeatmapContainer.cs +++ b/osu.Game/Overlays/Profile/Sections/Beatmaps/PaginatedBeatmapContainer.cs @@ -40,7 +40,7 @@ namespace osu.Game.Overlays.Profile.Sections.Beatmaps ShowMoreButton.FadeTo(sets.Count == ItemsPerPage ? 1 : 0); ShowMoreLoading.Hide(); - if (!sets.Any()) + if (!sets.Any() && VisiblePages == 1) { MissingText.Show(); return; From 9aaefb5e97b95689c22377f0d478d41a7de993e7 Mon Sep 17 00:00:00 2001 From: jorolf Date: Sat, 18 Nov 2017 20:09:31 +0100 Subject: [PATCH 26/35] same for PaginatedScoreContainer --- .../Overlays/Profile/Sections/Ranks/PaginatedScoreContainer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Overlays/Profile/Sections/Ranks/PaginatedScoreContainer.cs b/osu.Game/Overlays/Profile/Sections/Ranks/PaginatedScoreContainer.cs index bb383cac0d..dc30934990 100644 --- a/osu.Game/Overlays/Profile/Sections/Ranks/PaginatedScoreContainer.cs +++ b/osu.Game/Overlays/Profile/Sections/Ranks/PaginatedScoreContainer.cs @@ -41,7 +41,7 @@ namespace osu.Game.Overlays.Profile.Sections.Ranks ShowMoreButton.FadeTo(scores.Count == ItemsPerPage ? 1 : 0); ShowMoreLoading.Hide(); - if (!scores.Any()) + if (!scores.Any() && VisiblePages == 1) { MissingText.Show(); return; From 0b5614e4ee27dff86a9b5bfe7950495cedd14990 Mon Sep 17 00:00:00 2001 From: Aergwyn Date: Sat, 18 Nov 2017 22:12:15 +0100 Subject: [PATCH 27/35] fix result screen not showing name of mapper --- osu.Game/Screens/Ranking/ResultsPageScore.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Screens/Ranking/ResultsPageScore.cs b/osu.Game/Screens/Ranking/ResultsPageScore.cs index b01410cff5..9104473b82 100644 --- a/osu.Game/Screens/Ranking/ResultsPageScore.cs +++ b/osu.Game/Screens/Ranking/ResultsPageScore.cs @@ -324,7 +324,7 @@ namespace osu.Game.Screens.Ranking title.Colour = artist.Colour = colours.BlueDarker; versionMapper.Colour = colours.Gray8; - versionMapper.Text = $"{beatmap.Version} - mapped by {beatmap.Metadata.Author}"; + versionMapper.Text = $"{beatmap.Version} - mapped by {beatmap.Metadata.Author.Username}"; title.Current = localisation.GetUnicodePreference(beatmap.Metadata.TitleUnicode, beatmap.Metadata.Title); artist.Current = localisation.GetUnicodePreference(beatmap.Metadata.ArtistUnicode, beatmap.Metadata.Artist); } From 492120e88cf9ae2b43dc535c19b6c2f19a895b53 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 19 Nov 2017 16:02:08 +0900 Subject: [PATCH 28/35] Add migration for unique constraint on online id --- ...eatmapOnlineIDUniqueConstraint.Designer.cs | 302 ++++++++++++++++++ ...5731_AddBeatmapOnlineIDUniqueConstraint.cs | 25 ++ .../Migrations/OsuDbContextModelSnapshot.cs | 3 + osu.Game/osu.Game.csproj | 4 + 4 files changed, 334 insertions(+) create mode 100644 osu.Game/Migrations/20171119065731_AddBeatmapOnlineIDUniqueConstraint.Designer.cs create mode 100644 osu.Game/Migrations/20171119065731_AddBeatmapOnlineIDUniqueConstraint.cs diff --git a/osu.Game/Migrations/20171119065731_AddBeatmapOnlineIDUniqueConstraint.Designer.cs b/osu.Game/Migrations/20171119065731_AddBeatmapOnlineIDUniqueConstraint.Designer.cs new file mode 100644 index 0000000000..b2f81a729a --- /dev/null +++ b/osu.Game/Migrations/20171119065731_AddBeatmapOnlineIDUniqueConstraint.Designer.cs @@ -0,0 +1,302 @@ +// +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage; +using osu.Game.Database; +using System; + +namespace osu.Game.Migrations +{ + [DbContext(typeof(OsuDbContext))] + [Migration("20171119065731_AddBeatmapOnlineIDUniqueConstraint")] + partial class AddBeatmapOnlineIDUniqueConstraint + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "2.0.0-rtm-26452"); + + modelBuilder.Entity("osu.Game.Beatmaps.BeatmapDifficulty", b => + { + b.Property("ID") + .ValueGeneratedOnAdd(); + + b.Property("ApproachRate"); + + b.Property("CircleSize"); + + b.Property("DrainRate"); + + b.Property("OverallDifficulty"); + + b.Property("SliderMultiplier"); + + b.Property("SliderTickRate"); + + b.HasKey("ID"); + + b.ToTable("BeatmapDifficulty"); + }); + + modelBuilder.Entity("osu.Game.Beatmaps.BeatmapInfo", b => + { + b.Property("ID") + .ValueGeneratedOnAdd(); + + b.Property("AudioLeadIn"); + + b.Property("BaseDifficultyID"); + + b.Property("BeatDivisor"); + + b.Property("BeatmapSetInfoID"); + + b.Property("Countdown"); + + b.Property("DistanceSpacing"); + + b.Property("GridSize"); + + b.Property("Hash"); + + b.Property("Hidden"); + + b.Property("LetterboxInBreaks"); + + b.Property("MD5Hash"); + + b.Property("MetadataID"); + + b.Property("OnlineBeatmapID"); + + b.Property("Path"); + + b.Property("RulesetID"); + + b.Property("SpecialStyle"); + + b.Property("StackLeniency"); + + b.Property("StarDifficulty"); + + b.Property("StoredBookmarks"); + + b.Property("TimelineZoom"); + + b.Property("Version"); + + b.Property("WidescreenStoryboard"); + + b.HasKey("ID"); + + b.HasIndex("BaseDifficultyID"); + + b.HasIndex("BeatmapSetInfoID"); + + b.HasIndex("Hash") + .IsUnique(); + + b.HasIndex("MD5Hash") + .IsUnique(); + + b.HasIndex("MetadataID"); + + b.HasIndex("OnlineBeatmapID") + .IsUnique(); + + b.HasIndex("RulesetID"); + + b.ToTable("BeatmapInfo"); + }); + + modelBuilder.Entity("osu.Game.Beatmaps.BeatmapMetadata", b => + { + b.Property("ID") + .ValueGeneratedOnAdd(); + + b.Property("Artist"); + + b.Property("ArtistUnicode"); + + b.Property("AudioFile"); + + b.Property("AuthorString") + .HasColumnName("Author"); + + b.Property("BackgroundFile"); + + b.Property("PreviewTime"); + + b.Property("Source"); + + b.Property("Tags"); + + b.Property("Title"); + + b.Property("TitleUnicode"); + + b.HasKey("ID"); + + b.ToTable("BeatmapMetadata"); + }); + + modelBuilder.Entity("osu.Game.Beatmaps.BeatmapSetFileInfo", b => + { + b.Property("ID") + .ValueGeneratedOnAdd(); + + b.Property("BeatmapSetInfoID"); + + b.Property("FileInfoID"); + + b.Property("Filename") + .IsRequired(); + + b.HasKey("ID"); + + b.HasIndex("BeatmapSetInfoID"); + + b.HasIndex("FileInfoID"); + + b.ToTable("BeatmapSetFileInfo"); + }); + + modelBuilder.Entity("osu.Game.Beatmaps.BeatmapSetInfo", b => + { + b.Property("ID") + .ValueGeneratedOnAdd(); + + b.Property("DeletePending"); + + b.Property("Hash"); + + b.Property("MetadataID"); + + b.Property("OnlineBeatmapSetID"); + + b.Property("Protected"); + + b.HasKey("ID"); + + b.HasIndex("DeletePending"); + + b.HasIndex("Hash") + .IsUnique(); + + b.HasIndex("MetadataID"); + + b.HasIndex("OnlineBeatmapSetID") + .IsUnique(); + + b.ToTable("BeatmapSetInfo"); + }); + + modelBuilder.Entity("osu.Game.Input.Bindings.DatabasedKeyBinding", b => + { + b.Property("ID") + .ValueGeneratedOnAdd(); + + b.Property("IntAction") + .HasColumnName("Action"); + + b.Property("KeysString") + .HasColumnName("Keys"); + + b.Property("RulesetID"); + + b.Property("Variant"); + + b.HasKey("ID"); + + b.HasIndex("IntAction"); + + b.HasIndex("Variant"); + + b.ToTable("KeyBinding"); + }); + + modelBuilder.Entity("osu.Game.IO.FileInfo", b => + { + b.Property("ID") + .ValueGeneratedOnAdd(); + + b.Property("Hash"); + + b.Property("ReferenceCount"); + + b.HasKey("ID"); + + b.HasIndex("Hash") + .IsUnique(); + + b.HasIndex("ReferenceCount"); + + b.ToTable("FileInfo"); + }); + + modelBuilder.Entity("osu.Game.Rulesets.RulesetInfo", b => + { + b.Property("ID") + .ValueGeneratedOnAdd(); + + b.Property("Available"); + + b.Property("InstantiationInfo"); + + b.Property("Name"); + + b.HasKey("ID"); + + b.HasIndex("Available"); + + b.ToTable("RulesetInfo"); + }); + + modelBuilder.Entity("osu.Game.Beatmaps.BeatmapInfo", b => + { + b.HasOne("osu.Game.Beatmaps.BeatmapDifficulty", "BaseDifficulty") + .WithMany() + .HasForeignKey("BaseDifficultyID") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("osu.Game.Beatmaps.BeatmapSetInfo", "BeatmapSet") + .WithMany("Beatmaps") + .HasForeignKey("BeatmapSetInfoID") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("osu.Game.Beatmaps.BeatmapMetadata", "Metadata") + .WithMany("Beatmaps") + .HasForeignKey("MetadataID"); + + b.HasOne("osu.Game.Rulesets.RulesetInfo", "Ruleset") + .WithMany() + .HasForeignKey("RulesetID") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("osu.Game.Beatmaps.BeatmapSetFileInfo", b => + { + b.HasOne("osu.Game.Beatmaps.BeatmapSetInfo") + .WithMany("Files") + .HasForeignKey("BeatmapSetInfoID") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("osu.Game.IO.FileInfo", "FileInfo") + .WithMany() + .HasForeignKey("FileInfoID") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("osu.Game.Beatmaps.BeatmapSetInfo", b => + { + b.HasOne("osu.Game.Beatmaps.BeatmapMetadata", "Metadata") + .WithMany("BeatmapSets") + .HasForeignKey("MetadataID"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/osu.Game/Migrations/20171119065731_AddBeatmapOnlineIDUniqueConstraint.cs b/osu.Game/Migrations/20171119065731_AddBeatmapOnlineIDUniqueConstraint.cs new file mode 100644 index 0000000000..d3830ec0f5 --- /dev/null +++ b/osu.Game/Migrations/20171119065731_AddBeatmapOnlineIDUniqueConstraint.cs @@ -0,0 +1,25 @@ +using Microsoft.EntityFrameworkCore.Migrations; +using System; +using System.Collections.Generic; + +namespace osu.Game.Migrations +{ + public partial class AddBeatmapOnlineIDUniqueConstraint : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateIndex( + name: "IX_BeatmapInfo_OnlineBeatmapID", + table: "BeatmapInfo", + column: "OnlineBeatmapID", + unique: true); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropIndex( + name: "IX_BeatmapInfo_OnlineBeatmapID", + table: "BeatmapInfo"); + } + } +} diff --git a/osu.Game/Migrations/OsuDbContextModelSnapshot.cs b/osu.Game/Migrations/OsuDbContextModelSnapshot.cs index 7029dcdcd5..e3f1cf798b 100644 --- a/osu.Game/Migrations/OsuDbContextModelSnapshot.cs +++ b/osu.Game/Migrations/OsuDbContextModelSnapshot.cs @@ -103,6 +103,9 @@ namespace osu.Game.Migrations b.HasIndex("MetadataID"); + b.HasIndex("OnlineBeatmapID") + .IsUnique(); + b.HasIndex("RulesetID"); b.ToTable("BeatmapInfo"); diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 7b479bdba2..3b4434d1f4 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -279,6 +279,10 @@ 20171025071459_AddMissingIndexRules.cs + + + 20171119065731_AddBeatmapOnlineIDUniqueConstraint.cs + From 8919e98d13adcdbef4a51609a10701b221d1009c Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 20 Nov 2017 11:32:20 +0900 Subject: [PATCH 29/35] Fix CI issue --- osu.Game/Beatmaps/BeatmapManager.cs | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/osu.Game/Beatmaps/BeatmapManager.cs b/osu.Game/Beatmaps/BeatmapManager.cs index 2e74adbf45..006269f186 100644 --- a/osu.Game/Beatmaps/BeatmapManager.cs +++ b/osu.Game/Beatmaps/BeatmapManager.cs @@ -484,19 +484,14 @@ namespace osu.Game.Beatmaps metadata = BeatmapDecoder.GetDecoder(stream).Decode(stream).Metadata; // check if a set already exists with the same online id. - beatmapSet = beatmaps.BeatmapSets.FirstOrDefault(b => b.OnlineBeatmapSetID == metadata.OnlineBeatmapSetID); - - if (beatmapSet == null) + beatmapSet = beatmaps.BeatmapSets.FirstOrDefault(b => b.OnlineBeatmapSetID == metadata.OnlineBeatmapSetID) ?? new BeatmapSetInfo { - beatmapSet = new BeatmapSetInfo - { - OnlineBeatmapSetID = metadata.OnlineBeatmapSetID, - Beatmaps = new List(), - Hash = hash, - Files = fileInfos, - Metadata = metadata - }; - } + OnlineBeatmapSetID = metadata.OnlineBeatmapSetID, + Beatmaps = new List(), + Hash = hash, + Files = fileInfos, + Metadata = metadata + }; var mapNames = reader.Filenames.Where(f => f.EndsWith(".osu")); From 6df18ffb7accaeeb96254af4818350e1859235b1 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 20 Nov 2017 18:14:30 +0900 Subject: [PATCH 30/35] FocusedTextBox should not handle repeated escapes --- osu.Game/Graphics/UserInterface/FocusedTextBox.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Graphics/UserInterface/FocusedTextBox.cs b/osu.Game/Graphics/UserInterface/FocusedTextBox.cs index fe060f70f0..206c7a839d 100644 --- a/osu.Game/Graphics/UserInterface/FocusedTextBox.cs +++ b/osu.Game/Graphics/UserInterface/FocusedTextBox.cs @@ -38,7 +38,7 @@ namespace osu.Game.Graphics.UserInterface protected override bool OnKeyDown(InputState state, KeyDownEventArgs args) { - if (args.Key == Key.Escape) + if (!args.Repeat && args.Key == Key.Escape) { if (Text.Length > 0) Text = string.Empty; From 165ac8cdec031195c565a4dfbad2d26a8ba218b0 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 20 Nov 2017 21:21:34 +0900 Subject: [PATCH 31/35] Update framework --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index f27e36d405..14eb531c00 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit f27e36d405dd3f041e19defd59ecbb389ba84617 +Subproject commit 14eb531c0056b8569f21b3571890383ffbea768e From 4f6263ef868e64a473c5189531d3f19e6cbe9005 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 21 Nov 2017 11:49:42 +0900 Subject: [PATCH 32/35] Make many internal classes and methods public This is important when using dynamic compiling to rapidly iterate. Until we actually split projects out into pieces (like the abstract ruleset project we have talked about) there is no advantage to using internal in the osu! game code. --- osu.Game/Beatmaps/Drawables/BeatmapBackgroundSprite.cs | 2 +- osu.Game/Beatmaps/DummyWorkingBeatmap.cs | 2 +- osu.Game/Graphics/UserInterface/DialogButton.cs | 2 +- osu.Game/Graphics/UserInterface/Volume/VolumeControl.cs | 4 ++-- .../Graphics/UserInterface/Volume/VolumeControlReceptor.cs | 2 +- osu.Game/Graphics/UserInterface/Volume/VolumeMeter.cs | 4 ++-- osu.Game/Online/API/OAuth.cs | 2 +- osu.Game/Online/API/OAuthToken.cs | 2 +- osu.Game/Online/Multiplayer/GameType.cs | 2 +- osu.Game/Overlays/ChatOverlay.cs | 2 +- osu.Game/Overlays/KeyBinding/KeyBindingRow.cs | 2 +- osu.Game/Overlays/KeyBinding/KeyBindingsSubsection.cs | 2 +- osu.Game/Overlays/LoginOverlay.cs | 2 +- osu.Game/Overlays/Music/FilterControl.cs | 2 +- osu.Game/Overlays/Music/PlaylistItem.cs | 2 +- osu.Game/Overlays/Music/PlaylistList.cs | 2 +- osu.Game/Overlays/Settings/SettingsItem.cs | 6 +++--- osu.Game/Overlays/Settings/SettingsLabel.cs | 2 +- osu.Game/Overlays/Settings/Sidebar.cs | 6 +++--- osu.Game/Overlays/SettingsOverlay.cs | 2 +- osu.Game/Overlays/Toolbar/ToolbarChatButton.cs | 4 ++-- osu.Game/Overlays/Toolbar/ToolbarDirectButton.cs | 4 ++-- osu.Game/Overlays/Toolbar/ToolbarHomeButton.cs | 4 ++-- osu.Game/Overlays/Toolbar/ToolbarModeSelector.cs | 2 +- osu.Game/Overlays/Toolbar/ToolbarMusicButton.cs | 4 ++-- osu.Game/Overlays/Toolbar/ToolbarNotificationButton.cs | 4 ++-- osu.Game/Overlays/Toolbar/ToolbarOverlayToggleButton.cs | 2 +- osu.Game/Overlays/Toolbar/ToolbarSettingsButton.cs | 4 ++-- osu.Game/Overlays/Toolbar/ToolbarSocialButton.cs | 4 ++-- osu.Game/Overlays/Toolbar/ToolbarUserArea.cs | 2 +- osu.Game/Overlays/Toolbar/ToolbarUserButton.cs | 2 +- osu.Game/Rulesets/Judgements/Judgement.cs | 6 +++--- .../Rulesets/Objects/Legacy/Catch/ConvertHitObjectParser.cs | 2 +- .../Rulesets/Objects/Legacy/Mania/ConvertHitObjectParser.cs | 2 +- .../Rulesets/Objects/Legacy/Osu/ConvertHitObjectParser.cs | 2 +- .../Rulesets/Objects/Legacy/Taiko/ConvertHitObjectParser.cs | 2 +- osu.Game/Rulesets/Timing/LinearScrollingContainer.cs | 2 +- osu.Game/Rulesets/UI/Playfield.cs | 2 +- osu.Game/Rulesets/UI/RulesetContainer.cs | 2 +- osu.Game/Screens/Charts/ChartInfo.cs | 2 +- osu.Game/Screens/Charts/ChartListing.cs | 2 +- osu.Game/Screens/Direct/OnlineListing.cs | 2 +- .../Edit/Components/Timelines/Summary/Parts/BookmarkPart.cs | 2 +- .../Edit/Components/Timelines/Summary/Parts/BreakPart.cs | 2 +- .../Components/Timelines/Summary/Parts/ControlPointPart.cs | 2 +- .../Edit/Components/Timelines/Summary/Parts/MarkerPart.cs | 2 +- .../Edit/Components/Timelines/Summary/Parts/TimelinePart.cs | 2 +- .../Summary/Visualisations/DurationVisualisation.cs | 2 +- .../Timelines/Summary/Visualisations/PointVisualisation.cs | 2 +- osu.Game/Screens/Edit/Screens/Design/Design.cs | 2 +- osu.Game/Screens/Menu/ButtonSystem.cs | 6 +++--- osu.Game/Screens/Menu/Intro.cs | 2 +- osu.Game/Screens/Menu/OsuLogo.cs | 2 +- osu.Game/Screens/Multiplayer/Lobby.cs | 2 +- osu.Game/Screens/Multiplayer/Match.cs | 2 +- osu.Game/Screens/Multiplayer/MatchCreate.cs | 2 +- osu.Game/Screens/Ranking/ResultsPage.cs | 2 +- osu.Game/Screens/Ranking/ResultsPageRanking.cs | 4 ++-- osu.Game/Screens/Ranking/ResultsPageScore.cs | 2 +- osu.Game/Screens/Select/BeatmapCarousel.cs | 4 ++-- osu.Game/Screens/Select/BeatmapInfoWedge.cs | 2 +- .../Screens/Tournament/Components/VisualiserContainer.cs | 2 +- 62 files changed, 81 insertions(+), 81 deletions(-) diff --git a/osu.Game/Beatmaps/Drawables/BeatmapBackgroundSprite.cs b/osu.Game/Beatmaps/Drawables/BeatmapBackgroundSprite.cs index 0ac8d12591..e4904786c7 100644 --- a/osu.Game/Beatmaps/Drawables/BeatmapBackgroundSprite.cs +++ b/osu.Game/Beatmaps/Drawables/BeatmapBackgroundSprite.cs @@ -7,7 +7,7 @@ using osu.Framework.Graphics.Sprites; namespace osu.Game.Beatmaps.Drawables { - internal class BeatmapBackgroundSprite : Sprite + public class BeatmapBackgroundSprite : Sprite { private readonly WorkingBeatmap working; diff --git a/osu.Game/Beatmaps/DummyWorkingBeatmap.cs b/osu.Game/Beatmaps/DummyWorkingBeatmap.cs index c15d585eb2..c187aa592a 100644 --- a/osu.Game/Beatmaps/DummyWorkingBeatmap.cs +++ b/osu.Game/Beatmaps/DummyWorkingBeatmap.cs @@ -11,7 +11,7 @@ using osu.Game.Rulesets.UI; namespace osu.Game.Beatmaps { - internal class DummyWorkingBeatmap : WorkingBeatmap + public class DummyWorkingBeatmap : WorkingBeatmap { private readonly OsuGameBase game; diff --git a/osu.Game/Graphics/UserInterface/DialogButton.cs b/osu.Game/Graphics/UserInterface/DialogButton.cs index 289ccbf5cd..bb62815a7b 100644 --- a/osu.Game/Graphics/UserInterface/DialogButton.cs +++ b/osu.Game/Graphics/UserInterface/DialogButton.cs @@ -66,7 +66,7 @@ namespace osu.Game.Graphics.UserInterface } private float textSize = 28; - internal float TextSize + public float TextSize { get { diff --git a/osu.Game/Graphics/UserInterface/Volume/VolumeControl.cs b/osu.Game/Graphics/UserInterface/Volume/VolumeControl.cs index 8c777f491b..273a2279bf 100644 --- a/osu.Game/Graphics/UserInterface/Volume/VolumeControl.cs +++ b/osu.Game/Graphics/UserInterface/Volume/VolumeControl.cs @@ -11,7 +11,7 @@ using osu.Game.Input.Bindings; namespace osu.Game.Graphics.UserInterface.Volume { - internal class VolumeControl : OverlayContainer + public class VolumeControl : OverlayContainer { private readonly VolumeMeter volumeMeterMaster; @@ -119,4 +119,4 @@ namespace osu.Game.Graphics.UserInterface.Volume this.Delay(1000).Schedule(Hide, out popOutDelegate); } } -} \ No newline at end of file +} diff --git a/osu.Game/Graphics/UserInterface/Volume/VolumeControlReceptor.cs b/osu.Game/Graphics/UserInterface/Volume/VolumeControlReceptor.cs index c222fecb5d..7c740f16ce 100644 --- a/osu.Game/Graphics/UserInterface/Volume/VolumeControlReceptor.cs +++ b/osu.Game/Graphics/UserInterface/Volume/VolumeControlReceptor.cs @@ -8,7 +8,7 @@ using osu.Game.Input.Bindings; namespace osu.Game.Graphics.UserInterface.Volume { - internal class VolumeControlReceptor : Container, IKeyBindingHandler + public class VolumeControlReceptor : Container, IKeyBindingHandler { public Func ActionRequested; diff --git a/osu.Game/Graphics/UserInterface/Volume/VolumeMeter.cs b/osu.Game/Graphics/UserInterface/Volume/VolumeMeter.cs index 81c4fa9bae..d55b16563d 100644 --- a/osu.Game/Graphics/UserInterface/Volume/VolumeMeter.cs +++ b/osu.Game/Graphics/UserInterface/Volume/VolumeMeter.cs @@ -13,7 +13,7 @@ using osu.Game.Input.Bindings; namespace osu.Game.Graphics.UserInterface.Volume { - internal class VolumeMeter : Container, IKeyBindingHandler + public class VolumeMeter : Container, IKeyBindingHandler { private readonly Box meterFill; public BindableDouble Bindable { get; } = new BindableDouble(); @@ -108,4 +108,4 @@ namespace osu.Game.Graphics.UserInterface.Volume public bool OnReleased(GlobalAction action) => false; } -} \ No newline at end of file +} diff --git a/osu.Game/Online/API/OAuth.cs b/osu.Game/Online/API/OAuth.cs index ca38f72904..322688ced9 100644 --- a/osu.Game/Online/API/OAuth.cs +++ b/osu.Game/Online/API/OAuth.cs @@ -6,7 +6,7 @@ using osu.Framework.IO.Network; namespace osu.Game.Online.API { - internal class OAuth + public class OAuth { private readonly string clientId; private readonly string clientSecret; diff --git a/osu.Game/Online/API/OAuthToken.cs b/osu.Game/Online/API/OAuthToken.cs index 2abd7b6c1f..0c9dc26b59 100644 --- a/osu.Game/Online/API/OAuthToken.cs +++ b/osu.Game/Online/API/OAuthToken.cs @@ -8,7 +8,7 @@ using Newtonsoft.Json; namespace osu.Game.Online.API { [Serializable] - internal class OAuthToken + public class OAuthToken { /// /// OAuth 2.0 access token. diff --git a/osu.Game/Online/Multiplayer/GameType.cs b/osu.Game/Online/Multiplayer/GameType.cs index c94b409d1b..7bec0e94bb 100644 --- a/osu.Game/Online/Multiplayer/GameType.cs +++ b/osu.Game/Online/Multiplayer/GameType.cs @@ -100,7 +100,7 @@ namespace osu.Game.Online.Multiplayer } } - internal class VersusRow : FillFlowContainer + public class VersusRow : FillFlowContainer { public VersusRow(Color4 first, Color4 second, float size) { diff --git a/osu.Game/Overlays/ChatOverlay.cs b/osu.Game/Overlays/ChatOverlay.cs index 24fc322199..c5ffc5a2f1 100644 --- a/osu.Game/Overlays/ChatOverlay.cs +++ b/osu.Game/Overlays/ChatOverlay.cs @@ -58,7 +58,7 @@ namespace osu.Game.Overlays private readonly Box chatBackground; private readonly Box tabBackground; - public Bindable ChatHeight { get; internal set; } + public Bindable ChatHeight { get; public set; } private readonly Container channelSelectionContainer; private readonly ChannelSelectionOverlay channelSelection; diff --git a/osu.Game/Overlays/KeyBinding/KeyBindingRow.cs b/osu.Game/Overlays/KeyBinding/KeyBindingRow.cs index 4141a502a0..509a4f3856 100644 --- a/osu.Game/Overlays/KeyBinding/KeyBindingRow.cs +++ b/osu.Game/Overlays/KeyBinding/KeyBindingRow.cs @@ -19,7 +19,7 @@ using OpenTK.Input; namespace osu.Game.Overlays.KeyBinding { - internal class KeyBindingRow : Container, IFilterable + public class KeyBindingRow : Container, IFilterable { private readonly object action; private readonly IEnumerable bindings; diff --git a/osu.Game/Overlays/KeyBinding/KeyBindingsSubsection.cs b/osu.Game/Overlays/KeyBinding/KeyBindingsSubsection.cs index 2ff5d7b81f..30ff0ab026 100644 --- a/osu.Game/Overlays/KeyBinding/KeyBindingsSubsection.cs +++ b/osu.Game/Overlays/KeyBinding/KeyBindingsSubsection.cs @@ -55,7 +55,7 @@ namespace osu.Game.Overlays.KeyBinding } } - internal class ResetButton : OsuButton + public class ResetButton : OsuButton { [BackgroundDependencyLoader] private void load(OsuColour colours) diff --git a/osu.Game/Overlays/LoginOverlay.cs b/osu.Game/Overlays/LoginOverlay.cs index 0a47637589..fe3a846eb2 100644 --- a/osu.Game/Overlays/LoginOverlay.cs +++ b/osu.Game/Overlays/LoginOverlay.cs @@ -13,7 +13,7 @@ using osu.Game.Graphics.Cursor; namespace osu.Game.Overlays { - internal class LoginOverlay : OsuFocusedOverlayContainer + public class LoginOverlay : OsuFocusedOverlayContainer { private LoginSettings settingsSection; diff --git a/osu.Game/Overlays/Music/FilterControl.cs b/osu.Game/Overlays/Music/FilterControl.cs index 56cd6e864b..52d311e501 100644 --- a/osu.Game/Overlays/Music/FilterControl.cs +++ b/osu.Game/Overlays/Music/FilterControl.cs @@ -13,7 +13,7 @@ using System; namespace osu.Game.Overlays.Music { - internal class FilterControl : Container + public class FilterControl : Container { public readonly FilterTextBox Search; diff --git a/osu.Game/Overlays/Music/PlaylistItem.cs b/osu.Game/Overlays/Music/PlaylistItem.cs index 723b3f4e96..8168929f9c 100644 --- a/osu.Game/Overlays/Music/PlaylistItem.cs +++ b/osu.Game/Overlays/Music/PlaylistItem.cs @@ -17,7 +17,7 @@ using OpenTK; namespace osu.Game.Overlays.Music { - internal class PlaylistItem : Container, IFilterable, IDraggable + public class PlaylistItem : Container, IFilterable, IDraggable { private const float fade_duration = 100; diff --git a/osu.Game/Overlays/Music/PlaylistList.cs b/osu.Game/Overlays/Music/PlaylistList.cs index 6f1eaded7f..af01cdc451 100644 --- a/osu.Game/Overlays/Music/PlaylistList.cs +++ b/osu.Game/Overlays/Music/PlaylistList.cs @@ -14,7 +14,7 @@ using OpenTK; namespace osu.Game.Overlays.Music { - internal class PlaylistList : CompositeDrawable + public class PlaylistList : CompositeDrawable { public Action OnSelect; diff --git a/osu.Game/Overlays/Settings/SettingsItem.cs b/osu.Game/Overlays/Settings/SettingsItem.cs index a3933b775e..d9aac58c54 100644 --- a/osu.Game/Overlays/Settings/SettingsItem.cs +++ b/osu.Game/Overlays/Settings/SettingsItem.cs @@ -135,7 +135,7 @@ namespace osu.Game.Overlays.Settings private class RestoreDefaultValueButton : Box, IHasTooltip { private Bindable bindable; - internal Bindable Bindable + public Bindable Bindable { get { return bindable; } set @@ -185,13 +185,13 @@ namespace osu.Game.Overlays.Settings UpdateState(); } - internal void SetButtonColour(Color4 buttonColour) + public void SetButtonColour(Color4 buttonColour) { this.buttonColour = buttonColour; UpdateState(); } - internal void UpdateState() + public void UpdateState() { if (bindable == null) return; diff --git a/osu.Game/Overlays/Settings/SettingsLabel.cs b/osu.Game/Overlays/Settings/SettingsLabel.cs index 7d1364ef41..6a1d3ae72c 100644 --- a/osu.Game/Overlays/Settings/SettingsLabel.cs +++ b/osu.Game/Overlays/Settings/SettingsLabel.cs @@ -7,7 +7,7 @@ using osu.Game.Graphics; namespace osu.Game.Overlays.Settings { - internal class SettingsLabel : SettingsItem + public class SettingsLabel : SettingsItem { protected override Drawable CreateControl() => null; diff --git a/osu.Game/Overlays/Settings/Sidebar.cs b/osu.Game/Overlays/Settings/Sidebar.cs index 55167188a3..4e51ae3a2e 100644 --- a/osu.Game/Overlays/Settings/Sidebar.cs +++ b/osu.Game/Overlays/Settings/Sidebar.cs @@ -18,8 +18,8 @@ namespace osu.Game.Overlays.Settings public class Sidebar : Container, IStateful { private readonly FillFlowContainer content; - internal const float DEFAULT_WIDTH = ToolbarButton.WIDTH; - internal const int EXPANDED_WIDTH = 200; + public const float DEFAULT_WIDTH = ToolbarButton.WIDTH; + public const int EXPANDED_WIDTH = 200; public event Action StateChanged; @@ -137,4 +137,4 @@ namespace osu.Game.Overlays.Settings Contracted, Expanded, } -} \ No newline at end of file +} diff --git a/osu.Game/Overlays/SettingsOverlay.cs b/osu.Game/Overlays/SettingsOverlay.cs index ddef5d1001..798fa00032 100644 --- a/osu.Game/Overlays/SettingsOverlay.cs +++ b/osu.Game/Overlays/SettingsOverlay.cs @@ -20,7 +20,7 @@ namespace osu.Game.Overlays { public abstract class SettingsOverlay : OsuFocusedOverlayContainer { - internal const float CONTENT_MARGINS = 10; + public const float CONTENT_MARGINS = 10; public const float TRANSITION_LENGTH = 600; diff --git a/osu.Game/Overlays/Toolbar/ToolbarChatButton.cs b/osu.Game/Overlays/Toolbar/ToolbarChatButton.cs index 2e2786851c..ed206e7e1d 100644 --- a/osu.Game/Overlays/Toolbar/ToolbarChatButton.cs +++ b/osu.Game/Overlays/Toolbar/ToolbarChatButton.cs @@ -6,7 +6,7 @@ using osu.Game.Graphics; namespace osu.Game.Overlays.Toolbar { - internal class ToolbarChatButton : ToolbarOverlayToggleButton + public class ToolbarChatButton : ToolbarOverlayToggleButton { public ToolbarChatButton() { @@ -19,4 +19,4 @@ namespace osu.Game.Overlays.Toolbar StateContainer = chat; } } -} \ No newline at end of file +} diff --git a/osu.Game/Overlays/Toolbar/ToolbarDirectButton.cs b/osu.Game/Overlays/Toolbar/ToolbarDirectButton.cs index dacb6d67b8..7d25440e2c 100644 --- a/osu.Game/Overlays/Toolbar/ToolbarDirectButton.cs +++ b/osu.Game/Overlays/Toolbar/ToolbarDirectButton.cs @@ -6,7 +6,7 @@ using osu.Game.Graphics; namespace osu.Game.Overlays.Toolbar { - internal class ToolbarDirectButton : ToolbarOverlayToggleButton + public class ToolbarDirectButton : ToolbarOverlayToggleButton { public ToolbarDirectButton() { @@ -19,4 +19,4 @@ namespace osu.Game.Overlays.Toolbar StateContainer = direct; } } -} \ No newline at end of file +} diff --git a/osu.Game/Overlays/Toolbar/ToolbarHomeButton.cs b/osu.Game/Overlays/Toolbar/ToolbarHomeButton.cs index 431cc73887..9f020cada5 100644 --- a/osu.Game/Overlays/Toolbar/ToolbarHomeButton.cs +++ b/osu.Game/Overlays/Toolbar/ToolbarHomeButton.cs @@ -5,7 +5,7 @@ using osu.Game.Graphics; namespace osu.Game.Overlays.Toolbar { - internal class ToolbarHomeButton : ToolbarButton + public class ToolbarHomeButton : ToolbarButton { public ToolbarHomeButton() { @@ -14,4 +14,4 @@ namespace osu.Game.Overlays.Toolbar TooltipSub = "Return to the main menu"; } } -} \ No newline at end of file +} diff --git a/osu.Game/Overlays/Toolbar/ToolbarModeSelector.cs b/osu.Game/Overlays/Toolbar/ToolbarModeSelector.cs index da72ae0347..319dd63bc9 100644 --- a/osu.Game/Overlays/Toolbar/ToolbarModeSelector.cs +++ b/osu.Game/Overlays/Toolbar/ToolbarModeSelector.cs @@ -14,7 +14,7 @@ using osu.Game.Rulesets; namespace osu.Game.Overlays.Toolbar { - internal class ToolbarModeSelector : Container + public class ToolbarModeSelector : Container { private const float padding = 10; diff --git a/osu.Game/Overlays/Toolbar/ToolbarMusicButton.cs b/osu.Game/Overlays/Toolbar/ToolbarMusicButton.cs index 82599b9a0d..d150aacdf9 100644 --- a/osu.Game/Overlays/Toolbar/ToolbarMusicButton.cs +++ b/osu.Game/Overlays/Toolbar/ToolbarMusicButton.cs @@ -6,7 +6,7 @@ using osu.Game.Graphics; namespace osu.Game.Overlays.Toolbar { - internal class ToolbarMusicButton : ToolbarOverlayToggleButton + public class ToolbarMusicButton : ToolbarOverlayToggleButton { public ToolbarMusicButton() { @@ -19,4 +19,4 @@ namespace osu.Game.Overlays.Toolbar StateContainer = music; } } -} \ No newline at end of file +} diff --git a/osu.Game/Overlays/Toolbar/ToolbarNotificationButton.cs b/osu.Game/Overlays/Toolbar/ToolbarNotificationButton.cs index dcadc4bf56..e11a22d675 100644 --- a/osu.Game/Overlays/Toolbar/ToolbarNotificationButton.cs +++ b/osu.Game/Overlays/Toolbar/ToolbarNotificationButton.cs @@ -7,7 +7,7 @@ using osu.Game.Graphics; namespace osu.Game.Overlays.Toolbar { - internal class ToolbarNotificationButton : ToolbarOverlayToggleButton + public class ToolbarNotificationButton : ToolbarOverlayToggleButton { protected override Anchor TooltipAnchor => Anchor.TopRight; @@ -24,4 +24,4 @@ namespace osu.Game.Overlays.Toolbar StateContainer = notificationOverlay; } } -} \ No newline at end of file +} diff --git a/osu.Game/Overlays/Toolbar/ToolbarOverlayToggleButton.cs b/osu.Game/Overlays/Toolbar/ToolbarOverlayToggleButton.cs index 28ecf6ad03..69fdd27d5d 100644 --- a/osu.Game/Overlays/Toolbar/ToolbarOverlayToggleButton.cs +++ b/osu.Game/Overlays/Toolbar/ToolbarOverlayToggleButton.cs @@ -9,7 +9,7 @@ using osu.Game.Graphics; namespace osu.Game.Overlays.Toolbar { - internal class ToolbarOverlayToggleButton : ToolbarButton + public class ToolbarOverlayToggleButton : ToolbarButton { private readonly Box stateBackground; diff --git a/osu.Game/Overlays/Toolbar/ToolbarSettingsButton.cs b/osu.Game/Overlays/Toolbar/ToolbarSettingsButton.cs index 2eb8c15dcf..cf4f664e81 100644 --- a/osu.Game/Overlays/Toolbar/ToolbarSettingsButton.cs +++ b/osu.Game/Overlays/Toolbar/ToolbarSettingsButton.cs @@ -6,7 +6,7 @@ using osu.Game.Graphics; namespace osu.Game.Overlays.Toolbar { - internal class ToolbarSettingsButton : ToolbarOverlayToggleButton + public class ToolbarSettingsButton : ToolbarOverlayToggleButton { public ToolbarSettingsButton() { @@ -21,4 +21,4 @@ namespace osu.Game.Overlays.Toolbar StateContainer = settings; } } -} \ No newline at end of file +} diff --git a/osu.Game/Overlays/Toolbar/ToolbarSocialButton.cs b/osu.Game/Overlays/Toolbar/ToolbarSocialButton.cs index ed36fd8f9e..234d6f0f9a 100644 --- a/osu.Game/Overlays/Toolbar/ToolbarSocialButton.cs +++ b/osu.Game/Overlays/Toolbar/ToolbarSocialButton.cs @@ -6,7 +6,7 @@ using osu.Game.Graphics; namespace osu.Game.Overlays.Toolbar { - internal class ToolbarSocialButton : ToolbarOverlayToggleButton + public class ToolbarSocialButton : ToolbarOverlayToggleButton { public ToolbarSocialButton() { @@ -19,4 +19,4 @@ namespace osu.Game.Overlays.Toolbar StateContainer = chat; } } -} \ No newline at end of file +} diff --git a/osu.Game/Overlays/Toolbar/ToolbarUserArea.cs b/osu.Game/Overlays/Toolbar/ToolbarUserArea.cs index 95a25fcb86..4562464dfe 100644 --- a/osu.Game/Overlays/Toolbar/ToolbarUserArea.cs +++ b/osu.Game/Overlays/Toolbar/ToolbarUserArea.cs @@ -9,7 +9,7 @@ using OpenTK; namespace osu.Game.Overlays.Toolbar { - internal class ToolbarUserArea : Container + public class ToolbarUserArea : Container { public LoginOverlay LoginOverlay; private ToolbarUserButton button; diff --git a/osu.Game/Overlays/Toolbar/ToolbarUserButton.cs b/osu.Game/Overlays/Toolbar/ToolbarUserButton.cs index deacfbb9ec..3714094924 100644 --- a/osu.Game/Overlays/Toolbar/ToolbarUserButton.cs +++ b/osu.Game/Overlays/Toolbar/ToolbarUserButton.cs @@ -12,7 +12,7 @@ using OpenTK.Graphics; namespace osu.Game.Overlays.Toolbar { - internal class ToolbarUserButton : ToolbarButton, IOnlineComponent + public class ToolbarUserButton : ToolbarButton, IOnlineComponent { private readonly UpdateableAvatar avatar; diff --git a/osu.Game/Rulesets/Judgements/Judgement.cs b/osu.Game/Rulesets/Judgements/Judgement.cs index 2b5c4aae95..5ad18e67ee 100644 --- a/osu.Game/Rulesets/Judgements/Judgement.cs +++ b/osu.Game/Rulesets/Judgements/Judgement.cs @@ -20,12 +20,12 @@ namespace osu.Game.Rulesets.Judgements /// /// The combo prior to this judgement occurring. /// - internal int ComboAtJudgement; + public int ComboAtJudgement; /// /// The highest combo achieved prior to this judgement occurring. /// - internal int HighestComboAtJudgement; + public int HighestComboAtJudgement; /// /// Whether a successful hit occurred. @@ -41,7 +41,7 @@ namespace osu.Game.Rulesets.Judgements /// The offset from a perfect hit at which this judgement occurred. /// Populated when added via . /// - public double TimeOffset { get; internal set; } + public double TimeOffset { get; public set; } /// /// Whether the should affect the combo portion of the score. diff --git a/osu.Game/Rulesets/Objects/Legacy/Catch/ConvertHitObjectParser.cs b/osu.Game/Rulesets/Objects/Legacy/Catch/ConvertHitObjectParser.cs index c7f7802191..667f921e04 100644 --- a/osu.Game/Rulesets/Objects/Legacy/Catch/ConvertHitObjectParser.cs +++ b/osu.Game/Rulesets/Objects/Legacy/Catch/ConvertHitObjectParser.cs @@ -11,7 +11,7 @@ namespace osu.Game.Rulesets.Objects.Legacy.Catch /// /// A HitObjectParser to parse legacy osu!catch Beatmaps. /// - internal class ConvertHitObjectParser : Legacy.ConvertHitObjectParser + public class ConvertHitObjectParser : Legacy.ConvertHitObjectParser { protected override HitObject CreateHit(Vector2 position, bool newCombo) { diff --git a/osu.Game/Rulesets/Objects/Legacy/Mania/ConvertHitObjectParser.cs b/osu.Game/Rulesets/Objects/Legacy/Mania/ConvertHitObjectParser.cs index 7141876b8b..86dd40b06e 100644 --- a/osu.Game/Rulesets/Objects/Legacy/Mania/ConvertHitObjectParser.cs +++ b/osu.Game/Rulesets/Objects/Legacy/Mania/ConvertHitObjectParser.cs @@ -11,7 +11,7 @@ namespace osu.Game.Rulesets.Objects.Legacy.Mania /// /// A HitObjectParser to parse legacy osu!mania Beatmaps. /// - internal class ConvertHitObjectParser : Legacy.ConvertHitObjectParser + public class ConvertHitObjectParser : Legacy.ConvertHitObjectParser { protected override HitObject CreateHit(Vector2 position, bool newCombo) { diff --git a/osu.Game/Rulesets/Objects/Legacy/Osu/ConvertHitObjectParser.cs b/osu.Game/Rulesets/Objects/Legacy/Osu/ConvertHitObjectParser.cs index 00fe171f0f..24c205db13 100644 --- a/osu.Game/Rulesets/Objects/Legacy/Osu/ConvertHitObjectParser.cs +++ b/osu.Game/Rulesets/Objects/Legacy/Osu/ConvertHitObjectParser.cs @@ -11,7 +11,7 @@ namespace osu.Game.Rulesets.Objects.Legacy.Osu /// /// A HitObjectParser to parse legacy osu! Beatmaps. /// - internal class ConvertHitObjectParser : Legacy.ConvertHitObjectParser + public class ConvertHitObjectParser : Legacy.ConvertHitObjectParser { protected override HitObject CreateHit(Vector2 position, bool newCombo) { diff --git a/osu.Game/Rulesets/Objects/Legacy/Taiko/ConvertHitObjectParser.cs b/osu.Game/Rulesets/Objects/Legacy/Taiko/ConvertHitObjectParser.cs index 5929c5a907..0554cfd97d 100644 --- a/osu.Game/Rulesets/Objects/Legacy/Taiko/ConvertHitObjectParser.cs +++ b/osu.Game/Rulesets/Objects/Legacy/Taiko/ConvertHitObjectParser.cs @@ -11,7 +11,7 @@ namespace osu.Game.Rulesets.Objects.Legacy.Taiko /// /// A HitObjectParser to parse legacy osu!taiko Beatmaps. /// - internal class ConvertHitObjectParser : Legacy.ConvertHitObjectParser + public class ConvertHitObjectParser : Legacy.ConvertHitObjectParser { protected override HitObject CreateHit(Vector2 position, bool newCombo) { diff --git a/osu.Game/Rulesets/Timing/LinearScrollingContainer.cs b/osu.Game/Rulesets/Timing/LinearScrollingContainer.cs index f8e87bc022..b093cf3303 100644 --- a/osu.Game/Rulesets/Timing/LinearScrollingContainer.cs +++ b/osu.Game/Rulesets/Timing/LinearScrollingContainer.cs @@ -8,7 +8,7 @@ namespace osu.Game.Rulesets.Timing /// /// A which scrolls linearly relative to the start time. /// - internal class LinearScrollingContainer : ScrollingContainer + public class LinearScrollingContainer : ScrollingContainer { private readonly MultiplierControlPoint controlPoint; diff --git a/osu.Game/Rulesets/UI/Playfield.cs b/osu.Game/Rulesets/UI/Playfield.cs index 0270751946..b4a26344d5 100644 --- a/osu.Game/Rulesets/UI/Playfield.cs +++ b/osu.Game/Rulesets/UI/Playfield.cs @@ -20,7 +20,7 @@ namespace osu.Game.Rulesets.UI /// public HitObjectContainer HitObjects { get; protected set; } - internal Container ScaledContent; + public Container ScaledContent; /// /// Whether we are currently providing the local user a gameplay cursor. diff --git a/osu.Game/Rulesets/UI/RulesetContainer.cs b/osu.Game/Rulesets/UI/RulesetContainer.cs index 6726d94995..a5ac9c201a 100644 --- a/osu.Game/Rulesets/UI/RulesetContainer.cs +++ b/osu.Game/Rulesets/UI/RulesetContainer.cs @@ -61,7 +61,7 @@ namespace osu.Game.Rulesets.UI /// A visual representation of a . /// /// The ruleset being repesented. - internal RulesetContainer(Ruleset ruleset) + public RulesetContainer(Ruleset ruleset) { Ruleset = ruleset; } diff --git a/osu.Game/Screens/Charts/ChartInfo.cs b/osu.Game/Screens/Charts/ChartInfo.cs index b5ac5e4945..32577f3e05 100644 --- a/osu.Game/Screens/Charts/ChartInfo.cs +++ b/osu.Game/Screens/Charts/ChartInfo.cs @@ -3,7 +3,7 @@ namespace osu.Game.Screens.Charts { - internal class ChartInfo : ScreenWhiteBox + public class ChartInfo : ScreenWhiteBox { } } diff --git a/osu.Game/Screens/Charts/ChartListing.cs b/osu.Game/Screens/Charts/ChartListing.cs index 7bc6f0fa03..41c2a01600 100644 --- a/osu.Game/Screens/Charts/ChartListing.cs +++ b/osu.Game/Screens/Charts/ChartListing.cs @@ -6,7 +6,7 @@ using System.Collections.Generic; namespace osu.Game.Screens.Charts { - internal class ChartListing : ScreenWhiteBox + public class ChartListing : ScreenWhiteBox { protected override IEnumerable PossibleChildren => new[] { typeof(ChartInfo) diff --git a/osu.Game/Screens/Direct/OnlineListing.cs b/osu.Game/Screens/Direct/OnlineListing.cs index 9ce23c2863..ff6c599e6f 100644 --- a/osu.Game/Screens/Direct/OnlineListing.cs +++ b/osu.Game/Screens/Direct/OnlineListing.cs @@ -3,7 +3,7 @@ namespace osu.Game.Screens.Direct { - internal class OnlineListing : ScreenWhiteBox + public class OnlineListing : ScreenWhiteBox { } } diff --git a/osu.Game/Screens/Edit/Components/Timelines/Summary/Parts/BookmarkPart.cs b/osu.Game/Screens/Edit/Components/Timelines/Summary/Parts/BookmarkPart.cs index 1793cb4334..cdb2985473 100644 --- a/osu.Game/Screens/Edit/Components/Timelines/Summary/Parts/BookmarkPart.cs +++ b/osu.Game/Screens/Edit/Components/Timelines/Summary/Parts/BookmarkPart.cs @@ -11,7 +11,7 @@ namespace osu.Game.Screens.Edit.Components.Timelines.Summary.Parts /// /// The part of the timeline that displays bookmarks. /// - internal class BookmarkPart : TimelinePart + public class BookmarkPart : TimelinePart { protected override void LoadBeatmap(WorkingBeatmap beatmap) { diff --git a/osu.Game/Screens/Edit/Components/Timelines/Summary/Parts/BreakPart.cs b/osu.Game/Screens/Edit/Components/Timelines/Summary/Parts/BreakPart.cs index 004491d489..380f8e2c7b 100644 --- a/osu.Game/Screens/Edit/Components/Timelines/Summary/Parts/BreakPart.cs +++ b/osu.Game/Screens/Edit/Components/Timelines/Summary/Parts/BreakPart.cs @@ -12,7 +12,7 @@ namespace osu.Game.Screens.Edit.Components.Timelines.Summary.Parts /// /// The part of the timeline that displays breaks in the song. /// - internal class BreakPart : TimelinePart + public class BreakPart : TimelinePart { protected override void LoadBeatmap(WorkingBeatmap beatmap) { diff --git a/osu.Game/Screens/Edit/Components/Timelines/Summary/Parts/ControlPointPart.cs b/osu.Game/Screens/Edit/Components/Timelines/Summary/Parts/ControlPointPart.cs index d230578e13..405befb80a 100644 --- a/osu.Game/Screens/Edit/Components/Timelines/Summary/Parts/ControlPointPart.cs +++ b/osu.Game/Screens/Edit/Components/Timelines/Summary/Parts/ControlPointPart.cs @@ -14,7 +14,7 @@ namespace osu.Game.Screens.Edit.Components.Timelines.Summary.Parts /// /// The part of the timeline that displays the control points. /// - internal class ControlPointPart : TimelinePart + public class ControlPointPart : TimelinePart { protected override void LoadBeatmap(WorkingBeatmap beatmap) { diff --git a/osu.Game/Screens/Edit/Components/Timelines/Summary/Parts/MarkerPart.cs b/osu.Game/Screens/Edit/Components/Timelines/Summary/Parts/MarkerPart.cs index 0bdd081907..367cf4337d 100644 --- a/osu.Game/Screens/Edit/Components/Timelines/Summary/Parts/MarkerPart.cs +++ b/osu.Game/Screens/Edit/Components/Timelines/Summary/Parts/MarkerPart.cs @@ -15,7 +15,7 @@ namespace osu.Game.Screens.Edit.Components.Timelines.Summary.Parts /// /// The part of the timeline that displays the current position of the song. /// - internal class MarkerPart : TimelinePart + public class MarkerPart : TimelinePart { private readonly Drawable marker; diff --git a/osu.Game/Screens/Edit/Components/Timelines/Summary/Parts/TimelinePart.cs b/osu.Game/Screens/Edit/Components/Timelines/Summary/Parts/TimelinePart.cs index 378ce78c67..229d06ef09 100644 --- a/osu.Game/Screens/Edit/Components/Timelines/Summary/Parts/TimelinePart.cs +++ b/osu.Game/Screens/Edit/Components/Timelines/Summary/Parts/TimelinePart.cs @@ -13,7 +13,7 @@ namespace osu.Game.Screens.Edit.Components.Timelines.Summary.Parts /// /// Represents a part of the summary timeline.. /// - internal abstract class TimelinePart : CompositeDrawable + public abstract class TimelinePart : CompositeDrawable { public Bindable Beatmap = new Bindable(); diff --git a/osu.Game/Screens/Edit/Components/Timelines/Summary/Visualisations/DurationVisualisation.cs b/osu.Game/Screens/Edit/Components/Timelines/Summary/Visualisations/DurationVisualisation.cs index aee8e250c3..91f5e9b222 100644 --- a/osu.Game/Screens/Edit/Components/Timelines/Summary/Visualisations/DurationVisualisation.cs +++ b/osu.Game/Screens/Edit/Components/Timelines/Summary/Visualisations/DurationVisualisation.cs @@ -10,7 +10,7 @@ namespace osu.Game.Screens.Edit.Components.Timelines.Summary.Visualisations /// /// Represents a spanning point on a timeline part. /// - internal class DurationVisualisation : Container + public class DurationVisualisation : Container { protected DurationVisualisation(double startTime, double endTime) { diff --git a/osu.Game/Screens/Edit/Components/Timelines/Summary/Visualisations/PointVisualisation.cs b/osu.Game/Screens/Edit/Components/Timelines/Summary/Visualisations/PointVisualisation.cs index 9d7272808b..4719db37d1 100644 --- a/osu.Game/Screens/Edit/Components/Timelines/Summary/Visualisations/PointVisualisation.cs +++ b/osu.Game/Screens/Edit/Components/Timelines/Summary/Visualisations/PointVisualisation.cs @@ -10,7 +10,7 @@ namespace osu.Game.Screens.Edit.Components.Timelines.Summary.Visualisations /// /// Represents a singular point on a timeline part. /// - internal class PointVisualisation : Box + public class PointVisualisation : Box { protected PointVisualisation(double startTime) { diff --git a/osu.Game/Screens/Edit/Screens/Design/Design.cs b/osu.Game/Screens/Edit/Screens/Design/Design.cs index e527d7dad9..edd5ae1a1e 100644 --- a/osu.Game/Screens/Edit/Screens/Design/Design.cs +++ b/osu.Game/Screens/Edit/Screens/Design/Design.cs @@ -9,7 +9,7 @@ using OpenTK.Graphics; namespace osu.Game.Screens.Edit.Screens.Design { - internal class Design : EditorScreen + public class Design : EditorScreen { public Design() { diff --git a/osu.Game/Screens/Menu/ButtonSystem.cs b/osu.Game/Screens/Menu/ButtonSystem.cs index c3bd7c1f37..5a4a5f07b5 100644 --- a/osu.Game/Screens/Menu/ButtonSystem.cs +++ b/osu.Game/Screens/Menu/ButtonSystem.cs @@ -39,10 +39,10 @@ namespace osu.Game.Screens.Menu private readonly FlowContainerWithOrigin buttonFlow; //todo: make these non-internal somehow. - internal const float BUTTON_AREA_HEIGHT = 100; + public const float BUTTON_AREA_HEIGHT = 100; - internal const float BUTTON_WIDTH = 140f; - internal const float WEDGE_WIDTH = 20; + public const float BUTTON_WIDTH = 140f; + public const float WEDGE_WIDTH = 20; private OsuLogo logo; diff --git a/osu.Game/Screens/Menu/Intro.cs b/osu.Game/Screens/Menu/Intro.cs index 987e29d6d6..d7beb34a2f 100644 --- a/osu.Game/Screens/Menu/Intro.cs +++ b/osu.Game/Screens/Menu/Intro.cs @@ -25,7 +25,7 @@ namespace osu.Game.Screens.Menu /// /// Whether we have loaded the menu previously. /// - internal bool DidLoadMenu; + public bool DidLoadMenu; private MainMenu mainMenu; private SampleChannel welcome; diff --git a/osu.Game/Screens/Menu/OsuLogo.cs b/osu.Game/Screens/Menu/OsuLogo.cs index fb8e755b61..252f2d37b5 100644 --- a/osu.Game/Screens/Menu/OsuLogo.cs +++ b/osu.Game/Screens/Menu/OsuLogo.cs @@ -226,7 +226,7 @@ namespace osu.Game.Screens.Menu /// /// The animation to be performed /// If true, the new animation is delayed until all previous transforms finish. If false, existing transformed are cleared. - internal void AppendAnimatingAction(Action action, bool waitForPrevious) + public void AppendAnimatingAction(Action action, bool waitForPrevious) { Action runnableAction = () => { diff --git a/osu.Game/Screens/Multiplayer/Lobby.cs b/osu.Game/Screens/Multiplayer/Lobby.cs index d34da46ec3..b297835ca9 100644 --- a/osu.Game/Screens/Multiplayer/Lobby.cs +++ b/osu.Game/Screens/Multiplayer/Lobby.cs @@ -6,7 +6,7 @@ using System.Collections.Generic; namespace osu.Game.Screens.Multiplayer { - internal class Lobby : ScreenWhiteBox + public class Lobby : ScreenWhiteBox { protected override IEnumerable PossibleChildren => new[] { typeof(MatchCreate), diff --git a/osu.Game/Screens/Multiplayer/Match.cs b/osu.Game/Screens/Multiplayer/Match.cs index a0843bfcae..e50a7199a4 100644 --- a/osu.Game/Screens/Multiplayer/Match.cs +++ b/osu.Game/Screens/Multiplayer/Match.cs @@ -12,7 +12,7 @@ using osu.Framework.Graphics; namespace osu.Game.Screens.Multiplayer { - internal class Match : ScreenWhiteBox + public class Match : ScreenWhiteBox { protected override IEnumerable PossibleChildren => new[] { typeof(MatchSongSelect), diff --git a/osu.Game/Screens/Multiplayer/MatchCreate.cs b/osu.Game/Screens/Multiplayer/MatchCreate.cs index f28261fa7f..c232c38d08 100644 --- a/osu.Game/Screens/Multiplayer/MatchCreate.cs +++ b/osu.Game/Screens/Multiplayer/MatchCreate.cs @@ -6,7 +6,7 @@ using System.Collections.Generic; namespace osu.Game.Screens.Multiplayer { - internal class MatchCreate : ScreenWhiteBox + public class MatchCreate : ScreenWhiteBox { protected override IEnumerable PossibleChildren => new[] { typeof(Match) diff --git a/osu.Game/Screens/Ranking/ResultsPage.cs b/osu.Game/Screens/Ranking/ResultsPage.cs index 7f381ebf99..037d5ada09 100644 --- a/osu.Game/Screens/Ranking/ResultsPage.cs +++ b/osu.Game/Screens/Ranking/ResultsPage.cs @@ -14,7 +14,7 @@ using OpenTK.Graphics; namespace osu.Game.Screens.Ranking { - internal class ResultsPage : Container + public class ResultsPage : Container { protected readonly Score Score; protected readonly WorkingBeatmap Beatmap; diff --git a/osu.Game/Screens/Ranking/ResultsPageRanking.cs b/osu.Game/Screens/Ranking/ResultsPageRanking.cs index d316dc7fb4..c9d1061bd1 100644 --- a/osu.Game/Screens/Ranking/ResultsPageRanking.cs +++ b/osu.Game/Screens/Ranking/ResultsPageRanking.cs @@ -12,7 +12,7 @@ using osu.Framework.Graphics.Shapes; namespace osu.Game.Screens.Ranking { - internal class ResultsPageRanking : ResultsPage + public class ResultsPageRanking : ResultsPage { public ResultsPageRanking(Score score, WorkingBeatmap beatmap = null) : base(score, beatmap) { @@ -39,4 +39,4 @@ namespace osu.Game.Screens.Ranking }; } } -} \ No newline at end of file +} diff --git a/osu.Game/Screens/Ranking/ResultsPageScore.cs b/osu.Game/Screens/Ranking/ResultsPageScore.cs index 9104473b82..911b688669 100644 --- a/osu.Game/Screens/Ranking/ResultsPageScore.cs +++ b/osu.Game/Screens/Ranking/ResultsPageScore.cs @@ -26,7 +26,7 @@ using osu.Framework.Graphics.Shapes; namespace osu.Game.Screens.Ranking { - internal class ResultsPageScore : ResultsPage + public class ResultsPageScore : ResultsPage { private ScoreCounter scoreCounter; diff --git a/osu.Game/Screens/Select/BeatmapCarousel.cs b/osu.Game/Screens/Select/BeatmapCarousel.cs index f4dcf9a69e..452f8c484c 100644 --- a/osu.Game/Screens/Select/BeatmapCarousel.cs +++ b/osu.Game/Screens/Select/BeatmapCarousel.cs @@ -23,7 +23,7 @@ using osu.Game.Graphics.Cursor; namespace osu.Game.Screens.Select { - internal class BeatmapCarousel : OsuScrollContainer + public class BeatmapCarousel : OsuScrollContainer { public BeatmapInfo SelectedBeatmap => selectedPanel?.Beatmap; @@ -116,7 +116,7 @@ namespace osu.Game.Screens.Select Schedule(() => removeGroup(groups.Find(b => b.BeatmapSet.ID == beatmapSet.ID))); } - internal void UpdateBeatmap(BeatmapInfo beatmap) + public void UpdateBeatmap(BeatmapInfo beatmap) { // todo: this method should not run more than once for the same BeatmapSetInfo. var set = manager.QueryBeatmapSet(s => s.ID == beatmap.BeatmapSetInfoID); diff --git a/osu.Game/Screens/Select/BeatmapInfoWedge.cs b/osu.Game/Screens/Select/BeatmapInfoWedge.cs index dc3b012328..22cb718d0a 100644 --- a/osu.Game/Screens/Select/BeatmapInfoWedge.cs +++ b/osu.Game/Screens/Select/BeatmapInfoWedge.cs @@ -22,7 +22,7 @@ using osu.Framework.Graphics.Shapes; namespace osu.Game.Screens.Select { - internal class BeatmapInfoWedge : OverlayContainer + public class BeatmapInfoWedge : OverlayContainer { private static readonly Vector2 wedged_container_shear = new Vector2(0.15f, 0); diff --git a/osu.Game/Screens/Tournament/Components/VisualiserContainer.cs b/osu.Game/Screens/Tournament/Components/VisualiserContainer.cs index 3dd7207607..d2b2feb68d 100644 --- a/osu.Game/Screens/Tournament/Components/VisualiserContainer.cs +++ b/osu.Game/Screens/Tournament/Components/VisualiserContainer.cs @@ -12,7 +12,7 @@ using System.Linq; namespace osu.Game.Screens.Tournament.Components { - internal class VisualiserContainer : Container + public class VisualiserContainer : Container { /// /// Number of lines in the visualiser. From 2610cadd3cf4dfedda929a26f4abc91a047a65e7 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 21 Nov 2017 12:11:29 +0900 Subject: [PATCH 33/35] CI fixes --- osu.Game/Overlays/ChatOverlay.cs | 2 +- osu.Game/Rulesets/Judgements/Judgement.cs | 2 +- osu.Game/Rulesets/Objects/Legacy/ConvertHitObjectParser.cs | 2 +- osu.Game/Rulesets/UI/RulesetContainer.cs | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/osu.Game/Overlays/ChatOverlay.cs b/osu.Game/Overlays/ChatOverlay.cs index c5ffc5a2f1..9f40a08ad2 100644 --- a/osu.Game/Overlays/ChatOverlay.cs +++ b/osu.Game/Overlays/ChatOverlay.cs @@ -58,7 +58,7 @@ namespace osu.Game.Overlays private readonly Box chatBackground; private readonly Box tabBackground; - public Bindable ChatHeight { get; public set; } + public Bindable ChatHeight { get; set; } private readonly Container channelSelectionContainer; private readonly ChannelSelectionOverlay channelSelection; diff --git a/osu.Game/Rulesets/Judgements/Judgement.cs b/osu.Game/Rulesets/Judgements/Judgement.cs index 5ad18e67ee..d804111a7f 100644 --- a/osu.Game/Rulesets/Judgements/Judgement.cs +++ b/osu.Game/Rulesets/Judgements/Judgement.cs @@ -41,7 +41,7 @@ namespace osu.Game.Rulesets.Judgements /// The offset from a perfect hit at which this judgement occurred. /// Populated when added via . /// - public double TimeOffset { get; public set; } + public double TimeOffset { get; set; } /// /// Whether the should affect the combo portion of the score. diff --git a/osu.Game/Rulesets/Objects/Legacy/ConvertHitObjectParser.cs b/osu.Game/Rulesets/Objects/Legacy/ConvertHitObjectParser.cs index b5e3f837fc..d4f9c7191a 100644 --- a/osu.Game/Rulesets/Objects/Legacy/ConvertHitObjectParser.cs +++ b/osu.Game/Rulesets/Objects/Legacy/ConvertHitObjectParser.cs @@ -15,7 +15,7 @@ namespace osu.Game.Rulesets.Objects.Legacy /// /// A HitObjectParser to parse legacy Beatmaps. /// - internal abstract class ConvertHitObjectParser : HitObjectParser + public abstract class ConvertHitObjectParser : HitObjectParser { public override HitObject Parse(string text) { diff --git a/osu.Game/Rulesets/UI/RulesetContainer.cs b/osu.Game/Rulesets/UI/RulesetContainer.cs index a5ac9c201a..ec26f6f310 100644 --- a/osu.Game/Rulesets/UI/RulesetContainer.cs +++ b/osu.Game/Rulesets/UI/RulesetContainer.cs @@ -61,7 +61,7 @@ namespace osu.Game.Rulesets.UI /// A visual representation of a . /// /// The ruleset being repesented. - public RulesetContainer(Ruleset ruleset) + protected RulesetContainer(Ruleset ruleset) { Ruleset = ruleset; } From 8e63a7dd8dd6478eba9089024e39456f89716fb9 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 21 Nov 2017 14:42:49 +0900 Subject: [PATCH 34/35] Handle more exceptions when checking for updates Should resolve #849. --- osu.Desktop/Overlays/VersionManager.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/osu.Desktop/Overlays/VersionManager.cs b/osu.Desktop/Overlays/VersionManager.cs index 8c17e18ed8..3d66e6754c 100644 --- a/osu.Desktop/Overlays/VersionManager.cs +++ b/osu.Desktop/Overlays/VersionManager.cs @@ -198,10 +198,9 @@ namespace osu.Desktop.Overlays } } } - catch (HttpRequestException) + catch (Exception) { - //likely have no internet connection. - //we'll ignore this and retry later. + // we'll ignore this and retry later. can be triggered by no internet connection or thread abortion. } finally { From 62dcc316e265063c9e8e386a9a2a4d7ff7ce7607 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 21 Nov 2017 15:02:16 +0900 Subject: [PATCH 35/35] Remove unnecessary using --- osu.Desktop/Overlays/VersionManager.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/osu.Desktop/Overlays/VersionManager.cs b/osu.Desktop/Overlays/VersionManager.cs index 3d66e6754c..9e13003c3f 100644 --- a/osu.Desktop/Overlays/VersionManager.cs +++ b/osu.Desktop/Overlays/VersionManager.cs @@ -3,7 +3,6 @@ using System; using System.Diagnostics; -using System.Net.Http; using osu.Framework.Allocation; using osu.Framework.Development; using osu.Framework.Graphics;