feat(payload-handler): add skeleton with 7-param ctor + Draw() popup tick
Replaces the 15-LOC C2 forward-stub with the full PayloadHandler skeleton. Class header flips to `internal sealed` per §4.1; ctor takes 7 DI-registered services (ThemeRegistry, IpcManager, GameFunctions, InputBar, MainWindow, ChunkRenderer, ILogger) per Flo decision 2026-05-27 (ChunkRenderer was added to the ctor list to satisfy the §4.2 _chunkRenderer.DrawChunks references in HoverStatus/HoverItem/ DrawItemPopup paths — those land in E2-E5). Draw() per-frame popup tick is a 1:1 port from v1.5.6 PayloadHandler. DrawPopups() call is stubbed as TODO(E2) since that method lands in E2. Hover/Click signatures remain empty (E5 fills the bodies, but the signatures must compile so ChunkRenderer + ImGuiUtil callers stay live). Skeleton-only — DrawPopups/Integrations (E2), DrawPlayerPopup (E3), DrawItemPopup/DrawStatusPopup (E4), Hover/Click bodies (E5), MoveTooltip (E6) all defer to their respective sub-sub-tasks.
This commit is contained in:
@@ -1,15 +1,66 @@
|
||||
using Dalamud.Bindings.ImGui;
|
||||
using Dalamud.Game.Text.SeStringHandling;
|
||||
using HellionChat.Themes;
|
||||
using HellionChat.Ui.Components;
|
||||
using HellionChat.Ui.Windows;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace HellionChat;
|
||||
|
||||
// TODO(E): full PayloadHandler implementation — click/hover routing, tooltip
|
||||
// positioning, party-finder and URI handling. This forward-stub exists only to
|
||||
// satisfy the DrawChunks/DrawChunk and ImGuiUtil.PostPayload signatures while
|
||||
// Sub-Task E is pending.
|
||||
public sealed class PayloadHandler
|
||||
internal sealed class PayloadHandler
|
||||
{
|
||||
private const string PopupId = "hellionchat-context-popup";
|
||||
|
||||
private readonly ThemeRegistry _themes;
|
||||
private readonly IpcManager _ipc;
|
||||
private readonly GameFunctions.GameFunctions _functions;
|
||||
private readonly InputBar _inputBar;
|
||||
private readonly MainWindow _mainWindow;
|
||||
private readonly ChunkRenderer _chunkRenderer;
|
||||
private readonly ILogger<PayloadHandler> _logger;
|
||||
|
||||
public bool HandleTooltips;
|
||||
public uint HoveredItem;
|
||||
public uint HoverCounter;
|
||||
public uint LastHoverCounter;
|
||||
|
||||
#pragma warning disable CS0169 // used in DrawPopups (E2)
|
||||
private (Chunk, Payload?)? _popup;
|
||||
#pragma warning restore CS0169
|
||||
|
||||
public PayloadHandler(
|
||||
ThemeRegistry themes,
|
||||
IpcManager ipc,
|
||||
GameFunctions.GameFunctions functions,
|
||||
InputBar inputBar,
|
||||
MainWindow mainWindow,
|
||||
ChunkRenderer chunkRenderer,
|
||||
ILogger<PayloadHandler> logger
|
||||
)
|
||||
{
|
||||
_themes = themes;
|
||||
_ipc = ipc;
|
||||
_functions = functions;
|
||||
_inputBar = inputBar;
|
||||
_mainWindow = mainWindow;
|
||||
_chunkRenderer = chunkRenderer;
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
internal void Draw()
|
||||
{
|
||||
// TODO(E2): DrawPopups();
|
||||
|
||||
if (HandleTooltips && ++HoverCounter - LastHoverCounter > 1)
|
||||
{
|
||||
GameFunctions.GameFunctions.CloseItemTooltip();
|
||||
HoveredItem = 0;
|
||||
HoverCounter = LastHoverCounter = 0;
|
||||
HandleTooltips = false;
|
||||
}
|
||||
}
|
||||
|
||||
internal void Hover(Payload payload) { }
|
||||
|
||||
internal void Click(Chunk chunk, Payload? payload, ImGuiMouseButton button) { }
|
||||
internal unsafe void Click(Chunk chunk, Payload? payload, ImGuiMouseButton button) { }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user