Add back support for new API and private messages

This commit is contained in:
Dean Herbert
2018-11-13 15:20:40 +09:00
parent 8b9f7f6691
commit f241fcdba1
9 changed files with 135 additions and 234 deletions

View File

@ -54,11 +54,11 @@ namespace osu.Game.Overlays.Chat.Tabs
protected override TabItem<Channel> CreateTabItem(Channel value)
{
switch (value.Target)
switch (value.Type)
{
case TargetType.Channel:
case ChannelType.Public:
return new ChannelTabItem(value) { OnRequestClose = tabCloseRequested };
case TargetType.User:
case ChannelType.PM:
return new PrivateChannelTabItem(value) { OnRequestClose = tabCloseRequested };
default:
throw new InvalidOperationException("Only TargetType User and Channel are supported.");

View File

@ -25,7 +25,7 @@ namespace osu.Game.Overlays.Chat.Tabs
public PrivateChannelTabItem(Channel value)
: base(value)
{
if (value.Target != TargetType.User)
if (value.Type != ChannelType.PM)
throw new ArgumentException("Argument value needs to have the targettype user!");
AddRange(new Drawable[]
@ -49,7 +49,7 @@ namespace osu.Game.Overlays.Chat.Tabs
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Masking = true,
Child = new DelayedLoadWrapper(new Avatar(value.JoinedUsers.First())
Child = new DelayedLoadWrapper(new Avatar(value.Users.First())
{
RelativeSizeAxes = Axes.Both,
OnLoadComplete = d => d.FadeInFromZero(300, Easing.OutQuint),
@ -88,7 +88,7 @@ namespace osu.Game.Overlays.Chat.Tabs
[BackgroundDependencyLoader]
private void load(OsuColour colours)
{
var user = Value.JoinedUsers.First();
var user = Value.Users.First();
BackgroundActive = user.Colour != null ? OsuColour.FromHex(user.Colour) : colours.BlueDark;
BackgroundInactive = BackgroundActive.Darken(0.5f);