1.12.X - LightFinder + Bugfixes + Other fixes from 1.11.X #39
@@ -19,20 +19,11 @@ internal class ContextMenuService : IHostedService
|
|||||||
private readonly IDataManager _gameData;
|
private readonly IDataManager _gameData;
|
||||||
private readonly ILogger<ContextMenuService> _logger;
|
private readonly ILogger<ContextMenuService> _logger;
|
||||||
private readonly DalamudUtilService _dalamudUtil;
|
private readonly DalamudUtilService _dalamudUtil;
|
||||||
private readonly LightlessConfigService _configService;
|
|
||||||
private readonly IClientState _clientState;
|
private readonly IClientState _clientState;
|
||||||
private readonly PairManager _pairManager;
|
private readonly PairManager _pairManager;
|
||||||
private readonly ApiController _apiController;
|
private readonly ApiController _apiController;
|
||||||
private readonly IObjectTable _objectTable;
|
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(
|
public ContextMenuService(
|
||||||
IContextMenu contextMenu,
|
IContextMenu contextMenu,
|
||||||
IDalamudPluginInterface pluginInterface,
|
IDalamudPluginInterface pluginInterface,
|
||||||
@@ -52,7 +43,6 @@ internal class ContextMenuService : IHostedService
|
|||||||
_dalamudUtil = dalamudUtil;
|
_dalamudUtil = dalamudUtil;
|
||||||
_apiController = apiController;
|
_apiController = apiController;
|
||||||
_objectTable = objectTable;
|
_objectTable = objectTable;
|
||||||
_configService = configService;
|
|
||||||
_pairManager = pairManager;
|
_pairManager = pairManager;
|
||||||
_clientState = clientState;
|
_clientState = clientState;
|
||||||
}
|
}
|
||||||
@@ -83,10 +73,11 @@ internal class ContextMenuService : IHostedService
|
|||||||
|
|
||||||
private void OnMenuOpened(IMenuOpenedArgs args)
|
private void OnMenuOpened(IMenuOpenedArgs args)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (!_pluginInterface.UiBuilder.ShouldModifyUi)
|
if (!_pluginInterface.UiBuilder.ShouldModifyUi)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!_validAddons.Contains(args.AddonName, StringComparer.Ordinal))
|
if (args.AddonName != null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
//Check if target is not menutargetdefault.
|
//Check if target is not menutargetdefault.
|
||||||
@@ -114,7 +105,7 @@ internal class ContextMenuService : IHostedService
|
|||||||
var world = GetWorld(target.TargetHomeWorld.RowId);
|
var world = GetWorld(target.TargetHomeWorld.RowId);
|
||||||
if (!IsWorldValid(world))
|
if (!IsWorldValid(world))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
args.AddMenuItem(new MenuItem
|
args.AddMenuItem(new MenuItem
|
||||||
{
|
{
|
||||||
Name = "Send Pair Request",
|
Name = "Send Pair Request",
|
||||||
|
|||||||
Reference in New Issue
Block a user