mirror of
https://github.com/osukey/osukey.git
synced 2025-05-30 09:57:21 +09:00
Add ability to send pm via context menu
This commit is contained in:
parent
15e47d8432
commit
8a437e1b54
@ -6,6 +6,7 @@ using System.Collections.Generic;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Game.Graphics.Cursor;
|
||||
using osu.Game.Graphics.UserInterfaceV2.Users;
|
||||
using osu.Game.Overlays;
|
||||
using osu.Game.Users;
|
||||
@ -27,7 +28,10 @@ namespace osu.Game.Tests.Visual.UserInterface
|
||||
|
||||
public TestSceneUserCard()
|
||||
{
|
||||
Add(new FillFlowContainer
|
||||
Add(new OsuContextMenuContainer
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Child = new FillFlowContainer
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
@ -84,6 +88,7 @@ namespace osu.Game.Tests.Visual.UserInterface
|
||||
IsOnline = true,
|
||||
}),
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -18,9 +18,9 @@ using JetBrains.Annotations;
|
||||
using osu.Game.Users.Drawables;
|
||||
using osuTK;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
using osu.Game.Overlays.Profile.Header.Components;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osuTK.Graphics;
|
||||
using osu.Game.Online.Chat;
|
||||
|
||||
namespace osu.Game.Graphics.UserInterfaceV2.Users
|
||||
{
|
||||
@ -32,7 +32,7 @@ namespace osu.Game.Graphics.UserInterfaceV2.Users
|
||||
|
||||
protected DelayedLoadUnloadWrapper Background;
|
||||
|
||||
public UserCard(User user)
|
||||
protected UserCard(User user)
|
||||
{
|
||||
if (user == null)
|
||||
throw new ArgumentNullException(nameof(user));
|
||||
@ -43,6 +43,12 @@ namespace osu.Game.Graphics.UserInterfaceV2.Users
|
||||
[Resolved(canBeNull: true)]
|
||||
private UserProfileOverlay profileOverlay { get; set; }
|
||||
|
||||
[Resolved(canBeNull: true)]
|
||||
private ChannelManager channelManager { get; set; }
|
||||
|
||||
[Resolved(canBeNull: true)]
|
||||
private ChatOverlay chatOverlay { get; set; }
|
||||
|
||||
[Resolved]
|
||||
private OsuColour colours { get; set; }
|
||||
|
||||
@ -54,7 +60,7 @@ namespace osu.Game.Graphics.UserInterfaceV2.Users
|
||||
Masking = true;
|
||||
BorderColour = colours.GreyVioletLighter;
|
||||
|
||||
AddRange(new Drawable[]
|
||||
AddRange(new[]
|
||||
{
|
||||
new Box
|
||||
{
|
||||
@ -152,6 +158,11 @@ namespace osu.Game.Graphics.UserInterfaceV2.Users
|
||||
public MenuItem[] ContextMenuItems => new MenuItem[]
|
||||
{
|
||||
new OsuMenuItem("View Profile", MenuItemType.Highlighted, Action),
|
||||
new OsuMenuItem("Send message", MenuItemType.Standard, () =>
|
||||
{
|
||||
channelManager?.OpenPrivateChannel(User);
|
||||
chatOverlay?.Show();
|
||||
})
|
||||
};
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user