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:
parent
36f6b4fc3f
commit
03546c9d0d
@ -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
|
||||
|
@ -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";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user