refactor: update for new API changes

This commit is contained in:
Anna 2021-08-29 13:08:40 -04:00
parent 74b0fc3772
commit f1be5a37ba
Signed by: anna
GPG Key ID: 0B391D8F06FCD9E0
7 changed files with 7 additions and 9 deletions

1
.gitattributes vendored
View File

@ -1 +1,2 @@
* text eol=lf
*.png binary

View File

@ -2,7 +2,7 @@
<PropertyGroup>
<TargetFramework>net5-windows</TargetFramework>
<Version>1.3.5</Version>
<Version>1.3.6</Version>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>

View File

@ -34,7 +34,7 @@ namespace ExpandedSearchInfo {
// Updated: 4.5
var actorId = *(uint*) (data + 48);
var searchInfo = this.Plugin.SeStringManager.ReadRawSeString(searchInfoPtr);
var searchInfo = Util.ReadRawSeString(searchInfoPtr);
this.ReceiveSearchInfo?.Invoke(actorId, searchInfo);
} catch (Exception ex) {

View File

@ -2,7 +2,6 @@
using Dalamud.Game.ClientState.Objects;
using Dalamud.Game.Command;
using Dalamud.Game.Gui;
using Dalamud.Game.Text.SeStringHandling;
using Dalamud.IoC;
using Dalamud.Plugin;
@ -23,9 +22,6 @@ namespace ExpandedSearchInfo {
[PluginService]
internal ObjectTable ObjectTable { get; init; } = null!;
[PluginService]
internal SeStringManager SeStringManager { get; init; } = null!;
[PluginService]
internal SigScanner SigScanner { get; init; } = null!;

View File

@ -137,7 +137,7 @@ namespace ExpandedSearchInfo {
}
var addon = (AtkUnitBase*) addonPtr;
if (addon->IsVisible) {
if (!addon->IsVisible) {
return;
}
@ -166,6 +166,7 @@ namespace ExpandedSearchInfo {
ImGui.SetNextWindowSize(new Vector2(-1, -1));
if (!ImGui.Begin(this.Plugin.Name, ImGuiWindowFlags.NoTitleBar)) {
ImGui.End();
return;
}

View File

@ -8,7 +8,7 @@ namespace ExpandedSearchInfo {
internal static class Util {
private static readonly Regex BbCodeTag = new(@"\[/?\w+(?:=.+?)?\]", RegexOptions.Compiled | RegexOptions.IgnoreCase);
internal static unsafe SeString ReadRawSeString(this SeStringManager manager, IntPtr data) {
internal static unsafe SeString ReadRawSeString(IntPtr data) {
var bytes = new List<byte>();
var ptr = (byte*) data;
@ -17,7 +17,7 @@ namespace ExpandedSearchInfo {
ptr += 1;
}
return manager.Parse(bytes.ToArray());
return SeString.Parse(bytes.ToArray());
}
internal static string StripBbCode(this string input) => BbCodeTag.Replace(input, "");

BIN
icon.png Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 22 KiB