mirror of
https://github.com/ppy/osu.git
synced 2025-03-24 19:17:20 +08:00
Rename Room{Status -> Mode}Filter
I need the "status" term free for an upcoming change. And web calls this
parameter "mode" as well:
642e973f91/app/Models/Multiplayer/Room.php (L184-L199)
so it works in my head.
This commit is contained in:
parent
197d553238
commit
637fe07b31
@ -11,12 +11,12 @@ namespace osu.Game.Online.Rooms
|
||||
{
|
||||
public class GetRoomsRequest : APIRequest<List<Room>>
|
||||
{
|
||||
private readonly RoomStatusFilter status;
|
||||
private readonly RoomModeFilter mode;
|
||||
private readonly string category;
|
||||
|
||||
public GetRoomsRequest(RoomStatusFilter status, string category)
|
||||
public GetRoomsRequest(RoomModeFilter mode, string category)
|
||||
{
|
||||
this.status = status;
|
||||
this.mode = mode;
|
||||
this.category = category;
|
||||
}
|
||||
|
||||
@ -24,8 +24,8 @@ namespace osu.Game.Online.Rooms
|
||||
{
|
||||
var req = base.CreateWebRequest();
|
||||
|
||||
if (status != RoomStatusFilter.Open)
|
||||
req.AddParameter("mode", status.ToString().ToSnakeCase().ToLowerInvariant());
|
||||
if (mode != RoomModeFilter.Open)
|
||||
req.AddParameter("mode", mode.ToString().ToSnakeCase().ToLowerInvariant());
|
||||
|
||||
if (!string.IsNullOrEmpty(category))
|
||||
req.AddParameter("category", category);
|
||||
|
@ -47,7 +47,7 @@ namespace osu.Game.Screens.OnlinePlay.Components
|
||||
|
||||
lastPollRequest?.Cancel();
|
||||
|
||||
var req = new GetRoomsRequest(Filter.Value.Status, Filter.Value.Category);
|
||||
var req = new GetRoomsRequest(Filter.Value.Mode, Filter.Value.Category);
|
||||
|
||||
req.Success += result =>
|
||||
{
|
||||
|
@ -8,7 +8,7 @@ namespace osu.Game.Screens.OnlinePlay.Lounge.Components
|
||||
public class FilterCriteria
|
||||
{
|
||||
public string SearchString = string.Empty;
|
||||
public RoomStatusFilter Status;
|
||||
public RoomModeFilter Mode;
|
||||
public string Category = string.Empty;
|
||||
public RulesetInfo? Ruleset;
|
||||
public RoomPermissionsFilter Permissions;
|
||||
|
@ -5,7 +5,7 @@ using System.ComponentModel;
|
||||
|
||||
namespace osu.Game.Screens.OnlinePlay.Lounge.Components
|
||||
{
|
||||
public enum RoomStatusFilter
|
||||
public enum RoomModeFilter
|
||||
{
|
||||
Open,
|
||||
|
@ -83,7 +83,7 @@ namespace osu.Game.Screens.OnlinePlay.Lounge
|
||||
private LoadingLayer loadingLayer = null!;
|
||||
private RoomsContainer roomsContainer = null!;
|
||||
private SearchTextBox searchTextBox = null!;
|
||||
private Dropdown<RoomStatusFilter> statusDropdown = null!;
|
||||
private Dropdown<RoomModeFilter> statusDropdown = null!;
|
||||
|
||||
[BackgroundDependencyLoader(true)]
|
||||
private void load()
|
||||
@ -223,12 +223,12 @@ namespace osu.Game.Screens.OnlinePlay.Lounge
|
||||
{
|
||||
SearchString = searchTextBox.Current.Value,
|
||||
Ruleset = ruleset.Value,
|
||||
Status = statusDropdown.Current.Value
|
||||
Mode = statusDropdown.Current.Value
|
||||
};
|
||||
|
||||
protected virtual IEnumerable<Drawable> CreateFilterControls()
|
||||
{
|
||||
statusDropdown = new SlimEnumDropdown<RoomStatusFilter>
|
||||
statusDropdown = new SlimEnumDropdown<RoomModeFilter>
|
||||
{
|
||||
RelativeSizeAxes = Axes.None,
|
||||
Width = 160,
|
||||
|
Loading…
x
Reference in New Issue
Block a user