Register OpenMainUi callback to satisfy Dalamud validation
The plugin list expects a main UI entry point so the "Open Plugin" button has something to fire on. Hook UiBuilder.OpenMainUi to a toggle of the settings window — same surface as OpenConfigUi, just exposed under both buttons. Wiring lives in Plugin.cs (not the inherited Settings.cs) so future upstream cherry-picks don't fight with this addition.
This commit is contained in:
@@ -204,6 +204,11 @@ public sealed class Plugin : IDalamudPlugin
|
|||||||
Framework.Update += FrameworkUpdate;
|
Framework.Update += FrameworkUpdate;
|
||||||
Interface.UiBuilder.Draw += Draw;
|
Interface.UiBuilder.Draw += Draw;
|
||||||
Interface.LanguageChanged += LanguageChanged;
|
Interface.LanguageChanged += LanguageChanged;
|
||||||
|
// Hellion Chat — surface a "main UI" entry point so Dalamud's
|
||||||
|
// plugin list shows the Open-Plugin button. Settings is the
|
||||||
|
// most useful landing place; OpenConfigUi is already wired to
|
||||||
|
// the same toggle inside SettingsWindow.
|
||||||
|
Interface.UiBuilder.OpenMainUi += OpenMainUi;
|
||||||
|
|
||||||
if (Config.ShowEmotes)
|
if (Config.ShowEmotes)
|
||||||
Task.Run(EmoteCache.LoadData);
|
Task.Run(EmoteCache.LoadData);
|
||||||
@@ -240,6 +245,7 @@ public sealed class Plugin : IDalamudPlugin
|
|||||||
[SuppressMessage("ReSharper", "ConditionalAccessQualifierIsNonNullableAccordingToAPIContract")]
|
[SuppressMessage("ReSharper", "ConditionalAccessQualifierIsNonNullableAccordingToAPIContract")]
|
||||||
public void Dispose()
|
public void Dispose()
|
||||||
{
|
{
|
||||||
|
Interface.UiBuilder.OpenMainUi -= OpenMainUi;
|
||||||
Interface.LanguageChanged -= LanguageChanged;
|
Interface.LanguageChanged -= LanguageChanged;
|
||||||
Interface.UiBuilder.Draw -= Draw;
|
Interface.UiBuilder.Draw -= Draw;
|
||||||
Framework.Update -= FrameworkUpdate;
|
Framework.Update -= FrameworkUpdate;
|
||||||
@@ -323,6 +329,15 @@ public sealed class Plugin : IDalamudPlugin
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void OpenMainUi()
|
||||||
|
{
|
||||||
|
// Settings is the most useful landing surface — same target as the
|
||||||
|
// Configure button. SettingsWindow.Toggle is internal and already
|
||||||
|
// wired to OpenConfigUi, so re-using IsOpen keeps both entry points
|
||||||
|
// behaviourally identical.
|
||||||
|
SettingsWindow.IsOpen = !SettingsWindow.IsOpen;
|
||||||
|
}
|
||||||
|
|
||||||
private void RunRetentionSweepIfDue()
|
private void RunRetentionSweepIfDue()
|
||||||
{
|
{
|
||||||
if (!Config.RetentionEnabled)
|
if (!Config.RetentionEnabled)
|
||||||
|
|||||||
Reference in New Issue
Block a user