fix merge + add catch
Some checks failed
Tag and Release Lightless / tag-and-release (push) Failing after 38s
Some checks failed
Tag and Release Lightless / tag-and-release (push) Failing after 38s
This commit is contained in:
@@ -741,6 +741,11 @@ public sealed class PairHandler : DisposableMediatorSubscriberBase
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
catch (OperationCanceledException)
|
||||||
|
{
|
||||||
|
Logger.LogTrace("[BASE-{appBase}] Modded path calculation cancelled", applicationBase);
|
||||||
|
throw;
|
||||||
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
Logger.LogError(ex, "[BASE-{appBase}] Something went wrong during calculation replacements", applicationBase);
|
Logger.LogError(ex, "[BASE-{appBase}] Something went wrong during calculation replacements", applicationBase);
|
||||||
|
|||||||
@@ -204,43 +204,40 @@ 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 objectInfo = ui3DModule->NamePlateObjectInfoPointers[i].Value;
|
||||||
if (objectInfo != null &&
|
|
||||||
objectInfo->GameObject != null &&
|
if (objectInfo == null || objectInfo->GameObject == null)
|
||||||
objectInfo->NamePlateIndex >= 0)
|
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))
|
||||||
{
|
{
|
||||||
if (objectInfo == null || objectInfo->GameObject == null)
|
pNode->AtkResNode.ToggleVisibility(false);
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
var nameplateIndex = objectInfo->NamePlateIndex;
|
var nameplateObject = mpNameplateAddon->NamePlateObjectArray[nameplateIndex];
|
||||||
if (nameplateIndex < 0 || nameplateIndex >= AddonNamePlate.NumNamePlateObjects)
|
nameplateObject.RootComponentNode->Component->UldManager.UpdateDrawNodeList();
|
||||||
continue;
|
|
||||||
|
|
||||||
var pNode = mTextNodes[nameplateIndex];
|
var pNameplateIconNode = nameplateObject.MarkerIcon;
|
||||||
if (pNode == null)
|
var pNameplateResNode = nameplateObject.NameContainer;
|
||||||
continue;
|
var pNameplateTextNode = nameplateObject.NameText;
|
||||||
|
bool IsVisible = pNameplateIconNode->AtkResNode.IsVisible() || (pNameplateResNode->IsVisible() && pNameplateTextNode->AtkResNode.IsVisible());
|
||||||
|
pNode->AtkResNode.ToggleVisibility(IsVisible);
|
||||||
|
|
||||||
var cid = DalamudUtilService.GetHashedCIDFromPlayerPointer((nint)objectInfo->GameObject);
|
var nameContainer = nameplateObject.NameContainer;
|
||||||
|
var nameText = nameplateObject.NameText;
|
||||||
|
|
||||||
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");
|
|
||||||
if (nameContainer == null || nameText == null)
|
if (nameContainer == null || nameText == null)
|
||||||
{
|
{
|
||||||
pNode->AtkResNode.ToggleVisibility(false);
|
pNode->AtkResNode.ToggleVisibility(false);
|
||||||
@@ -302,7 +299,6 @@ public unsafe class NameplateHandler : IMediatorSubscriber
|
|||||||
_cachedNameplateContainerHeights[nameplateIndex] = containerHeight;
|
_cachedNameplateContainerHeights[nameplateIndex] = containerHeight;
|
||||||
}
|
}
|
||||||
|
|
||||||
var labelY = nameContainer->Height - nameplateObject.TextH - (int)(24 * nameText->AtkResNode.ScaleY);
|
|
||||||
var blockTop = containerHeight - blockHeight;
|
var blockTop = containerHeight - blockHeight;
|
||||||
if (blockTop < 0)
|
if (blockTop < 0)
|
||||||
blockTop = 0;
|
blockTop = 0;
|
||||||
@@ -345,9 +341,6 @@ public unsafe class NameplateHandler : IMediatorSubscriber
|
|||||||
hasValidOffset = false;
|
hasValidOffset = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
pNode->AtkResNode.SetPositionShort(58, (short)labelY);
|
|
||||||
pNode->AtkResNode.SetUseDepthBasedPriority(true);
|
|
||||||
pNode->AtkResNode.SetScale(0.5f, 0.5f);
|
|
||||||
if (config.LightfinderAutoAlign && nameContainer != null && hasValidOffset)
|
if (config.LightfinderAutoAlign && nameContainer != null && hasValidOffset)
|
||||||
{
|
{
|
||||||
switch (config.LabelAlignment)
|
switch (config.LabelAlignment)
|
||||||
@@ -379,23 +372,18 @@ public unsafe class NameplateHandler : IMediatorSubscriber
|
|||||||
pNode->AtkResNode.SetUseDepthBasedPriority(true);
|
pNode->AtkResNode.SetUseDepthBasedPriority(true);
|
||||||
pNode->AtkResNode.SetScale(effectiveScale, effectiveScale);
|
pNode->AtkResNode.SetScale(effectiveScale, effectiveScale);
|
||||||
|
|
||||||
pNode->AtkResNode.Color.A = 255;
|
pNode->AtkResNode.Color.A = 255;
|
||||||
|
|
||||||
pNode->TextColor.R = (byte)(labelColor.X * 255);
|
pNode->TextColor.R = (byte)(labelColor.X * 255);
|
||||||
pNode->TextColor.G = (byte)(labelColor.Y * 255);
|
pNode->TextColor.G = (byte)(labelColor.Y * 255);
|
||||||
pNode->TextColor.B = (byte)(labelColor.Z * 255);
|
pNode->TextColor.B = (byte)(labelColor.Z * 255);
|
||||||
pNode->TextColor.A = (byte)(labelColor.W * 255);
|
pNode->TextColor.A = (byte)(labelColor.W * 255);
|
||||||
|
|
||||||
pNode->EdgeColor.R = (byte)(edgeColor.X * 255);
|
pNode->EdgeColor.R = (byte)(edgeColor.X * 255);
|
||||||
pNode->EdgeColor.G = (byte)(edgeColor.Y * 255);
|
pNode->EdgeColor.G = (byte)(edgeColor.Y * 255);
|
||||||
pNode->EdgeColor.B = (byte)(edgeColor.Z * 255);
|
pNode->EdgeColor.B = (byte)(edgeColor.Z * 255);
|
||||||
pNode->EdgeColor.A = (byte)(edgeColor.W * 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;
|
|
||||||
var baseFontSize = config.LightfinderLabelUseIcon ? 36f : 24f;
|
var baseFontSize = config.LightfinderLabelUseIcon ? 36f : 24f;
|
||||||
var computedFontSize = (int)System.Math.Round(baseFontSize * scaleMultiplier);
|
var computedFontSize = (int)System.Math.Round(baseFontSize * scaleMultiplier);
|
||||||
pNode->FontSize = (byte)System.Math.Clamp(computedFontSize, 1, 255);
|
pNode->FontSize = (byte)System.Math.Clamp(computedFontSize, 1, 255);
|
||||||
@@ -404,7 +392,6 @@ public unsafe class NameplateHandler : IMediatorSubscriber
|
|||||||
pNode->LineSpacing = (byte)System.Math.Clamp(computedLineSpacing, 0, byte.MaxValue);
|
pNode->LineSpacing = (byte)System.Math.Clamp(computedLineSpacing, 0, byte.MaxValue);
|
||||||
pNode->CharSpacing = 1;
|
pNode->CharSpacing = 1;
|
||||||
|
|
||||||
pNode->TextFlags = TextFlags.Edge | TextFlags.Glare;
|
|
||||||
pNode->TextFlags = config.LightfinderLabelUseIcon
|
pNode->TextFlags = config.LightfinderLabelUseIcon
|
||||||
? TextFlags.Edge | TextFlags.Glare | TextFlags.AutoAdjustNodeSize
|
? TextFlags.Edge | TextFlags.Glare | TextFlags.AutoAdjustNodeSize
|
||||||
: TextFlags.Edge | TextFlags.Glare;
|
: TextFlags.Edge | TextFlags.Glare;
|
||||||
@@ -452,10 +439,6 @@ public unsafe class NameplateHandler : IMediatorSubscriber
|
|||||||
if (scale <= 0f)
|
if (scale <= 0f)
|
||||||
scale = 1f;
|
scale = 1f;
|
||||||
|
|
||||||
pNode->SetText("Lightfinder");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
var computed = (int)System.Math.Round(rawWidth * scale);
|
var computed = (int)System.Math.Round(rawWidth * scale);
|
||||||
return System.Math.Max(1, computed);
|
return System.Math.Max(1, computed);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user