Re-enable context menus finally...

This commit is contained in:
Loporrit
2024-10-28 00:38:28 +00:00
parent 8c5296bc3e
commit 5815b5c2e5

View File

@@ -59,37 +59,40 @@ public class Pair
public void AddContextMenu(IMenuOpenedArgs args)
{
if (CachedPlayer == null || true /* TODO: Check target */ || IsPaused) return;
if (CachedPlayer == null || (args.Target is not MenuTargetDefault target) || target.TargetObjectId != CachedPlayer.PlayerCharacterId || IsPaused) return;
args.AddMenuItem(new MenuItem()
{
Name = "Open Profile",
OnClicked = (a) => _mediator.Publish(new ProfileOpenStandaloneMessage(this)),
PrefixColor = 559,
PrefixChar = '',
PrefixChar = 'L'
});
args.AddMenuItem(new MenuItem()
{
Name = "Reapply last data",
OnClicked = (a) => ApplyLastReceivedData(forced: true),
PrefixColor = 559,
PrefixChar = '',
PrefixChar = 'L',
});
if (UserPair != null)
{
args.AddMenuItem(new MenuItem()
{
Name = "Change Permissions",
OnClicked = (a) => _mediator.Publish(new OpenPermissionWindow(this)),
PrefixColor = 559,
PrefixChar = '',
PrefixChar = 'L',
});
args.AddMenuItem(new MenuItem()
{
Name = "Cycle pause state",
OnClicked = (a) => _mediator.Publish(new CyclePauseMessage(UserData)),
PrefixColor = 559,
PrefixChar = '',
PrefixChar = 'L',
});
}
}
public void ApplyData(OnlineUserCharaDataDto data)
{