1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 10:12:54 +08:00

Implement primary filter routes

This commit is contained in:
smoogipoo 2018-12-20 15:16:46 +09:00
parent 36f6b4fc3f
commit 03546c9d0d
2 changed files with 23 additions and 9 deletions

View File

@ -11,7 +11,7 @@ namespace osu.Game.Screens.Multi.Lounge.Components
public class FilterControl : SearchableListFilterControl<PrimaryFilter, SecondaryFilter>
{
protected override Color4 BackgroundColour => OsuColour.FromHex(@"362e42");
protected override PrimaryFilter DefaultTab => PrimaryFilter.Current;
protected override PrimaryFilter DefaultTab => PrimaryFilter.Open;
public FilterControl()
{
@ -28,10 +28,11 @@ namespace osu.Game.Screens.Multi.Lounge.Components
public enum PrimaryFilter
{
Current,
Open,
[Description("Recently Ended")]
RecentlyEnded,
Participated,
Owned,
}
public enum SecondaryFilter

View File

@ -150,17 +150,30 @@ namespace osu.Game.Screens.Multi
this.primaryFilter = primaryFilter;
}
protected override WebRequest CreateWebRequest()
protected override string Target
{
var req = base.CreateWebRequest();
get
{
string target = "rooms";
if (primaryFilter == PrimaryFilter.Participated)
req.AddParameter("participated", "1");
switch (primaryFilter)
{
case PrimaryFilter.Open:
break;
case PrimaryFilter.Owned:
target += "/owned";
break;
case PrimaryFilter.Participated:
target += "/participated";
break;
case PrimaryFilter.RecentlyEnded:
target += "/ended";
break;
}
return req;
return target;
}
}
protected override string Target => "rooms";
}
}
}