mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 11:07:52 +08:00
Merge remote-tracking branch 'upstream/master' into remove-usings
This commit is contained in:
commit
c5552dfb27
@ -1 +1 @@
|
||||
Subproject commit 00027168fef083a14e24c076a61f1073dccb34b2
|
||||
Subproject commit 943410e228f704252a803cee75532434c6b5be72
|
@ -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().
|
||||
|
@ -29,7 +29,7 @@ namespace osu.Desktop
|
||||
{
|
||||
base.LoadComplete();
|
||||
|
||||
versionManager.Preload(this);
|
||||
versionManager.LoadAsync(this);
|
||||
ModeChanged += m =>
|
||||
{
|
||||
if (!versionManager.IsAlive && m is Intro)
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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");
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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();
|
||||
|
@ -5,8 +5,6 @@ namespace osu.Game.Beatmaps.Timing
|
||||
{
|
||||
class TimingChange : ControlPoint
|
||||
{
|
||||
public double BeatLength;
|
||||
|
||||
public TimingChange(double beatLength)
|
||||
{
|
||||
BeatLength = beatLength;
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -35,7 +35,7 @@ namespace osu.Game.Graphics.UserInterface
|
||||
private Container c1;
|
||||
private Container c2;
|
||||
|
||||
public Color4 Colour
|
||||
public Color4 BackgroundColour
|
||||
{
|
||||
set
|
||||
{
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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();
|
||||
|
@ -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);
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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)
|
||||
|
@ -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));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -77,7 +77,7 @@ namespace osu.Game.Screens.Menu
|
||||
{
|
||||
bgm.Start();
|
||||
|
||||
(mainMenu = new MainMenu()).Preload(Game);
|
||||
(mainMenu = new MainMenu()).LoadAsync(Game);
|
||||
|
||||
Scheduler.AddDelayed(delegate
|
||||
{
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -51,7 +51,7 @@ namespace osu.Game.Screens.Play
|
||||
Origin = Anchor.Centre,
|
||||
});
|
||||
|
||||
player.Preload(Game);
|
||||
player.LoadAsync(Game);
|
||||
}
|
||||
|
||||
protected override void OnEntering(Screen last)
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -177,7 +177,7 @@ namespace osu.Game.Screens.Select
|
||||
}
|
||||
},
|
||||
}
|
||||
}).Preload(game, delegate (Drawable d)
|
||||
}).LoadAsync(game, delegate (Drawable d)
|
||||
{
|
||||
FadeIn(250);
|
||||
|
||||
|
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user