From b2b366032b03adb826863ba1b7a9735f87242242 Mon Sep 17 00:00:00 2001 From: Cara Date: Wed, 4 Oct 2023 03:18:37 +1030 Subject: [PATCH] Fix dtr (#1446) * Fix DtrBar * Zero some things * Update FFXIVClientStructs --- Dalamud/Game/Gui/Dtr/DtrBar.cs | 12 +++++++++++- lib/FFXIVClientStructs | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/Dalamud/Game/Gui/Dtr/DtrBar.cs b/Dalamud/Game/Gui/Dtr/DtrBar.cs index 06d37e7ec..66cf8c7cc 100644 --- a/Dalamud/Game/Gui/Dtr/DtrBar.cs +++ b/Dalamud/Game/Gui/Dtr/DtrBar.cs @@ -417,7 +417,7 @@ internal sealed unsafe class DtrBar : IDisposable, IServiceType, IDtrBar private AtkTextNode* MakeNode(uint nodeId) { - var newTextNode = IMemorySpace.GetUISpace()->Create(); + var newTextNode = AtkUldManager.CreateAtkTextNode(); if (newTextNode == null) { Log.Debug("Failed to allocate memory for AtkTextNode"); @@ -443,6 +443,16 @@ internal sealed unsafe class DtrBar : IDisposable, IServiceType, IDtrBar newTextNode->TextColor = new ByteColor { R = 255, G = 255, B = 255, A = 255 }; newTextNode->EdgeColor = new ByteColor { R = 142, G = 106, B = 12, A = 255 }; + // Memory is filled with random data after being created, zero out some things to avoid issues. + newTextNode->UnkPtr_1 = null; + newTextNode->SelectStart = 0; + newTextNode->SelectEnd = 0; + newTextNode->FontCacheHandle = 0; + newTextNode->CharSpacing = 0; + newTextNode->BackgroundColor = new ByteColor { R = 0, G = 0, B = 0, A = 0 }; + newTextNode->TextId = 0; + newTextNode->SheetType = 0; + return newTextNode; } diff --git a/lib/FFXIVClientStructs b/lib/FFXIVClientStructs index b39667d61..a58001056 160000 --- a/lib/FFXIVClientStructs +++ b/lib/FFXIVClientStructs @@ -1 +1 @@ -Subproject commit b39667d619d2446b2a03129a387e79faa7026c0f +Subproject commit a580010564e460b979bb3bc55756827229a0ebc2