1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-13 16:02:58 +08:00

Add setting for queue mode

This commit is contained in:
smoogipoo 2021-10-20 14:51:59 +09:00
parent 2fd101ad50
commit ea9c070e59
4 changed files with 28 additions and 5 deletions

View File

@ -44,7 +44,7 @@ namespace osu.Game.Online.Multiplayer
public MatchType MatchType { get; set; } = MatchType.HeadToHead; public MatchType MatchType { get; set; } = MatchType.HeadToHead;
[Key(9)] [Key(9)]
public QueueingModes QueueingMode { get; set; } = QueueingModes.Host; public QueueModes QueueMode { get; set; } = QueueModes.HostPick;
public bool Equals(MultiplayerRoomSettings other) public bool Equals(MultiplayerRoomSettings other)
=> BeatmapID == other.BeatmapID => BeatmapID == other.BeatmapID
@ -56,7 +56,7 @@ namespace osu.Game.Online.Multiplayer
&& Name.Equals(other.Name, StringComparison.Ordinal) && Name.Equals(other.Name, StringComparison.Ordinal)
&& PlaylistItemId == other.PlaylistItemId && PlaylistItemId == other.PlaylistItemId
&& MatchType == other.MatchType && MatchType == other.MatchType
&& QueueingMode == other.QueueingMode; && QueueMode == other.QueueMode;
public override string ToString() => $"Name:{Name}" public override string ToString() => $"Name:{Name}"
+ $" Beatmap:{BeatmapID} ({BeatmapChecksum})" + $" Beatmap:{BeatmapID} ({BeatmapChecksum})"
@ -66,6 +66,6 @@ namespace osu.Game.Online.Multiplayer
+ $" Ruleset:{RulesetID}" + $" Ruleset:{RulesetID}"
+ $" Type:{MatchType}" + $" Type:{MatchType}"
+ $" Item:{PlaylistItemId}" + $" Item:{PlaylistItemId}"
+ $" Queue:{QueueingMode}"; + $" Queue:{QueueMode}";
} }
} }

View File

@ -3,9 +3,11 @@
namespace osu.Game.Online.Multiplayer namespace osu.Game.Online.Multiplayer
{ {
public enum QueueingModes public enum QueueModes
{ {
Host, // used for osu-web deserialization so names shouldn't be changed.
HostPick,
Karaoke, Karaoke,
} }
} }

View File

@ -7,6 +7,7 @@ using Newtonsoft.Json;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Bindables; using osu.Framework.Bindables;
using osu.Game.IO.Serialization.Converters; using osu.Game.IO.Serialization.Converters;
using osu.Game.Online.Multiplayer;
using osu.Game.Online.Rooms.RoomStatuses; using osu.Game.Online.Rooms.RoomStatuses;
using osu.Game.Users; using osu.Game.Users;
using osu.Game.Utils; using osu.Game.Utils;
@ -73,6 +74,18 @@ namespace osu.Game.Online.Rooms
set => Type.Value = value; set => Type.Value = value;
} }
[Cached]
[JsonIgnore]
public readonly Bindable<QueueModes> QueueMode = new Bindable<QueueModes>();
[JsonConverter(typeof(SnakeCaseStringEnumConverter))]
[JsonProperty("queue_mode")]
private QueueModes queueMode
{
get => QueueMode.Value;
set => QueueMode.Value = value;
}
[Cached] [Cached]
[JsonIgnore] [JsonIgnore]
public readonly Bindable<int?> MaxParticipants = new Bindable<int?>(); public readonly Bindable<int?> MaxParticipants = new Bindable<int?>();

View File

@ -59,6 +59,7 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Match
public OsuTextBox NameField, MaxParticipantsField; public OsuTextBox NameField, MaxParticipantsField;
public RoomAvailabilityPicker AvailabilityPicker; public RoomAvailabilityPicker AvailabilityPicker;
public MatchTypePicker TypePicker; public MatchTypePicker TypePicker;
public OsuEnumDropdown<QueueModes> QueueModeDropdown;
public OsuTextBox PasswordTextBox; public OsuTextBox PasswordTextBox;
public TriangleButton ApplyButton; public TriangleButton ApplyButton;
@ -190,6 +191,13 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Match
}, },
}, },
}, },
new Section("Beatmap queueing mode")
{
Child = QueueModeDropdown = new OsuEnumDropdown<QueueModes>
{
RelativeSizeAxes = Axes.X
}
}
}, },
}, },
new SectionContainer new SectionContainer