From eb835548d3352a4e53783825a84f25331078cd69 Mon Sep 17 00:00:00 2001 From: MidoriKami <9083275+MidoriKami@users.noreply.github.com> Date: Tue, 3 Oct 2023 13:35:35 -0700 Subject: [PATCH] Restore Create (#1449) --- Dalamud/Game/Gui/Dtr/DtrBar.cs | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/Dalamud/Game/Gui/Dtr/DtrBar.cs b/Dalamud/Game/Gui/Dtr/DtrBar.cs index 66cf8c7cc..764eec988 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 = AtkUldManager.CreateAtkTextNode(); + var newTextNode = IMemorySpace.GetUISpace()->Create(); // AtkUldManager.CreateAtkTextNode(); if (newTextNode == null) { Log.Debug("Failed to allocate memory for AtkTextNode"); @@ -443,15 +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; + // ICreatable was restored, this may be necessary if AtkUldManager.CreateAtkTextNode(); is used instead of Create + // // 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; }