feat(main-window): wire Lender + handler.Draw() (A2, MessageList popups)
A2 completes the deferred Lender-cycle from A1 and addresses the handler.Draw() gap identified in I code-quality-review: - MainWindow ctor takes Lender<PayloadHandler> as new param (DI-reg extended in PluginHostFactory); _handlerLender.ResetCounter() called at top of Draw() as primary pool-reset path (InputPreview has the secondary defensive fallback for MainWindow-closed edge case) - MessageList.DrawHandlerPopups() new passthrough method (=> _handler?.Draw()) provides the per-frame popup-tick that PayloadHandler needs to render the right-click context popup; MainWindow.Draw() calls it after the message-list body renders Without this fix, right-clicking a player/item/status in the chat log would silently fail to open a popup (handler.Draw() never fired for the MessageList's _handler). Phase 3 smoke steps 3/4/5 unblocked. Polish-Sweep + Smoke-Gate are the last cycle-tasks.
This commit is contained in:
@@ -198,7 +198,8 @@ internal static class PluginHostFactory
|
|||||||
sp.GetRequiredService<Ui.Components.Sidebar>(),
|
sp.GetRequiredService<Ui.Components.Sidebar>(),
|
||||||
sp.GetRequiredService<Ui.Components.MessageList>(),
|
sp.GetRequiredService<Ui.Components.MessageList>(),
|
||||||
sp.GetRequiredService<Ui.Components.InputBar>(),
|
sp.GetRequiredService<Ui.Components.InputBar>(),
|
||||||
sp.GetRequiredService<Ui.Components.StatusBar>()
|
sp.GetRequiredService<Ui.Components.StatusBar>(),
|
||||||
|
sp.GetRequiredService<Lender<PayloadHandler>>()
|
||||||
));
|
));
|
||||||
services.AddSingleton(sp => new Integrations.FailedTellNotifier(
|
services.AddSingleton(sp => new Integrations.FailedTellNotifier(
|
||||||
sp.GetRequiredService<ILogger<Integrations.FailedTellNotifier>>()
|
sp.GetRequiredService<ILogger<Integrations.FailedTellNotifier>>()
|
||||||
|
|||||||
@@ -31,6 +31,10 @@ internal sealed class MessageList
|
|||||||
_handler = handler;
|
_handler = handler;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Delegates to PayloadHandler.Draw for per-frame popup tick; PayloadHandler.Draw doesn't auto-fire
|
||||||
|
// so MainWindow's draw loop must invoke it explicitly to render right-click context popups.
|
||||||
|
internal void DrawHandlerPopups() => _handler?.Draw();
|
||||||
|
|
||||||
public MessageList(
|
public MessageList(
|
||||||
ThemeRegistry themes,
|
ThemeRegistry themes,
|
||||||
TokenResolver resolver,
|
TokenResolver resolver,
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ using System.Numerics;
|
|||||||
using Dalamud.Bindings.ImGui;
|
using Dalamud.Bindings.ImGui;
|
||||||
using Dalamud.Interface.Utility.Raii;
|
using Dalamud.Interface.Utility.Raii;
|
||||||
using Dalamud.Interface.Windowing;
|
using Dalamud.Interface.Windowing;
|
||||||
|
using HellionChat.Util;
|
||||||
|
|
||||||
namespace HellionChat.Ui.Windows;
|
namespace HellionChat.Ui.Windows;
|
||||||
|
|
||||||
@@ -26,6 +27,7 @@ internal sealed class MainWindow : Window
|
|||||||
private readonly Components.MessageList _messages;
|
private readonly Components.MessageList _messages;
|
||||||
private readonly Components.InputBar _input;
|
private readonly Components.InputBar _input;
|
||||||
private readonly Components.StatusBar _status;
|
private readonly Components.StatusBar _status;
|
||||||
|
private readonly Lender<PayloadHandler> _handlerLender;
|
||||||
|
|
||||||
private Tab? _activeTab;
|
private Tab? _activeTab;
|
||||||
|
|
||||||
@@ -38,7 +40,8 @@ internal sealed class MainWindow : Window
|
|||||||
Components.Sidebar sidebar,
|
Components.Sidebar sidebar,
|
||||||
Components.MessageList messages,
|
Components.MessageList messages,
|
||||||
Components.InputBar input,
|
Components.InputBar input,
|
||||||
Components.StatusBar status
|
Components.StatusBar status,
|
||||||
|
Lender<PayloadHandler> handlerLender
|
||||||
)
|
)
|
||||||
: base($"{Plugin.PluginName}###hellion-main")
|
: base($"{Plugin.PluginName}###hellion-main")
|
||||||
{
|
{
|
||||||
@@ -47,6 +50,7 @@ internal sealed class MainWindow : Window
|
|||||||
_messages = messages;
|
_messages = messages;
|
||||||
_input = input;
|
_input = input;
|
||||||
_status = status;
|
_status = status;
|
||||||
|
_handlerLender = handlerLender;
|
||||||
|
|
||||||
Size = new Vector2(DefaultWidth, DefaultHeight);
|
Size = new Vector2(DefaultWidth, DefaultHeight);
|
||||||
SizeCondition = ImGuiCond.FirstUseEver;
|
SizeCondition = ImGuiCond.FirstUseEver;
|
||||||
@@ -92,6 +96,9 @@ internal sealed class MainWindow : Window
|
|||||||
LastViewport = ImGui.GetWindowViewport().Handle;
|
LastViewport = ImGui.GetWindowViewport().Handle;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Primary pool-reset path; InputPreview has a defensive fallback for the MainWindow-closed edge case.
|
||||||
|
_handlerLender.ResetCounter();
|
||||||
|
|
||||||
// First-frame seed: the active tab defaults to the first persisted
|
// First-frame seed: the active tab defaults to the first persisted
|
||||||
// tab so the message list isn't empty on a clean session.
|
// tab so the message list isn't empty on a clean session.
|
||||||
if (_activeTab is null && Plugin.Config.Tabs.Count > 0)
|
if (_activeTab is null && Plugin.Config.Tabs.Count > 0)
|
||||||
@@ -105,6 +112,7 @@ internal sealed class MainWindow : Window
|
|||||||
DrawBody();
|
DrawBody();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_messages.DrawHandlerPopups();
|
||||||
_status.Draw(_activeTab);
|
_status.Draw(_activeTab);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user