PlayerTags 1.1.4.0
- Added option to apply color to name in chat. - Added options to apply color to name, and free company in nameplates. - Fixed an issue where context menu tagging wouldn't save correctly. - Tweaked config defaults for better job visibility in chat. - Expanded word lists for randomly generated names because they amuse my simple brain.
This commit is contained in:
@@ -171,7 +171,7 @@ namespace PlayerTags.Configuration
|
||||
int rowIndex = 0;
|
||||
foreach (var player in orderedPlayerNameContexts)
|
||||
{
|
||||
DrawPlayerAssignmentRow(player.Key, rowIndex);
|
||||
DrawQuickAddRow(new Identity(player.Key), rowIndex);
|
||||
++rowIndex;
|
||||
}
|
||||
}
|
||||
@@ -200,15 +200,15 @@ namespace PlayerTags.Configuration
|
||||
ImGui.TableHeadersRow();
|
||||
|
||||
int rowIndex = 0;
|
||||
foreach (var gameObjectName in m_PluginData.CustomTags.SelectMany(customTag => customTag.SplitGameObjectNamesToApplyTo).Distinct().OrderBy(name => name).ToArray())
|
||||
foreach (var identity in m_PluginData.CustomTags.SelectMany(customTag => customTag.IdentitiesToAddTo).Distinct().OrderBy(name => name).ToArray())
|
||||
{
|
||||
DrawPlayerAssignmentRow(gameObjectName, rowIndex);
|
||||
DrawQuickAddRow(identity, rowIndex);
|
||||
++rowIndex;
|
||||
}
|
||||
|
||||
if (PluginServices.ObjectTable.Length == 0 && PluginServices.ClientState.LocalPlayer != null)
|
||||
{
|
||||
DrawPlayerAssignmentRow(PluginServices.ClientState.LocalPlayer.Name.TextValue, 0);
|
||||
DrawQuickAddRow(new Identity(PluginServices.ClientState.LocalPlayer.Name.TextValue), 0);
|
||||
}
|
||||
|
||||
ImGui.EndTable();
|
||||
@@ -229,9 +229,9 @@ namespace PlayerTags.Configuration
|
||||
}
|
||||
}
|
||||
|
||||
void DrawPlayerAssignmentRow(string playerName, int rowIndex)
|
||||
void DrawQuickAddRow(Identity identity, int rowIndex)
|
||||
{
|
||||
ImGui.PushID(playerName);
|
||||
ImGui.PushID(identity.ToString());
|
||||
|
||||
ImGui.TableNextRow();
|
||||
|
||||
@@ -244,7 +244,7 @@ namespace PlayerTags.Configuration
|
||||
ImGui.TableNextColumn();
|
||||
|
||||
ImGui.AlignTextToFramePadding();
|
||||
ImGui.Text(playerName);
|
||||
ImGui.Text(identity.Name);
|
||||
|
||||
foreach (Tag customTag in m_PluginData.CustomTags)
|
||||
{
|
||||
@@ -252,17 +252,17 @@ namespace PlayerTags.Configuration
|
||||
|
||||
ImGui.TableNextColumn();
|
||||
|
||||
bool isTagAssigned = customTag.IncludesGameObjectNameToApplyTo(playerName);
|
||||
bool isTagAssigned = customTag.CanAddToIdentity(identity);
|
||||
|
||||
DrawSimpleCheckbox(string.Format(Strings.Loc_Static_Format_AddTagToPlayer, customTag.Text.InheritedValue, playerName), ref isTagAssigned, () =>
|
||||
DrawSimpleCheckbox(string.Format(Strings.Loc_Static_Format_AddTagToPlayer, customTag.Text.InheritedValue, identity.Name), ref isTagAssigned, () =>
|
||||
{
|
||||
if (isTagAssigned)
|
||||
{
|
||||
customTag.AddGameObjectNameToApplyTo(playerName);
|
||||
customTag.AddIdentityToAddTo(identity);
|
||||
}
|
||||
else
|
||||
{
|
||||
customTag.RemoveGameObjectNameToApplyTo(playerName);
|
||||
customTag.RemoveIdentityToAddTo(identity);
|
||||
}
|
||||
|
||||
m_PluginConfiguration.Save(m_PluginData);
|
||||
|
||||
@@ -60,7 +60,9 @@ namespace PlayerTags.Data
|
||||
IsSelected = false,
|
||||
IsExpanded = true,
|
||||
IsIconVisibleInChat = true,
|
||||
IsTextVisibleInChat = true,
|
||||
IsTextVisibleInNameplates = true,
|
||||
IsTextColorAppliedToChatName = true
|
||||
}.GetChanges();
|
||||
|
||||
RoleTagsChanges = new Dictionary<Role, Dictionary<string, InheritableData>>();
|
||||
|
||||
74
PlayerTags/Data/Identity.cs
Normal file
74
PlayerTags/Data/Identity.cs
Normal file
@@ -0,0 +1,74 @@
|
||||
using System;
|
||||
|
||||
namespace PlayerTags.Data
|
||||
{
|
||||
// FirstName LastName
|
||||
// FirstName LastName:Id
|
||||
public struct Identity : IEquatable<Identity>
|
||||
{
|
||||
public string Name;
|
||||
public string? Id;
|
||||
|
||||
public Identity(string name)
|
||||
{
|
||||
Name = name;
|
||||
Id = null;
|
||||
}
|
||||
|
||||
public Identity(string name, string id)
|
||||
{
|
||||
Name = name;
|
||||
Id = id;
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
string str = Name;
|
||||
|
||||
if (Id != null)
|
||||
{
|
||||
Name += $":{Id}";
|
||||
}
|
||||
|
||||
return str;
|
||||
|
||||
}
|
||||
|
||||
public override bool Equals(object? obj)
|
||||
{
|
||||
return obj is Identity identity && Equals(identity);
|
||||
}
|
||||
|
||||
public bool Equals(Identity obj)
|
||||
{
|
||||
return this == obj;
|
||||
}
|
||||
|
||||
public static bool operator ==(Identity first, Identity second)
|
||||
{
|
||||
if (first.Id != null || second.Id != null)
|
||||
{
|
||||
return first.Id == second.Id;
|
||||
}
|
||||
|
||||
return first.Name.ToLower().Trim() == second.Name.ToLower().Trim();
|
||||
}
|
||||
|
||||
public static bool operator !=(Identity first, Identity second)
|
||||
{
|
||||
return !(first == second);
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
var hashCode = Name.GetHashCode();
|
||||
|
||||
if (Id != null)
|
||||
{
|
||||
hashCode *= 17 ^ Id.GetHashCode();
|
||||
}
|
||||
|
||||
return hashCode;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -81,8 +81,15 @@ namespace PlayerTags.Data
|
||||
}
|
||||
}
|
||||
|
||||
public InheritableValue<bool> IsSelected = new InheritableValue<bool>(false);
|
||||
public InheritableValue<bool> IsExpanded = new InheritableValue<bool>(false);
|
||||
public InheritableValue<bool> IsSelected = new InheritableValue<bool>(false)
|
||||
{
|
||||
Behavior = InheritableBehavior.Enabled
|
||||
};
|
||||
|
||||
public InheritableValue<bool> IsExpanded = new InheritableValue<bool>(false)
|
||||
{
|
||||
Behavior = InheritableBehavior.Enabled
|
||||
};
|
||||
|
||||
[InheritableCategory("GeneralCategory")]
|
||||
public InheritableReference<string> GameObjectNamesToApplyTo = new InheritableReference<string>("");
|
||||
@@ -106,6 +113,14 @@ namespace PlayerTags.Data
|
||||
public InheritableValue<bool> IsTextVisibleInChat = new InheritableValue<bool>(false);
|
||||
[InheritableCategory("TextCategory")]
|
||||
public InheritableValue<bool> IsTextVisibleInNameplates = new InheritableValue<bool>(false);
|
||||
[InheritableCategory("TextCategory")]
|
||||
public InheritableValue<bool> IsTextColorAppliedToChatName = new InheritableValue<bool>(false);
|
||||
[InheritableCategory("TextCategory")]
|
||||
public InheritableValue<bool> IsTextColorAppliedToNameplateName = new InheritableValue<bool>(false);
|
||||
[InheritableCategory("TextCategory")]
|
||||
public InheritableValue<bool> IsTextColorAppliedToNameplateTitle = new InheritableValue<bool>(false);
|
||||
[InheritableCategory("TextCategory")]
|
||||
public InheritableValue<bool> IsTextColorAppliedToNameplateFreeCompany = new InheritableValue<bool>(false);
|
||||
|
||||
[InheritableCategory("PositionCategory")]
|
||||
public InheritableValue<TagPosition> TagPositionInChat = new InheritableValue<TagPosition>(TagPosition.Before);
|
||||
@@ -134,7 +149,7 @@ namespace PlayerTags.Data
|
||||
[InheritableCategory("PlayerCategory")]
|
||||
public InheritableValue<bool> IsVisibleForOtherPlayers = new InheritableValue<bool>(false);
|
||||
|
||||
public string[] SplitGameObjectNamesToApplyTo
|
||||
private string[] IdentityDatasToAddTo
|
||||
{
|
||||
get
|
||||
{
|
||||
@@ -147,11 +162,26 @@ namespace PlayerTags.Data
|
||||
}
|
||||
}
|
||||
|
||||
private string[] CleanGameObjectNamesToApplyTo
|
||||
private Identity GetIdentity(string identityData)
|
||||
{
|
||||
var identity = new Identity();
|
||||
|
||||
var IdParts = identityData.Split(':');
|
||||
if (IdParts.Length > 1)
|
||||
{
|
||||
identity.Id = IdParts[1];
|
||||
}
|
||||
|
||||
identity.Name = IdParts[0];
|
||||
|
||||
return identity;
|
||||
}
|
||||
|
||||
public Identity[] IdentitiesToAddTo
|
||||
{
|
||||
get
|
||||
{
|
||||
return SplitGameObjectNamesToApplyTo.Select(gameObjectName => gameObjectName.ToLower().Trim()).ToArray();
|
||||
return IdentityDatasToAddTo.Select(identityData => GetIdentity(identityData)).ToArray();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -160,38 +190,29 @@ namespace PlayerTags.Data
|
||||
Name = name;
|
||||
}
|
||||
|
||||
public bool IncludesGameObjectNameToApplyTo(string gameObjectName)
|
||||
public bool CanAddToIdentity(Identity identity)
|
||||
{
|
||||
return CleanGameObjectNamesToApplyTo.Contains(gameObjectName.ToLower());
|
||||
return IdentitiesToAddTo.Contains(identity);
|
||||
}
|
||||
|
||||
public void AddGameObjectNameToApplyTo(string gameObjectName)
|
||||
public void AddIdentityToAddTo(Identity identity)
|
||||
{
|
||||
if (IncludesGameObjectNameToApplyTo(gameObjectName))
|
||||
if (CanAddToIdentity(identity))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
List<string> newSplitGameObjectNamesToApplyTo = SplitGameObjectNamesToApplyTo.ToList();
|
||||
|
||||
newSplitGameObjectNamesToApplyTo.Add(gameObjectName);
|
||||
|
||||
GameObjectNamesToApplyTo.Value = string.Join(",", newSplitGameObjectNamesToApplyTo);
|
||||
GameObjectNamesToApplyTo.Value = string.Join(", ", IdentitiesToAddTo.Append(identity));
|
||||
}
|
||||
|
||||
public void RemoveGameObjectNameToApplyTo(string gameObjectName)
|
||||
public void RemoveIdentityToAddTo(Identity identity)
|
||||
{
|
||||
if (!IncludesGameObjectNameToApplyTo(gameObjectName))
|
||||
if (!CanAddToIdentity(identity))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
List<string> newSplitGameObjectNamesToApplyTo = SplitGameObjectNamesToApplyTo.ToList();
|
||||
|
||||
var index = Array.IndexOf(CleanGameObjectNamesToApplyTo, gameObjectName.ToLower());
|
||||
newSplitGameObjectNamesToApplyTo.RemoveAt(index);
|
||||
|
||||
GameObjectNamesToApplyTo = string.Join(",", newSplitGameObjectNamesToApplyTo);
|
||||
GameObjectNamesToApplyTo.Value = string.Join(", ", IdentitiesToAddTo.Where(identityToAddTo => identityToAddTo != identity));
|
||||
}
|
||||
|
||||
public Dictionary<string, InheritableData> GetChanges(Dictionary<string, InheritableData>? defaultChanges = null)
|
||||
|
||||
@@ -63,7 +63,6 @@ namespace PlayerTags.Features
|
||||
private PluginData m_PluginData;
|
||||
|
||||
public ChatTagTargetFeature(PluginConfiguration pluginConfiguration, PluginData pluginData)
|
||||
: base(pluginConfiguration)
|
||||
{
|
||||
m_PluginConfiguration = pluginConfiguration;
|
||||
m_PluginData = pluginData;
|
||||
@@ -160,7 +159,7 @@ namespace PlayerTags.Features
|
||||
{
|
||||
if (jobTag.TagPositionInChat.InheritedValue != null)
|
||||
{
|
||||
var payloads = GetPayloads(stringMatch.GameObject, jobTag);
|
||||
var payloads = GetPayloads(jobTag, stringMatch.GameObject);
|
||||
if (payloads.Any())
|
||||
{
|
||||
AddPayloadChanges(jobTag.TagPositionInChat.InheritedValue.Value, payloads, stringChanges);
|
||||
@@ -181,15 +180,18 @@ namespace PlayerTags.Features
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Add the custom tag payloads
|
||||
if (stringMatch.PlayerPayload != null)
|
||||
{
|
||||
// Add all other tags
|
||||
foreach (var customTag in m_PluginData.CustomTags)
|
||||
{
|
||||
if (customTag.TagPositionInChat.InheritedValue != null)
|
||||
if (customTag.CanAddToIdentity(new Identity(stringMatch.PlayerPayload.PlayerName)))
|
||||
{
|
||||
if (customTag.IncludesGameObjectNameToApplyTo(stringMatch.GetMatchText()))
|
||||
if (customTag.TagPositionInChat.InheritedValue != null)
|
||||
{
|
||||
var customTagPayloads = GetPayloads(stringMatch.GameObject, customTag);
|
||||
var customTagPayloads = GetPayloads(customTag, stringMatch.GameObject);
|
||||
if (customTagPayloads.Any())
|
||||
{
|
||||
AddPayloadChanges(customTag.TagPositionInChat.InheritedValue.Value, customTagPayloads, stringChanges);
|
||||
@@ -199,6 +201,48 @@ namespace PlayerTags.Features
|
||||
}
|
||||
}
|
||||
|
||||
// An additional step to apply text color to additional locations
|
||||
if (stringMatch.GameObject is PlayerCharacter playerCharacter1)
|
||||
{
|
||||
if (m_PluginData.JobTags.TryGetValue(playerCharacter1.ClassJob.GameData.Abbreviation, out var jobTag))
|
||||
{
|
||||
if (IsTagVisible(jobTag, stringMatch.GameObject))
|
||||
{
|
||||
if (jobTag.TextColor.InheritedValue != null)
|
||||
{
|
||||
if (jobTag.IsTextColorAppliedToChatName.InheritedValue != null && jobTag.IsTextColorAppliedToChatName.InheritedValue.Value)
|
||||
{
|
||||
int payloadIndex = message.Payloads.IndexOf(stringMatch.TextPayload);
|
||||
message.Payloads.Insert(payloadIndex + 1, new UIForegroundPayload(0));
|
||||
message.Payloads.Insert(payloadIndex, (new UIForegroundPayload(jobTag.TextColor.InheritedValue.Value)));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (stringMatch.PlayerPayload != null)
|
||||
{
|
||||
foreach (var customTag in m_PluginData.CustomTags)
|
||||
{
|
||||
if (customTag.CanAddToIdentity(new Identity(stringMatch.PlayerPayload.PlayerName)))
|
||||
{
|
||||
if (IsTagVisible(customTag, stringMatch.GameObject))
|
||||
{
|
||||
if (customTag.TextColor.InheritedValue != null)
|
||||
{
|
||||
if (customTag.IsTextColorAppliedToChatName.InheritedValue != null && customTag.IsTextColorAppliedToChatName.InheritedValue.Value)
|
||||
{
|
||||
int payloadIndex = message.Payloads.IndexOf(stringMatch.TextPayload);
|
||||
message.Payloads.Insert(payloadIndex + 1, new UIForegroundPayload(0));
|
||||
message.Payloads.Insert(payloadIndex, (new UIForegroundPayload(customTag.TextColor.InheritedValue.Value)));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ApplyStringChanges(message, stringChanges, stringMatch.TextPayload);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,7 +53,10 @@ namespace PlayerTags.Features
|
||||
|
||||
string gameObjectName = args.Text!.TextValue;
|
||||
|
||||
var notAddedTags = m_PluginData.CustomTags.Where(tag => !tag.IncludesGameObjectNameToApplyTo(gameObjectName));
|
||||
var notAddedTags = m_PluginData.CustomTags.Where(tag => !tag.CanAddToIdentity(new Identity()
|
||||
{
|
||||
Name = gameObjectName
|
||||
}));
|
||||
if (notAddedTags.Any())
|
||||
{
|
||||
args.Items.Add(new NormalContextSubMenuItem(Strings.Loc_Static_ContextMenu_AddTag, (itemArgs =>
|
||||
@@ -62,13 +65,21 @@ namespace PlayerTags.Features
|
||||
{
|
||||
itemArgs.Items.Add(new NormalContextMenuItem(notAddedTag.Text.Value, (args =>
|
||||
{
|
||||
notAddedTag.AddGameObjectNameToApplyTo(gameObjectName);
|
||||
notAddedTag.AddIdentityToAddTo(new Identity()
|
||||
{
|
||||
Name = gameObjectName
|
||||
});
|
||||
|
||||
m_PluginConfiguration.Save(m_PluginData);
|
||||
})));
|
||||
}
|
||||
})));
|
||||
}
|
||||
|
||||
var addedTags = m_PluginData.CustomTags.Where(tag => tag.IncludesGameObjectNameToApplyTo(gameObjectName));
|
||||
var addedTags = m_PluginData.CustomTags.Where(tag => tag.CanAddToIdentity(new Identity()
|
||||
{
|
||||
Name = gameObjectName
|
||||
}));
|
||||
if (addedTags.Any())
|
||||
{
|
||||
args.Items.Add(new NormalContextSubMenuItem(Strings.Loc_Static_ContextMenu_RemoveTag, (itemArgs =>
|
||||
@@ -77,7 +88,12 @@ namespace PlayerTags.Features
|
||||
{
|
||||
itemArgs.Items.Add(new NormalContextMenuItem(addedTag.Text.Value, (args =>
|
||||
{
|
||||
addedTag.RemoveGameObjectNameToApplyTo(gameObjectName);
|
||||
addedTag.RemoveIdentityToAddTo(new Identity()
|
||||
{
|
||||
Name = gameObjectName
|
||||
});
|
||||
|
||||
m_PluginConfiguration.Save(m_PluginData);
|
||||
})));
|
||||
}
|
||||
})));
|
||||
|
||||
@@ -19,7 +19,6 @@ namespace PlayerTags.Features
|
||||
private NameplateHooks? m_NameplateHooks;
|
||||
|
||||
public NameplatesTagTargetFeature(PluginConfiguration pluginConfiguration, PluginData pluginData)
|
||||
: base(pluginConfiguration)
|
||||
{
|
||||
m_PluginConfiguration = pluginConfiguration;
|
||||
m_PluginData = pluginData;
|
||||
@@ -176,14 +175,14 @@ namespace PlayerTags.Features
|
||||
|
||||
Dictionary<NameplateElement, Dictionary<TagPosition, List<Payload>>> nameplateChanges = new Dictionary<NameplateElement, Dictionary<TagPosition, List<Payload>>>();
|
||||
|
||||
if (gameObject is Character character)
|
||||
if (gameObject is PlayerCharacter playerCharacter)
|
||||
{
|
||||
// Add the job tags
|
||||
if (m_PluginData.JobTags.TryGetValue(character.ClassJob.GameData.Abbreviation, out var jobTag))
|
||||
if (m_PluginData.JobTags.TryGetValue(playerCharacter.ClassJob.GameData.Abbreviation, out var jobTag))
|
||||
{
|
||||
if (jobTag.TagTargetInNameplates.InheritedValue != null && jobTag.TagPositionInNameplates.InheritedValue != null)
|
||||
{
|
||||
var payloads = GetPayloads(gameObject, jobTag);
|
||||
var payloads = GetPayloads(jobTag, gameObject);
|
||||
if (payloads.Any())
|
||||
{
|
||||
AddPayloadChanges(jobTag.TagTargetInNameplates.InheritedValue.Value, jobTag.TagPositionInNameplates.InheritedValue.Value, payloads, nameplateChanges);
|
||||
@@ -194,7 +193,7 @@ namespace PlayerTags.Features
|
||||
// Add the randomly generated name tag payload
|
||||
if (m_PluginConfiguration.IsPlayerNameRandomlyGenerated)
|
||||
{
|
||||
var characterName = character.Name.TextValue;
|
||||
var characterName = playerCharacter.Name.TextValue;
|
||||
if (characterName != null)
|
||||
{
|
||||
var generatedName = RandomNameGenerator.Generate(characterName);
|
||||
@@ -204,19 +203,19 @@ namespace PlayerTags.Features
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Add all other tags
|
||||
foreach (var customTag in m_PluginData.AllTags.Descendents)
|
||||
{
|
||||
if (customTag.TagTargetInNameplates.InheritedValue != null && customTag.TagPositionInNameplates.InheritedValue != null)
|
||||
// Add all other tags
|
||||
foreach (var customTag in m_PluginData.CustomTags)
|
||||
{
|
||||
if (customTag.IncludesGameObjectNameToApplyTo(gameObject.Name.TextValue))
|
||||
if (customTag.CanAddToIdentity(new Identity(gameObject.Name.TextValue)))
|
||||
{
|
||||
var payloads = GetPayloads(gameObject, customTag);
|
||||
if (payloads.Any())
|
||||
if (customTag.TagTargetInNameplates.InheritedValue != null && customTag.TagPositionInNameplates.InheritedValue != null)
|
||||
{
|
||||
AddPayloadChanges(customTag.TagTargetInNameplates.InheritedValue.Value, customTag.TagPositionInNameplates.InheritedValue.Value, payloads, nameplateChanges);
|
||||
var payloads = GetPayloads(customTag, gameObject);
|
||||
if (payloads.Any())
|
||||
{
|
||||
AddPayloadChanges(customTag.TagTargetInNameplates.InheritedValue.Value, customTag.TagPositionInNameplates.InheritedValue.Value, payloads, nameplateChanges);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -247,6 +246,73 @@ namespace PlayerTags.Features
|
||||
ApplyStringChanges(seString, stringChanges);
|
||||
}
|
||||
}
|
||||
|
||||
// An additional step to apply text color to additional locations
|
||||
if (gameObject is PlayerCharacter playerCharacter1)
|
||||
{
|
||||
if (m_PluginData.JobTags.TryGetValue(playerCharacter1.ClassJob.GameData.Abbreviation, out var jobTag))
|
||||
{
|
||||
if (IsTagVisible(jobTag, gameObject))
|
||||
{
|
||||
if (jobTag.TextColor.InheritedValue != null)
|
||||
{
|
||||
if (jobTag.IsTextColorAppliedToNameplateName.InheritedValue != null && jobTag.IsTextColorAppliedToNameplateName.InheritedValue.Value)
|
||||
{
|
||||
name.Payloads.Insert(0, (new UIForegroundPayload(jobTag.TextColor.InheritedValue.Value)));
|
||||
name.Payloads.Add(new UIForegroundPayload(0));
|
||||
isNameChanged = true;
|
||||
}
|
||||
|
||||
if (jobTag.IsTextColorAppliedToNameplateTitle.InheritedValue != null && jobTag.IsTextColorAppliedToNameplateTitle.InheritedValue.Value)
|
||||
{
|
||||
title.Payloads.Insert(0, (new UIForegroundPayload(jobTag.TextColor.InheritedValue.Value)));
|
||||
title.Payloads.Add(new UIForegroundPayload(0));
|
||||
isTitleChanged = true;
|
||||
}
|
||||
|
||||
if (jobTag.IsTextColorAppliedToNameplateFreeCompany.InheritedValue != null && jobTag.IsTextColorAppliedToNameplateFreeCompany.InheritedValue.Value)
|
||||
{
|
||||
freeCompany.Payloads.Insert(0, (new UIForegroundPayload(jobTag.TextColor.InheritedValue.Value)));
|
||||
freeCompany.Payloads.Add(new UIForegroundPayload(0));
|
||||
isFreeCompanyChanged = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var customTag in m_PluginData.CustomTags)
|
||||
{
|
||||
if (customTag.CanAddToIdentity(new Identity(gameObject.Name.TextValue)))
|
||||
{
|
||||
if (IsTagVisible(customTag, gameObject))
|
||||
{
|
||||
if (customTag.TextColor.InheritedValue != null)
|
||||
{
|
||||
if (customTag.IsTextColorAppliedToNameplateName.InheritedValue != null && customTag.IsTextColorAppliedToNameplateName.InheritedValue.Value)
|
||||
{
|
||||
name.Payloads.Insert(0, (new UIForegroundPayload(customTag.TextColor.InheritedValue.Value)));
|
||||
name.Payloads.Add(new UIForegroundPayload(0));
|
||||
isNameChanged = true;
|
||||
}
|
||||
|
||||
if (customTag.IsTextColorAppliedToNameplateTitle.InheritedValue != null && customTag.IsTextColorAppliedToNameplateTitle.InheritedValue.Value)
|
||||
{
|
||||
title.Payloads.Insert(0, (new UIForegroundPayload(customTag.TextColor.InheritedValue.Value)));
|
||||
title.Payloads.Add(new UIForegroundPayload(0));
|
||||
isTitleChanged = true;
|
||||
}
|
||||
|
||||
if (customTag.IsTextColorAppliedToNameplateFreeCompany.InheritedValue != null && customTag.IsTextColorAppliedToNameplateFreeCompany.InheritedValue.Value)
|
||||
{
|
||||
freeCompany.Payloads.Insert(0, (new UIForegroundPayload(customTag.TextColor.InheritedValue.Value)));
|
||||
freeCompany.Payloads.Add(new UIForegroundPayload(0));
|
||||
isFreeCompanyChanged = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,13 +17,10 @@ namespace PlayerTags.Features
|
||||
{
|
||||
public abstract class TagTargetFeature : IDisposable
|
||||
{
|
||||
private PluginConfiguration m_PluginConfiguration;
|
||||
|
||||
private ActivityContext m_CurrentActivityContext;
|
||||
|
||||
public TagTargetFeature(PluginConfiguration pluginConfiguration)
|
||||
public TagTargetFeature()
|
||||
{
|
||||
m_PluginConfiguration = pluginConfiguration;
|
||||
|
||||
m_CurrentActivityContext = ActivityContext.None;
|
||||
|
||||
@@ -61,13 +58,7 @@ namespace PlayerTags.Features
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the payloads for the given game object tag. If the payloads don't yet exist then they will be created.
|
||||
/// </summary>
|
||||
/// <param name="gameObject">The game object to get payloads for.</param>
|
||||
/// <param name="tag">The tag config to get payloads for.</param>
|
||||
/// <returns>A list of payloads for the given tag.</returns>
|
||||
protected IEnumerable<Payload> GetPayloads(GameObject gameObject, Tag tag)
|
||||
protected bool IsTagVisible(Tag tag, GameObject? gameObject)
|
||||
{
|
||||
bool isVisibleForActivity = ActivityContextHelper.GetIsVisible(m_CurrentActivityContext,
|
||||
tag.IsVisibleInPveDuties.InheritedValue ?? false,
|
||||
@@ -76,7 +67,7 @@ namespace PlayerTags.Features
|
||||
|
||||
if (!isVisibleForActivity)
|
||||
{
|
||||
return Enumerable.Empty<Payload>();
|
||||
return false;
|
||||
}
|
||||
|
||||
if (gameObject is PlayerCharacter playerCharacter)
|
||||
@@ -91,14 +82,30 @@ namespace PlayerTags.Features
|
||||
|
||||
if (!isVisibleForPlayer)
|
||||
{
|
||||
return Enumerable.Empty<Payload>();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return CreatePayloads(gameObject, tag);
|
||||
return true;
|
||||
}
|
||||
|
||||
private Payload[] CreatePayloads(GameObject gameObject, Tag tag)
|
||||
/// <summary>
|
||||
/// Gets the payloads for the given game object tag. If the payloads don't yet exist then they will be created.
|
||||
/// </summary>
|
||||
/// <param name="gameObject">The game object to get payloads for.</param>
|
||||
/// <param name="tag">The tag config to get payloads for.</param>
|
||||
/// <returns>A list of payloads for the given tag.</returns>
|
||||
protected IEnumerable<Payload> GetPayloads(Tag tag, GameObject? gameObject)
|
||||
{
|
||||
if (!IsTagVisible(tag, gameObject))
|
||||
{
|
||||
return Enumerable.Empty<Payload>();
|
||||
}
|
||||
|
||||
return CreatePayloads(tag);
|
||||
}
|
||||
|
||||
private Payload[] CreatePayloads(Tag tag)
|
||||
{
|
||||
List<Payload> newPayloads = new List<Payload>();
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<Authors>r00telement</Authors>
|
||||
<Version>1.1.3.0</Version>
|
||||
<Version>1.1.4.0</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using Dalamud.Logging;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
|
||||
BIN
PlayerTags/Resources/Promo/PatchNote_1.png
Normal file
BIN
PlayerTags/Resources/Promo/PatchNote_1.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 30 KiB |
BIN
PlayerTags/Resources/Promo/PatchNote_2.png
Normal file
BIN
PlayerTags/Resources/Promo/PatchNote_2.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 87 KiB |
72
PlayerTags/Resources/Strings.Designer.cs
generated
72
PlayerTags/Resources/Strings.Designer.cs
generated
@@ -411,6 +411,78 @@ namespace PlayerTags.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Apply color to chat name.
|
||||
/// </summary>
|
||||
public static string Loc_IsTextColorAppliedToChatName {
|
||||
get {
|
||||
return ResourceManager.GetString("Loc_IsTextColorAppliedToChatName", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Whether the color will be applied to the name in chat..
|
||||
/// </summary>
|
||||
public static string Loc_IsTextColorAppliedToChatName_Description {
|
||||
get {
|
||||
return ResourceManager.GetString("Loc_IsTextColorAppliedToChatName_Description", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Apply color to nameplate free company.
|
||||
/// </summary>
|
||||
public static string Loc_IsTextColorAppliedToNameplateFreeCompany {
|
||||
get {
|
||||
return ResourceManager.GetString("Loc_IsTextColorAppliedToNameplateFreeCompany", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Whether the color will be applied to the free company in nameplates..
|
||||
/// </summary>
|
||||
public static string Loc_IsTextColorAppliedToNameplateFreeCompany_Description {
|
||||
get {
|
||||
return ResourceManager.GetString("Loc_IsTextColorAppliedToNameplateFreeCompany_Description", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Apply color to nameplate name.
|
||||
/// </summary>
|
||||
public static string Loc_IsTextColorAppliedToNameplateName {
|
||||
get {
|
||||
return ResourceManager.GetString("Loc_IsTextColorAppliedToNameplateName", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Whether the color will be applied to the name in nameplates..
|
||||
/// </summary>
|
||||
public static string Loc_IsTextColorAppliedToNameplateName_Description {
|
||||
get {
|
||||
return ResourceManager.GetString("Loc_IsTextColorAppliedToNameplateName_Description", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Apply color to nameplate title.
|
||||
/// </summary>
|
||||
public static string Loc_IsTextColorAppliedToNameplateTitle {
|
||||
get {
|
||||
return ResourceManager.GetString("Loc_IsTextColorAppliedToNameplateTitle", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Whether the color will be applied to title in nameplates..
|
||||
/// </summary>
|
||||
public static string Loc_IsTextColorAppliedToNameplateTitle_Description {
|
||||
get {
|
||||
return ResourceManager.GetString("Loc_IsTextColorAppliedToNameplateTitle_Description", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Italic.
|
||||
/// </summary>
|
||||
|
||||
@@ -531,4 +531,32 @@
|
||||
<data name="Loc_IsPlayersTabOthersVisible_Description" xml:space="preserve">
|
||||
<value>Show others in the players list.</value>
|
||||
</data>
|
||||
|
||||
<data name="Loc_IsTextColorAppliedToChatName" xml:space="preserve">
|
||||
<value>Apply color to chat name</value>
|
||||
</data>
|
||||
<data name="Loc_IsTextColorAppliedToChatName_Description" xml:space="preserve">
|
||||
<value>Whether the color will be applied to the name in chat.</value>
|
||||
</data>
|
||||
|
||||
<data name="Loc_IsTextColorAppliedToNameplateName" xml:space="preserve">
|
||||
<value>Apply color to nameplate name</value>
|
||||
</data>
|
||||
<data name="Loc_IsTextColorAppliedToNameplateName_Description" xml:space="preserve">
|
||||
<value>Whether the color will be applied to the name in nameplates.</value>
|
||||
</data>
|
||||
|
||||
<data name="Loc_IsTextColorAppliedToNameplateTitle" xml:space="preserve">
|
||||
<value>Apply color to nameplate title</value>
|
||||
</data>
|
||||
<data name="Loc_IsTextColorAppliedToNameplateTitle_Description" xml:space="preserve">
|
||||
<value>Whether the color will be applied to title in nameplates.</value>
|
||||
</data>
|
||||
|
||||
<data name="Loc_IsTextColorAppliedToNameplateFreeCompany" xml:space="preserve">
|
||||
<value>Apply color to nameplate free company</value>
|
||||
</data>
|
||||
<data name="Loc_IsTextColorAppliedToNameplateFreeCompany_Description" xml:space="preserve">
|
||||
<value>Whether the color will be applied to the free company in nameplates.</value>
|
||||
</data>
|
||||
</root>
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user