From fe9034323b884a0dca913524ad46a517aba1a716 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Tue, 8 Nov 2016 18:46:08 -0500 Subject: [PATCH] Get the game running, though not perfectly --- .../Tests/TestCasePlayer.cs | 6 ---- osu.Game/Beatmaps/Formats/BeatmapDecoder.cs | 2 +- .../Graphics/Containers/ParallaxContainer.cs | 2 +- osu.Game/OsuGameBase.cs | 30 +++++++++---------- 4 files changed, 17 insertions(+), 23 deletions(-) diff --git a/osu.Desktop.VisualTests/Tests/TestCasePlayer.cs b/osu.Desktop.VisualTests/Tests/TestCasePlayer.cs index 80289ae488..03e382b71e 100644 --- a/osu.Desktop.VisualTests/Tests/TestCasePlayer.cs +++ b/osu.Desktop.VisualTests/Tests/TestCasePlayer.cs @@ -26,12 +26,6 @@ namespace osu.Desktop.VisualTests.Tests protected override IFrameBasedClock Clock => localClock; - [Initializer] - private void Load() - { - // TODO: Do we even need this here? - } - public override void Reset() { base.Reset(); diff --git a/osu.Game/Beatmaps/Formats/BeatmapDecoder.cs b/osu.Game/Beatmaps/Formats/BeatmapDecoder.cs index e3d89ac6fc..ca11b97587 100644 --- a/osu.Game/Beatmaps/Formats/BeatmapDecoder.cs +++ b/osu.Game/Beatmaps/Formats/BeatmapDecoder.cs @@ -52,7 +52,7 @@ namespace osu.Game.Beatmaps.Formats foreach (HitObject h in b.HitObjects) { - if (h.NewCombo) i = (i + 1) % colours.Count; + if (h.NewCombo || i == -1) i = (i + 1) % colours.Count; h.Colour = colours[i]; } } diff --git a/osu.Game/Graphics/Containers/ParallaxContainer.cs b/osu.Game/Graphics/Containers/ParallaxContainer.cs index 6a39659afd..370f7fbbe9 100644 --- a/osu.Game/Graphics/Containers/ParallaxContainer.cs +++ b/osu.Game/Graphics/Containers/ParallaxContainer.cs @@ -45,4 +45,4 @@ namespace osu.Game.Graphics.Containers content.Scale = new Vector2(1 + ParallaxAmount); } } -} \ No newline at end of file +} diff --git a/osu.Game/OsuGameBase.cs b/osu.Game/OsuGameBase.cs index 2957a375be..a99d0967f1 100644 --- a/osu.Game/OsuGameBase.cs +++ b/osu.Game/OsuGameBase.cs @@ -37,18 +37,6 @@ namespace osu.Game public readonly Bindable Beatmap = new Bindable(); - public OsuGameBase() - { - AddInternal(ratioContainer = new RatioAdjust()); - - Children = new Drawable[] - { - Cursor = new OsuCursorContainer { Depth = float.MaxValue } - }; - - Beatmap.ValueChanged += Beatmap_ValueChanged; - } - private void Beatmap_ValueChanged(object sender, EventArgs e) { } @@ -57,8 +45,20 @@ namespace osu.Game private void Load() { Dependencies.Cache(this); - Dependencies.Cache(); + Dependencies.Cache(new OsuConfigManager(Host.Storage)); Dependencies.Cache(new BeatmapDatabase(Host.Storage, Host)); + + AddInternal(ratioContainer = new RatioAdjust()); + + Children = new Drawable[] + { + Options = new OptionsOverlay(), + Cursor = new OsuCursorContainer { Depth = float.MaxValue } + }; + + Dependencies.Cache(Options); + + Beatmap.ValueChanged += Beatmap_ValueChanged; OszArchiveReader.Register(); @@ -80,12 +80,12 @@ namespace osu.Game Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Exo2.0-Black")); Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Exo2.0-BlackItalic")); - API = new APIAccess() + Dependencies.Cache(API = new APIAccess { Username = Config.Get(OsuConfig.Username), Password = Config.Get(OsuConfig.Password), Token = Config.Get(OsuConfig.Token) - }; + }); } public override void SetHost(BasicGameHost host)