refactor: update for api7 and net6

This commit is contained in:
Anna 2022-08-21 15:57:42 -04:00
parent 8278a8db0d
commit 0456d77d7d
Signed by: anna
GPG Key ID: 0B391D8F06FCD9E0
7 changed files with 1200 additions and 30 deletions

View File

@ -1,13 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net5</TargetFramework>
<TargetFramework>net6</TargetFramework>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.ML" Version="1.6.0"/>
<PackageReference Include="Microsoft.ML" Version="1.7.1"/>
</ItemGroup>
</Project>

View File

@ -2,16 +2,16 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net5</TargetFramework>
<TargetFramework>net6</TargetFramework>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="ConsoleTables" Version="2.4.2"/>
<PackageReference Include="CsvHelper" Version="27.1.1"/>
<PackageReference Include="Microsoft.ML" Version="1.6.0"/>
<PackageReference Include="MimeKitLite" Version="2.15.1"/>
<PackageReference Include="CsvHelper" Version="28.0.1"/>
<PackageReference Include="Microsoft.ML" Version="1.7.1"/>
<PackageReference Include="MimeKitLite" Version="3.4.0"/>
</ItemGroup>
<ItemGroup>

View File

@ -1,7 +1,7 @@
using System;
using System.Linq;
using Dalamud.ContextMenu;
using NoSoliciting.Resources;
using XivCommon.Functions.ContextMenu;
namespace NoSoliciting {
public class ContextMenu : IDisposable {
@ -10,14 +10,14 @@ namespace NoSoliciting {
internal ContextMenu(Plugin plugin) {
this.Plugin = plugin;
this.Plugin.Common.Functions.ContextMenu.OpenContextMenu += this.OnOpenContextMenu;
this.Plugin.DalamudContextMenu.OnOpenGameObjectContextMenu += this.OnOpenContextMenu;
}
public void Dispose() {
this.Plugin.Common.Functions.ContextMenu.OpenContextMenu -= this.OnOpenContextMenu;
this.Plugin.DalamudContextMenu.OnOpenGameObjectContextMenu -= this.OnOpenContextMenu;
}
private void OnOpenContextMenu(ContextMenuOpenArgs args) {
private void OnOpenContextMenu(GameObjectContextMenuOpenArgs args) {
if (args.ParentAddonName != "LookingForGroup") {
return;
}
@ -27,10 +27,10 @@ namespace NoSoliciting {
}
var label = Language.ReportToNoSoliciting;
args.Items.Add(new NormalContextMenuItem(label, this.Report));
args.AddCustomItem(new GameObjectContextMenuItem(label, this.Report));
}
private void Report(ContextMenuItemSelectedArgs args) {
private void Report(GameObjectContextMenuItemSelectedArgs args) {
if (args.ContentIdLower == 0) {
return;
}

View File

@ -4,51 +4,56 @@
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
<Version>3.0.1</Version>
<TargetFramework>net5-windows</TargetFramework>
<TargetFramework>net6-windows</TargetFramework>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<PlatformTarget>x64</PlatformTarget>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
<ProduceReferenceAssembly>false</ProduceReferenceAssembly>
</PropertyGroup>
<PropertyGroup>
<Dalamud>$(AppData)\XIVLauncher\addon\Hooks\dev</Dalamud>
<DalamudLibPath>$(AppData)\XIVLauncher\addon\Hooks\dev</DalamudLibPath>
</PropertyGroup>
<PropertyGroup Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Linux)))'">
<DalamudLibPath>$(DALAMUD_HOME)</DalamudLibPath>
</PropertyGroup>
<PropertyGroup Condition="'$(IsCI)' == 'true'">
<Dalamud>$(HOME)/dalamud</Dalamud>
<DalamudLibPath>$(HOME)/dalamud</DalamudLibPath>
</PropertyGroup>
<ItemGroup>
<Reference Include="Dalamud">
<HintPath>$(Dalamud)\Dalamud.dll</HintPath>
<HintPath>$(DalamudLibPath)\Dalamud.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="ImGui.NET">
<HintPath>$(Dalamud)\ImGui.NET.dll</HintPath>
<HintPath>$(DalamudLibPath)\ImGui.NET.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Lumina">
<HintPath>$(Dalamud)\Lumina.dll</HintPath>
<HintPath>$(DalamudLibPath)\Lumina.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Lumina.Excel">
<HintPath>$(Dalamud)\Lumina.Excel.dll</HintPath>
<HintPath>$(DalamudLibPath)\Lumina.Excel.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Newtonsoft.Json">
<HintPath>$(Dalamud)\Newtonsoft.Json.dll</HintPath>
<HintPath>$(DalamudLibPath)\Newtonsoft.Json.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<PackageReference Include="DalamudLinter" Version="1.0.3"/>
<PackageReference Include="DalamudPackager" Version="2.1.4"/>
<PackageReference Include="Fody" Version="6.5.3" PrivateAssets="all"/>
<PackageReference Include="Microsoft.ML" Version="1.6.0"/>
<PackageReference Include="Dalamud.ContextMenu" Version="1.2.0"/>
<PackageReference Include="DalamudPackager" Version="2.1.7"/>
<PackageReference Include="Fody" Version="6.6.3" PrivateAssets="all"/>
<PackageReference Include="Microsoft.ML" Version="1.7.1"/>
<PackageReference Include="Resourcer.Fody" Version="1.8.0" PrivateAssets="all"/>
<PackageReference Include="XivCommon" Version="3.0.2"/>
<PackageReference Include="YamlDotNet" Version="11.2.1"/>
<PackageReference Include="XivCommon" Version="6.0.0"/>
<PackageReference Include="YamlDotNet" Version="12.0.0"/>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Update="Resources\Language.resx">
@ -66,7 +71,4 @@
<DependentUpon>NoSoliciting.resx</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<Content Include="..\icon.png" Link="images/icon.png" CopyToOutputDirectory="PreserveNewest" Visible="false"/>
</ItemGroup>
</Project>

View File

@ -17,3 +17,4 @@ description: |-
repo_url: https://git.sr.ht/~jkcclemens/NoSoliciting
# Use higher priority to filter messages before other plugins get them.
load_priority: 100
dalamud_api_level: 7

View File

@ -6,6 +6,7 @@ using System.IO;
using System.Reflection;
using System.Threading.Tasks;
using Dalamud;
using Dalamud.ContextMenu;
using Dalamud.Data;
using Dalamud.Game.ClientState;
using Dalamud.Game.Command;
@ -51,6 +52,7 @@ namespace NoSoliciting {
internal PluginConfiguration Config { get; }
internal XivCommonBase Common { get; }
internal DalamudContextMenu DalamudContextMenu { get; }
internal PluginUi Ui { get; }
private Commands Commands { get; }
private ContextMenu ContextMenu { get; }
@ -78,7 +80,8 @@ namespace NoSoliciting {
this.ConfigureLanguage();
this.Interface.LanguageChanged += this.OnLanguageUpdate;
this.Common = new XivCommonBase(Hooks.PartyFinder | Hooks.ContextMenu);
this.Common = new XivCommonBase(Hooks.PartyFinderListings);
this.DalamudContextMenu = new DalamudContextMenu();
this.Ui = new PluginUi(this);
this.Commands = new Commands(this);
@ -107,6 +110,7 @@ namespace NoSoliciting {
this.ContextMenu.Dispose();
this.Commands.Dispose();
this.Ui.Dispose();
this.DalamudContextMenu.Dispose();
this.Common.Dispose();
this.Interface.LanguageChanged -= this.OnLanguageUpdate;
}

File diff suppressed because it is too large Load Diff