Add DTR entry with number of visible pairs (#52)

* Add DTR entry with number of visible pairs

* Simplify DTR visible pair counter

- Merge the new PairHandlerInvisibleMessage and PairHandlerVisibleDisposedMessage ;
- Leave alone a bunch of messages that were actually unneccessary.

* Match encodings with the rest of the codebase

* Make the DTR entry opt-in and add explanations

* More reliable publishing of PairHandlerVisible/Invisible

* Simplify things for DTR

* Rework async
This commit is contained in:
N. Lo
2023-06-18 23:01:39 +02:00
committed by GitHub
parent de36e9e8bd
commit 0e84d312dc
5 changed files with 115 additions and 1 deletions

View File

@@ -6,6 +6,7 @@ using Dalamud.Game.ClientState.Conditions;
using Dalamud.Game.ClientState.Objects;
using Dalamud.Game.Command;
using Dalamud.Game.Gui;
using Dalamud.Game.Gui.Dtr;
using Dalamud.Interface.ImGuiFileDialog;
using Dalamud.Interface.Windowing;
using Dalamud.Plugin;
@@ -36,7 +37,7 @@ public sealed class Plugin : IDalamudPlugin
public Plugin(DalamudPluginInterface pluginInterface, CommandManager commandManager, DataManager gameData,
Framework framework, ObjectTable objectTable, ClientState clientState, Condition condition, ChatGui chatGui,
GameGui gameGui)
GameGui gameGui, DtrBar dtrBar)
{
new HostBuilder()
.UseContentRoot(pluginInterface.ConfigDirectory.FullName)
@@ -75,6 +76,8 @@ public sealed class Plugin : IDalamudPlugin
collection.AddSingleton((s) => new DalamudUtilService(s.GetRequiredService<ILogger<DalamudUtilService>>(),
clientState, objectTable, framework, gameGui, condition, gameData,
s.GetRequiredService<MareMediator>(), s.GetRequiredService<PerformanceCollectorService>()));
collection.AddSingleton((s) => new DtrEntry(dtrBar, s.GetRequiredService<MareConfigService>(),
s.GetRequiredService<PairManager>(), s.GetRequiredService<ApiController>()));
collection.AddSingleton((s) => new IpcManager(s.GetRequiredService<ILogger<IpcManager>>(),
pluginInterface, s.GetRequiredService<DalamudUtilService>(), s.GetRequiredService<MareMediator>()));
@@ -124,6 +127,7 @@ public sealed class Plugin : IDalamudPlugin
collection.AddHostedService(p => p.GetRequiredService<ConfigurationMigrator>());
collection.AddHostedService(p => p.GetRequiredService<DalamudUtilService>());
collection.AddHostedService(p => p.GetRequiredService<PerformanceCollectorService>());
collection.AddHostedService(p => p.GetRequiredService<DtrEntry>());
collection.AddHostedService(p => p.GetRequiredService<MarePlugin>());
})
.Build()