diff --git a/osu-framework b/osu-framework index 00027168fe..943410e228 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 00027168fef083a14e24c076a61f1073dccb34b2 +Subproject commit 943410e228f704252a803cee75532434c6b5be72 diff --git a/osu.Desktop.VisualTests/VisualTestGame.cs b/osu.Desktop.VisualTests/VisualTestGame.cs index db6e43a138..3128824da2 100644 --- a/osu.Desktop.VisualTests/VisualTestGame.cs +++ b/osu.Desktop.VisualTests/VisualTestGame.cs @@ -13,7 +13,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 1343290a81..33de58be3c 100644 --- a/osu.Desktop/OsuGameDesktop.cs +++ b/osu.Desktop/OsuGameDesktop.cs @@ -29,7 +29,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 9da79273d3..bdc8bc7e1a 100644 --- a/osu.Desktop/Overlays/VersionManager.cs +++ b/osu.Desktop/Overlays/VersionManager.cs @@ -102,7 +102,7 @@ namespace osu.Desktop.Overlays }; if (IsDeployedBuild) - updateChecker(); + checkForUpdateAsync(); } protected override void LoadComplete() @@ -117,7 +117,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; @@ -163,7 +163,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; } } @@ -178,7 +178,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 b833ff6b47..ce702e5679 100644 --- a/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs +++ b/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs @@ -56,7 +56,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 74f63443f4..8681259272 100644 --- a/osu.Game/Beatmaps/Drawables/BeatmapSetHeader.cs +++ b/osu.Game/Beatmaps/Drawables/BeatmapSetHeader.cs @@ -161,7 +161,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/Beatmaps/Timing/TimingChange.cs b/osu.Game/Beatmaps/Timing/TimingChange.cs index 10a68bb540..74e855e157 100644 --- a/osu.Game/Beatmaps/Timing/TimingChange.cs +++ b/osu.Game/Beatmaps/Timing/TimingChange.cs @@ -5,8 +5,6 @@ namespace osu.Game.Beatmaps.Timing { class TimingChange : ControlPoint { - public double BeatLength; - public TimingChange(double beatLength) { BeatLength = beatLength; diff --git a/osu.Game/Graphics/UserInterface/BackButton.cs b/osu.Game/Graphics/UserInterface/BackButton.cs index ca69bdc1f6..2b4b9cdb04 100644 --- a/osu.Game/Graphics/UserInterface/BackButton.cs +++ b/osu.Game/Graphics/UserInterface/BackButton.cs @@ -21,7 +21,7 @@ namespace osu.Game.Graphics.UserInterface private void load(AudioManager audio, OsuColour colours) { ActivationSound = audio.Sample.Get(@"Menu/menuback"); - Colour = colours.Pink; + BackgroundColour = colours.Pink; HoverColour = colours.PinkDark; } } diff --git a/osu.Game/Graphics/UserInterface/TwoLayerButton.cs b/osu.Game/Graphics/UserInterface/TwoLayerButton.cs index 294d8533e4..cae2431898 100644 --- a/osu.Game/Graphics/UserInterface/TwoLayerButton.cs +++ b/osu.Game/Graphics/UserInterface/TwoLayerButton.cs @@ -35,7 +35,7 @@ namespace osu.Game.Graphics.UserInterface private Container c1; private Container c2; - public Color4 Colour + public Color4 BackgroundColour { set { 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 efb2d2d965..1f087ac4a6 100644 --- a/osu.Game/Overlays/MusicController.cs +++ b/osu.Game/Overlays/MusicController.cs @@ -320,10 +320,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; @@ -347,7 +347,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..e3f20d26a4 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(); @@ -120,7 +120,6 @@ namespace osu.Game.Overlays.Toolbar public class OnlineSprite : Sprite { private readonly string url; - private readonly int userId; public OnlineSprite(string url) { diff --git a/osu.Game/Screens/BackgroundScreen.cs b/osu.Game/Screens/BackgroundScreen.cs index 288cade481..fb934551e1 100644 --- a/osu.Game/Screens/BackgroundScreen.cs +++ b/osu.Game/Screens/BackgroundScreen.cs @@ -42,7 +42,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 02d004b264..56074dbdfd 100644 --- a/osu.Game/Screens/Menu/Disclaimer.cs +++ b/osu.Game/Screens/Menu/Disclaimer.cs @@ -88,7 +88,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 98217cd1cc..b106ea60c6 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -228,7 +228,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 13520f5215..f14ae65f68 100644 --- a/osu.Game/Screens/Play/PlayerLoader.cs +++ b/osu.Game/Screens/Play/PlayerLoader.cs @@ -51,7 +51,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/Play/SkipButton.cs b/osu.Game/Screens/Play/SkipButton.cs index fab2210757..f57bbd4cb0 100644 --- a/osu.Game/Screens/Play/SkipButton.cs +++ b/osu.Game/Screens/Play/SkipButton.cs @@ -13,8 +13,6 @@ namespace osu.Game.Screens.Play { public class SkipButton : TwoLayerButton { - private readonly double skipDestination; - public SkipButton() { Text = @"Skip"; @@ -27,7 +25,7 @@ namespace osu.Game.Screens.Play private void load(AudioManager audio, OsuColour colours) { ActivationSound = audio.Sample.Get(@"Menu/menuhit"); - Colour = colours.Yellow; + BackgroundColour = colours.Yellow; HoverColour = colours.YellowDark; } diff --git a/osu.Game/Screens/Select/BeatmapInfoWedge.cs b/osu.Game/Screens/Select/BeatmapInfoWedge.cs index 4c9eab7b75..7856d0b031 100644 --- a/osu.Game/Screens/Select/BeatmapInfoWedge.cs +++ b/osu.Game/Screens/Select/BeatmapInfoWedge.cs @@ -177,7 +177,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 bacd2e305f..bfa5697047 100644 --- a/osu.Game/Screens/Select/PlaySongSelect.cs +++ b/osu.Game/Screens/Select/PlaySongSelect.cs @@ -120,7 +120,7 @@ namespace osu.Game.Screens.Select { BeatmapInfo = carousel.SelectedGroup.SelectedPanel.Beatmap, PreferredPlayMode = playMode.Value - })).Preload(Game, l => Push(player)); + })).LoadAsync(Game, l => Push(player)); } } }; @@ -338,7 +338,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);