Added an infoMessage class to represent system messages that aren't errors

This commit is contained in:
MrTheMake 2017-09-22 15:30:07 +02:00
parent 29707788f9
commit 18c26a85ba
2 changed files with 29 additions and 13 deletions

View File

@ -6,20 +6,11 @@ using osu.Game.Users;
namespace osu.Game.Online.Chat
{
public class ErrorMessage : Message
public class ErrorMessage : InfoMessage
{
private static int errorId = -1;
public ErrorMessage(string message) : base(errorId--)
public ErrorMessage(string message) : base(message)
{
Timestamp = DateTimeOffset.Now;
Content = message;
Sender = new User
{
Username = @"system",
Colour = @"ff0000",
};
Sender.Colour = @"ff0000";
}
}
}
}

View File

@ -0,0 +1,25 @@
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System;
using osu.Game.Users;
namespace osu.Game.Online.Chat
{
public class InfoMessage : Message
{
private static int infoID = -1;
public InfoMessage(string message) : base(infoID--)
{
Timestamp = DateTimeOffset.Now;
Content = message;
Sender = new User
{
Username = @"system",
Colour = @"0000ff",
};
}
}
}