mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 10:52:53 +08:00
Add LocalMessage
This commit is contained in:
parent
4c57e629ff
commit
b4ef3dd4dd
@ -6,7 +6,7 @@ using osu.Game.Users;
|
||||
|
||||
namespace osu.Game.Online.Chat
|
||||
{
|
||||
public class InfoMessage : Message
|
||||
public class InfoMessage : LocalMessage
|
||||
{
|
||||
private static int infoID = -1;
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
namespace osu.Game.Online.Chat
|
||||
{
|
||||
public class LocalEchoMessage : Message
|
||||
public class LocalEchoMessage : LocalMessage
|
||||
{
|
||||
public LocalEchoMessage() : base(null)
|
||||
{
|
||||
|
16
osu.Game/Online/Chat/LocalMessage.cs
Normal file
16
osu.Game/Online/Chat/LocalMessage.cs
Normal file
@ -0,0 +1,16 @@
|
||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
namespace osu.Game.Online.Chat
|
||||
{
|
||||
/// <summary>
|
||||
/// A message which is generated and displayed locally.
|
||||
/// </summary>
|
||||
public class LocalMessage : Message
|
||||
{
|
||||
protected LocalMessage(long? id)
|
||||
: base(id)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
@ -85,7 +85,7 @@ namespace osu.Game.Overlays.Chat
|
||||
|
||||
if (!IsLoaded) return;
|
||||
|
||||
if (scroll.IsScrolledToEnd(10) || !flow.Children.Any() || newMessages.Any(m => m.GetType() == typeof(LocalEchoMessage)))
|
||||
if (scroll.IsScrolledToEnd(10) || !flow.Children.Any() || newMessages.Any(m => m is LocalMessage))
|
||||
scrollToEnd();
|
||||
|
||||
var staleMessages = flow.Children.Where(c => c.LifetimeEnd == double.MaxValue).ToArray();
|
||||
|
Loading…
Reference in New Issue
Block a user