diff --git a/Pilz.Dalamud b/Pilz.Dalamud index 004056b..ca638c1 160000 --- a/Pilz.Dalamud +++ b/Pilz.Dalamud @@ -1 +1 @@ -Subproject commit 004056b64860a08cd8dd215b1f7a69518baa58c2 +Subproject commit ca638c19a2a92c7d60f8b7c18062b293788225ce diff --git a/PlayerTags/PlayerTags.csproj b/PlayerTags/PlayerTags.csproj index f08c97b..f0a2eed 100644 --- a/PlayerTags/PlayerTags.csproj +++ b/PlayerTags/PlayerTags.csproj @@ -1,91 +1,49 @@ - - - r00telement;Pilzinsel64 - 1.12.1.0 - + - - net8.0-windows - x64 - annotations - latest - true - false - false - + + r00telement;Pilzinsel64 + 1.12.1.0 + - - true - true - - - - $(appdata)\XIVLauncher\addon\Hooks\dev\ - + + annotations + - - - - - $(DalamudLibPath)FFXIVClientStructs.dll - false - - - $(DalamudLibPath)Newtonsoft.Json.dll - false - - - $(DalamudLibPath)Dalamud.dll - false - - - $(DalamudLibPath)ImGui.NET.dll - false - - - $(DalamudLibPath)ImGuiScene.dll - false - - - $(DalamudLibPath)Lumina.dll - false - - - $(DalamudLibPath)Lumina.Excel.dll - false - - + + + - - - True - True - Paths.resx - - - True - True - Strings.resx - - + + + True + True + Paths.resx + + + True + True + Strings.resx + + - - - ResXFileCodeGenerator - Paths.Designer.cs - - - PublicResXFileCodeGenerator - Strings.Designer.cs - - + + + ResXFileCodeGenerator + Paths.Designer.cs + + + PublicResXFileCodeGenerator + Strings.Designer.cs + + + + + + PreserveNewest + + + PreserveNewest + + - - - PreserveNewest - - - PreserveNewest - - \ No newline at end of file diff --git a/PlayerTags/UIColorHelper.cs b/PlayerTags/UIColorHelper.cs index a21b25a..188cc54 100644 --- a/PlayerTags/UIColorHelper.cs +++ b/PlayerTags/UIColorHelper.cs @@ -1,4 +1,5 @@ using ImGuiNET; +using Lumina.Excel; using Lumina.Excel.Sheets; using System; using System.Collections.Generic; @@ -13,12 +14,12 @@ public static class UIColorHelper { public bool Equals(UIColor left, UIColor right) { - return left.UIForeground == right.UIForeground; + return left.Dark == right.Dark; } public int GetHashCode(UIColor obj) { - return obj.UIForeground.GetHashCode(); + return obj.Dark.GetHashCode(); } } @@ -36,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, @@ -59,42 +60,38 @@ public static class UIColorHelper private static UIColor[] CreateUIColors() { - var uiColors = PluginServices.DataManager.GetExcelSheet(); - if (uiColors != null) + if (PluginServices.DataManager.GetExcelSheet() is not ExcelSheet uiColors) + return []; + + var filteredUIColors = new List(uiColors.Distinct(new UIColorComparer()).Where(uiColor => uiColor.Dark != 0 && uiColor.Dark != 255)); + filteredUIColors.Sort((left, right) => { - var filteredUIColors = new List(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(); } } diff --git a/PlayerTags/packages.lock.json b/PlayerTags/packages.lock.json index 64aee44..ccb023e 100644 --- a/PlayerTags/packages.lock.json +++ b/PlayerTags/packages.lock.json @@ -1,12 +1,18 @@ { "version": 1, "dependencies": { - "net8.0-windows7.0": { + "net9.0-windows7.0": { "DalamudPackager": { "type": "Direct", - "requested": "[11.0.0, )", - "resolved": "11.0.0", - "contentHash": "bjT7XUlhIJSmsE/O76b7weUX+evvGQctbQB8aKXt94o+oPWxHpCepxAGMs7Thow3AzCyqWs7cOpp9/2wcgRRQA==" + "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"