mirror of
https://github.com/ppy/osu.git
synced 2026-05-19 05:09:54 +08:00
Merge pull request #33665 from bdach/map-upload-status-better
Pick better initial beatmap status when submitting
This commit is contained in:
@@ -191,6 +191,13 @@ namespace osu.Game.Screens.Edit.Submission
|
||||
});
|
||||
|
||||
completedSample = audio.Samples.Get(@"UI/bss-complete");
|
||||
|
||||
if (Beatmap.Value.BeatmapSetInfo.OnlineID > 0)
|
||||
{
|
||||
var req = new GetBeatmapSetRequest(Beatmap.Value.BeatmapSetInfo.OnlineID);
|
||||
api.Queue(req);
|
||||
settings.LatestOnlineStateRequest = req;
|
||||
}
|
||||
}
|
||||
|
||||
private void createBeatmapSet()
|
||||
|
||||
@@ -8,6 +8,8 @@ namespace osu.Game.Screens.Edit.Submission
|
||||
{
|
||||
public class BeatmapSubmissionSettings
|
||||
{
|
||||
public GetBeatmapSetRequest? LatestOnlineStateRequest { get; set; }
|
||||
|
||||
public Bindable<BeatmapSubmissionTarget> Target { get; } = new Bindable<BeatmapSubmissionTarget>();
|
||||
|
||||
public Bindable<bool> NotifyOnDiscussionReplies { get; } = new Bindable<bool>();
|
||||
|
||||
@@ -1,16 +1,19 @@
|
||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using System.Diagnostics;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Localisation;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Configuration;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.Containers;
|
||||
using osu.Game.Graphics.UserInterfaceV2;
|
||||
using osu.Game.Localisation;
|
||||
using osu.Game.Online.API;
|
||||
using osu.Game.Online.API.Requests;
|
||||
using osu.Game.Overlays;
|
||||
using osuTK;
|
||||
@@ -25,8 +28,11 @@ namespace osu.Game.Screens.Edit.Submission
|
||||
|
||||
public override LocalisableString? NextStepText => BeatmapSubmissionStrings.ConfirmSubmission;
|
||||
|
||||
[Resolved]
|
||||
private BeatmapSubmissionSettings settings { get; set; } = null!;
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuConfigManager configManager, OsuColour colours, BeatmapSubmissionSettings settings)
|
||||
private void load(OsuConfigManager configManager, OsuColour colours)
|
||||
{
|
||||
configManager.BindWith(OsuSetting.EditorSubmissionNotifyOnDiscussionReplies, settings.NotifyOnDiscussionReplies);
|
||||
configManager.BindWith(OsuSetting.EditorSubmissionLoadInBrowserAfterSubmission, loadInBrowserAfterSubmission);
|
||||
@@ -63,6 +69,25 @@ namespace osu.Game.Screens.Edit.Submission
|
||||
},
|
||||
}
|
||||
});
|
||||
|
||||
switch (settings.LatestOnlineStateRequest?.CompletionState)
|
||||
{
|
||||
case APIRequestCompletionState.Completed:
|
||||
setSubmissionTargetFromLatestOnlineState();
|
||||
break;
|
||||
|
||||
case APIRequestCompletionState.Waiting:
|
||||
settings.Target.Disabled = true;
|
||||
settings.LatestOnlineStateRequest.Success += _ => setSubmissionTargetFromLatestOnlineState();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void setSubmissionTargetFromLatestOnlineState()
|
||||
{
|
||||
Debug.Assert(settings.LatestOnlineStateRequest != null);
|
||||
settings.Target.Disabled = false;
|
||||
settings.Target.Value = settings.LatestOnlineStateRequest.Response?.Status >= BeatmapOnlineStatus.Pending ? BeatmapSubmissionTarget.Pending : BeatmapSubmissionTarget.WIP;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user