master #4

Merged
cacahuetes merged 75 commits from liza/Questionable:master into master 2024-09-02 21:50:11 +00:00
2 changed files with 33 additions and 0 deletions
Showing only changes of commit 1572ff11a8 - Show all commits

View File

@ -0,0 +1,31 @@
using System;
using Dalamud.Plugin;
using Dalamud.Plugin.Ipc;
using Questionable.Controller;
namespace Questionable.External;
internal sealed class QuestionableIpc : IDisposable
{
private const string IpcIsRunning = "Questionable.IsRunning";
private const string IpcGetCurrentQuestId = "Questionable.GetCurrentQuestId";
private readonly ICallGateProvider<bool> _isRunning;
private readonly ICallGateProvider<string?> _getCurrentQuestId;
public QuestionableIpc(QuestController questController, IDalamudPluginInterface pluginInterface)
{
_isRunning = pluginInterface.GetIpcProvider<bool>(IpcIsRunning);
_isRunning.RegisterFunc(() => questController.IsRunning);
_getCurrentQuestId = pluginInterface.GetIpcProvider<string?>(IpcGetCurrentQuestId);
_getCurrentQuestId.RegisterFunc(() => questController.CurrentQuest?.Quest.Id.ToString());
}
public void Dispose()
{
_getCurrentQuestId.UnregisterFunc();
_isRunning.UnregisterFunc();
}
}

View File

@ -120,6 +120,7 @@ public sealed class QuestionablePlugin : IDalamudPlugin
serviceCollection.AddSingleton<LifestreamIpc>();
serviceCollection.AddSingleton<YesAlreadyIpc>();
serviceCollection.AddSingleton<ArtisanIpc>();
serviceCollection.AddSingleton<QuestionableIpc>();
}
private static void AddTaskFactories(ServiceCollection serviceCollection)
@ -235,6 +236,7 @@ public sealed class QuestionablePlugin : IDalamudPlugin
serviceProvider.GetRequiredService<CreditsController>();
serviceProvider.GetRequiredService<HelpUiController>();
serviceProvider.GetRequiredService<LeveUiController>();
serviceProvider.GetRequiredService<QuestionableIpc>();
serviceProvider.GetRequiredService<DalamudInitializer>();
}