diff --git a/SliceIsRight.csproj b/SliceIsRight.csproj index 55b5983..54d4230 100644 --- a/SliceIsRight.csproj +++ b/SliceIsRight.csproj @@ -1,64 +1,9 @@ - - + - - - 7.0 - Slice is Right. - - https://github.com/carvelli/Slice-Is-Right - Release - - - - net7.0-windows - x64 - enable - latest - true - false - false + 8.0 dist - false - - $(appdata)\XIVLauncher\addon\Hooks\dev\ - - - - none - false - - - - - - $(DalamudLibPath)FFXIVClientStructs.dll - false - - - $(DalamudLibPath)Newtonsoft.Json.dll - false - - - $(DalamudLibPath)Dalamud.dll - false - - - $(DalamudLibPath)ImGui.NET.dll - false - - - $(DalamudLibPath)Lumina.dll - false - - - $(DalamudLibPath)Lumina.Excel.dll - false - - - Never @@ -68,5 +13,4 @@ - diff --git a/SlightIsRightPlugin.cs b/SlightIsRightPlugin.cs index be39c99..11ee1b5 100644 --- a/SlightIsRightPlugin.cs +++ b/SlightIsRightPlugin.cs @@ -21,8 +21,7 @@ public sealed class SliceIsRightPlugin : IDalamudPlugin private static readonly uint ColourRed = ImGui.GetColorU32(ImGui.ColorConvertFloat4ToU32(new Vector4(1, 0, 0, 0.4f))); [PluginService] - [RequiredVersion("1.0")] - private DalamudPluginInterface PluginInterface { get; set; } = null!; + private IDalamudPluginInterface PluginInterface { get; set; } = null!; [PluginService] private IObjectTable ObjectTable { get; set; } = null!; @@ -68,7 +67,7 @@ public sealed class SliceIsRightPlugin : IDalamudPlugin for (int index = 0; index < ObjectTable.Length; ++index) { - GameObject? obj = ObjectTable[index]; + IGameObject? obj = ObjectTable[index]; if (obj == null || DistanceToPlayer(obj.Position) > MaxDistance) continue; @@ -77,7 +76,7 @@ public sealed class SliceIsRightPlugin : IDalamudPlugin { RenderObject(obj, model); } - else if (ClientState.LocalPlayer?.ObjectId == obj.ObjectId) + else if (ClientState.LocalPlayer?.EntityId == obj.EntityId) { // local player //RenderObject(index, obj, 2010779, 0.1f); // circle @@ -91,18 +90,18 @@ public sealed class SliceIsRightPlugin : IDalamudPlugin _objectsToMatch.Clear(); } - private void RenderObject(GameObject obj, int model, float? radius = null) + private void RenderObject(IGameObject obj, int model, float? radius = null) { - _objectsToMatch.Remove(obj.ObjectId); + _objectsToMatch.Remove(obj.EntityId); - if (_objectsAndSpawnTime.TryGetValue(obj.ObjectId, out DateTime spawnTime)) + if (_objectsAndSpawnTime.TryGetValue(obj.EntityId, out DateTime spawnTime)) { if (spawnTime.AddSeconds(5) > DateTime.Now) return; } else { - _objectsAndSpawnTime.Add(obj.ObjectId, DateTime.Now); + _objectsAndSpawnTime.Add(obj.EntityId, DateTime.Now); return; } @@ -143,7 +142,7 @@ public sealed class SliceIsRightPlugin : IDalamudPlugin ImGui.PopID(); } - private void DrawFilledCircleWorld(GameObject obj, float radius, uint colour) + private void DrawFilledCircleWorld(IGameObject obj, float radius, uint colour) { BeginRender(obj.Address.ToString()); @@ -164,7 +163,7 @@ public sealed class SliceIsRightPlugin : IDalamudPlugin EndRender(); } - private void DrawRectWorld(GameObject obj, float rotation, float length, float width, uint colour) + private void DrawRectWorld(IGameObject obj, float rotation, float length, float width, uint colour) { BeginRender($"{obj.Address}{obj.Rotation}"); diff --git a/packages.lock.json b/packages.lock.json new file mode 100644 index 0000000..ba37d65 --- /dev/null +++ b/packages.lock.json @@ -0,0 +1,71 @@ +{ + "version": 1, + "dependencies": { + "net8.0-windows7.0": { + "DalamudPackager": { + "type": "Direct", + "requested": "[2.1.13, )", + "resolved": "2.1.13", + "contentHash": "rMN1omGe8536f4xLMvx9NwfvpAc9YFFfeXJ1t4P4PE6Gu8WCIoFliR1sh07hM+bfODmesk/dvMbji7vNI+B/pQ==" + }, + "DotNet.ReproducibleBuilds": { + "type": "Direct", + "requested": "[1.1.1, )", + "resolved": "1.1.1", + "contentHash": "+H2t/t34h6mhEoUvHi8yGXyuZ2GjSovcGYehJrS2MDm2XgmPfZL2Sdxg+uL2lKgZ4M6tTwKHIlxOob2bgh0NRQ==", + "dependencies": { + "Microsoft.SourceLink.AzureRepos.Git": "1.1.1", + "Microsoft.SourceLink.Bitbucket.Git": "1.1.1", + "Microsoft.SourceLink.GitHub": "1.1.1", + "Microsoft.SourceLink.GitLab": "1.1.1" + } + }, + "Microsoft.Build.Tasks.Git": { + "type": "Transitive", + "resolved": "1.1.1", + "contentHash": "AT3HlgTjsqHnWpBHSNeR0KxbLZD7bztlZVj7I8vgeYG9SYqbeFGh0TM/KVtC6fg53nrWHl3VfZFvb5BiQFcY6Q==" + }, + "Microsoft.SourceLink.AzureRepos.Git": { + "type": "Transitive", + "resolved": "1.1.1", + "contentHash": "qB5urvw9LO2bG3eVAkuL+2ughxz2rR7aYgm2iyrB8Rlk9cp2ndvGRCvehk3rNIhRuNtQaeKwctOl1KvWiklv5w==", + "dependencies": { + "Microsoft.Build.Tasks.Git": "1.1.1", + "Microsoft.SourceLink.Common": "1.1.1" + } + }, + "Microsoft.SourceLink.Bitbucket.Git": { + "type": "Transitive", + "resolved": "1.1.1", + "contentHash": "cDzxXwlyWpLWaH0em4Idj0H3AmVo3L/6xRXKssYemx+7W52iNskj/SQ4FOmfCb8YQt39otTDNMveCZzYtMoucQ==", + "dependencies": { + "Microsoft.Build.Tasks.Git": "1.1.1", + "Microsoft.SourceLink.Common": "1.1.1" + } + }, + "Microsoft.SourceLink.Common": { + "type": "Transitive", + "resolved": "1.1.1", + "contentHash": "WMcGpWKrmJmzrNeuaEb23bEMnbtR/vLmvZtkAP5qWu7vQsY59GqfRJd65sFpBszbd2k/bQ8cs8eWawQKAabkVg==" + }, + "Microsoft.SourceLink.GitHub": { + "type": "Transitive", + "resolved": "1.1.1", + "contentHash": "IaJGnOv/M7UQjRJks7B6p7pbPnOwisYGOIzqCz5ilGFTApZ3ktOR+6zJ12ZRPInulBmdAf1SrGdDG2MU8g6XTw==", + "dependencies": { + "Microsoft.Build.Tasks.Git": "1.1.1", + "Microsoft.SourceLink.Common": "1.1.1" + } + }, + "Microsoft.SourceLink.GitLab": { + "type": "Transitive", + "resolved": "1.1.1", + "contentHash": "tvsg47DDLqqedlPeYVE2lmiTpND8F0hkrealQ5hYltSmvruy/Gr5nHAKSsjyw5L3NeM/HLMI5ORv7on/M4qyZw==", + "dependencies": { + "Microsoft.Build.Tasks.Git": "1.1.1", + "Microsoft.SourceLink.Common": "1.1.1" + } + } + } + } +} \ No newline at end of file