Fixed merge conflict

This commit is contained in:
CakeAndBanana
2025-10-05 21:21:18 +02:00
5 changed files with 68 additions and 36 deletions

View File

@@ -42,7 +42,8 @@ public sealed class CommandManagerService : IDisposable
"\t /light toggle on|off - Connects or disconnects to Lightless respectively" + Environment.NewLine + "\t /light toggle on|off - Connects or disconnects to Lightless respectively" + Environment.NewLine +
"\t /light gpose - Opens the Lightless Character Data Hub window" + Environment.NewLine + "\t /light gpose - Opens the Lightless Character Data Hub window" + Environment.NewLine +
"\t /light analyze - Opens the Lightless Character Data Analysis window" + Environment.NewLine + "\t /light analyze - Opens the Lightless Character Data Analysis window" + Environment.NewLine +
"\t /light settings - Opens the Lightless Settings window" "\t /light settings - Opens the Lightless Settings window" + Environment.NewLine +
"\t /light lightfinder - Opens the Lightfinder window"
}); });
} }
@@ -122,5 +123,9 @@ public sealed class CommandManagerService : IDisposable
{ {
_mediator.Publish(new UiToggleMessage(typeof(SettingsUi))); _mediator.Publish(new UiToggleMessage(typeof(SettingsUi)));
} }
else if (string.Equals(splitArgs[0], "lightfinder", StringComparison.OrdinalIgnoreCase))
{
_mediator.Publish(new UiToggleMessage(typeof(BroadcastUI)));
}
} }
} }

View File

@@ -24,6 +24,7 @@ internal class ContextMenuService : IHostedService
private readonly PairRequestService _pairRequestService; private readonly PairRequestService _pairRequestService;
private readonly ApiController _apiController; private readonly ApiController _apiController;
private readonly IObjectTable _objectTable; private readonly IObjectTable _objectTable;
private readonly LightlessConfigService _configService;
public ContextMenuService( public ContextMenuService(
IContextMenu contextMenu, IContextMenu contextMenu,
@@ -45,6 +46,7 @@ internal class ContextMenuService : IHostedService
_dalamudUtil = dalamudUtil; _dalamudUtil = dalamudUtil;
_apiController = apiController; _apiController = apiController;
_objectTable = objectTable; _objectTable = objectTable;
_configService = configService;
_pairManager = pairManager; _pairManager = pairManager;
_pairRequestService = pairRequestService; _pairRequestService = pairRequestService;
_clientState = clientState; _clientState = clientState;
@@ -108,6 +110,9 @@ internal class ContextMenuService : IHostedService
var world = GetWorld(target.TargetHomeWorld.RowId); var world = GetWorld(target.TargetHomeWorld.RowId);
if (!IsWorldValid(world)) if (!IsWorldValid(world))
return; return;
if (!_configService.Current.EnableRightClickMenus)
return;
args.AddMenuItem(new MenuItem args.AddMenuItem(new MenuItem
{ {

View File

@@ -204,35 +204,43 @@ 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 &&
continue; objectInfo->GameObject != null &&
objectInfo->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); if (objectInfo == null || objectInfo->GameObject == null)
continue; continue;
}
pNode->AtkResNode.ToggleVisibility(true); var nameplateIndex = objectInfo->NamePlateIndex;
if (nameplateIndex < 0 || nameplateIndex >= AddonNamePlate.NumNamePlateObjects)
continue;
var nameplateObject = mpNameplateAddon->NamePlateObjectArray[nameplateIndex]; var pNode = mTextNodes[nameplateIndex];
nameplateObject.RootComponentNode->Component->UldManager.UpdateDrawNodeList(); if (pNode == null)
continue;
var nameContainer = nameplateObject.NameContainer; var cid = DalamudUtilService.GetHashedCIDFromPlayerPointer((nint)objectInfo->GameObject);
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);
@@ -294,6 +302,7 @@ 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;
@@ -336,6 +345,9 @@ 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)
@@ -367,18 +379,23 @@ 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);
@@ -387,6 +404,7 @@ 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;
@@ -434,6 +452,10 @@ 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);
} }

View File

@@ -313,7 +313,7 @@ public class DrawUserPair
using (ImRaii.PushColor(ImGuiCol.Text, roleColor)) using (ImRaii.PushColor(ImGuiCol.Text, roleColor))
{ {
ImGui.TextUnformatted(_pair.UserData.IsAdmin ImGui.TextUnformatted(_pair.UserData.IsAdmin
? "Official Lightless Admin" ? "Official Lightless Developer"
: "Official Lightless Moderator"); : "Official Lightless Moderator");
} }
ImGui.EndTooltip(); ImGui.EndTooltip();

View File

@@ -1032,7 +1032,7 @@ public class SettingsUi : WindowMediatorSubscriberBase
_configService.Current.EnableRightClickMenus = enableRightClickMenu; _configService.Current.EnableRightClickMenus = enableRightClickMenu;
_configService.Save(); _configService.Save();
} }
_uiShared.DrawHelpText("This will add Lightless related right click menu entries in the game UI on paired players."); _uiShared.DrawHelpText("This will add all Lightless related right click menu entries in the game UI.");
if (ImGui.Checkbox("Display status and visible pair count in Server Info Bar", ref enableDtrEntry)) if (ImGui.Checkbox("Display status and visible pair count in Server Info Bar", ref enableDtrEntry))
{ {