refactor: update to api level 3

This commit is contained in:
Anna 2021-04-05 15:13:41 -04:00
parent 49c86d4915
commit ac83b04fc9
3 changed files with 16 additions and 16 deletions

View File

@ -13,7 +13,7 @@
<EmbeddedResource Include="Resources\target.wav"/> <EmbeddedResource Include="Resources\target.wav"/>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Reference Include="Dalamud, Version=5.2.3.3, Culture=neutral, PublicKeyToken=null"> <Reference Include="Dalamud, Version=5.2.4.2, Culture=neutral, PublicKeyToken=null">
<HintPath>$(AppData)\XIVLauncher\addon\Hooks\dev\Dalamud.dll</HintPath> <HintPath>$(AppData)\XIVLauncher\addon\Hooks\dev\Dalamud.dll</HintPath>
<Private>False</Private> <Private>False</Private>
</Reference> </Reference>
@ -39,8 +39,8 @@
</Reference> </Reference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="DalamudPackager" Version="1.2.0"/> <PackageReference Include="DalamudPackager" Version="1.2.1"/>
<PackageReference Include="Fody" Version="6.3.0"> <PackageReference Include="Fody" Version="6.5.1">
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> </PackageReference>
@ -50,6 +50,6 @@
<PackageReference Include="Resourcer.Fody" Version="1.8.0"> <PackageReference Include="Resourcer.Fody" Version="1.8.0">
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
</PackageReference> </PackageReference>
<PackageReference Include="NAudio" Version="1.10.0"/> <PackageReference Include="NAudio" Version="2.0.0"/>
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -1,7 +1,4 @@
using Dalamud.Game.Chat; using Dalamud.Game.ClientState;
using Dalamud.Game.Chat.SeStringHandling;
using Dalamud.Game.Chat.SeStringHandling.Payloads;
using Dalamud.Game.ClientState;
using Dalamud.Game.ClientState.Actors.Types; using Dalamud.Game.ClientState.Actors.Types;
using ImGuiNET; using ImGuiNET;
using NAudio.Wave; using NAudio.Wave;
@ -9,6 +6,9 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Numerics; using System.Numerics;
using Dalamud.Game.Text;
using Dalamud.Game.Text.SeStringHandling;
using Dalamud.Game.Text.SeStringHandling.Payloads;
namespace PeepingTom { namespace PeepingTom {
internal class PluginUi : IDisposable { internal class PluginUi : IDisposable {
@ -367,7 +367,7 @@ namespace PeepingTom {
var payload = new PlayerPayload(this.Plugin.Interface.Data, actor.Name, actor.HomeWorld.Id); var payload = new PlayerPayload(this.Plugin.Interface.Data, actor.Name, actor.HomeWorld.Id);
Payload[] payloads = {payload}; Payload[] payloads = {payload};
this.Plugin.Interface.Framework.Gui.Chat.PrintChat(new XivChatEntry { this.Plugin.Interface.Framework.Gui.Chat.PrintChat(new XivChatEntry {
MessageBytes = new SeString(payloads).Encode() MessageBytes = new SeString(payloads).Encode(),
}); });
} }
} }
@ -380,7 +380,7 @@ namespace PeepingTom {
var payload = new PlayerPayload(this.Plugin.Interface.Data, target.Name, target.HomeWorld.Id); var payload = new PlayerPayload(this.Plugin.Interface.Data, target.Name, target.HomeWorld.Id);
Payload[] payloads = {payload}; Payload[] payloads = {payload};
this.Plugin.Interface.Framework.Gui.Chat.PrintChat(new XivChatEntry { this.Plugin.Interface.Framework.Gui.Chat.PrintChat(new XivChatEntry {
MessageBytes = new SeString(payloads).Encode() MessageBytes = new SeString(payloads).Encode(),
}); });
} }
} }
@ -437,7 +437,7 @@ namespace PeepingTom {
height -= ImGui.GetStyle().ItemSpacing.Y; height -= ImGui.GetStyle().ItemSpacing.Y;
var anyHovered = false; var anyHovered = false;
if (ImGui.ListBoxHeader("##targeting", new Vector2(-1, height))) { if (ImGui.BeginListBox("##targeting", new Vector2(-1, height))) {
// add the two first players for testing // add the two first players for testing
//foreach (PlayerCharacter p in this.plugin.Interface.ClientState.Actors //foreach (PlayerCharacter p in this.plugin.Interface.ClientState.Actors
// .Where(actor => actor is PlayerCharacter) // .Where(actor => actor is PlayerCharacter)
@ -465,7 +465,7 @@ namespace PeepingTom {
} }
} }
ImGui.ListBoxFooter(); ImGui.EndListBox();
} }
if (this.Plugin.Config.FocusTargetOnHover && !anyHovered && this.PreviousFocus.Get(out var previousFocus)) { if (this.Plugin.Config.FocusTargetOnHover && !anyHovered && this.PreviousFocus.Get(out var previousFocus)) {

View File

@ -1,7 +1,4 @@
using Dalamud.Game.Chat; using Dalamud.Game.ClientState.Actors.Types;
using Dalamud.Game.Chat.SeStringHandling;
using Dalamud.Game.Chat.SeStringHandling.Payloads;
using Dalamud.Game.ClientState.Actors.Types;
using Dalamud.Game.Internal; using Dalamud.Game.Internal;
using Dalamud.Plugin; using Dalamud.Plugin;
using NAudio.Wave; using NAudio.Wave;
@ -12,6 +9,9 @@ using System.Diagnostics;
using System.Linq; using System.Linq;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Threading; using System.Threading;
using Dalamud.Game.Text;
using Dalamud.Game.Text.SeStringHandling;
using Dalamud.Game.Text.SeStringHandling.Payloads;
namespace PeepingTom { namespace PeepingTom {
internal class TargetWatcher : IDisposable { internal class TargetWatcher : IDisposable {