Send Pair Request will only show on Target Player rather than menus.
This commit is contained in:
@@ -19,20 +19,11 @@ internal class ContextMenuService : IHostedService
|
||||
private readonly IDataManager _gameData;
|
||||
private readonly ILogger<ContextMenuService> _logger;
|
||||
private readonly DalamudUtilService _dalamudUtil;
|
||||
private readonly LightlessConfigService _configService;
|
||||
private readonly IClientState _clientState;
|
||||
private readonly PairManager _pairManager;
|
||||
private readonly ApiController _apiController;
|
||||
private readonly IObjectTable _objectTable;
|
||||
|
||||
private static readonly string[] _validAddons =
|
||||
[
|
||||
null,
|
||||
"PartyMemberList", "FriendList", "FreeCompany", "LinkShell", "CrossWorldLinkshell",
|
||||
"_PartyList", "ChatLog", "LookingForGroup", "BlackList", "ContentMemberList",
|
||||
"SocialList", "ContactList", "BeginnerChatList", "MuteList"
|
||||
];
|
||||
|
||||
public ContextMenuService(
|
||||
IContextMenu contextMenu,
|
||||
IDalamudPluginInterface pluginInterface,
|
||||
@@ -52,7 +43,6 @@ internal class ContextMenuService : IHostedService
|
||||
_dalamudUtil = dalamudUtil;
|
||||
_apiController = apiController;
|
||||
_objectTable = objectTable;
|
||||
_configService = configService;
|
||||
_pairManager = pairManager;
|
||||
_clientState = clientState;
|
||||
}
|
||||
@@ -83,10 +73,11 @@ internal class ContextMenuService : IHostedService
|
||||
|
||||
private void OnMenuOpened(IMenuOpenedArgs args)
|
||||
{
|
||||
|
||||
if (!_pluginInterface.UiBuilder.ShouldModifyUi)
|
||||
return;
|
||||
|
||||
if (!_validAddons.Contains(args.AddonName, StringComparer.Ordinal))
|
||||
if (args.AddonName != null)
|
||||
return;
|
||||
|
||||
//Check if target is not menutargetdefault.
|
||||
@@ -114,7 +105,7 @@ internal class ContextMenuService : IHostedService
|
||||
var world = GetWorld(target.TargetHomeWorld.RowId);
|
||||
if (!IsWorldValid(world))
|
||||
return;
|
||||
|
||||
|
||||
args.AddMenuItem(new MenuItem
|
||||
{
|
||||
Name = "Send Pair Request",
|
||||
|
||||
Reference in New Issue
Block a user