Merge branch 'master'

This commit is contained in:
Huo Yaoyuan
2016-11-16 10:51:39 +08:00
141 changed files with 1566 additions and 775 deletions

View File

@ -8,7 +8,6 @@ using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Transformations;
using osu.Game.Online.Chat.Display.osu.Online.Social;
using OpenTK;
using osu.Framework;
using osu.Framework.Allocation;

View File

@ -1,75 +1,68 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System;
using osu.Framework.Configuration;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Primitives;
using osu.Framework.Graphics.Sprites;
using OpenTK;
using OpenTK.Graphics;
using osu.Framework;
using osu.Framework.Graphics.Primitives;
using osu.Framework.Allocation;
namespace osu.Game.Online.Chat.Display
{
namespace osu.Online.Social
public class ChatLine : Container
{
public class ChatLine : Container
public readonly Message Message;
const float padding = 200;
const float text_size = 20;
public ChatLine(Message message)
{
public readonly Message Message;
this.Message = message;
const float padding = 200;
const float text_size = 20;
RelativeSizeAxes = Axes.X;
AutoSizeAxes = Axes.Y;
public ChatLine(Message message)
Children = new Drawable[]
{
this.Message = message;
RelativeSizeAxes = Axes.X;
AutoSizeAxes = Axes.Y;
Children = new Drawable[]
new Container
{
new Container
Size = new Vector2(padding, text_size),
Children = new Drawable[]
{
Size = new Vector2(padding, text_size),
Children = new Drawable[]
new SpriteText
{
new SpriteText
{
Text = Message.Timestamp.LocalDateTime.ToLongTimeString(),
TextSize = text_size,
Colour = new Color4(128, 128, 128, 255)
},
new SpriteText
{
Text = Message.User.Name,
TextSize = text_size,
Origin = Anchor.TopRight,
Anchor = Anchor.TopRight,
}
}
},
new Container
{
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Padding = new MarginPadding { Left = padding + 10 },
Children = new Drawable[]
Text = Message.Timestamp.LocalDateTime.ToLongTimeString(),
TextSize = text_size,
Colour = new Color4(128, 128, 128, 255)
},
new SpriteText
{
new SpriteText
{
Text = Message.Content,
TextSize = text_size,
AutoSizeAxes = Axes.Y,
RelativeSizeAxes = Axes.X,
}
Text = Message.User.Name,
TextSize = text_size,
Origin = Anchor.TopRight,
Anchor = Anchor.TopRight,
}
}
};
}
},
new Container
{
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Padding = new MarginPadding { Left = padding + 10 },
Children = new Drawable[]
{
new SpriteText
{
Text = Message.Content,
TextSize = text_size,
AutoSizeAxes = Axes.Y,
RelativeSizeAxes = Axes.X,
}
}
}
};
}
}
}