mirror of
https://github.com/osukey/osukey.git
synced 2025-06-16 16:57:56 +09:00
make chat message users open UserProfileOverlay
This commit is contained in:
parent
689866f5dd
commit
b9eb7a8445
@ -8,6 +8,7 @@ using osu.Game.Graphics.Sprites;
|
|||||||
using osu.Game.Online.Chat;
|
using osu.Game.Online.Chat;
|
||||||
using OpenTK;
|
using OpenTK;
|
||||||
using OpenTK.Graphics;
|
using OpenTK.Graphics;
|
||||||
|
using osu.Framework.Allocation;
|
||||||
|
|
||||||
namespace osu.Game.Overlays.Chat
|
namespace osu.Game.Overlays.Chat
|
||||||
{
|
{
|
||||||
@ -68,6 +69,8 @@ namespace osu.Game.Overlays.Chat
|
|||||||
private const float message_padding = 200;
|
private const float message_padding = 200;
|
||||||
private const float text_size = 20;
|
private const float text_size = 20;
|
||||||
|
|
||||||
|
private UserProfileOverlay profileOverlay;
|
||||||
|
|
||||||
public ChatLine(Message message)
|
public ChatLine(Message message)
|
||||||
{
|
{
|
||||||
Message = message;
|
Message = message;
|
||||||
@ -94,15 +97,20 @@ namespace osu.Game.Overlays.Chat
|
|||||||
TextSize = text_size * 0.75f,
|
TextSize = text_size * 0.75f,
|
||||||
Alpha = 0.4f,
|
Alpha = 0.4f,
|
||||||
},
|
},
|
||||||
new OsuSpriteText
|
new ClickableContainer
|
||||||
|
{
|
||||||
|
AutoSizeAxes = Axes.Both,
|
||||||
|
Origin = Anchor.TopRight,
|
||||||
|
Anchor = Anchor.TopRight,
|
||||||
|
Child = new OsuSpriteText
|
||||||
{
|
{
|
||||||
Font = @"Exo2.0-BoldItalic",
|
Font = @"Exo2.0-BoldItalic",
|
||||||
Text = $@"{Message.Sender.Username}:",
|
Text = $@"{Message.Sender.Username}:",
|
||||||
Colour = getUsernameColour(Message),
|
Colour = getUsernameColour(Message),
|
||||||
TextSize = text_size,
|
TextSize = text_size,
|
||||||
Origin = Anchor.TopRight,
|
},
|
||||||
Anchor = Anchor.TopRight,
|
Action = () => profileOverlay?.ShowUser(Message.Sender),
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
new Container
|
new Container
|
||||||
@ -123,5 +131,11 @@ namespace osu.Game.Overlays.Chat
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[BackgroundDependencyLoader(permitNulls: true)]
|
||||||
|
private void load(UserProfileOverlay profileOverlay)
|
||||||
|
{
|
||||||
|
this.profileOverlay = profileOverlay;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user