From 45bd30fccac0702981bdf7509353616c3f30cc4e Mon Sep 17 00:00:00 2001 From: Haselnussbomber Date: Wed, 12 Nov 2025 00:27:51 +0100 Subject: [PATCH] Use inherited fields --- Dalamud/Game/Gui/Dtr/DtrBar.cs | 48 +++++++++++++++++----------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/Dalamud/Game/Gui/Dtr/DtrBar.cs b/Dalamud/Game/Gui/Dtr/DtrBar.cs index b5c671a6f..2235c5ade 100644 --- a/Dalamud/Game/Gui/Dtr/DtrBar.cs +++ b/Dalamud/Game/Gui/Dtr/DtrBar.cs @@ -378,12 +378,12 @@ internal sealed unsafe class DtrBar : IInternalDisposableService, IDtrBar var isHide = !data.Shown || data.UserHidden; var node = data.TextNode; - var nodeHidden = !node->AtkResNode.IsVisible(); + var nodeHidden = !node->IsVisible(); if (!isHide) { if (nodeHidden) - node->AtkResNode.ToggleVisibility(true); + node->ToggleVisibility(true); if (data is { Added: true, Text: not null, TextNode: not null } && (data.Dirty || nodeHidden)) { @@ -397,27 +397,27 @@ internal sealed unsafe class DtrBar : IInternalDisposableService, IDtrBar ushort w = 0, h = 0; node->GetTextDrawSize(&w, &h, node->NodeText.StringPtr); - node->AtkResNode.SetWidth(w); + node->SetWidth(w); } - var elementWidth = data.TextNode->AtkResNode.Width + this.configuration.DtrSpacing; + var elementWidth = data.TextNode->Width + this.configuration.DtrSpacing; if (this.configuration.DtrSwapDirection) { - data.TextNode->AtkResNode.SetPositionFloat(runningXPos + this.configuration.DtrSpacing, 2); + data.TextNode->SetPositionFloat(runningXPos + this.configuration.DtrSpacing, 2); runningXPos += elementWidth; } else { runningXPos -= elementWidth; - data.TextNode->AtkResNode.SetPositionFloat(runningXPos, 2); + data.TextNode->SetPositionFloat(runningXPos, 2); } } else if (!nodeHidden) { // If we want the node hidden, shift it up, to prevent collision conflicts - node->AtkResNode.SetYFloat(-collisionNode->Height * dtr->RootNode->ScaleX); - node->AtkResNode.ToggleVisibility(false); + node->SetYFloat(-collisionNode->Height * dtr->RootNode->ScaleX); + node->ToggleVisibility(false); } data.Dirty = false; @@ -516,8 +516,8 @@ internal sealed unsafe class DtrBar : IInternalDisposableService, IDtrBar var node = data.TextNode = this.MakeNode(++this.runningNodeIds); - this.eventHandles.TryAdd(node->AtkResNode.NodeId, new List()); - this.eventHandles[node->AtkResNode.NodeId].AddRange(new List + this.eventHandles.TryAdd(node->NodeId, new List()); + this.eventHandles[node->NodeId].AddRange(new List { this.uiEventManager.AddEvent(AddonEventManager.DalamudInternalKey, (nint)dtr, (nint)node, AddonEventType.MouseOver, this.DtrEventHandler), this.uiEventManager.AddEvent(AddonEventManager.DalamudInternalKey, (nint)dtr, (nint)node, AddonEventType.MouseOut, this.DtrEventHandler), @@ -528,8 +528,8 @@ internal sealed unsafe class DtrBar : IInternalDisposableService, IDtrBar while (lastChild->PrevSiblingNode != null) lastChild = lastChild->PrevSiblingNode; Log.Debug($"Found last sibling: {(ulong)lastChild:X}"); lastChild->PrevSiblingNode = (AtkResNode*)node; - node->AtkResNode.ParentNode = lastChild->ParentNode; - node->AtkResNode.NextSiblingNode = lastChild; + node->ParentNode = lastChild->ParentNode; + node->NextSiblingNode = lastChild; dtr->RootNode->ChildCount = (ushort)(dtr->RootNode->ChildCount + 1); Log.Debug("Set last sibling of DTR and updated child count"); @@ -548,24 +548,24 @@ internal sealed unsafe class DtrBar : IInternalDisposableService, IDtrBar var node = data.TextNode; if (dtr == null || dtr->RootNode == null || dtr->UldManager.NodeList == null || node == null) return; - if (this.eventHandles.TryGetValue(node->AtkResNode.NodeId, out var eventHandles)) + if (this.eventHandles.TryGetValue(node->NodeId, out var eventHandles)) { eventHandles.ForEach(handle => this.uiEventManager.RemoveEvent(AddonEventManager.DalamudInternalKey, handle)); eventHandles.Clear(); } else { - Log.Warning("Could not find AtkResNode with NodeId {nodeId} in eventHandles", node->AtkResNode.NodeId); + Log.Warning("Could not find AtkResNode with NodeId {nodeId} in eventHandles", node->NodeId); } - var tmpPrevNode = node->AtkResNode.PrevSiblingNode; - var tmpNextNode = node->AtkResNode.NextSiblingNode; + var tmpPrevNode = node->PrevSiblingNode; + var tmpNextNode = node->NextSiblingNode; // if (tmpNextNode != null) tmpNextNode->PrevSiblingNode = tmpPrevNode; if (tmpPrevNode != null) tmpPrevNode->NextSiblingNode = tmpNextNode; - node->AtkResNode.Destroy(true); + node->Destroy(true); data.TextNode = null; dtr->RootNode->ChildCount = (ushort)(dtr->RootNode->ChildCount - 1); @@ -584,13 +584,13 @@ internal sealed unsafe class DtrBar : IInternalDisposableService, IDtrBar return null; } - newTextNode->AtkResNode.NodeId = nodeId; - newTextNode->AtkResNode.Type = NodeType.Text; - newTextNode->AtkResNode.NodeFlags = NodeFlags.AnchorLeft | NodeFlags.AnchorTop | NodeFlags.Enabled | NodeFlags.RespondToMouse | NodeFlags.HasCollision | NodeFlags.EmitsEvents; - newTextNode->AtkResNode.DrawFlags = 12; - newTextNode->AtkResNode.SetWidth(22); - newTextNode->AtkResNode.SetHeight(22); - newTextNode->AtkResNode.SetPositionFloat(-200, 2); + newTextNode->NodeId = nodeId; + newTextNode->Type = NodeType.Text; + newTextNode->NodeFlags = NodeFlags.AnchorLeft | NodeFlags.AnchorTop | NodeFlags.Enabled | NodeFlags.RespondToMouse | NodeFlags.HasCollision | NodeFlags.EmitsEvents; + newTextNode->DrawFlags = 12; + newTextNode->SetWidth(22); + newTextNode->SetHeight(22); + newTextNode->SetPositionFloat(-200, 2); newTextNode->LineSpacing = 12; newTextNode->AlignmentFontType = 5;