mirror of
https://github.com/ppy/osu.git
synced 2025-02-21 18:42:56 +08:00
Merge pull request #31940 from bdach/notify-discussion-replies
Send "notify on discussion replies" setting value in beatmap creation request
This commit is contained in:
commit
a971013d19
@ -11,6 +11,7 @@ using osu.Framework.IO.Network;
|
||||
using osu.Framework.Localisation;
|
||||
using osu.Game.Localisation;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Screens.Edit.Submission;
|
||||
|
||||
namespace osu.Game.Online.API.Requests
|
||||
{
|
||||
@ -42,22 +43,27 @@ namespace osu.Game.Online.API.Requests
|
||||
[JsonProperty("target")]
|
||||
public BeatmapSubmissionTarget SubmissionTarget { get; init; }
|
||||
|
||||
[JsonProperty("notify_on_discussion_replies")]
|
||||
public bool NotifyOnDiscussionReplies { get; init; }
|
||||
|
||||
private PutBeatmapSetRequest()
|
||||
{
|
||||
}
|
||||
|
||||
public static PutBeatmapSetRequest CreateNew(uint beatmapCount, BeatmapSubmissionTarget target) => new PutBeatmapSetRequest
|
||||
public static PutBeatmapSetRequest CreateNew(uint beatmapCount, BeatmapSubmissionSettings settings) => new PutBeatmapSetRequest
|
||||
{
|
||||
BeatmapsToCreate = beatmapCount,
|
||||
SubmissionTarget = target,
|
||||
SubmissionTarget = settings.Target.Value,
|
||||
NotifyOnDiscussionReplies = settings.NotifyOnDiscussionReplies.Value,
|
||||
};
|
||||
|
||||
public static PutBeatmapSetRequest UpdateExisting(uint beatmapSetId, IEnumerable<uint> beatmapsToKeep, uint beatmapsToCreate, BeatmapSubmissionTarget target) => new PutBeatmapSetRequest
|
||||
public static PutBeatmapSetRequest UpdateExisting(uint beatmapSetId, IEnumerable<uint> beatmapsToKeep, uint beatmapsToCreate, BeatmapSubmissionSettings settings) => new PutBeatmapSetRequest
|
||||
{
|
||||
BeatmapSetID = beatmapSetId,
|
||||
BeatmapsToKeep = beatmapsToKeep.ToArray(),
|
||||
BeatmapsToCreate = beatmapsToCreate,
|
||||
SubmissionTarget = target,
|
||||
SubmissionTarget = settings.Target.Value,
|
||||
NotifyOnDiscussionReplies = settings.NotifyOnDiscussionReplies.Value,
|
||||
};
|
||||
|
||||
protected override WebRequest CreateWebRequest()
|
||||
|
@ -13,6 +13,7 @@ namespace osu.Game.Online
|
||||
SpectatorUrl = "https://spectator.ppy.sh/spectator";
|
||||
MultiplayerUrl = "https://spectator.ppy.sh/multiplayer";
|
||||
MetadataUrl = "https://spectator.ppy.sh/metadata";
|
||||
BeatmapSubmissionServiceUrl = "https://bss.ppy.sh";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -192,8 +192,8 @@ namespace osu.Game.Screens.Edit.Submission
|
||||
(uint)Beatmap.Value.BeatmapSetInfo.OnlineID,
|
||||
Beatmap.Value.BeatmapSetInfo.Beatmaps.Where(b => b.OnlineID > 0).Select(b => (uint)b.OnlineID).ToArray(),
|
||||
(uint)Beatmap.Value.BeatmapSetInfo.Beatmaps.Count(b => b.OnlineID <= 0),
|
||||
settings.Target.Value)
|
||||
: PutBeatmapSetRequest.CreateNew((uint)Beatmap.Value.BeatmapSetInfo.Beatmaps.Count, settings.Target.Value);
|
||||
settings)
|
||||
: PutBeatmapSetRequest.CreateNew((uint)Beatmap.Value.BeatmapSetInfo.Beatmaps.Count, settings);
|
||||
|
||||
createRequest.Success += async response =>
|
||||
{
|
||||
|
@ -9,5 +9,7 @@ namespace osu.Game.Screens.Edit.Submission
|
||||
public class BeatmapSubmissionSettings
|
||||
{
|
||||
public Bindable<BeatmapSubmissionTarget> Target { get; } = new Bindable<BeatmapSubmissionTarget>();
|
||||
|
||||
public Bindable<bool> NotifyOnDiscussionReplies { get; } = new Bindable<bool>();
|
||||
}
|
||||
}
|
||||
|
@ -28,7 +28,7 @@ namespace osu.Game.Screens.Edit.Submission
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuConfigManager configManager, OsuColour colours, BeatmapSubmissionSettings settings)
|
||||
{
|
||||
configManager.BindWith(OsuSetting.EditorSubmissionNotifyOnDiscussionReplies, notifyOnDiscussionReplies);
|
||||
configManager.BindWith(OsuSetting.EditorSubmissionNotifyOnDiscussionReplies, settings.NotifyOnDiscussionReplies);
|
||||
configManager.BindWith(OsuSetting.EditorSubmissionLoadInBrowserAfterSubmission, loadInBrowserAfterSubmission);
|
||||
|
||||
Content.Add(new FillFlowContainer
|
||||
@ -47,7 +47,7 @@ namespace osu.Game.Screens.Edit.Submission
|
||||
new FormCheckBox
|
||||
{
|
||||
Caption = BeatmapSubmissionStrings.NotifyOnDiscussionReplies,
|
||||
Current = notifyOnDiscussionReplies,
|
||||
Current = settings.NotifyOnDiscussionReplies,
|
||||
},
|
||||
new FormCheckBox
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user