Revert DI usage of ChannelSelectorState in favour of directly binding BindableBool SelectorActive

This commit is contained in:
Jai Sharma
2022-04-20 21:05:33 +01:00
parent e596c9d171
commit 5319bce772
4 changed files with 12 additions and 23 deletions

View File

@ -29,6 +29,8 @@ namespace osu.Game.Overlays.Chat.ChannelList
public readonly BindableBool Unread = new BindableBool();
public readonly BindableBool SelectorActive = new BindableBool();
private readonly Channel channel;
private Box hoverBox = null!;
@ -39,9 +41,6 @@ namespace osu.Game.Overlays.Chat.ChannelList
[Resolved]
private Bindable<Channel> selectedChannel { get; set; } = null!;
[Resolved]
private Bindable<ChannelSelectorState> selectorState { get; set; } = null!;
[Resolved]
private OverlayColourProvider colourProvider { get; set; } = null!;
@ -128,7 +127,7 @@ namespace osu.Game.Overlays.Chat.ChannelList
base.LoadComplete();
selectedChannel.BindValueChanged(_ => updateSelectState(), true);
selectorState.BindValueChanged(_ => updateSelectState(), true);
SelectorActive.BindValueChanged(_ => updateSelectState(), true);
Unread.BindValueChanged(change =>
{
@ -168,7 +167,7 @@ namespace osu.Game.Overlays.Chat.ChannelList
private void updateSelectState()
{
if (selectedChannel.Value == channel && selectorState.Value == ChannelSelectorState.Hidden)
if (selectedChannel.Value == channel && !SelectorActive.Value)
selectBox.FadeIn(300, Easing.OutQuint);
else
selectBox.FadeOut(200, Easing.OutQuint);