Compare commits

...

2 Commits
v7.0 ... master

Author SHA1 Message Date
Liza cb208758fd
API 10 2024-07-05 21:53:41 +02:00
Liza f357bdcf2a
Update icon URL 2024-01-16 06:48:28 +01:00
4 changed files with 83 additions and 69 deletions

View File

@ -1,64 +1,9 @@
<?xml version="1.0" encoding="utf-8"?> <Project Sdk="Dalamud.NET.Sdk/9.0.2">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<Authors></Authors> <Version>8.0</Version>
<Company></Company>
<Version>7.0</Version>
<Description>Slice is Right.</Description>
<Copyright></Copyright>
<PackageProjectUrl>https://github.com/carvelli/Slice-Is-Right</PackageProjectUrl>
<Configurations>Release</Configurations>
</PropertyGroup>
<PropertyGroup>
<TargetFramework>net7.0-windows</TargetFramework>
<Platforms>x64</Platforms>
<Nullable>enable</Nullable>
<LangVersion>latest</LangVersion>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<ProduceReferenceAssembly>false</ProduceReferenceAssembly>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<OutputPath>dist</OutputPath> <OutputPath>dist</OutputPath>
<GenerateDependencyFile>false</GenerateDependencyFile>
</PropertyGroup> </PropertyGroup>
<PropertyGroup>
<DalamudLibPath>$(appdata)\XIVLauncher\addon\Hooks\dev\</DalamudLibPath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<DebugType>none</DebugType>
<DebugSymbols>false</DebugSymbols>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="DalamudPackager" Version="2.1.12" />
<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="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> <ItemGroup>
<None Update="SliceIsRight.yaml"> <None Update="SliceIsRight.yaml">
<CopyToOutputDirectory>Never</CopyToOutputDirectory> <CopyToOutputDirectory>Never</CopyToOutputDirectory>
@ -68,5 +13,4 @@
<Target Name="RenameLatestZip" AfterTargets="PackagePlugin"> <Target Name="RenameLatestZip" AfterTargets="PackagePlugin">
<Exec Command="rename $(OutDir)$(AssemblyName)\latest.zip $(AssemblyName)-$(Version).zip" /> <Exec Command="rename $(OutDir)$(AssemblyName)\latest.zip $(AssemblyName)-$(Version).zip" />
</Target> </Target>
</Project> </Project>

View File

@ -7,4 +7,4 @@ tags:
- gold saucer - gold saucer
- yojimbo - yojimbo
repo_url: https://git.carvel.li/liza/SliceIsRight repo_url: https://git.carvel.li/liza/SliceIsRight
icon_url: https://git.carvel.li/liza/plugin-repo/raw/branch/master/dist/SliceIsRight.png icon_url: https://plugins.carvel.li/icons/SliceIsRight.png

View File

@ -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))); private static readonly uint ColourRed = ImGui.GetColorU32(ImGui.ColorConvertFloat4ToU32(new Vector4(1, 0, 0, 0.4f)));
[PluginService] [PluginService]
[RequiredVersion("1.0")] private IDalamudPluginInterface PluginInterface { get; set; } = null!;
private DalamudPluginInterface PluginInterface { get; set; } = null!;
[PluginService] [PluginService]
private IObjectTable ObjectTable { get; set; } = null!; private IObjectTable ObjectTable { get; set; } = null!;
@ -68,7 +67,7 @@ public sealed class SliceIsRightPlugin : IDalamudPlugin
for (int index = 0; index < ObjectTable.Length; ++index) for (int index = 0; index < ObjectTable.Length; ++index)
{ {
GameObject? obj = ObjectTable[index]; IGameObject? obj = ObjectTable[index];
if (obj == null || DistanceToPlayer(obj.Position) > MaxDistance) if (obj == null || DistanceToPlayer(obj.Position) > MaxDistance)
continue; continue;
@ -77,7 +76,7 @@ public sealed class SliceIsRightPlugin : IDalamudPlugin
{ {
RenderObject(obj, model); RenderObject(obj, model);
} }
else if (ClientState.LocalPlayer?.ObjectId == obj.ObjectId) else if (ClientState.LocalPlayer?.EntityId == obj.EntityId)
{ {
// local player // local player
//RenderObject(index, obj, 2010779, 0.1f); // circle //RenderObject(index, obj, 2010779, 0.1f); // circle
@ -91,18 +90,18 @@ public sealed class SliceIsRightPlugin : IDalamudPlugin
_objectsToMatch.Clear(); _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) if (spawnTime.AddSeconds(5) > DateTime.Now)
return; return;
} }
else else
{ {
_objectsAndSpawnTime.Add(obj.ObjectId, DateTime.Now); _objectsAndSpawnTime.Add(obj.EntityId, DateTime.Now);
return; return;
} }
@ -143,7 +142,7 @@ public sealed class SliceIsRightPlugin : IDalamudPlugin
ImGui.PopID(); ImGui.PopID();
} }
private void DrawFilledCircleWorld(GameObject obj, float radius, uint colour) private void DrawFilledCircleWorld(IGameObject obj, float radius, uint colour)
{ {
BeginRender(obj.Address.ToString()); BeginRender(obj.Address.ToString());
@ -164,7 +163,7 @@ public sealed class SliceIsRightPlugin : IDalamudPlugin
EndRender(); 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}"); BeginRender($"{obj.Address}{obj.Rotation}");

71
packages.lock.json Normal file
View File

@ -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"
}
}
}
}
}