ensure +1 with number prefix at own name

This commit is contained in:
2022-09-21 15:02:31 +02:00
parent c6a4891852
commit b0210a940f

View File

@@ -294,14 +294,19 @@ namespace PlayerTags.Features
var playerPayload = new PlayerPayload(playerName, PluginServices.ClientState.LocalPlayer.HomeWorld.Id);
int playerPayloadIndex = seString.Payloads.IndexOf(playerTextPayload);
var hasNumberPrefix = isSender && (chatType == XivChatType.Party || chatType == XivChatType.Alliance);
// Ensure to include the group number prefix within the player link
if (isSender && (chatType == XivChatType.Party || chatType == XivChatType.Alliance))
if (hasNumberPrefix)
playerPayloadIndex--;
// Add the Player Link Payload
seString.Payloads.Insert(playerPayloadIndex++, playerPayload);
// Same as above, but reverse
if (hasNumberPrefix)
playerPayloadIndex++;
// Add the Link Terminator to end the Player Link. This should be done behind the Text Payload (display text).
// Normally used to end PlayerPayload linking. But for the own player it has no affect. Anyway, use it, just because. Maybe it's needed in the future somewhere else.
seString.Payloads.Insert(++playerPayloadIndex, RawPayload.LinkTerminator);