Pair request button only shows when lightfinder is on

This commit is contained in:
CakeAndBanana
2025-09-29 19:44:36 +02:00
parent 8f7f07311f
commit f74cd01a32
2 changed files with 16 additions and 9 deletions

View File

@@ -147,7 +147,7 @@ public sealed class Plugin : IDalamudPlugin
collection.AddSingleton<RedrawManager>();
collection.AddSingleton<BroadcastService>();
collection.AddSingleton(addonLifecycle);
collection.AddSingleton(p => new ContextMenu(contextMenu, pluginInterface, gameData, p.GetRequiredService<ILogger<ContextMenu>>(), p.GetRequiredService<DalamudUtilService>(), p.GetRequiredService<ApiController>(), objectTable));
collection.AddSingleton(p => new ContextMenu(contextMenu, pluginInterface, gameData, p.GetRequiredService<ILogger<ContextMenu>>(), p.GetRequiredService<DalamudUtilService>(), p.GetRequiredService<ApiController>(), objectTable, p.GetRequiredService<LightlessConfigService>()));
collection.AddSingleton((s) => new IpcCallerPenumbra(s.GetRequiredService<ILogger<IpcCallerPenumbra>>(), pluginInterface,
s.GetRequiredService<DalamudUtilService>(), s.GetRequiredService<LightlessMediator>(), s.GetRequiredService<RedrawManager>()));
collection.AddSingleton((s) => new IpcCallerGlamourer(s.GetRequiredService<ILogger<IpcCallerGlamourer>>(), pluginInterface,

View File

@@ -3,6 +3,7 @@ using Dalamud.Game.ClientState.Objects.Types;
using Dalamud.Game.Gui.ContextMenu;
using Dalamud.Plugin;
using Dalamud.Plugin.Services;
using LightlessSync.LightlessConfiguration;
using LightlessSync.Services;
using LightlessSync.Utils;
using LightlessSync.WebAPI;
@@ -19,6 +20,7 @@ internal class ContextMenu : IHostedService
private readonly IDataManager _gameData;
private readonly ILogger<ContextMenu> _logger;
private readonly DalamudUtilService _dalamudUtil;
private readonly LightlessConfigService _configService;
private readonly ApiController _apiController;
private readonly IObjectTable _objectTable;
@@ -37,7 +39,8 @@ internal class ContextMenu : IHostedService
ILogger<ContextMenu> logger,
DalamudUtilService dalamudUtil,
ApiController apiController,
IObjectTable objectTable)
IObjectTable objectTable,
LightlessConfigService configService)
{
_contextMenu = contextMenu;
_pluginInterface = pluginInterface;
@@ -46,6 +49,7 @@ internal class ContextMenu : IHostedService
_dalamudUtil = dalamudUtil;
_apiController = apiController;
_objectTable = objectTable;
_configService = configService;
}
public Task StartAsync(CancellationToken cancellationToken)
@@ -90,6 +94,8 @@ internal class ContextMenu : IHostedService
if (!IsWorldValid(world))
return;
if (_configService.Current.BroadcastEnabled)
{
args.AddMenuItem(new MenuItem
{
Name = "Send Pair Request",
@@ -99,6 +105,7 @@ internal class ContextMenu : IHostedService
OnClicked = async _ => await HandleSelection(args)
});
}
}
private async Task HandleSelection(IMenuArgs args)
{