This commit is contained in:
cake
2025-11-03 21:47:15 +01:00
parent 1b686e45dc
commit 35636f27f6

View File

@@ -205,7 +205,7 @@ public unsafe class NameplateHandler : IMediatorSubscriber
private void UpdateNameplateNodes() private void UpdateNameplateNodes()
{ {
var currentAddon = (AddonNamePlate*)_gameGui.GetAddonByName("NamePlate", 1).Address; var currentAddon = (AddonNamePlate*)_gameGui.GetAddonByName("NamePlate").Address;
if (_mpNameplateAddon == null || currentAddon == null || currentAddon != _mpNameplateAddon) if (_mpNameplateAddon == null || currentAddon == null || currentAddon != _mpNameplateAddon)
return; return;
@@ -248,7 +248,7 @@ public unsafe class NameplateHandler : IMediatorSubscriber
var cid = DalamudUtilService.GetHashedCIDFromPlayerPointer((nint)objectInfo->GameObject); var cid = DalamudUtilService.GetHashedCIDFromPlayerPointer((nint)objectInfo->GameObject);
if (cid == null || !_activeBroadcastingCids.Contains(cid)) if (cid == null || !_activeBroadcastingCids.Contains(cid))
{ {
pNode->AtkResNode.ToggleVisibility(false); pNode->AtkResNode.ToggleVisibility(enable: false);
continue; continue;
} }
@@ -256,7 +256,7 @@ public unsafe class NameplateHandler : IMediatorSubscriber
if (!config.LightfinderLabelShowOwn && local != null && if (!config.LightfinderLabelShowOwn && local != null &&
objectInfo->GameObject->GetGameObjectId() == local.GameObjectId) objectInfo->GameObject->GetGameObjectId() == local.GameObjectId)
{ {
pNode->AtkResNode.ToggleVisibility(false); pNode->AtkResNode.ToggleVisibility(enable: false);
continue; continue;
} }
@@ -266,7 +266,7 @@ public unsafe class NameplateHandler : IMediatorSubscriber
var goId = (ulong)objectInfo->GameObject->GetGameObjectId(); var goId = (ulong)objectInfo->GameObject->GetGameObjectId();
if (hidePaired && visibleUserIds.Contains(goId)) if (hidePaired && visibleUserIds.Contains(goId))
{ {
pNode->AtkResNode.ToggleVisibility(false); pNode->AtkResNode.ToggleVisibility(enable: false);
continue; continue;
} }
@@ -278,7 +278,7 @@ public unsafe class NameplateHandler : IMediatorSubscriber
if (root == null || nameContainer == null || nameText == null) if (root == null || nameContainer == null || nameText == null)
{ {
pNode->AtkResNode.ToggleVisibility(false); pNode->AtkResNode.ToggleVisibility(enable: false);
continue; continue;
} }
@@ -453,7 +453,7 @@ public unsafe class NameplateHandler : IMediatorSubscriber
positionY += config.LightfinderLabelOffsetY; positionY += config.LightfinderLabelOffsetY;
alignment = (AlignmentType)System.Math.Clamp((int)alignment, 0, 8); alignment = (AlignmentType)System.Math.Clamp((int)alignment, 0, 8);
pNode->AtkResNode.SetUseDepthBasedPriority(true); pNode->AtkResNode.SetUseDepthBasedPriority(enable: true);
pNode->AtkResNode.Color.A = 255; pNode->AtkResNode.Color.A = 255;
@@ -613,9 +613,8 @@ public unsafe class NameplateHandler : IMediatorSubscriber
if (ReferenceEquals(_activeBroadcastingCids, newSet) || _activeBroadcastingCids.SetEquals(newSet)) if (ReferenceEquals(_activeBroadcastingCids, newSet) || _activeBroadcastingCids.SetEquals(newSet))
return; return;
// single atomic swap <20> readers always see a consistent snapshot
_activeBroadcastingCids = newSet; _activeBroadcastingCids = newSet;
_logger.LogInformation("Active broadcast CIDs: {Cids}", string.Join(",", _activeBroadcastingCids)); _logger.LogInformation("Active broadcast CIDs: {Cids}", string.Join(',', _activeBroadcastingCids));
FlagRefresh(); FlagRefresh();
} }