1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 18:42:56 +08:00

Update ChannelManager.CurrentChannel directly to handle non-loaded chat scenario

`currentChannel` gets instantiated once the chat overlay is open, while
`HighlightMessage` could be called while the chat overlay has never been
open.

This will all be rewritten with the new chat overlay design anyways, so
should be fine for now.
This commit is contained in:
Salman Ahmed 2022-03-08 03:42:17 +03:00
parent f8e5570e41
commit f645869958

View File

@ -309,10 +309,10 @@ namespace osu.Game.Overlays
/// <param name="message">The message to highlight.</param>
public void HighlightMessage(Message message)
{
if (currentChannel.Value.Id != message.ChannelId)
currentChannel.Value = channelManager.JoinedChannels.Single(c => c.Id == message.ChannelId);
if (channelManager.CurrentChannel.Value.Id != message.ChannelId)
channelManager.CurrentChannel.Value = channelManager.JoinedChannels.Single(c => c.Id == message.ChannelId);
currentChannel.Value.HighlightedMessage.Value = message;
channelManager.CurrentChannel.Value.HighlightedMessage.Value = message;
}
private float startDragChatHeight;