mirror of
https://github.com/ppy/osu.git
synced 2025-01-14 20:03:21 +08:00
add locked room filter
This commit is contained in:
parent
97fcf8cec9
commit
bf5a7e3f2a
@ -13,5 +13,6 @@ namespace osu.Game.Screens.OnlinePlay.Lounge.Components
|
||||
public RoomStatusFilter Status;
|
||||
public string Category;
|
||||
public RulesetInfo Ruleset;
|
||||
public bool Locked = true;
|
||||
}
|
||||
}
|
||||
|
@ -87,6 +87,8 @@ namespace osu.Game.Screens.OnlinePlay.Lounge.Components
|
||||
matchingFilter &= r.FilterTerms.Any(term => term.ToString().Contains(criteria.SearchString, StringComparison.InvariantCultureIgnoreCase));
|
||||
}
|
||||
|
||||
matchingFilter &= criteria.Locked || !r.Room.HasPassword.Value;
|
||||
|
||||
r.MatchingFilter = matchingFilter;
|
||||
}
|
||||
});
|
||||
|
@ -85,6 +85,7 @@ namespace osu.Game.Screens.OnlinePlay.Lounge
|
||||
private RoomsContainer roomsContainer;
|
||||
private SearchTextBox searchTextBox;
|
||||
private Dropdown<RoomStatusFilter> statusDropdown;
|
||||
private Checkbox lockedCheckbox;
|
||||
|
||||
[BackgroundDependencyLoader(true)]
|
||||
private void load([CanBeNull] IdleTracker idleTracker)
|
||||
@ -224,9 +225,12 @@ namespace osu.Game.Screens.OnlinePlay.Lounge
|
||||
{
|
||||
SearchString = searchTextBox.Current.Value,
|
||||
Ruleset = ruleset.Value,
|
||||
Status = statusDropdown.Current.Value
|
||||
Status = statusDropdown.Current.Value,
|
||||
Locked = lockedCheckbox.Current.Value,
|
||||
};
|
||||
|
||||
#endregion
|
||||
|
||||
protected virtual IEnumerable<Drawable> CreateFilterControls()
|
||||
{
|
||||
statusDropdown = new SlimEnumDropdown<RoomStatusFilter>
|
||||
@ -237,10 +241,17 @@ namespace osu.Game.Screens.OnlinePlay.Lounge
|
||||
|
||||
statusDropdown.Current.BindValueChanged(_ => UpdateFilter());
|
||||
|
||||
yield return statusDropdown;
|
||||
}
|
||||
lockedCheckbox = new OsuTabControlCheckbox
|
||||
{
|
||||
Current = new Bindable<bool>(true),
|
||||
RelativeSizeAxes = Axes.None,
|
||||
Text = @"Show Locked",
|
||||
};
|
||||
|
||||
#endregion
|
||||
lockedCheckbox.Current.BindValueChanged(_ => UpdateFilter());
|
||||
|
||||
return new Drawable[] { lockedCheckbox, statusDropdown, };
|
||||
}
|
||||
|
||||
public override void OnEntering(ScreenTransitionEvent e)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user