mirror of
https://github.com/ppy/osu.git
synced 2024-12-13 03:42:57 +08:00
Store last set score to a SessionStatic
This commit is contained in:
parent
c2d60006cb
commit
d4423d4933
@ -9,6 +9,7 @@ using osu.Game.Input;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Overlays;
|
||||
using osu.Game.Overlays.Mods;
|
||||
using osu.Game.Scoring;
|
||||
|
||||
namespace osu.Game.Configuration
|
||||
{
|
||||
@ -27,6 +28,7 @@ namespace osu.Game.Configuration
|
||||
SetDefault(Static.LastModSelectPanelSamplePlaybackTime, (double?)null);
|
||||
SetDefault<APISeasonalBackgrounds>(Static.SeasonalBackgrounds, null);
|
||||
SetDefault(Static.TouchInputActive, RuntimeInfo.IsMobile);
|
||||
SetDefault<ScoreInfo>(Static.LastLocalUserScore, null);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -73,5 +75,10 @@ namespace osu.Game.Configuration
|
||||
/// Used in touchscreen detection scenarios (<see cref="TouchInputInterceptor"/>).
|
||||
/// </summary>
|
||||
TouchInputActive,
|
||||
|
||||
/// <summary>
|
||||
/// Stores the local user's last score (can be completed or aborted).
|
||||
/// </summary>
|
||||
LastLocalUserScore,
|
||||
}
|
||||
}
|
||||
|
@ -207,6 +207,7 @@ namespace osu.Game.Scoring
|
||||
|
||||
clone.Statistics = new Dictionary<HitResult, int>(clone.Statistics);
|
||||
clone.MaximumStatistics = new Dictionary<HitResult, int>(clone.MaximumStatistics);
|
||||
clone.HitEvents = new List<HitEvent>(clone.HitEvents);
|
||||
|
||||
// Ensure we have fresh mods to avoid any references (ie. after gameplay).
|
||||
clone.clearAllMods();
|
||||
|
@ -11,6 +11,7 @@ using osu.Framework.Allocation;
|
||||
using osu.Framework.Logging;
|
||||
using osu.Framework.Screens;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Configuration;
|
||||
using osu.Game.Database;
|
||||
using osu.Game.Online.API;
|
||||
using osu.Game.Online.Multiplayer;
|
||||
@ -37,6 +38,9 @@ namespace osu.Game.Screens.Play
|
||||
[Resolved]
|
||||
private SpectatorClient spectatorClient { get; set; }
|
||||
|
||||
[Resolved]
|
||||
private SessionStatics statics { get; set; }
|
||||
|
||||
private TaskCompletionSource<bool> scoreSubmissionSource;
|
||||
|
||||
protected SubmittingPlayer(PlayerConfiguration configuration = null)
|
||||
@ -176,6 +180,7 @@ namespace osu.Game.Screens.Play
|
||||
{
|
||||
bool exiting = base.OnExiting(e);
|
||||
submitFromFailOrQuit();
|
||||
statics.SetValue(Static.LastLocalUserScore, Score.ScoreInfo.DeepClone());
|
||||
return exiting;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user