diff --git a/osu.Desktop.VisualTests/Tests/TestCaseChatDisplay.cs b/osu.Desktop.VisualTests/Tests/TestCaseChatDisplay.cs index 353ad4f9f1..ff8f0e07dc 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseChatDisplay.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseChatDisplay.cs @@ -16,6 +16,7 @@ using System.Diagnostics; using System.Linq; using osu.Framework.Graphics.Sprites; using osu.Game.Online.Chat.Display.osu.Online.Social; +using osu.Framework; namespace osu.Desktop.Tests { @@ -31,10 +32,17 @@ namespace osu.Desktop.Tests private Scheduler scheduler = new Scheduler(); - private APIAccess api => ((OsuGameBase)Game).API; + private APIAccess api; private long? lastMessageId; + public override void Load(BaseGame game) + { + base.Load(game); + + api = ((OsuGameBase)game).API; + } + public override void Reset() { base.Reset(); diff --git a/osu.Desktop.VisualTests/VisualTestGame.cs b/osu.Desktop.VisualTests/VisualTestGame.cs index ecbaf7ac8f..bc4c59c4e3 100644 --- a/osu.Desktop.VisualTests/VisualTestGame.cs +++ b/osu.Desktop.VisualTests/VisualTestGame.cs @@ -9,9 +9,9 @@ namespace osu.Framework.VisualTests { class VisualTestGame : OsuGameBase { - public override void Load() + public override void Load(BaseGame game) { - base.Load(); + base.Load(game); Add(new TestBrowser()); diff --git a/osu.Game/GameModes/BackgroundMode.cs b/osu.Game/GameModes/BackgroundMode.cs index 1f90448e55..d9b1c1b18f 100644 --- a/osu.Game/GameModes/BackgroundMode.cs +++ b/osu.Game/GameModes/BackgroundMode.cs @@ -11,6 +11,7 @@ using osu.Framework.Graphics.Transformations; using OpenTK; using osu.Framework.Graphics; using osu.Framework.Input; +using osu.Framework; namespace osu.Game.GameModes { @@ -30,9 +31,9 @@ namespace osu.Game.GameModes return false; } - public override void Load() + public override void Load(BaseGame game) { - base.Load(); + base.Load(game); Content.Scale *= 1 + (x_movement_amount / Size.X) * 2; } diff --git a/osu.Game/GameModes/Backgrounds/BackgroundModeCustom.cs b/osu.Game/GameModes/Backgrounds/BackgroundModeCustom.cs index ae8e2d916e..7b1756436f 100644 --- a/osu.Game/GameModes/Backgrounds/BackgroundModeCustom.cs +++ b/osu.Game/GameModes/Backgrounds/BackgroundModeCustom.cs @@ -1,6 +1,7 @@ //Copyright (c) 2007-2016 ppy Pty Ltd . //Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using osu.Framework; using osu.Game.Graphics.Background; namespace osu.Game.GameModes.Backgrounds @@ -14,9 +15,9 @@ namespace osu.Game.GameModes.Backgrounds this.textureName = textureName; } - public override void Load() + public override void Load(BaseGame game) { - base.Load(); + base.Load(game); Add(new Background(textureName)); } diff --git a/osu.Game/GameModes/Backgrounds/BackgroundModeDefault.cs b/osu.Game/GameModes/Backgrounds/BackgroundModeDefault.cs index 0683a267a5..542e9b58b7 100644 --- a/osu.Game/GameModes/Backgrounds/BackgroundModeDefault.cs +++ b/osu.Game/GameModes/Backgrounds/BackgroundModeDefault.cs @@ -1,15 +1,16 @@ //Copyright (c) 2007-2016 ppy Pty Ltd . //Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using osu.Framework; using osu.Game.Graphics.Background; namespace osu.Game.GameModes.Backgrounds { public class BackgroundModeDefault : BackgroundMode { - public override void Load() + public override void Load(BaseGame game) { - base.Load(); + base.Load(game); Add(new Background()); } diff --git a/osu.Game/GameModes/GameModeWhiteBox.cs b/osu.Game/GameModes/GameModeWhiteBox.cs index 46250d9a91..121cb20d12 100644 --- a/osu.Game/GameModes/GameModeWhiteBox.cs +++ b/osu.Game/GameModes/GameModeWhiteBox.cs @@ -13,6 +13,7 @@ using osu.Framework.Graphics.UserInterface; using osu.Game.GameModes.Backgrounds; using OpenTK; using OpenTK.Graphics; +using osu.Framework; namespace osu.Game.GameModes { @@ -77,9 +78,9 @@ namespace osu.Game.GameModes Content.FadeIn(transition_time, EasingTypes.OutExpo); } - public override void Load() + public override void Load(BaseGame game) { - base.Load(); + base.Load(game); Children = new Drawable[] { diff --git a/osu.Game/GameModes/Menu/ButtonSystem.cs b/osu.Game/GameModes/Menu/ButtonSystem.cs index 93701e6c18..75d6288a4f 100644 --- a/osu.Game/GameModes/Menu/ButtonSystem.cs +++ b/osu.Game/GameModes/Menu/ButtonSystem.cs @@ -16,6 +16,7 @@ using osu.Game.Graphics.Containers; using OpenTK; using OpenTK.Graphics; using OpenTK.Input; +using osu.Framework; namespace osu.Game.GameModes.Menu { @@ -63,9 +64,9 @@ namespace osu.Game.GameModes.Menu RelativeSizeAxes = Axes.Both; } - public override void Load() + public override void Load(BaseGame game) { - base.Load(); + base.Load(game); Children = new Drawable[] { @@ -346,9 +347,9 @@ namespace osu.Game.GameModes.Menu this.text = text; } - public override void Load() + public override void Load(BaseGame game) { - base.Load(); + base.Load(game); Alpha = 0; Children = new Drawable[] diff --git a/osu.Game/GameModes/Menu/Intro.cs b/osu.Game/GameModes/Menu/Intro.cs index e70b2639cf..5127f5be5c 100644 --- a/osu.Game/GameModes/Menu/Intro.cs +++ b/osu.Game/GameModes/Menu/Intro.cs @@ -23,9 +23,9 @@ namespace osu.Game.GameModes.Menu protected override BackgroundMode CreateBackground() => new BackgroundModeEmpty(); - public override void Load() + public override void Load(Framework.BaseGame game) { - base.Load(); + base.Load(game); Children = new Drawable[] { @@ -39,9 +39,9 @@ namespace osu.Game.GameModes.Menu } }; - AudioSample welcome = Game.Audio.Sample.Get(@"welcome"); + AudioSample welcome = game.Audio.Sample.Get(@"welcome"); - AudioTrack bgm = Game.Audio.Track.Get(@"circles"); + AudioTrack bgm = game.Audio.Track.Get(@"circles"); bgm.Looping = true; Scheduler.Add(delegate diff --git a/osu.Game/GameModes/Menu/MainMenu.cs b/osu.Game/GameModes/Menu/MainMenu.cs index e74c83e03d..c700b370c2 100644 --- a/osu.Game/GameModes/Menu/MainMenu.cs +++ b/osu.Game/GameModes/Menu/MainMenu.cs @@ -15,6 +15,7 @@ using osu.Game.GameModes.Multiplayer; using osu.Game.GameModes.Play; using osu.Game.Graphics.Containers; using OpenTK; +using osu.Framework; namespace osu.Game.GameModes.Menu { @@ -25,11 +26,11 @@ namespace osu.Game.GameModes.Menu protected override BackgroundMode CreateBackground() => new BackgroundModeDefault(); - public override void Load() + public override void Load(BaseGame game) { - base.Load(); + base.Load(game); - OsuGame osu = (OsuGame)Game; + OsuGame osu = (OsuGame)game; Children = new Drawable[] { diff --git a/osu.Game/GameModes/Menu/OsuLogo.cs b/osu.Game/GameModes/Menu/OsuLogo.cs index 5e50ae5db4..5190e1f027 100644 --- a/osu.Game/GameModes/Menu/OsuLogo.cs +++ b/osu.Game/GameModes/Menu/OsuLogo.cs @@ -7,6 +7,7 @@ using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Transformations; using osu.Framework.Input; +using osu.Framework; namespace osu.Game.GameModes.Menu { @@ -82,12 +83,12 @@ namespace osu.Game.GameModes.Menu }; } - public override void Load() + public override void Load(BaseGame game) { - base.Load(); + base.Load(game); - logo.Texture = Game.Textures.Get(@"Menu/logo"); - ripple.Texture = Game.Textures.Get(@"Menu/logo"); + logo.Texture = game.Textures.Get(@"Menu/logo"); + ripple.Texture = game.Textures.Get(@"Menu/logo"); ripple.ScaleTo(1.1f, 500); ripple.FadeOut(500); diff --git a/osu.Game/GameModes/Play/Catch/CatchHitRenderer.cs b/osu.Game/GameModes/Play/Catch/CatchHitRenderer.cs index 0c42039af0..d6543360fc 100644 --- a/osu.Game/GameModes/Play/Catch/CatchHitRenderer.cs +++ b/osu.Game/GameModes/Play/Catch/CatchHitRenderer.cs @@ -10,6 +10,7 @@ using osu.Game.Beatmaps.Objects; using osu.Game.Beatmaps.Objects.Osu; using osu.Game.Beatmaps.Objects.Catch; using OpenTK; +using osu.Framework; namespace osu.Game.GameModes.Play.Catch { @@ -24,9 +25,6 @@ namespace osu.Game.GameModes.Play.Catch { //osu! mode requires all objects to be of CatchBaseHit type. objects = value.ConvertAll(convertForCatch); - - if (Parent != null) - Load(); } } @@ -50,9 +48,9 @@ namespace osu.Game.GameModes.Play.Catch return h; } - public override void Load() + public override void Load(BaseGame game) { - base.Load(); + base.Load(game); if (playfield == null) Add(playfield = new CatchPlayfield()); @@ -66,7 +64,7 @@ namespace osu.Game.GameModes.Play.Catch //render stuff! Sprite s = new Sprite { - Texture = Game.Textures.Get(@"Menu/logo"), + Texture = game.Textures.Get(@"Menu/logo"), Origin = Anchor.Centre, Scale = new Vector2(0.1f), RelativePositionAxes = Axes.Y, diff --git a/osu.Game/GameModes/Play/Catch/CatchPlayfield.cs b/osu.Game/GameModes/Play/Catch/CatchPlayfield.cs index 97979319e2..fef80e6b4a 100644 --- a/osu.Game/GameModes/Play/Catch/CatchPlayfield.cs +++ b/osu.Game/GameModes/Play/Catch/CatchPlayfield.cs @@ -7,6 +7,7 @@ using osu.Framework.Graphics.Drawables; using osu.Framework.Graphics.Sprites; using OpenTK; using OpenTK.Graphics; +using osu.Framework; namespace osu.Game.GameModes.Play.Catch { @@ -20,9 +21,9 @@ namespace osu.Game.GameModes.Play.Catch Origin = Anchor.BottomCentre; } - public override void Load() + public override void Load(BaseGame game) { - base.Load(); + base.Load(game); Add(new Box { RelativeSizeAxes = Axes.Both, Alpha = 0.5f }); } diff --git a/osu.Game/GameModes/Play/HitRenderer.cs b/osu.Game/GameModes/Play/HitRenderer.cs index 6016c93a34..06d98da836 100644 --- a/osu.Game/GameModes/Play/HitRenderer.cs +++ b/osu.Game/GameModes/Play/HitRenderer.cs @@ -9,6 +9,7 @@ using osu.Framework.Graphics.Drawables; using osu.Game.Beatmaps.Objects; using OpenTK; using OpenTK.Graphics; +using osu.Framework; namespace osu.Game.GameModes.Play { @@ -21,9 +22,9 @@ namespace osu.Game.GameModes.Play RelativeSizeAxes = Axes.Both; } - public override void Load() + public override void Load(BaseGame game) { - base.Load(); + base.Load(game); Add(new Box() { diff --git a/osu.Game/GameModes/Play/Mania/ManiaHitRenderer.cs b/osu.Game/GameModes/Play/Mania/ManiaHitRenderer.cs index e001626974..1e55e552d3 100644 --- a/osu.Game/GameModes/Play/Mania/ManiaHitRenderer.cs +++ b/osu.Game/GameModes/Play/Mania/ManiaHitRenderer.cs @@ -10,6 +10,7 @@ using osu.Game.Beatmaps.Objects; using osu.Game.Beatmaps.Objects.Osu; using osu.Game.Beatmaps.Objects.Mania; using OpenTK; +using osu.Framework; namespace osu.Game.GameModes.Play.Mania { @@ -30,9 +31,6 @@ namespace osu.Game.GameModes.Play.Mania { //osu! mode requires all objects to be of ManiaBaseHit type. objects = value.ConvertAll(convertForMania); - - if (Parent != null) - Load(); } } @@ -56,9 +54,9 @@ namespace osu.Game.GameModes.Play.Mania return h; } - public override void Load() + public override void Load(BaseGame game) { - base.Load(); + base.Load(game); if (playfield == null) Add(playfield = new ManiaPlayfield(columns)); @@ -72,7 +70,7 @@ namespace osu.Game.GameModes.Play.Mania //render stuff! Sprite s = new Sprite { - Texture = Game.Textures.Get(@"Menu/logo"), + Texture = game.Textures.Get(@"Menu/logo"), Origin = Anchor.Centre, Scale = new Vector2(0.1f), RelativePositionAxes = Axes.Both, diff --git a/osu.Game/GameModes/Play/Mania/ManiaPlayfield.cs b/osu.Game/GameModes/Play/Mania/ManiaPlayfield.cs index 287db8777b..53de8221eb 100644 --- a/osu.Game/GameModes/Play/Mania/ManiaPlayfield.cs +++ b/osu.Game/GameModes/Play/Mania/ManiaPlayfield.cs @@ -7,6 +7,7 @@ using osu.Framework.Graphics.Drawables; using osu.Framework.Graphics.Sprites; using OpenTK; using OpenTK.Graphics; +using osu.Framework; namespace osu.Game.GameModes.Play.Mania { @@ -23,9 +24,9 @@ namespace osu.Game.GameModes.Play.Mania Origin = Anchor.BottomCentre; } - public override void Load() + public override void Load(BaseGame game) { - base.Load(); + base.Load(game); Add(new Box() { RelativeSizeAxes = Axes.Both, Alpha = 0.5f }); diff --git a/osu.Game/GameModes/Play/Osu/OsuHitRenderer.cs b/osu.Game/GameModes/Play/Osu/OsuHitRenderer.cs index d2f72fd85f..1f027fb6ae 100644 --- a/osu.Game/GameModes/Play/Osu/OsuHitRenderer.cs +++ b/osu.Game/GameModes/Play/Osu/OsuHitRenderer.cs @@ -8,6 +8,7 @@ using osu.Framework.Graphics.Transformations; using osu.Game.Beatmaps.Objects; using osu.Game.Beatmaps.Objects.Osu; using OpenTK; +using System.Diagnostics; namespace osu.Game.GameModes.Play.Osu { @@ -20,17 +21,16 @@ namespace osu.Game.GameModes.Play.Osu { set { + Debug.Assert(objects == null); + //osu! mode requires all objects to be of OsuBaseHit type. objects = value.ConvertAll(o => (OsuBaseHit)o); - - if (Parent != null) - Load(); } } - public override void Load() + public override void Load(Framework.BaseGame game) { - base.Load(); + base.Load(game); if (playfield == null) Add(playfield = new OsuPlayfield()); @@ -44,7 +44,7 @@ namespace osu.Game.GameModes.Play.Osu //render stuff! Sprite s = new Sprite { - Texture = Game.Textures.Get(@"Menu/logo"), + Texture = game.Textures.Get(@"Menu/logo"), Origin = Anchor.Centre, Scale = new Vector2(0.1f), Alpha = 0, diff --git a/osu.Game/GameModes/Play/Osu/OsuPlayfield.cs b/osu.Game/GameModes/Play/Osu/OsuPlayfield.cs index dd3348d8e1..e232a2af40 100644 --- a/osu.Game/GameModes/Play/Osu/OsuPlayfield.cs +++ b/osu.Game/GameModes/Play/Osu/OsuPlayfield.cs @@ -5,6 +5,7 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Drawables; using OpenTK; +using osu.Framework; namespace osu.Game.GameModes.Play.Osu { @@ -18,9 +19,9 @@ namespace osu.Game.GameModes.Play.Osu Origin = Anchor.Centre; } - public override void Load() + public override void Load(BaseGame game) { - base.Load(); + base.Load(game); Add(new Box() { diff --git a/osu.Game/GameModes/Play/PlaySongSelect.cs b/osu.Game/GameModes/Play/PlaySongSelect.cs index 06f7d8f914..df120ba8ba 100644 --- a/osu.Game/GameModes/Play/PlaySongSelect.cs +++ b/osu.Game/GameModes/Play/PlaySongSelect.cs @@ -5,6 +5,7 @@ using System; using System.Collections.Generic; using osu.Framework.Configuration; using osu.Game.GameModes.Backgrounds; +using osu.Framework; namespace osu.Game.GameModes.Play { @@ -19,11 +20,11 @@ namespace osu.Game.GameModes.Play typeof(Player) }; - public override void Load() + public override void Load(BaseGame game) { - base.Load(); + base.Load(game); - OsuGame osu = Game as OsuGame; + OsuGame osu = game as OsuGame; playMode = osu.PlayMode; playMode.ValueChanged += PlayMode_ValueChanged; diff --git a/osu.Game/GameModes/Play/Player.cs b/osu.Game/GameModes/Play/Player.cs index 3a8685b501..829b3e8db0 100644 --- a/osu.Game/GameModes/Play/Player.cs +++ b/osu.Game/GameModes/Play/Player.cs @@ -20,6 +20,7 @@ using osu.Game.GameModes.Play.Taiko; using osu.Game.Graphics.UserInterface; using OpenTK; using OpenTK.Input; +using osu.Framework; namespace osu.Game.GameModes.Play { @@ -31,9 +32,9 @@ namespace osu.Game.GameModes.Play typeof(Results) }; - public override void Load() + public override void Load(BaseGame game) { - base.Load(); + base.Load(game); List objects = new List(); @@ -54,7 +55,7 @@ namespace osu.Game.GameModes.Play HitObjects = objects }; - OsuGame osu = Game as OsuGame; + OsuGame osu = game as OsuGame; switch (osu.PlayMode.Value) { diff --git a/osu.Game/GameModes/Play/Playfield.cs b/osu.Game/GameModes/Play/Playfield.cs index 41a73472d8..aee8287be3 100644 --- a/osu.Game/GameModes/Play/Playfield.cs +++ b/osu.Game/GameModes/Play/Playfield.cs @@ -1,15 +1,16 @@ //Copyright (c) 2007-2016 ppy Pty Ltd . //Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using osu.Framework; using osu.Framework.Graphics.Containers; namespace osu.Game.GameModes.Play { public class Playfield : Container { - public override void Load() + public override void Load(BaseGame game) { - base.Load(); + base.Load(game); Masking = true; } diff --git a/osu.Game/GameModes/Play/Taiko/TaikoHitRenderer.cs b/osu.Game/GameModes/Play/Taiko/TaikoHitRenderer.cs index 7315614c8d..2874c62fca 100644 --- a/osu.Game/GameModes/Play/Taiko/TaikoHitRenderer.cs +++ b/osu.Game/GameModes/Play/Taiko/TaikoHitRenderer.cs @@ -10,6 +10,7 @@ using osu.Game.Beatmaps.Objects; using osu.Game.Beatmaps.Objects.Osu; using osu.Game.Beatmaps.Objects.Taiko; using OpenTK; +using osu.Framework; namespace osu.Game.GameModes.Play.Taiko { @@ -24,9 +25,6 @@ namespace osu.Game.GameModes.Play.Taiko { //osu! mode requires all objects to be of TaikoBaseHit type. objects = value.ConvertAll(convertForTaiko); - - if (Parent != null) - Load(); } } @@ -49,9 +47,9 @@ namespace osu.Game.GameModes.Play.Taiko return h; } - public override void Load() + public override void Load(BaseGame game) { - base.Load(); + base.Load(game); if (playfield == null) Add(playfield = new TaikoPlayfield()); @@ -65,7 +63,7 @@ namespace osu.Game.GameModes.Play.Taiko //render stuff! Sprite s = new Sprite { - Texture = Game.Textures.Get(@"Menu/logo"), + Texture = game.Textures.Get(@"Menu/logo"), Origin = Anchor.Centre, Scale = new Vector2(0.2f), RelativePositionAxes = Axes.Both, diff --git a/osu.Game/GameModes/Play/Taiko/TaikoPlayfield.cs b/osu.Game/GameModes/Play/Taiko/TaikoPlayfield.cs index e99914c1c2..0f2ab70727 100644 --- a/osu.Game/GameModes/Play/Taiko/TaikoPlayfield.cs +++ b/osu.Game/GameModes/Play/Taiko/TaikoPlayfield.cs @@ -7,6 +7,7 @@ using osu.Framework.Graphics.Drawables; using osu.Framework.Graphics.Sprites; using OpenTK; using OpenTK.Graphics; +using osu.Framework; namespace osu.Game.GameModes.Play.Taiko { @@ -20,15 +21,15 @@ namespace osu.Game.GameModes.Play.Taiko Origin = Anchor.Centre; } - public override void Load() + public override void Load(BaseGame game) { - base.Load(); + base.Load(game); Add(new Box { RelativeSizeAxes = Axes.Both, Alpha = 0.5f }); Add(new Sprite { - Texture = Game.Textures.Get(@"Menu/logo"), + Texture = game.Textures.Get(@"Menu/logo"), Origin = Anchor.Centre, Scale = new Vector2(0.2f), RelativePositionAxes = Axes.Both, diff --git a/osu.Game/Graphics/Background/Background.cs b/osu.Game/Graphics/Background/Background.cs index 8333d975f9..a0bb99f589 100644 --- a/osu.Game/Graphics/Background/Background.cs +++ b/osu.Game/Graphics/Background/Background.cs @@ -8,6 +8,7 @@ using osu.Game.Graphics.Containers; using OpenTK; using OpenTK.Graphics; using osu.Framework.Graphics.Containers; +using osu.Framework; namespace osu.Game.Graphics.Background { @@ -24,13 +25,13 @@ namespace osu.Game.Graphics.Background Depth = float.MinValue; } - public override void Load() + public override void Load(BaseGame game) { - base.Load(); + base.Load(game); Add(BackgroundSprite = new Sprite { - Texture = Game.Textures.Get(textureName), + Texture = game.Textures.Get(textureName), Anchor = Anchor.Centre, Origin = Anchor.Centre, Colour = Color4.DarkGray diff --git a/osu.Game/Graphics/Containers/ParallaxContainer.cs b/osu.Game/Graphics/Containers/ParallaxContainer.cs index 183b0c054a..129997e663 100644 --- a/osu.Game/Graphics/Containers/ParallaxContainer.cs +++ b/osu.Game/Graphics/Containers/ParallaxContainer.cs @@ -2,6 +2,7 @@ using osu.Framework.Graphics; using osu.Framework.Input; using OpenTK; +using osu.Framework; namespace osu.Game.Graphics.Containers { @@ -26,9 +27,9 @@ namespace osu.Game.Graphics.Containers protected override Container Content => content; - public override void Load() + public override void Load(BaseGame game) { - base.Load(); + base.Load(game); } protected override bool OnMouseMove(InputState state) diff --git a/osu.Game/Graphics/Cursor/OsuCursorContainer.cs b/osu.Game/Graphics/Cursor/OsuCursorContainer.cs index 8f862d288a..3239961eff 100644 --- a/osu.Game/Graphics/Cursor/OsuCursorContainer.cs +++ b/osu.Game/Graphics/Cursor/OsuCursorContainer.cs @@ -1,6 +1,7 @@ //Copyright (c) 2007-2016 ppy Pty Ltd . //Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using osu.Framework; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Cursor; @@ -35,15 +36,15 @@ namespace osu.Game.Graphics.Cursor Origin = Anchor.Centre; } - public override void Load() + public override void Load(BaseGame game) { - base.Load(); + base.Load(game); Children = new Drawable[] { new Sprite { - Texture = Game.Textures.Get(@"Cursor/cursor") + Texture = game.Textures.Get(@"Cursor/cursor") } }; } diff --git a/osu.Game/Graphics/UserInterface/KeyCounter.cs b/osu.Game/Graphics/UserInterface/KeyCounter.cs index 480476ed00..5f48de699b 100644 --- a/osu.Game/Graphics/UserInterface/KeyCounter.cs +++ b/osu.Game/Graphics/UserInterface/KeyCounter.cs @@ -3,6 +3,7 @@ using OpenTK; using OpenTK.Graphics; +using osu.Framework; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Sprites; @@ -58,20 +59,20 @@ namespace osu.Game.Graphics.UserInterface Name = name; } - public override void Load() + public override void Load(BaseGame game) { - base.Load(); + base.Load(game); Children = new Drawable[] { buttonSprite = new Sprite { - Texture = Game.Textures.Get(@"KeyCounter/key-up"), + Texture = game.Textures.Get(@"KeyCounter/key-up"), Anchor = Anchor.Centre, Origin = Anchor.Centre, }, glowSprite = new Sprite { - Texture = Game.Textures.Get(@"KeyCounter/key-glow"), + Texture = game.Textures.Get(@"KeyCounter/key-glow"), Anchor = Anchor.Centre, Origin = Anchor.Centre, Alpha = 0 diff --git a/osu.Game/Online/Chat/Display/ChatLine.cs b/osu.Game/Online/Chat/Display/ChatLine.cs index aa75107c09..2c68b81479 100644 --- a/osu.Game/Online/Chat/Display/ChatLine.cs +++ b/osu.Game/Online/Chat/Display/ChatLine.cs @@ -7,6 +7,7 @@ using osu.Framework.Graphics.Drawables; using osu.Framework.Graphics.Sprites; using OpenTK; using OpenTK.Graphics; +using osu.Framework; namespace osu.Game.Online.Chat.Display { @@ -21,9 +22,9 @@ namespace osu.Game.Online.Chat.Display this.msg = msg; } - public override void Load() + public override void Load(BaseGame game) { - base.Load(); + base.Load(game); RelativeSizeAxes = Axes.X; diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index d8ae0b05a1..121505507c 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -15,6 +15,7 @@ using osu.Game.Graphics.Background; using osu.Game.GameModes.Play; using osu.Game.Graphics.Containers; using osu.Game.Overlays; +using osu.Framework; namespace osu.Game { @@ -33,9 +34,9 @@ namespace osu.Game host.Size = new Vector2(Config.Get(OsuConfig.Width), Config.Get(OsuConfig.Height)); } - public override void Load() + public override void Load(BaseGame game) { - base.Load(); + base.Load(game); //attach our bindables to the audio subsystem. Audio.Volume.Weld(Config.GetBindable(OsuConfig.VolumeGlobal)); diff --git a/osu.Game/OsuGameBase.cs b/osu.Game/OsuGameBase.cs index bd3990d5ef..41b2235dec 100644 --- a/osu.Game/OsuGameBase.cs +++ b/osu.Game/OsuGameBase.cs @@ -1,4 +1,5 @@ -using osu.Framework.GameModes; +using osu.Framework; +using osu.Framework.GameModes; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Cursor; @@ -12,7 +13,7 @@ using osu.Game.Overlays; namespace osu.Game { - public class OsuGameBase : Framework.Game + public class OsuGameBase : Framework.BaseGame { internal OsuConfigManager Config = new OsuConfigManager(); @@ -27,9 +28,9 @@ namespace osu.Game public CursorContainer Cursor; - public override void Load() + public override void Load(BaseGame game) { - base.Load(); + base.Load(game); //this completely overrides the framework default. will need to change once we make a proper FontStore. Fonts = new TextureStore() { ScaleAdjust = 0.01f }; diff --git a/osu.Game/Overlays/Options.cs b/osu.Game/Overlays/Options.cs index 4eb2b0f235..bdab31bc6e 100644 --- a/osu.Game/Overlays/Options.cs +++ b/osu.Game/Overlays/Options.cs @@ -9,6 +9,7 @@ using OpenTK; using OpenTK.Graphics; using osu.Framework.Input; using OpenTK.Input; +using osu.Framework; namespace osu.Game.Overlays { @@ -16,9 +17,9 @@ namespace osu.Game.Overlays { const float width = 300; - public override void Load() + public override void Load(BaseGame game) { - base.Load(); + base.Load(game); Depth = float.MaxValue; RelativeSizeAxes = Axes.Y; diff --git a/osu.Game/Overlays/Toolbar.cs b/osu.Game/Overlays/Toolbar.cs index 46bc2be0d6..ac9c653889 100644 --- a/osu.Game/Overlays/Toolbar.cs +++ b/osu.Game/Overlays/Toolbar.cs @@ -12,6 +12,7 @@ using System; using osu.Framework.Graphics.Transformations; using osu.Framework.Timing; using osu.Game.GameModes.Play; +using osu.Framework; namespace osu.Game.Overlays { @@ -42,9 +43,9 @@ namespace osu.Game.Overlays } } - public override void Load() + public override void Load(BaseGame game) { - base.Load(); + base.Load(game); RelativeSizeAxes = Axes.X; Size = new Vector2(1, height); @@ -97,7 +98,7 @@ namespace osu.Game.Overlays new ToolbarButton { Icon = FontAwesome.user, - Text = ((OsuGame)Game).Config.Get(OsuConfig.Username) + Text = ((OsuGame)game).Config.Get(OsuConfig.Username) }, new ToolbarButton { diff --git a/osu.Game/Overlays/ToolbarModeButton.cs b/osu.Game/Overlays/ToolbarModeButton.cs index a8519e3436..678a953fb1 100644 --- a/osu.Game/Overlays/ToolbarModeButton.cs +++ b/osu.Game/Overlays/ToolbarModeButton.cs @@ -5,6 +5,7 @@ using osu.Framework.Extensions; using osu.Game.GameModes.Play; using osu.Game.Graphics; using OpenTK.Graphics; +using osu.Framework; namespace osu.Game.Overlays { @@ -42,9 +43,9 @@ namespace osu.Game.Overlays } } - public override void Load() + public override void Load(BaseGame game) { - base.Load(); + base.Load(game); DrawableIcon.TextSize *= 1.4f; } } diff --git a/osu.Game/Overlays/ToolbarModeSelector.cs b/osu.Game/Overlays/ToolbarModeSelector.cs index c429dd5a24..d73c7dc8a9 100644 --- a/osu.Game/Overlays/ToolbarModeSelector.cs +++ b/osu.Game/Overlays/ToolbarModeSelector.cs @@ -11,6 +11,7 @@ using osu.Framework.Graphics.Transformations; using osu.Game.GameModes.Play; using OpenTK; using OpenTK.Graphics; +using osu.Framework; namespace osu.Game.Overlays { @@ -29,9 +30,9 @@ namespace osu.Game.Overlays RelativeSizeAxes = Axes.Y; } - public override void Load() + public override void Load(BaseGame game) { - base.Load(); + base.Load(game); Children = new Drawable[] { diff --git a/osu.Game/VolumeControl.cs b/osu.Game/VolumeControl.cs index 0ea9aab67e..ff74a767bd 100644 --- a/osu.Game/VolumeControl.cs +++ b/osu.Game/VolumeControl.cs @@ -7,6 +7,7 @@ using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Drawables; using osu.Framework.Input; using osu.Framework.Graphics.Transformations; +using osu.Framework; namespace osu.Game { @@ -24,9 +25,9 @@ namespace osu.Game RelativeSizeAxes = Axes.Both; } - public override void Load() + public override void Load(BaseGame game) { - base.Load(); + base.Load(game); Children = new Drawable[] { meterContainer = new Container {