mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 08:49:59 +09:00
Remove "current" multiplayer room item
This commit is contained in:
@ -33,6 +33,7 @@ namespace osu.Game.Screens.Multi.Match.Components
|
||||
public Action RequestBeatmapSelection;
|
||||
|
||||
private MatchBeatmapPanel beatmapPanel;
|
||||
private ModDisplay modDisplay;
|
||||
|
||||
public Header()
|
||||
{
|
||||
@ -44,7 +45,6 @@ namespace osu.Game.Screens.Multi.Match.Components
|
||||
private void load(OsuColour colours)
|
||||
{
|
||||
BeatmapSelectButton beatmapButton;
|
||||
ModDisplay modDisplay;
|
||||
|
||||
InternalChildren = new Drawable[]
|
||||
{
|
||||
@ -120,9 +120,12 @@ namespace osu.Game.Screens.Multi.Match.Components
|
||||
},
|
||||
};
|
||||
|
||||
CurrentItem.BindValueChanged(item => modDisplay.Current.Value = item.NewValue?.RequiredMods?.ToArray() ?? Array.Empty<Mod>(), true);
|
||||
|
||||
beatmapButton.Action = () => RequestBeatmapSelection?.Invoke();
|
||||
|
||||
Playlist.ItemsAdded += _ => updateMods();
|
||||
Playlist.ItemsRemoved += _ => updateMods();
|
||||
|
||||
updateMods();
|
||||
}
|
||||
|
||||
protected override void LoadComplete()
|
||||
@ -131,6 +134,13 @@ namespace osu.Game.Screens.Multi.Match.Components
|
||||
ShowBeatmapPanel.BindValueChanged(value => beatmapPanel.FadeTo(value.NewValue ? 1 : 0, 200, Easing.OutQuint), true);
|
||||
}
|
||||
|
||||
private void updateMods()
|
||||
{
|
||||
var item = Playlist.FirstOrDefault();
|
||||
|
||||
modDisplay.Current.Value = item?.RequiredMods?.ToArray() ?? Array.Empty<Mod>();
|
||||
}
|
||||
|
||||
private class BeatmapSelectButton : HeaderButton
|
||||
{
|
||||
[Resolved(typeof(Room), nameof(Room.RoomID))]
|
||||
|
Reference in New Issue
Block a user