Skip to content

Commit 1d02f5c

Browse files
committed
Add target context menu item. Co-authored-by: Arufonsu <github.com/Arufonsu>
1 parent 0808ccd commit 1d02f5c

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

Intersect.Client.Core/Interface/Game/TargetContextMenu.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ namespace Intersect.Client.Interface.Game;
1919
/// </summary>
2020
public sealed partial class TargetContextMenu : Framework.Gwen.Control.Menu
2121
{
22+
private readonly MenuItem _targetNameMenuItem;
2223
private readonly MenuItem _tradeMenuItem;
2324
private readonly MenuItem _partyMenuItem;
2425
private readonly MenuItem _friendMenuItem;
@@ -35,6 +36,12 @@ public TargetContextMenu(Canvas gameCanvas) : base(gameCanvas, nameof(TargetCont
3536

3637
_me = Globals.Me;
3738

39+
_targetNameMenuItem = AddItem(string.Empty);
40+
_targetNameMenuItem.SetText("");
41+
_targetNameMenuItem.MouseInputEnabled = false;
42+
43+
AddDivider();
44+
3845
_tradeMenuItem = AddItem(Strings.EntityContextMenu.Trade);
3946
_tradeMenuItem.Clicked += tradeRequest_Clicked;
4047

@@ -90,6 +97,11 @@ public void ToggleHidden(object? target)
9097
return;
9198
}
9299

100+
if (_entity == null)
101+
{
102+
return;
103+
}
104+
93105
if (Canvas is { } canvas)
94106
{
95107
if (newX + Width >= canvas.Width)
@@ -105,6 +117,9 @@ public void ToggleHidden(object? target)
105117

106118
if (IsHidden)
107119
{
120+
121+
_targetNameMenuItem.SetText(_entity.Name);
122+
_targetNameMenuItem.Alignment = Pos.Left;
108123
TryShowGuildButton();
109124
SizeToChildren();
110125
Open(Pos.None);

0 commit comments

Comments
 (0)