Added a check if nameplate is visible to show the lightless text.
This commit is contained in:
@@ -176,66 +176,78 @@ public unsafe class NameplateHandler : IMediatorSubscriber
|
|||||||
|
|
||||||
for (int i = 0; i < ui3DModule->NamePlateObjectInfoCount; ++i)
|
for (int i = 0; i < ui3DModule->NamePlateObjectInfoCount; ++i)
|
||||||
{
|
{
|
||||||
var objectInfo = ui3DModule->NamePlateObjectInfoPointers[i].Value;
|
var pObjectInfo = ui3DModule->NamePlateObjectInfoPointers[i].Value;
|
||||||
if (objectInfo == null || objectInfo->GameObject == null)
|
if (pObjectInfo != null &&
|
||||||
continue;
|
pObjectInfo->GameObject != null &&
|
||||||
|
pObjectInfo->NamePlateIndex >= 0)
|
||||||
var nameplateIndex = objectInfo->NamePlateIndex;
|
|
||||||
if (nameplateIndex < 0 || nameplateIndex >= AddonNamePlate.NumNamePlateObjects)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
var pNode = mTextNodes[nameplateIndex];
|
|
||||||
if (pNode == null)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
var cid = DalamudUtilService.GetHashedCIDFromPlayerPointer((nint)objectInfo->GameObject);
|
|
||||||
|
|
||||||
//_logger.LogInformation($"checking cid: {cid}", cid);
|
|
||||||
|
|
||||||
if (cid == null || !_activeBroadcastingCids.Contains(cid))
|
|
||||||
{
|
{
|
||||||
pNode->AtkResNode.ToggleVisibility(false);
|
var objectInfo = ui3DModule->NamePlateObjectInfoPointers[i].Value;
|
||||||
continue;
|
if (objectInfo == null || objectInfo->GameObject == null)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
var nameplateIndex = objectInfo->NamePlateIndex;
|
||||||
|
if (nameplateIndex < 0 || nameplateIndex >= AddonNamePlate.NumNamePlateObjects)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
var pNode = mTextNodes[nameplateIndex];
|
||||||
|
if (pNode == null)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
var cid = DalamudUtilService.GetHashedCIDFromPlayerPointer((nint)objectInfo->GameObject);
|
||||||
|
|
||||||
|
//_logger.LogInformation($"checking cid: {cid}", cid);
|
||||||
|
|
||||||
|
if (cid == null || !_activeBroadcastingCids.Contains(cid))
|
||||||
|
{
|
||||||
|
pNode->AtkResNode.ToggleVisibility(false);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
var nameplateObject = mpNameplateAddon->NamePlateObjectArray[nameplateIndex];
|
||||||
|
nameplateObject.RootComponentNode->Component->UldManager.UpdateDrawNodeList();
|
||||||
|
|
||||||
|
var pNameplateIconNode = nameplateObject.MarkerIcon;
|
||||||
|
var pNameplateResNode = nameplateObject.NameContainer;
|
||||||
|
var pNameplateTextNode = nameplateObject.NameText;
|
||||||
|
bool IsVisible = pNameplateIconNode->AtkResNode.IsVisible() || (pNameplateResNode->IsVisible() && pNameplateTextNode->AtkResNode.IsVisible());
|
||||||
|
pNode->AtkResNode.ToggleVisibility(IsVisible);
|
||||||
|
|
||||||
|
var nameContainer = nameplateObject.NameContainer;
|
||||||
|
var nameText = nameplateObject.NameText;
|
||||||
|
|
||||||
|
var labelColor = UIColors.Get("LightlessPurple");
|
||||||
|
var edgeColor = UIColors.Get("FullBlack");
|
||||||
|
|
||||||
|
var labelY = nameContainer->Height - nameplateObject.TextH - (int)(24 * nameText->AtkResNode.ScaleY);
|
||||||
|
|
||||||
|
pNode->AtkResNode.SetPositionShort(58, (short)labelY);
|
||||||
|
pNode->AtkResNode.SetUseDepthBasedPriority(true);
|
||||||
|
pNode->AtkResNode.SetScale(0.5f, 0.5f);
|
||||||
|
|
||||||
|
pNode->AtkResNode.Color.A = 255;
|
||||||
|
|
||||||
|
pNode->TextColor.R = (byte)(labelColor.X * 255);
|
||||||
|
pNode->TextColor.G = (byte)(labelColor.Y * 255);
|
||||||
|
pNode->TextColor.B = (byte)(labelColor.Z * 255);
|
||||||
|
pNode->TextColor.A = (byte)(labelColor.W * 255);
|
||||||
|
|
||||||
|
pNode->EdgeColor.R = (byte)(edgeColor.X * 255);
|
||||||
|
pNode->EdgeColor.G = (byte)(edgeColor.Y * 255);
|
||||||
|
pNode->EdgeColor.B = (byte)(edgeColor.Z * 255);
|
||||||
|
pNode->EdgeColor.A = (byte)(edgeColor.W * 255);
|
||||||
|
|
||||||
|
pNode->FontSize = 24;
|
||||||
|
pNode->AlignmentType = AlignmentType.Center;
|
||||||
|
pNode->FontType = FontType.MiedingerMed;
|
||||||
|
pNode->LineSpacing = 24;
|
||||||
|
pNode->CharSpacing = 1;
|
||||||
|
|
||||||
|
pNode->TextFlags = TextFlags.Edge | TextFlags.Glare;
|
||||||
|
|
||||||
|
pNode->SetText("Lightfinder");
|
||||||
}
|
}
|
||||||
|
|
||||||
pNode->AtkResNode.ToggleVisibility(true);
|
|
||||||
|
|
||||||
var nameplateObject = mpNameplateAddon->NamePlateObjectArray[nameplateIndex];
|
|
||||||
nameplateObject.RootComponentNode->Component->UldManager.UpdateDrawNodeList();
|
|
||||||
|
|
||||||
var nameContainer = nameplateObject.NameContainer;
|
|
||||||
var nameText = nameplateObject.NameText;
|
|
||||||
|
|
||||||
var labelColor = UIColors.Get("LightlessPurple");
|
|
||||||
var edgeColor = UIColors.Get("FullBlack");
|
|
||||||
|
|
||||||
var labelY = nameContainer->Height - nameplateObject.TextH - (int)(24 * nameText->AtkResNode.ScaleY);
|
|
||||||
|
|
||||||
pNode->AtkResNode.SetPositionShort(58, (short)labelY);
|
|
||||||
pNode->AtkResNode.SetUseDepthBasedPriority(true);
|
|
||||||
pNode->AtkResNode.SetScale(0.5f, 0.5f);
|
|
||||||
|
|
||||||
pNode->AtkResNode.Color.A = 255;
|
|
||||||
|
|
||||||
pNode->TextColor.R = (byte)(labelColor.X * 255);
|
|
||||||
pNode->TextColor.G = (byte)(labelColor.Y * 255);
|
|
||||||
pNode->TextColor.B = (byte)(labelColor.Z * 255);
|
|
||||||
pNode->TextColor.A = (byte)(labelColor.W * 255);
|
|
||||||
|
|
||||||
pNode->EdgeColor.R = (byte)(edgeColor.X * 255);
|
|
||||||
pNode->EdgeColor.G = (byte)(edgeColor.Y * 255);
|
|
||||||
pNode->EdgeColor.B = (byte)(edgeColor.Z * 255);
|
|
||||||
pNode->EdgeColor.A = (byte)(edgeColor.W * 255);
|
|
||||||
|
|
||||||
pNode->FontSize = 24;
|
|
||||||
pNode->AlignmentType = AlignmentType.Center;
|
|
||||||
pNode->FontType = FontType.MiedingerMed;
|
|
||||||
pNode->LineSpacing = 24;
|
|
||||||
pNode->CharSpacing = 1;
|
|
||||||
|
|
||||||
pNode->TextFlags = TextFlags.Edge | TextFlags.Glare;
|
|
||||||
|
|
||||||
pNode->SetText("Lightfinder");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user