Update ChannelList test scene

This commit is contained in:
Jai Sharma 2022-05-11 22:52:25 +01:00
parent db371ab068
commit c45e8f619b

View File

@ -25,7 +25,6 @@ namespace osu.Game.Tests.Visual.Online
[Cached] [Cached]
private readonly Bindable<Channel> selected = new Bindable<Channel>(); private readonly Bindable<Channel> selected = new Bindable<Channel>();
private OsuSpriteText selectorText;
private OsuSpriteText selectedText; private OsuSpriteText selectedText;
private OsuSpriteText leaveText; private OsuSpriteText leaveText;
private ChannelList channelList; private ChannelList channelList;
@ -43,21 +42,12 @@ namespace osu.Game.Tests.Visual.Online
Height = 0.7f, Height = 0.7f,
RowDimensions = new[] RowDimensions = new[]
{ {
new Dimension(GridSizeMode.Absolute, 20),
new Dimension(GridSizeMode.Absolute, 20), new Dimension(GridSizeMode.Absolute, 20),
new Dimension(GridSizeMode.Absolute, 20), new Dimension(GridSizeMode.Absolute, 20),
new Dimension(), new Dimension(),
}, },
Content = new[] Content = new[]
{ {
new Drawable[]
{
selectorText = new OsuSpriteText
{
Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre,
},
},
new Drawable[] new Drawable[]
{ {
selectedText = new OsuSpriteText selectedText = new OsuSpriteText
@ -89,7 +79,6 @@ namespace osu.Game.Tests.Visual.Online
channelList.OnRequestSelect += channel => channelList.OnRequestSelect += channel =>
{ {
channelList.SelectorActive.Value = false;
selected.Value = channel; selected.Value = channel;
}; };
@ -101,12 +90,6 @@ namespace osu.Game.Tests.Visual.Online
channelList.RemoveChannel(channel); channelList.RemoveChannel(channel);
}; };
channelList.SelectorActive.BindValueChanged(change =>
{
selectorText.Text = $"Channel Selector Active: {change.NewValue}";
selected.Value = null;
}, true);
selected.BindValueChanged(change => selected.BindValueChanged(change =>
{ {
selectedText.Text = $"Selected Channel: {change.NewValue?.Name ?? "[null]"}"; selectedText.Text = $"Selected Channel: {change.NewValue?.Name ?? "[null]"}";