mirror of
https://github.com/ppy/osu.git
synced 2025-01-15 13:33:03 +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 RoomStatusFilter Status;
|
||||||
public string Category;
|
public string Category;
|
||||||
public RulesetInfo Ruleset;
|
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 &= r.FilterTerms.Any(term => term.ToString().Contains(criteria.SearchString, StringComparison.InvariantCultureIgnoreCase));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
matchingFilter &= criteria.Locked || !r.Room.HasPassword.Value;
|
||||||
|
|
||||||
r.MatchingFilter = matchingFilter;
|
r.MatchingFilter = matchingFilter;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -85,6 +85,7 @@ namespace osu.Game.Screens.OnlinePlay.Lounge
|
|||||||
private RoomsContainer roomsContainer;
|
private RoomsContainer roomsContainer;
|
||||||
private SearchTextBox searchTextBox;
|
private SearchTextBox searchTextBox;
|
||||||
private Dropdown<RoomStatusFilter> statusDropdown;
|
private Dropdown<RoomStatusFilter> statusDropdown;
|
||||||
|
private Checkbox lockedCheckbox;
|
||||||
|
|
||||||
[BackgroundDependencyLoader(true)]
|
[BackgroundDependencyLoader(true)]
|
||||||
private void load([CanBeNull] IdleTracker idleTracker)
|
private void load([CanBeNull] IdleTracker idleTracker)
|
||||||
@ -224,9 +225,12 @@ namespace osu.Game.Screens.OnlinePlay.Lounge
|
|||||||
{
|
{
|
||||||
SearchString = searchTextBox.Current.Value,
|
SearchString = searchTextBox.Current.Value,
|
||||||
Ruleset = ruleset.Value,
|
Ruleset = ruleset.Value,
|
||||||
Status = statusDropdown.Current.Value
|
Status = statusDropdown.Current.Value,
|
||||||
|
Locked = lockedCheckbox.Current.Value,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
protected virtual IEnumerable<Drawable> CreateFilterControls()
|
protected virtual IEnumerable<Drawable> CreateFilterControls()
|
||||||
{
|
{
|
||||||
statusDropdown = new SlimEnumDropdown<RoomStatusFilter>
|
statusDropdown = new SlimEnumDropdown<RoomStatusFilter>
|
||||||
@ -237,10 +241,17 @@ namespace osu.Game.Screens.OnlinePlay.Lounge
|
|||||||
|
|
||||||
statusDropdown.Current.BindValueChanged(_ => UpdateFilter());
|
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)
|
public override void OnEntering(ScreenTransitionEvent e)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user