diff --git a/osu-framework b/osu-framework index 56535b834c..24d94c2c3c 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 56535b834cf2329e5abc8ecf698d19ece9ef7b07 +Subproject commit 24d94c2c3c625b614ffb19f2d1297bdfd1169f6b diff --git a/osu.Desktop.VisualTests/VisualTestGame.cs b/osu.Desktop.VisualTests/VisualTestGame.cs index 81b00d4ab2..9f85cda4f4 100644 --- a/osu.Desktop.VisualTests/VisualTestGame.cs +++ b/osu.Desktop.VisualTests/VisualTestGame.cs @@ -21,7 +21,7 @@ namespace osu.Desktop.VisualTests { base.LoadComplete(); - (new BackgroundScreenDefault() { Depth = 10 }).Preload(this, AddInternal); + (new BackgroundScreenDefault() { Depth = 10 }).LoadAsync(this, AddInternal); // Have to construct this here, rather than in the constructor, because // we depend on some dependencies to be loaded within OsuGameBase.load(). diff --git a/osu.Desktop/OsuGameDesktop.cs b/osu.Desktop/OsuGameDesktop.cs index c3adb8f81f..c987ec711e 100644 --- a/osu.Desktop/OsuGameDesktop.cs +++ b/osu.Desktop/OsuGameDesktop.cs @@ -34,7 +34,7 @@ namespace osu.Desktop { base.LoadComplete(); - versionManager.Preload(this); + versionManager.LoadAsync(this); ModeChanged += m => { if (!versionManager.IsAlive && m is Intro) diff --git a/osu.Desktop/Overlays/VersionManager.cs b/osu.Desktop/Overlays/VersionManager.cs index c3f31414de..728180673d 100644 --- a/osu.Desktop/Overlays/VersionManager.cs +++ b/osu.Desktop/Overlays/VersionManager.cs @@ -104,7 +104,7 @@ namespace osu.Desktop.Overlays }; if (IsDeployedBuild) - updateChecker(); + checkForUpdateAsync(); } protected override void LoadComplete() @@ -119,7 +119,7 @@ namespace osu.Desktop.Overlays updateManager?.Dispose(); } - private async void updateChecker(bool useDeltaPatching = true, UpdateProgressNotification notification = null) + private async void checkForUpdateAsync(bool useDeltaPatching = true, UpdateProgressNotification notification = null) { //should we schedule a retry on completion of this check? bool scheduleRetry = true; @@ -165,7 +165,7 @@ namespace osu.Desktop.Overlays { //could fail if deltas are unavailable for full update path (https://github.com/Squirrel/Squirrel.Windows/issues/959) //try again without deltas. - updateChecker(false, notification); + checkForUpdateAsync(false, notification); scheduleRetry = false; } } @@ -180,7 +180,7 @@ namespace osu.Desktop.Overlays if (scheduleRetry) { //check again in 30 minutes. - Scheduler.AddDelayed(() => updateChecker(), 60000 * 30); + Scheduler.AddDelayed(() => checkForUpdateAsync(), 60000 * 30); if (notification != null) notification.State = ProgressNotificationState.Cancelled; } diff --git a/osu.Desktop/Program.cs b/osu.Desktop/Program.cs index 3023cbfc39..23de1ddbba 100644 --- a/osu.Desktop/Program.cs +++ b/osu.Desktop/Program.cs @@ -35,7 +35,7 @@ namespace osu.Desktop foreach (var file in args) { Console.WriteLine(@"Importing {0}", file); - if (!importer.Import(Path.GetFullPath(file)).Wait(3000)) + if (!importer.ImportAsync(Path.GetFullPath(file)).Wait(3000)) throw new TimeoutException(@"IPC took too long to send"); } } diff --git a/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs b/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs index 8c892c0725..a2be0d2fc2 100644 --- a/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs +++ b/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs @@ -58,7 +58,7 @@ namespace osu.Game.Tests.Beatmaps.IO var osu = loadOsu(host); var importer = new BeatmapImporter(client); - if (!importer.Import(osz_path).Wait(1000)) + if (!importer.ImportAsync(osz_path).Wait(1000)) Assert.Fail(@"IPC took too long to send"); ensureLoaded(osu, 10000); diff --git a/osu.Game/Beatmaps/Drawables/BeatmapSetHeader.cs b/osu.Game/Beatmaps/Drawables/BeatmapSetHeader.cs index a0a7549caf..474b8f758a 100644 --- a/osu.Game/Beatmaps/Drawables/BeatmapSetHeader.cs +++ b/osu.Game/Beatmaps/Drawables/BeatmapSetHeader.cs @@ -162,7 +162,7 @@ namespace osu.Game.Beatmaps.Drawables Anchor = Anchor.Centre, Origin = Anchor.Centre, FillMode = FillMode.Fill, - }.Preload(game, (bg) => + }.LoadAsync(game, (bg) => { Add(bg); ForceRedraw(); diff --git a/osu.Game/IPC/BeatmapImporter.cs b/osu.Game/IPC/BeatmapImporter.cs index 73c47a1b97..b6ce4d1e35 100644 --- a/osu.Game/IPC/BeatmapImporter.cs +++ b/osu.Game/IPC/BeatmapImporter.cs @@ -21,13 +21,13 @@ namespace osu.Game.IPC channel.MessageReceived += messageReceived; } - public async Task Import(string path) + public async Task ImportAsync(string path) { if (beatmaps != null) beatmaps.Import(path); else { - await channel.SendMessage(new BeatmapImportMessage { Path = path }); + await channel.SendMessageAsync(new BeatmapImportMessage { Path = path }); } } @@ -35,7 +35,7 @@ namespace osu.Game.IPC { Debug.Assert(beatmaps != null); - Import(msg.Path); + ImportAsync(msg.Path); } } diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index 1a0f08ffb8..55eb3f861e 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -116,7 +116,7 @@ namespace osu.Game } }); - (screenStack = new Loader()).Preload(this, d => + (screenStack = new Loader()).LoadAsync(this, d => { screenStack.ModePushed += screenAdded; screenStack.Exited += screenRemoved; @@ -124,22 +124,22 @@ namespace osu.Game }); //overlay elements - (chat = new ChatOverlay { Depth = 0 }).Preload(this, overlayContent.Add); - (options = new OptionsOverlay { Depth = -1 }).Preload(this, overlayContent.Add); + (chat = new ChatOverlay { Depth = 0 }).LoadAsync(this, overlayContent.Add); + (options = new OptionsOverlay { Depth = -1 }).LoadAsync(this, overlayContent.Add); (musicController = new MusicController() { Depth = -2, Position = new Vector2(0, Toolbar.HEIGHT), Anchor = Anchor.TopRight, Origin = Anchor.TopRight, - }).Preload(this, overlayContent.Add); + }).LoadAsync(this, overlayContent.Add); (notificationManager = new NotificationManager { Depth = -2, Anchor = Anchor.TopRight, Origin = Anchor.TopRight, - }).Preload(this, overlayContent.Add); + }).LoadAsync(this, overlayContent.Add); Logger.NewEntry += entry => { @@ -160,7 +160,7 @@ namespace osu.Game Depth = -3, OnHome = delegate { intro?.ChildScreen?.MakeCurrent(); }, OnPlayModeChange = delegate (PlayMode m) { PlayMode.Value = m; }, - }).Preload(this, t => + }).LoadAsync(this, t => { PlayMode.ValueChanged += delegate { Toolbar.SetGameMode(PlayMode.Value); }; PlayMode.TriggerChange(); diff --git a/osu.Game/Overlays/MusicController.cs b/osu.Game/Overlays/MusicController.cs index 03575a10f0..880f8a0425 100644 --- a/osu.Game/Overlays/MusicController.cs +++ b/osu.Game/Overlays/MusicController.cs @@ -322,10 +322,10 @@ namespace osu.Game.Overlays updateDisplay(current, isNext ? TransformDirection.Next : TransformDirection.Prev); } - protected override void PerformLoad(Framework.Game game) + protected override void Load(Framework.Game game) { this.game = game; - base.PerformLoad(game); + base.Load(game); } Action pendingBeatmapSwitch; @@ -349,7 +349,7 @@ namespace osu.Game.Overlays MusicControllerBackground newBackground; - (newBackground = new MusicControllerBackground(beatmap)).Preload(game, delegate + (newBackground = new MusicControllerBackground(beatmap)).LoadAsync(game, delegate { dragContainer.Add(newBackground); diff --git a/osu.Game/Overlays/Toolbar/ToolbarUserButton.cs b/osu.Game/Overlays/Toolbar/ToolbarUserButton.cs index 921c2d26df..f624a0977a 100644 --- a/osu.Game/Overlays/Toolbar/ToolbarUserButton.cs +++ b/osu.Game/Overlays/Toolbar/ToolbarUserButton.cs @@ -102,7 +102,7 @@ namespace osu.Game.Overlays.Toolbar newSprite.FillMode = FillMode.Fit; - newSprite.Preload(game, s => + newSprite.LoadAsync(game, s => { Sprite?.FadeOut(); Sprite?.Expire(); diff --git a/osu.Game/Screens/BackgroundScreen.cs b/osu.Game/Screens/BackgroundScreen.cs index 5b79158946..77d9f3bb71 100644 --- a/osu.Game/Screens/BackgroundScreen.cs +++ b/osu.Game/Screens/BackgroundScreen.cs @@ -43,7 +43,7 @@ namespace osu.Game.Screens // once it's done. if (screen.LoadState == LoadState.NotLoaded) { - screen.Preload(game, d => Push((BackgroundScreen)d)); + screen.LoadAsync(game, d => Push((BackgroundScreen)d)); return true; } diff --git a/osu.Game/Screens/Backgrounds/BackgroundScreenBeatmap.cs b/osu.Game/Screens/Backgrounds/BackgroundScreenBeatmap.cs index f0c5c47797..2856d52113 100644 --- a/osu.Game/Screens/Backgrounds/BackgroundScreenBeatmap.cs +++ b/osu.Game/Screens/Backgrounds/BackgroundScreenBeatmap.cs @@ -36,7 +36,7 @@ namespace osu.Game.Screens.Backgrounds else newBackground = new BeatmapBackground(beatmap); - newBackground.Preload(Game, delegate + newBackground.LoadAsync(Game, delegate { float newDepth = 0; if (background != null) diff --git a/osu.Game/Screens/Loader.cs b/osu.Game/Screens/Loader.cs index 33094b7098..a3c7be8453 100644 --- a/osu.Game/Screens/Loader.cs +++ b/osu.Game/Screens/Loader.cs @@ -20,9 +20,9 @@ namespace osu.Game.Screens private void load(OsuGame game) { if (game.IsDeployedBuild) - new Disclaimer().Preload(game, d => Push((Screen)d)); + new Disclaimer().LoadAsync(game, d => Push((Screen)d)); else - new Intro().Preload(game, d => Push((Screen)d)); + new Intro().LoadAsync(game, d => Push((Screen)d)); } } } diff --git a/osu.Game/Screens/Menu/Disclaimer.cs b/osu.Game/Screens/Menu/Disclaimer.cs index c5c00d5037..148492d947 100644 --- a/osu.Game/Screens/Menu/Disclaimer.cs +++ b/osu.Game/Screens/Menu/Disclaimer.cs @@ -93,7 +93,7 @@ namespace osu.Game.Screens.Menu [BackgroundDependencyLoader] private void load(OsuGame game, OsuColour colours) { - (intro = new Intro()).Preload(game); + (intro = new Intro()).LoadAsync(game); iconColour = colours.Yellow; } diff --git a/osu.Game/Screens/Menu/Intro.cs b/osu.Game/Screens/Menu/Intro.cs index c69dfff7db..6d513c1286 100644 --- a/osu.Game/Screens/Menu/Intro.cs +++ b/osu.Game/Screens/Menu/Intro.cs @@ -77,7 +77,7 @@ namespace osu.Game.Screens.Menu { bgm.Start(); - (mainMenu = new MainMenu()).Preload(Game); + (mainMenu = new MainMenu()).LoadAsync(Game); Scheduler.AddDelayed(delegate { diff --git a/osu.Game/Screens/Menu/MainMenu.cs b/osu.Game/Screens/Menu/MainMenu.cs index 1a6310ea4e..c0ccbd044e 100644 --- a/osu.Game/Screens/Menu/MainMenu.cs +++ b/osu.Game/Screens/Menu/MainMenu.cs @@ -56,7 +56,7 @@ namespace osu.Game.Screens.Menu [BackgroundDependencyLoader] private void load(OsuGame game) { - background.Preload(game); + background.LoadAsync(game); buttons.OnSettings = game.ToggleOptions; } diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index 2359dcdcfa..ceb8af1ff4 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -229,7 +229,7 @@ namespace osu.Game.Screens.Play var newPlayer = new Player(); - newPlayer.Preload(Game, delegate + newPlayer.LoadAsync(Game, delegate { newPlayer.RestartCount = RestartCount + 1; ValidForResume = false; diff --git a/osu.Game/Screens/Play/PlayerLoader.cs b/osu.Game/Screens/Play/PlayerLoader.cs index 294eecd5fa..d71cb3f0a3 100644 --- a/osu.Game/Screens/Play/PlayerLoader.cs +++ b/osu.Game/Screens/Play/PlayerLoader.cs @@ -57,7 +57,7 @@ namespace osu.Game.Screens.Play Origin = Anchor.Centre, }); - player.Preload(Game); + player.LoadAsync(Game); } protected override void OnEntering(Screen last) diff --git a/osu.Game/Screens/Select/BeatmapInfoWedge.cs b/osu.Game/Screens/Select/BeatmapInfoWedge.cs index eb93b4ac1a..d5df0053e9 100644 --- a/osu.Game/Screens/Select/BeatmapInfoWedge.cs +++ b/osu.Game/Screens/Select/BeatmapInfoWedge.cs @@ -179,7 +179,7 @@ namespace osu.Game.Screens.Select } }, } - }).Preload(game, delegate (Drawable d) + }).LoadAsync(game, delegate (Drawable d) { FadeIn(250); diff --git a/osu.Game/Screens/Select/PlaySongSelect.cs b/osu.Game/Screens/Select/PlaySongSelect.cs index 83c4a97e6a..45c9ee7be3 100644 --- a/osu.Game/Screens/Select/PlaySongSelect.cs +++ b/osu.Game/Screens/Select/PlaySongSelect.cs @@ -122,7 +122,7 @@ namespace osu.Game.Screens.Select { BeatmapInfo = carousel.SelectedGroup.SelectedPanel.Beatmap, PreferredPlayMode = playMode.Value - })).Preload(Game, l => Push(player)); + })).LoadAsync(Game, l => Push(player)); } } }; @@ -340,7 +340,7 @@ namespace osu.Game.Screens.Select //for the time being, let's completely load the difficulty panels in the background. //this likely won't scale so well, but allows us to completely async the loading flow. - Task.WhenAll(group.BeatmapPanels.Select(panel => panel.Preload(game))).ContinueWith(task => Schedule(delegate + Task.WhenAll(group.BeatmapPanels.Select(panel => panel.LoadAsync(game))).ContinueWith(task => Schedule(delegate { beatmapGroups.Add(group);