Handle bindable changes to fix new playlist creation not showing correct details

This commit is contained in:
Dean Herbert
2021-10-26 18:13:28 +09:00
parent 42d8d4fd38
commit c15bfb2cf4

View File

@ -37,6 +37,8 @@ namespace osu.Game.Screens.OnlinePlay.Playlists
private MatchLeaderboard leaderboard; private MatchLeaderboard leaderboard;
private SelectionPollingComponent selectionPollingComponent; private SelectionPollingComponent selectionPollingComponent;
private FillFlowContainer progressSection;
public PlaylistsRoomSubScreen(Room room) public PlaylistsRoomSubScreen(Room room)
: base(room, false) // Editing is temporarily not allowed. : base(room, false) // Editing is temporarily not allowed.
{ {
@ -67,6 +69,8 @@ namespace osu.Game.Screens.OnlinePlay.Playlists
Schedule(() => SelectedItem.Value = Room.Playlist.FirstOrDefault()); Schedule(() => SelectedItem.Value = Room.Playlist.FirstOrDefault());
} }
}, true); }, true);
Room.MaxAttempts.BindValueChanged(attempts => progressSection.Alpha = Room.MaxAttempts.Value != null ? 1 : 0, true);
} }
protected override Drawable CreateMainContent() => new GridContainer protected override Drawable CreateMainContent() => new GridContainer
@ -154,11 +158,11 @@ namespace osu.Game.Screens.OnlinePlay.Playlists
}, },
new Drawable[] new Drawable[]
{ {
new FillFlowContainer progressSection = new FillFlowContainer
{ {
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y, AutoSizeAxes = Axes.Y,
Alpha = Room.MaxAttempts.Value != null ? 1 : 0, Alpha = 0,
Margin = new MarginPadding { Bottom = 10 }, Margin = new MarginPadding { Bottom = 10 },
Direction = FillDirection.Vertical, Direction = FillDirection.Vertical,
Children = new Drawable[] Children = new Drawable[]