11 Commits

Author SHA1 Message Date
5820c8c00e version bump 2025-03-29 09:10:13 +01:00
b55e3a2f14 migrate to API9
- also migrate to Dalamud.NET.Sdk
2025-03-29 09:09:50 +01:00
098d77bcc2 version bump 2024-11-23 08:52:06 +01:00
292b6ea98a update submodule 2024-11-23 08:51:22 +01:00
9901f98c5b bump version 2024-11-22 21:58:30 +01:00
385e43eeef update for API 11 2024-11-22 21:57:04 +01:00
b14b39ef4d v0.7 2024-07-25 05:53:40 +02:00
00bca4562c switch over to INamePlate service from Dalamud 2024-07-25 05:53:34 +02:00
e340c44e43 update Pilz.Dalamud 2024-07-25 05:52:56 +02:00
03833c5155 v1.11.1.1 2024-07-20 09:50:46 +02:00
660b211dd9 update submodule 2024-07-20 09:50:22 +02:00
12 changed files with 126 additions and 165 deletions

View File

@@ -4,7 +4,7 @@ using Dalamud.Game.Text.SeStringHandling;
using Dalamud.Interface;
using Dalamud.Interface.Utility;
using ImGuiNET;
using Lumina.Excel.GeneratedSheets;
using Lumina.Excel.Sheets;
using Pilz.Dalamud.ActivityContexts;
using Pilz.Dalamud.Icons;
using Pilz.Dalamud.Tools.NamePlates;

View File

@@ -1,6 +1,7 @@
using Dalamud.Game.Text;
using Dalamud.Game.Text.SeStringHandling;
using Lumina.Excel.GeneratedSheets;
using Lumina.Excel.Sheets;
using Pilz.Dalamud;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -475,15 +476,16 @@ public class DefaultPluginData
{
foreach ((var role, var roleTagChanges) in RoleTags)
{
foreach (var classJob in classJobs.Where(classJob => RoleHelper.RolesByRoleId[classJob.Role] == role && !string.IsNullOrEmpty(classJob.Abbreviation.RawString)))
foreach (var classJob in classJobs.Where(classJob => RoleHelper.RolesByRoleId[classJob.Role] == role && !string.IsNullOrEmpty(classJob.Abbreviation.ParseString())))
{
if (!JobTags.ContainsKey(classJob.Abbreviation.RawString))
var abbrv = classJob.Abbreviation.ParseString();
if (!JobTags.ContainsKey(abbrv))
{
JobTags[classJob.Abbreviation.RawString] = new Tag()
JobTags[abbrv] = new Tag()
{
IsSelected = false,
IsExpanded = false,
Text = classJob.Abbreviation.RawString,
Text = abbrv,
};
}
}

View File

@@ -280,22 +280,22 @@ public class PluginData
public Identity? GetIdentity(MenuTargetDefault taget)
{
if (string.IsNullOrEmpty(taget.TargetName)
|| taget.TargetHomeWorld.Id == 0
|| taget.TargetHomeWorld.Id == 65535)
|| taget.TargetHomeWorld.RowId == 0
|| taget.TargetHomeWorld.RowId == 65535)
{
return null;
}
return GetIdentity(taget.TargetName, taget.TargetHomeWorld.Id);
return GetIdentity(taget.TargetName, taget.TargetHomeWorld.RowId);
}
public Identity GetIdentity(IPlayerCharacter playerCharacter)
{
return GetIdentity(playerCharacter.Name.TextValue, playerCharacter.HomeWorld.Id);
return GetIdentity(playerCharacter.Name.TextValue, playerCharacter.HomeWorld.RowId);
}
public Identity GetIdentity(IPartyMember partyMember)
{
return GetIdentity(partyMember.Name.TextValue, partyMember.World.Id);
return GetIdentity(partyMember.Name.TextValue, partyMember.World.RowId);
}
public Identity GetIdentity(PlayerPayload playerPayload)

View File

@@ -1,4 +1,5 @@
using Lumina.Excel.GeneratedSheets;
using Lumina.Excel.Sheets;
using Pilz.Dalamud;
using System.Collections.Generic;
using System.Linq;
@@ -39,11 +40,11 @@ public static class RoleHelper
var classJobs = PluginServices.DataManager.GetExcelSheet<ClassJob>();
if (classJobs != null)
{
foreach (var classJob in classJobs.Where(classJob => !string.IsNullOrEmpty(classJob.Abbreviation.RawString)))
foreach (var classJob in classJobs.Where(classJob => !string.IsNullOrEmpty(classJob.Abbreviation.ParseString())))
{
if (RolesByRoleId.TryGetValue(classJob.Role, out var role))
{
s_RolesByJobAbbreviation[classJob.Abbreviation] = role;
s_RolesByJobAbbreviation[classJob.Abbreviation.ParseString()] = role;
}
}
}
@@ -65,11 +66,11 @@ public static class RoleHelper
var classJobs = PluginServices.DataManager.GetExcelSheet<ClassJob>();
if (classJobs != null)
{
foreach (var classJob in classJobs.Where(classJob => !string.IsNullOrEmpty(classJob.Abbreviation.RawString)))
foreach (var classJob in classJobs.Where(classJob => !string.IsNullOrEmpty(classJob.Abbreviation.ParseString())))
{
if (DpsRolesByRoleId.TryGetValue(classJob.Role, out var dpsRole))
{
s_DpsRolesByJobAbbreviation[classJob.Abbreviation] = dpsRole;
s_DpsRolesByJobAbbreviation[classJob.Abbreviation.ParseString()] = dpsRole;
}
}
}
@@ -91,13 +92,13 @@ public static class RoleHelper
var classJobs = PluginServices.DataManager.GetExcelSheet<ClassJob>();
if (classJobs != null)
{
foreach (var classJob in classJobs.Where(classJob => !string.IsNullOrEmpty(classJob.Abbreviation.RawString)))
foreach (var classJob in classJobs.Where(classJob => !string.IsNullOrEmpty(classJob.Abbreviation.ParseString())))
{
if (DpsRolesByJobAbbreviation.TryGetValue(classJob.Abbreviation, out var dpsRole) && dpsRole == DpsRole.Ranged)
if (DpsRolesByJobAbbreviation.TryGetValue(classJob.Abbreviation.ParseString(), out var dpsRole) && dpsRole == DpsRole.Ranged)
{
if (RangedDpsRolesByPrimaryStat.TryGetValue(classJob.PrimaryStat, out var rangedDPSRole))
{
s_RangedDpsRolesByJobAbbreviation[classJob.Abbreviation] = rangedDPSRole;
s_RangedDpsRolesByJobAbbreviation[classJob.Abbreviation.ParseString()] = rangedDPSRole;
}
}
}
@@ -123,10 +124,9 @@ public static class RoleHelper
{
var gatheringJobAbbreviations = gatheringSubCategories
.Select(gatheringSubCategory => gatheringSubCategory.ClassJob.Value)
.Where(classJob => classJob != null)
.Select(classJob => classJob!.Abbreviation).Distinct();
foreach (var classJob in classJobs.Where(classJob => !string.IsNullOrEmpty(classJob.Abbreviation.RawString)))
foreach (var classJob in classJobs.Where(classJob => !string.IsNullOrEmpty(classJob.Abbreviation.ParseString())))
{
if (RolesByRoleId.TryGetValue(classJob.Role, out var role))
{
@@ -134,11 +134,11 @@ public static class RoleHelper
{
if (gatheringJobAbbreviations.Contains(classJob.Abbreviation))
{
s_LandHandRolesByJobAbbreviation[classJob.Abbreviation] = LandHandRole.Land;
s_LandHandRolesByJobAbbreviation[classJob.Abbreviation.ParseString()] = LandHandRole.Land;
}
else
{
s_LandHandRolesByJobAbbreviation[classJob.Abbreviation] = LandHandRole.Hand;
s_LandHandRolesByJobAbbreviation[classJob.Abbreviation.ParseString()] = LandHandRole.Hand;
}
}
}

View File

@@ -1,4 +1,5 @@
using Lumina.Excel.GeneratedSheets;
using Lumina.Excel.Sheets;
using Pilz.Dalamud;
using System.Collections.Generic;
namespace PlayerTags.Data;
@@ -19,7 +20,7 @@ public static class WorldHelper
{
foreach (var world in worlds)
{
s_WorldNames[world.RowId] = world.Name;
s_WorldNames[world.RowId] = world.Name.ParseString();
}
}
}

View File

@@ -3,6 +3,8 @@ using Dalamud.Game.ClientState.Objects.Types;
using Dalamud.Game.Text;
using Dalamud.Game.Text.SeStringHandling;
using Dalamud.Game.Text.SeStringHandling.Payloads;
using Lumina.Excel.Sheets;
using Pilz.Dalamud;
using Pilz.Dalamud.Tools.Strings;
using PlayerTags.Configuration;
using PlayerTags.Data;
@@ -273,7 +275,7 @@ public class ChatTagTargetFeature : TagTargetFeature
// Fix displaying of abbreviated own player name as the game does this after the chat message handler
playerTextPayload.Text = BuildPlayername(playerTextPayload.Text);
var playerPayload = new PlayerPayload(playerName, PluginServices.ClientState.LocalPlayer.HomeWorld.Id);
var playerPayload = new PlayerPayload(playerName, PluginServices.ClientState.LocalPlayer.HomeWorld.RowId);
int playerPayloadIndex = seString.Payloads.IndexOf(playerTextPayload);
var hasNumberPrefix = isSender && (chatType == XivChatType.Party || chatType == XivChatType.Alliance);
@@ -326,7 +328,7 @@ public class ChatTagTargetFeature : TagTargetFeature
if (stringMatch.GameObject is IPlayerCharacter playerCharacter)
{
// Add the job tag
if (playerCharacter.ClassJob.GameData != null && pluginData.JobTags.TryGetValue(playerCharacter.ClassJob.GameData.Abbreviation, out var jobTag))
if (playerCharacter.ClassJob.ValueNullable is ClassJob classJob && pluginData.JobTags.TryGetValue(classJob.Abbreviation.ParseString(), out var jobTag))
{
if (isTagEnabled(jobTag))
{
@@ -390,7 +392,7 @@ public class ChatTagTargetFeature : TagTargetFeature
if (stringMatch.GameObject is IPlayerCharacter playerCharacter1)
{
if (playerCharacter1.ClassJob.GameData != null && pluginData.JobTags.TryGetValue(playerCharacter1.ClassJob.GameData.Abbreviation, out var jobTag) && isTagEnabled(jobTag))
if (playerCharacter1.ClassJob.ValueNullable is ClassJob classJob && pluginData.JobTags.TryGetValue(classJob.Abbreviation.ParseString(), out var jobTag) && isTagEnabled(jobTag))
applyTextFormatting(jobTag);
}

View File

@@ -1,8 +1,10 @@
using Dalamud.Game.ClientState.Objects.SubKinds;
using Dalamud.Game.Gui.NamePlate;
using Dalamud.Game.Text.SeStringHandling;
using Dalamud.Game.Text.SeStringHandling.Payloads;
using Lumina.Excel.Sheets;
using Pilz.Dalamud;
using Pilz.Dalamud.Icons;
using Pilz.Dalamud.NamePlate;
using Pilz.Dalamud.Tools.NamePlates;
using Pilz.Dalamud.Tools.Strings;
using PlayerTags.Configuration;
@@ -112,11 +114,10 @@ public class NameplateTagTargetFeature : TagTargetFeature
if (handler.PlayerCharacter != null && (!handler.PlayerCharacter.IsDead || generalOptions.NameplateDeadPlayerHandling != DeadPlayerHandling.Ignore))
{
var classJob = handler.PlayerCharacter.ClassJob;
var classJobGameData = classJob?.GameData;
var classJob = handler.PlayerCharacter.ClassJob.ValueNullable;
// Add the job tags
if (classJobGameData != null && pluginData.JobTags.TryGetValue(classJobGameData.Abbreviation, out var jobTag))
if (classJob.HasValue && pluginData.JobTags.TryGetValue(classJob.Value.Abbreviation.ParseString(), out var jobTag))
{
if (jobTag.TagTargetInNameplates.InheritedValue != null && jobTag.TagPositionInNameplates.InheritedValue != null)
checkTag(jobTag);
@@ -152,7 +153,7 @@ public class NameplateTagTargetFeature : TagTargetFeature
AddPayloadChanges(tag.TagTargetInNameplates.InheritedValue.Value, tag.TagPositionInNameplates.InheritedValue.Value, payloads, nameplateChanges, false);
}
if (IsTagVisible(tag, handler.PlayerCharacter) && newStatusIcon == null && classJob != null && (tag.IsJobIconVisibleInNameplates?.InheritedValue ?? false))
newStatusIcon = jobIconSets.GetJobIcon(tag.JobIconSet?.InheritedValue ?? JobIconSetName.Framed, classJob.Id);
newStatusIcon = jobIconSets.GetJobIcon(tag.JobIconSet?.InheritedValue ?? JobIconSetName.Framed, classJob.Value.RowId);
}
}
@@ -183,7 +184,7 @@ public class NameplateTagTargetFeature : TagTargetFeature
applyTextFormatting(customTag);
}
if (handler.PlayerCharacter.ClassJob.GameData != null && pluginData.JobTags.TryGetValue(handler.PlayerCharacter.ClassJob.GameData.Abbreviation, out var jobTag))
if (handler.PlayerCharacter.ClassJob.ValueNullable is ClassJob classJob && pluginData.JobTags.TryGetValue(classJob.Abbreviation.ParseString(), out var jobTag))
applyTextFormatting(jobTag);
void applyTextFormatting(Tag tag)

View File

@@ -1,91 +1,49 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Authors>r00telement;Pilzinsel64</Authors>
<Version>1.11.1.0</Version>
</PropertyGroup>
<Project Sdk="Dalamud.NET.Sdk/12.0.2">
<PropertyGroup>
<TargetFramework>net8.0-windows</TargetFramework>
<Platforms>x64</Platforms>
<Nullable>annotations</Nullable>
<LangVersion>latest</LangVersion>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<ProduceReferenceAssembly>false</ProduceReferenceAssembly>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
</PropertyGroup>
<PropertyGroup>
<Authors>r00telement;Pilzinsel64</Authors>
<Version>1.12.2.0</Version>
</PropertyGroup>
<PropertyGroup>
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
</PropertyGroup>
<PropertyGroup>
<DalamudLibPath>$(appdata)\XIVLauncher\addon\Hooks\dev\</DalamudLibPath>
</PropertyGroup>
<PropertyGroup>
<Nullable>annotations</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="DalamudPackager" Version="2.1.13" />
<ProjectReference Include="..\Pilz.Dalamud\Pilz.Dalamud\Pilz.Dalamud.csproj" />
<Reference Include="FFXIVClientStructs">
<HintPath>$(DalamudLibPath)FFXIVClientStructs.dll</HintPath>
<Private>false</Private>
</Reference>
<Reference Include="Newtonsoft.Json">
<HintPath>$(DalamudLibPath)Newtonsoft.Json.dll</HintPath>
<Private>false</Private>
</Reference>
<Reference Include="Dalamud">
<HintPath>$(DalamudLibPath)Dalamud.dll</HintPath>
<Private>false</Private>
</Reference>
<Reference Include="ImGui.NET">
<HintPath>$(DalamudLibPath)ImGui.NET.dll</HintPath>
<Private>false</Private>
</Reference>
<Reference Include="ImGuiScene">
<HintPath>$(DalamudLibPath)ImGuiScene.dll</HintPath>
<Private>false</Private>
</Reference>
<Reference Include="Lumina">
<HintPath>$(DalamudLibPath)Lumina.dll</HintPath>
<Private>false</Private>
</Reference>
<Reference Include="Lumina.Excel">
<HintPath>$(DalamudLibPath)Lumina.Excel.dll</HintPath>
<Private>false</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Pilz.Dalamud\Pilz.Dalamud\Pilz.Dalamud.csproj" />
</ItemGroup>
<ItemGroup>
<Compile Update="Resources\Paths.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>Paths.resx</DependentUpon>
</Compile>
<Compile Update="Resources\Strings.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>Strings.resx</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<Compile Update="Resources\Paths.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>Paths.resx</DependentUpon>
</Compile>
<Compile Update="Resources\Strings.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>Strings.resx</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Update="Resources\Paths.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Paths.Designer.cs</LastGenOutput>
</EmbeddedResource>
<EmbeddedResource Update="Resources\Strings.resx">
<Generator>PublicResXFileCodeGenerator</Generator>
<LastGenOutput>Strings.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Update="Resources\Paths.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Paths.Designer.cs</LastGenOutput>
</EmbeddedResource>
<EmbeddedResource Update="Resources\Strings.resx">
<Generator>PublicResXFileCodeGenerator</Generator>
<LastGenOutput>Strings.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<None Update="Resources\Words\Adjectives.txt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="Resources\Words\Nouns.txt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<None Update="Resources\Words\Adjectives.txt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="Resources\Words\Nouns.txt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>

View File

@@ -1,7 +1,6 @@
using Dalamud.IoC;
using Dalamud.Plugin;
using Dalamud.Plugin.Services;
using Pilz.Dalamud.NamePlate;
namespace PlayerTags;
@@ -20,7 +19,7 @@ public class PluginServices
[PluginService] public static IPartyList PartyList { get; set; }
[PluginService] public static IGameInteropProvider GameInteropProvider { get; set; }
[PluginService] public static IContextMenu ContextMenu { get; set; }
[PluginService] public static INamePlateGui NamePlateGui => INamePlateGui.Instance;
[PluginService] public static INamePlateGui NamePlateGui { get; set; }
public static void Initialize(IDalamudPluginInterface pluginInterface)
{

View File

@@ -1,5 +1,6 @@
using ImGuiNET;
using Lumina.Excel.GeneratedSheets;
using Lumina.Excel;
using Lumina.Excel.Sheets;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -11,19 +12,14 @@ public static class UIColorHelper
{
private class UIColorComparer : IEqualityComparer<UIColor>
{
public bool Equals(UIColor? left, UIColor? right)
public bool Equals(UIColor left, UIColor right)
{
if (left != null && right != null)
{
return left.UIForeground == right.UIForeground;
}
return false;
return left.Dark == right.Dark;
}
public int GetHashCode(UIColor obj)
{
return obj.UIForeground.GetHashCode();
return obj.Dark.GetHashCode();
}
}
@@ -41,7 +37,7 @@ public static class UIColorHelper
public static Vector4 ToColor(UIColor uiColor)
{
var uiColorBytes = BitConverter.GetBytes(uiColor.UIForeground);
var uiColorBytes = BitConverter.GetBytes(uiColor.Dark);
return
new Vector4((float)uiColorBytes[3] / 255,
(float)uiColorBytes[2] / 255,
@@ -64,42 +60,38 @@ public static class UIColorHelper
private static UIColor[] CreateUIColors()
{
var uiColors = PluginServices.DataManager.GetExcelSheet<UIColor>();
if (uiColors != null)
if (PluginServices.DataManager.GetExcelSheet<UIColor>() is not ExcelSheet<UIColor> uiColors)
return [];
var filteredUIColors = new List<UIColor>(uiColors.Distinct(new UIColorComparer()).Where(uiColor => uiColor.Dark != 0 && uiColor.Dark != 255));
filteredUIColors.Sort((left, right) =>
{
var filteredUIColors = new List<UIColor>(uiColors.Distinct(new UIColorComparer()).Where(uiColor => uiColor.UIForeground != 0 && uiColor.UIForeground != 255));
var leftColor = ToColor(left);
var rightColor = ToColor(right);
ImGui.ColorConvertRGBtoHSV(leftColor.X, leftColor.Y, leftColor.Z, out float leftHue, out float leftSaturation, out float leftValue);
ImGui.ColorConvertRGBtoHSV(rightColor.X, rightColor.Y, rightColor.Z, out float rightHue, out float rightSaturation, out float rightValue);
filteredUIColors.Sort((left, right) =>
var hueDifference = leftHue.CompareTo(rightHue);
if (hueDifference != 0)
{
var leftColor = ToColor(left);
var rightColor = ToColor(right);
ImGui.ColorConvertRGBtoHSV(leftColor.X, leftColor.Y, leftColor.Z, out float leftHue, out float leftSaturation, out float leftValue);
ImGui.ColorConvertRGBtoHSV(rightColor.X, rightColor.Y, rightColor.Z, out float rightHue, out float rightSaturation, out float rightValue);
return hueDifference;
}
var hueDifference = leftHue.CompareTo(rightHue);
if (hueDifference != 0)
{
return hueDifference;
}
var valueDifference = leftValue.CompareTo(rightValue);
if (valueDifference != 0)
{
return valueDifference;
}
var valueDifference = leftValue.CompareTo(rightValue);
if (valueDifference != 0)
{
return valueDifference;
}
var saturationDifference = leftSaturation.CompareTo(rightSaturation);
if (saturationDifference != 0)
{
return saturationDifference;
}
var saturationDifference = leftSaturation.CompareTo(rightSaturation);
if (saturationDifference != 0)
{
return saturationDifference;
}
return 0;
});
return 0;
});
return filteredUIColors.ToArray();
}
return new UIColor[] { };
return filteredUIColors.ToArray();
}
}

View File

@@ -1,12 +1,18 @@
{
"version": 1,
"dependencies": {
"net8.0-windows7.0": {
"net9.0-windows7.0": {
"DalamudPackager": {
"type": "Direct",
"requested": "[2.1.13, )",
"resolved": "2.1.13",
"contentHash": "rMN1omGe8536f4xLMvx9NwfvpAc9YFFfeXJ1t4P4PE6Gu8WCIoFliR1sh07hM+bfODmesk/dvMbji7vNI+B/pQ=="
"requested": "[12.0.0, )",
"resolved": "12.0.0",
"contentHash": "J5TJLV3f16T/E2H2P17ClWjtfEBPpq3yxvqW46eN36JCm6wR+EaoaYkqG9Rm5sHqs3/nK/vKjWWyvEs/jhKoXw=="
},
"DotNet.ReproducibleBuilds": {
"type": "Direct",
"requested": "[1.2.25, )",
"resolved": "1.2.25",
"contentHash": "xCXiw7BCxHJ8pF6wPepRUddlh2dlQlbr81gXA72hdk4FLHkKXas7EH/n+fk5UCA/YfMqG1Z6XaPiUjDbUNBUzg=="
},
"pilz.dalamud": {
"type": "Project"