Merge pull request #36

* Close item tooltip with event to support Dalamud HandleItemOut hook

* Greatly simplify tooltip close event logic
This commit is contained in:
nebel
2024-05-02 00:06:01 +09:00
committed by GitHub
parent 31221ac8f6
commit feb987744c
+5 -7
View File
@@ -204,13 +204,11 @@ internal unsafe class GameFunctions : IDisposable
var agent = Framework.Instance()->GetUiModule()->GetAgentModule()->GetAgentByInternalId(AgentId.ItemDetail); var agent = Framework.Instance()->GetUiModule()->GetAgentModule()->GetAgentByInternalId(AgentId.ItemDetail);
if (agent != null) if (agent != null)
{ {
Plugin.Log.Information("close and clean was called"); var eventData = stackalloc AtkValue[1];
agent->Hide(); var atkValues = stackalloc AtkValue[1];
atkValues->Type = ValueType.Int;
// The game sets them to 0 whenever tooltips aren't hovered anymore atkValues->Int = -1;
var agentPtr = (nint)agent; agent->ReceiveEvent(eventData, atkValues, 1, 1);
*(uint*) (agentPtr + 0x138) = 0;
*(uint*) (agentPtr + 0x13C) = 0;
} }
} }