mirror of
https://github.com/ppy/osu.git
synced 2025-01-15 15:12:57 +08:00
Rename lots of weird variables
This commit is contained in:
parent
f3a6e646a6
commit
e4ebab92c6
@ -21,6 +21,7 @@ namespace osu.Game.Screens.Play
|
|||||||
public class FailOverlay : GameplayMenuOverlay
|
public class FailOverlay : GameplayMenuOverlay
|
||||||
{
|
{
|
||||||
public Func<Task<ScoreInfo>> SaveReplay;
|
public Func<Task<ScoreInfo>> SaveReplay;
|
||||||
|
|
||||||
public override string Header => "failed";
|
public override string Header => "failed";
|
||||||
public override string Description => "you're dead, try again?";
|
public override string Description => "you're dead, try again?";
|
||||||
|
|
||||||
|
@ -20,8 +20,8 @@ namespace osu.Game.Screens.Play
|
|||||||
{
|
{
|
||||||
public class SaveFailedScoreButton : CompositeDrawable
|
public class SaveFailedScoreButton : CompositeDrawable
|
||||||
{
|
{
|
||||||
public Func<Task<ScoreInfo>> SaveReplay;
|
public Func<Task<ScoreInfo>> ImportFailedScore;
|
||||||
private Task<ScoreInfo> saveReplayAsync;
|
private Task<ScoreInfo> saveFailedScoreTask;
|
||||||
private ScoreInfo score;
|
private ScoreInfo score;
|
||||||
|
|
||||||
private ScheduledDelegate saveScoreDelegate;
|
private ScheduledDelegate saveScoreDelegate;
|
||||||
@ -31,10 +31,10 @@ namespace osu.Game.Screens.Play
|
|||||||
private DownloadButton button;
|
private DownloadButton button;
|
||||||
private ShakeContainer shakeContainer;
|
private ShakeContainer shakeContainer;
|
||||||
|
|
||||||
public SaveFailedScoreButton(Func<Task<ScoreInfo>> sr)
|
public SaveFailedScoreButton(Func<Task<ScoreInfo>> requestImportFailedScore)
|
||||||
{
|
{
|
||||||
Size = new Vector2(50, 30);
|
Size = new Vector2(50, 30);
|
||||||
SaveReplay = sr;
|
ImportFailedScore = requestImportFailedScore;
|
||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader(true)]
|
[BackgroundDependencyLoader(true)]
|
||||||
@ -89,17 +89,18 @@ namespace osu.Game.Screens.Play
|
|||||||
private void saveScore()
|
private void saveScore()
|
||||||
{
|
{
|
||||||
State.Value = ImportState.Importing;
|
State.Value = ImportState.Importing;
|
||||||
saveReplayAsync = Task.Run(SaveReplay);
|
|
||||||
|
saveFailedScoreTask = Task.Run(ImportFailedScore);
|
||||||
|
|
||||||
saveScoreDelegate = new ScheduledDelegate(() =>
|
saveScoreDelegate = new ScheduledDelegate(() =>
|
||||||
{
|
{
|
||||||
if (saveReplayAsync?.IsCompleted != true)
|
if (saveFailedScoreTask?.IsCompleted != true)
|
||||||
// If the asynchronous preparation has not completed, keep repeating this delegate.
|
// If the asynchronous preparation has not completed, keep repeating this delegate.
|
||||||
return;
|
return;
|
||||||
|
|
||||||
saveScoreDelegate?.Cancel();
|
saveScoreDelegate?.Cancel();
|
||||||
|
|
||||||
score = saveReplayAsync.GetAwaiter().GetResult();
|
score = saveFailedScoreTask.GetAwaiter().GetResult();
|
||||||
|
|
||||||
State.Value = score != null ? ImportState.Imported : ImportState.Failed;
|
State.Value = score != null ? ImportState.Imported : ImportState.Failed;
|
||||||
}, Time.Current, 50);
|
}, Time.Current, 50);
|
||||||
|
Loading…
Reference in New Issue
Block a user