Use private implementation

This commit is contained in:
Dean Herbert 2018-08-03 19:32:34 +09:00
parent 70ee7e4afd
commit 4c57e629ff
2 changed files with 4 additions and 6 deletions

View File

@ -64,7 +64,7 @@ namespace osu.Game.Overlays.Chat
protected override void LoadComplete()
{
base.LoadComplete();
ScrollToEnd();
scrollToEnd();
}
protected override void Dispose(bool isDisposing)
@ -85,8 +85,8 @@ namespace osu.Game.Overlays.Chat
if (!IsLoaded) return;
if (scroll.IsScrolledToEnd(10) || !flow.Children.Any())
ScrollToEnd();
if (scroll.IsScrolledToEnd(10) || !flow.Children.Any() || newMessages.Any(m => m.GetType() == typeof(LocalEchoMessage)))
scrollToEnd();
var staleMessages = flow.Children.Where(c => c.LifetimeEnd == double.MaxValue).ToArray();
int count = staleMessages.Length - Channel.MAX_HISTORY;
@ -118,7 +118,7 @@ namespace osu.Game.Overlays.Chat
flow.Children.FirstOrDefault(c => c.Message == removed)?.FadeColour(Color4.Red, 400).FadeOut(600).Expire();
}
public void ScrollToEnd() => ScheduleAfterChildren(() => scroll.ScrollToEnd());
private void scrollToEnd() => ScheduleAfterChildren(() => scroll.ScrollToEnd());
private class ChatLineContainer : FillFlowContainer<ChatLine>
{

View File

@ -475,8 +475,6 @@ namespace osu.Game.Overlays
if (target == null) return;
currentChannelContainer.Child.ScrollToEnd();
if (!api.IsLoggedIn)
{
target.AddNewMessages(new ErrorMessage("Please sign in to participate in chat!"));