Update to API 10 without the Kami touch

This commit is contained in:
Liza 2024-07-09 23:01:17 +02:00
parent 2cf6ded1cd
commit 40bd0a0a2d
Signed by: liza
GPG Key ID: 7199F8D727D55F67
27 changed files with 92 additions and 101 deletions

View File

@ -51,7 +51,7 @@ public class Configuration : IPluginConfiguration
}; };
[NonSerialized] [NonSerialized]
private DalamudPluginInterface? pluginInterface; private IDalamudPluginInterface? pluginInterface;
public void Initialize(DalamudPluginInterface inputPluginInterface) => pluginInterface = inputPluginInterface; public void Initialize(IDalamudPluginInterface inputPluginInterface) => pluginInterface = inputPluginInterface;
public void Save() => pluginInterface!.SavePluginConfig(this); public void Save() => pluginInterface!.SavePluginConfig(this);
} }

View File

@ -8,7 +8,7 @@
</PropertyGroup> </PropertyGroup>
<PropertyGroup> <PropertyGroup>
<TargetFramework>net7.0-windows</TargetFramework> <TargetFramework>net8.0-windows</TargetFramework>
<Platforms>x64</Platforms> <Platforms>x64</Platforms>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<LangVersion>latest</LangVersion> <LangVersion>latest</LangVersion>
@ -27,7 +27,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="DalamudPackager" Version="2.1.12" /> <PackageReference Include="DalamudPackager" Version="2.1.13" />
<Reference Include="FFXIVClientStructs"> <Reference Include="FFXIVClientStructs">
<HintPath>$(DalamudLibPath)FFXIVClientStructs.dll</HintPath> <HintPath>$(DalamudLibPath)FFXIVClientStructs.dll</HintPath>
<Private>false</Private> <Private>false</Private>

View File

@ -1,6 +1,8 @@
using System; using System;
using System.Linq; using System.Linq;
using Dalamud.Interface.Internal; using Dalamud.Interface.Internal;
using Dalamud.Interface.Textures;
using Dalamud.Interface.Textures.TextureWraps;
using Dalamud.Utility; using Dalamud.Utility;
using FFXIVClientStructs.FFXIV.Client.Game; using FFXIVClientStructs.FFXIV.Client.Game;
using ImGuiScene; using ImGuiScene;
@ -9,12 +11,12 @@ using Lumina.Excel.GeneratedSheets;
namespace CurrencyAlert.DataModels; namespace CurrencyAlert.DataModels;
public class CurrencyInfo : IDisposable public class CurrencyInfo
{ {
public uint ItemID { get; } public uint ItemID { get; }
public string ItemName { get; } = string.Empty; public string ItemName { get; } = string.Empty;
public uint IconID { get; } public uint IconID { get; }
public IDalamudTextureWrap? IconTexture { get; } public ISharedImmediateTexture? IconTexture { get; }
public CurrencyInfo(CurrencyName currency) public CurrencyInfo(CurrencyName currency)
{ {
@ -25,18 +27,9 @@ public class CurrencyInfo : IDisposable
{ {
ItemName = currencyItem.Name.ToDalamudString().TextValue; ItemName = currencyItem.Name.ToDalamudString().TextValue;
IconID = currencyItem.Icon; IconID = currencyItem.Icon;
IconTexture = IconCache.Instance.GetIcon(IconID);
if (IconCache.Instance.GetIcon(IconID) is { } iconTexture)
{
IconTexture = iconTexture;
} }
} }
}
public void Dispose()
{
IconTexture?.Dispose();
}
public unsafe int GetCurrentQuantity() => InventoryManager.Instance()->GetInventoryItemCount(ItemID); public unsafe int GetCurrentQuantity() => InventoryManager.Instance()->GetInventoryItemCount(ItemID);
@ -70,8 +63,8 @@ public class CurrencyInfo : IDisposable
{ {
return LuminaCache<TomestonesItem>.Instance return LuminaCache<TomestonesItem>.Instance
.Where(tomestone => tomestone.Tomestones.Row is 3) .Where(tomestone => tomestone.Tomestones.Row is 3)
.First() .FirstOrDefault()
.Item.Row; ?.Item?.Row ?? 0;
} }
// This will always return the ItemID of whatever tomestone is not limited // This will always return the ItemID of whatever tomestone is not limited

View File

@ -1,4 +1,5 @@
using System.Numerics; using System.Numerics;
using Dalamud.Interface.Textures.TextureWraps;
using ImGuiNET; using ImGuiNET;
using KamiLib.Configuration; using KamiLib.Configuration;
@ -15,9 +16,10 @@ public record TrackedCurrency(CurrencyName Name, Setting<int> Threshold, Setting
public void DrawIcon() public void DrawIcon()
{ {
if (CurrencyInfo().IconTexture is { } icon) var texture = CurrencyInfo().IconTexture;
if (texture != null && texture.TryGetWrap(out IDalamudTextureWrap? wrap, out _))
{ {
ImGui.Image(icon.ImGuiHandle, new Vector2(20.0f)); ImGui.Image(wrap.ImGuiHandle, new Vector2(20.0f));
} }
} }

View File

@ -30,12 +30,12 @@ internal class LocalizationManager : IDisposable
{ {
try try
{ {
PluginLog.Information($"Loading Localization for {languageCode}"); //PluginLog.Information($"Loading Localization for {languageCode}");
Strings.Culture = new CultureInfo(languageCode); Strings.Culture = new CultureInfo(languageCode);
} }
catch (Exception ex) catch (Exception ex)
{ {
PluginLog.Error(ex, "Unable to Load Localization"); //PluginLog.Error(ex, "Unable to Load Localization");
} }
} }
} }

View File

@ -10,7 +10,7 @@ public sealed class Plugin : IDalamudPlugin
{ {
public string Name => "CurrencyAlert"; public string Name => "CurrencyAlert";
public Plugin(DalamudPluginInterface pluginInterface) public Plugin(IDalamudPluginInterface pluginInterface)
{ {
pluginInterface.Create<Service>(); pluginInterface.Create<Service>();

View File

@ -9,7 +9,7 @@ namespace CurrencyAlert;
public class Service public class Service
{ {
[PluginService] public static DalamudPluginInterface PluginInterface { get; private set; } = null!; [PluginService] public static IDalamudPluginInterface PluginInterface { get; private set; } = null!;
[PluginService] public static IFramework Framework { get; private set; } = null!; [PluginService] public static IFramework Framework { get; private set; } = null!;
[PluginService] public static IClientState ClientState { get; private set; } = null!; [PluginService] public static IClientState ClientState { get; private set; } = null!;

View File

@ -59,7 +59,7 @@ public class CurrencyTracker : IDisposable
else else
{ {
var lockoutRemaining = TimeSpan.FromMinutes(5) - timer.Elapsed; var lockoutRemaining = TimeSpan.FromMinutes(5) - timer.Elapsed;
PluginLog.Debug($"Zone Change Messages Suppressed, '{lockoutRemaining}' Remaining"); //PluginLog.Debug($"Zone Change Messages Suppressed, '{lockoutRemaining}' Remaining");
} }
} }

View File

@ -1,12 +1,12 @@
{ {
"version": 1, "version": 1,
"dependencies": { "dependencies": {
"net7.0-windows7.0": { "net8.0-windows7.0": {
"DalamudPackager": { "DalamudPackager": {
"type": "Direct", "type": "Direct",
"requested": "[2.1.12, )", "requested": "[2.1.13, )",
"resolved": "2.1.12", "resolved": "2.1.13",
"contentHash": "Sc0PVxvgg4NQjcI8n10/VfUQBAS4O+Fw2pZrAqBdRMbthYGeogzu5+xmIGCGmsEZ/ukMOBuAqiNiB5qA3MRalg==" "contentHash": "rMN1omGe8536f4xLMvx9NwfvpAc9YFFfeXJ1t4P4PE6Gu8WCIoFliR1sh07hM+bfODmesk/dvMbji7vNI+B/pQ=="
}, },
"kamilib": { "kamilib": {
"type": "Project" "type": "Project"

View File

@ -8,6 +8,7 @@ namespace KamiLib.Atk;
public static class AtkValueHelper public static class AtkValueHelper
{ {
/*
public static unsafe void PrintAtkValue(AtkValue value, int index) public static unsafe void PrintAtkValue(AtkValue value, int index)
{ {
switch (value.Type) switch (value.Type)
@ -44,6 +45,7 @@ public static class AtkValueHelper
break; break;
} }
} }
*/
} }
public static class AtkValueExtensions public static class AtkValueExtensions

View File

@ -96,7 +96,7 @@ public static unsafe class Node
foreach (var index in Enumerable.Range(0, uldManager.NodeListCount)) foreach (var index in Enumerable.Range(0, uldManager.NodeListCount))
{ {
var currentNode = uldManager.NodeList[index]; var currentNode = uldManager.NodeList[index];
if (currentNode->NodeID != nodeId) continue; if (currentNode->NodeId != nodeId) continue;
return (T*) currentNode; return (T*) currentNode;
} }

View File

@ -76,7 +76,7 @@ public static class BlacklistDraw
if (ImGui.InputTextWithHint("###TerritorySearch", Strings.Blacklist_Search, ref _searchString, 60, ImGuiInputTextFlags.AutoSelectAll)) if (ImGui.InputTextWithHint("###TerritorySearch", Strings.Blacklist_Search, ref _searchString, 60, ImGuiInputTextFlags.AutoSelectAll))
{ {
_searchResults = Search(_searchString, 5); _searchResults = Search(_searchString, 5);
PluginLog.Debug("Updating TerritorySearch Results"); //PluginLog.Debug("Updating TerritorySearch Results");
} }
}) })
.AddAction(() => DisplayResults(_searchResults)) .AddAction(() => DisplayResults(_searchResults))

View File

@ -2,6 +2,8 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Threading.Tasks; using System.Threading.Tasks;
using Dalamud.Interface.Internal; using Dalamud.Interface.Internal;
using Dalamud.Interface.Textures;
using Dalamud.Interface.Textures.TextureWraps;
using Dalamud.Logging; using Dalamud.Logging;
using Dalamud.Utility; using Dalamud.Utility;
using ImGuiScene; using ImGuiScene;
@ -10,7 +12,7 @@ namespace KamiLib.Caching;
public class IconCache : IDisposable public class IconCache : IDisposable
{ {
private readonly Dictionary<uint, IDalamudTextureWrap?> iconTextures = new(); private readonly Dictionary<uint, ISharedImmediateTexture?> iconTextures = new();
private const string IconFilePath = "ui/icon/{0:D3}000/{1:D6}_hr1.tex"; private const string IconFilePath = "ui/icon/{0:D3}000/{1:D6}_hr1.tex";
@ -24,11 +26,6 @@ public class IconCache : IDisposable
public void Dispose() public void Dispose()
{ {
foreach (var texture in iconTextures.Values)
{
texture?.Dispose();
}
iconTextures.Clear(); iconTextures.Clear();
} }
@ -39,25 +36,18 @@ public class IconCache : IDisposable
try try
{ {
var path = IconFilePath.Format(iconId / 1000, iconId); var path = IconFilePath.Format(iconId / 1000, iconId);
var tex = Service.TextureProvider.GetTextureFromGame(path); var tex = Service.TextureProvider.GetFromGame(path);
if (tex is not null && tex.ImGuiHandle != nint.Zero)
{
iconTextures[iconId] = tex; iconTextures[iconId] = tex;
} }
else
{
tex?.Dispose();
}
}
catch (Exception ex) catch (Exception ex)
{ {
PluginLog.LogError($"Failed loading texture for icon {iconId} - {ex.Message}"); //PluginLog.LogError($"Failed loading texture for icon {iconId} - {ex.Message}");
} }
}); });
} }
public IDalamudTextureWrap? GetIcon(uint iconId) public ISharedImmediateTexture? GetIcon(uint iconId)
{ {
if (iconTextures.TryGetValue(iconId, out var value)) return value; if (iconTextures.TryGetValue(iconId, out var value)) return value;

View File

@ -2,6 +2,7 @@
using System.Collections; using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using Dalamud; using Dalamud;
using Dalamud.Game;
using Lumina.Excel; using Lumina.Excel;
namespace KamiLib.Caching; namespace KamiLib.Caching;

View File

@ -60,7 +60,7 @@ public class CommandManager : IDisposable
{ {
var commandData = Command.GetCommandData(command.ToLower(), arguments.ToLower()); var commandData = Command.GetCommandData(command.ToLower(), arguments.ToLower());
PluginLog.Debug($"[{KamiCommon.PluginName}] Received Command: {commandData}"); //PluginLog.Debug($"[{KamiCommon.PluginName}] Received Command: {commandData}");
Command.ProcessCommand(commandData, Commands); Command.ProcessCommand(commandData, Commands);
} }
} }

View File

@ -2,6 +2,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Numerics; using System.Numerics;
using Dalamud.Interface.Components; using Dalamud.Interface.Components;
using Dalamud.Interface.Textures.TextureWraps;
using Dalamud.Interface.Utility; using Dalamud.Interface.Utility;
using ImGuiNET; using ImGuiNET;
using KamiLib.Caching; using KamiLib.Caching;
@ -41,11 +42,11 @@ public abstract class DrawList<T>
{ {
var icon = IconCache.Instance.GetIcon(iconID); var icon = IconCache.Instance.GetIcon(iconID);
if (icon != null) if (icon != null && icon.TryGetWrap(out IDalamudTextureWrap? wrap, out _))
{ {
DrawActions.Add(() => DrawActions.Add(() =>
{ {
ImGui.Image(icon.ImGuiHandle, size, Vector2.Zero, Vector2.One, color); ImGui.Image(wrap.ImGuiHandle, size, Vector2.Zero, Vector2.One, color);
}); });
} }
@ -56,11 +57,11 @@ public abstract class DrawList<T>
{ {
var icon = IconCache.Instance.GetIcon(iconID); var icon = IconCache.Instance.GetIcon(iconID);
if (icon != null) if (icon != null && icon.TryGetWrap(out IDalamudTextureWrap? wrap, out _))
{ {
DrawActions.Add(() => DrawActions.Add(() =>
{ {
ImGui.Image(icon.ImGuiHandle, size, Vector2.Zero, Vector2.One, Vector4.One with {W = transparency}); ImGui.Image(wrap.ImGuiHandle, size, Vector2.Zero, Vector2.One, Vector4.One with {W = transparency});
}); });
} }

View File

@ -6,32 +6,32 @@ namespace KamiLib.Extensions;
public static class PartyListExtensions public static class PartyListExtensions
{ {
public static IEnumerable<PartyMember> Alive(this IEnumerable<PartyMember> list) public static IEnumerable<IPartyMember> Alive(this IEnumerable<IPartyMember> list)
{ {
return list.Where(member => member.GameObject != null && !member.GameObject.IsDead); return list.Where(member => member.GameObject != null && !member.GameObject.IsDead);
} }
public static IEnumerable<PartyMember> WithRole(this IEnumerable<PartyMember> list, uint roleID) public static IEnumerable<IPartyMember> WithRole(this IEnumerable<IPartyMember> list, uint roleID)
{ {
return list.Where(member => member.ClassJob.GameData?.Role == roleID); return list.Where(member => member.ClassJob.GameData?.Role == roleID);
} }
public static IEnumerable<PartyMember> WithJob(this IEnumerable<PartyMember> list, uint jobID) public static IEnumerable<IPartyMember> WithJob(this IEnumerable<IPartyMember> list, uint jobID)
{ {
return list.Where(member => member.ClassJob.Id == jobID); return list.Where(member => member.ClassJob.Id == jobID);
} }
public static IEnumerable<PartyMember> WithJob(this IEnumerable<PartyMember> list, List<uint> jobList) public static IEnumerable<IPartyMember> WithJob(this IEnumerable<IPartyMember> list, List<uint> jobList)
{ {
return list.Where(member => jobList.Contains(member.ClassJob.Id)); return list.Where(member => jobList.Contains(member.ClassJob.Id));
} }
public static IEnumerable<PartyMember> WithStatus(this IEnumerable<PartyMember> list, uint statusID) public static IEnumerable<IPartyMember> WithStatus(this IEnumerable<IPartyMember> list, uint statusID)
{ {
return list.Where(member => member.HasStatus(statusID)); return list.Where(member => member.HasStatus(statusID));
} }
public static IEnumerable<PartyMember> WithStatus(this IEnumerable<PartyMember> list, List<uint> statusList) public static IEnumerable<IPartyMember> WithStatus(this IEnumerable<IPartyMember> list, List<uint> statusList)
{ {
return list.Where(member => member.HasStatus(statusList)); return list.Where(member => member.HasStatus(statusList));
} }

View File

@ -6,12 +6,12 @@ namespace KamiLib.Extensions;
public static class PartyMemberExtensions public static class PartyMemberExtensions
{ {
public static bool HasStatus(this PartyMember character, uint statusId) public static bool HasStatus(this IPartyMember character, uint statusId)
{ {
return character.Statuses.Any(status => status.StatusId == statusId); return character.Statuses.Any(status => status.StatusId == statusId);
} }
public static bool HasStatus(this PartyMember character, List<uint> statusList) public static bool HasStatus(this IPartyMember character, List<uint> statusList)
{ {
return character.Statuses.Any(status => statusList.Contains(status.StatusId)); return character.Statuses.Any(status => statusList.Contains(status.StatusId));
} }

View File

@ -8,54 +8,54 @@ namespace KamiLib.Extensions;
public static class PlayerCharacterExtensions public static class PlayerCharacterExtensions
{ {
public static bool HasStatus(this PlayerCharacter character, uint statusId) public static bool HasStatus(this IPlayerCharacter character, uint statusId)
{ {
return character.StatusList.Any(status => status.StatusId == statusId); return character.StatusList.Any(status => status.StatusId == statusId);
} }
public static bool HasStatus(this PlayerCharacter character, List<uint> statusList) public static bool HasStatus(this IPlayerCharacter character, List<uint> statusList)
{ {
return character.StatusList.Any(status => statusList.Contains(status.StatusId)); return character.StatusList.Any(status => statusList.Contains(status.StatusId));
} }
public static bool HasOnlineStatus(this PlayerCharacter character, uint statusId) public static bool HasOnlineStatus(this IPlayerCharacter character, uint statusId)
{ {
return character.OnlineStatus.Id == statusId; return character.OnlineStatus.Id == statusId;
} }
public static int StatusCount(this PlayerCharacter character, List<uint> statusList) public static int StatusCount(this IPlayerCharacter character, List<uint> statusList)
{ {
return character.StatusList.Count(status => statusList.Contains(status.StatusId)); return character.StatusList.Count(status => statusList.Contains(status.StatusId));
} }
public static bool HasPet(this PlayerCharacter character) public static bool HasPet(this IPlayerCharacter character)
{ {
var ownedObjects = Service.ObjectTable.Where(obj => obj.OwnerId == character.ObjectId); var ownedObjects = Service.ObjectTable.Where(obj => obj.OwnerId == character.GameObjectId);
return ownedObjects.Any(obj => obj.ObjectKind == ObjectKind.BattleNpc && (obj as BattleNpc)?.SubKind == (byte) BattleNpcSubKind.Pet); return ownedObjects.Any(obj => obj.ObjectKind == ObjectKind.BattleNpc && (obj as IBattleNpc)?.SubKind == (byte) BattleNpcSubKind.Pet);
} }
public static IEnumerable<PlayerCharacter> Alive(this IEnumerable<PlayerCharacter> list) public static IEnumerable<IPlayerCharacter> Alive(this IEnumerable<IPlayerCharacter> list)
{ {
return list.Where(member => member.CurrentHp > 0); return list.Where(member => member.CurrentHp > 0);
} }
public static IEnumerable<PlayerCharacter> WithJob(this IEnumerable<PlayerCharacter> list, uint jobID) public static IEnumerable<IPlayerCharacter> WithJob(this IEnumerable<IPlayerCharacter> list, uint jobID)
{ {
return list.Where(member => member.ClassJob.Id == jobID); return list.Where(member => member.ClassJob.Id == jobID);
} }
public static IEnumerable<PlayerCharacter> WithJob(this IEnumerable<PlayerCharacter> list, List<uint> jobList) public static IEnumerable<IPlayerCharacter> WithJob(this IEnumerable<IPlayerCharacter> list, List<uint> jobList)
{ {
return list.Where(member => jobList.Contains(member.ClassJob.Id)); return list.Where(member => jobList.Contains(member.ClassJob.Id));
} }
public static IEnumerable<PlayerCharacter> WithStatus(this IEnumerable<PlayerCharacter> list, uint statusID) public static IEnumerable<IPlayerCharacter> WithStatus(this IEnumerable<IPlayerCharacter> list, uint statusID)
{ {
return list.Where(member => member.HasStatus(statusID)); return list.Where(member => member.HasStatus(statusID));
} }
public static IEnumerable<PlayerCharacter> WithStatus(this IEnumerable<PlayerCharacter> list, List<uint> statusList) public static IEnumerable<IPlayerCharacter> WithStatus(this IEnumerable<IPlayerCharacter> list, List<uint> statusList)
{ {
return list.Where(member => member.HasStatus(statusList)); return list.Where(member => member.HasStatus(statusList));
} }

View File

@ -1,4 +1,5 @@
using FFXIVClientStructs.FFXIV.Component.GUI; using FFXIVClientStructs.FFXIV.Client.UI.Agent;
using FFXIVClientStructs.FFXIV.Component.GUI;
namespace KamiLib.Hooking; namespace KamiLib.Hooking;

View File

@ -23,10 +23,10 @@ public static class Safety
var callingClass = trace.GetMethod()?.DeclaringType; var callingClass = trace.GetMethod()?.DeclaringType;
var callingName = trace.GetMethod()?.Name; var callingName = trace.GetMethod()?.Name;
PluginLog.Error($"Exception Source: {callingAssembly} :: {callingClass} :: {callingName}"); //PluginLog.Error($"Exception Source: {callingAssembly} :: {callingClass} :: {callingName}");
} }
PluginLog.Error(exception, message ?? "Caught Exception Safely"); //PluginLog.Error(exception, message ?? "Caught Exception Safely");
} }
} }
} }

View File

@ -19,7 +19,7 @@ public static class KamiCommon
private static Action _saveConfigFunction = null!; private static Action _saveConfigFunction = null!;
public static void Initialize(DalamudPluginInterface pluginInterface, string pluginName, Action saveConfig) public static void Initialize(IDalamudPluginInterface pluginInterface, string pluginName, Action saveConfig)
{ {
pluginInterface.Create<Service>(); pluginInterface.Create<Service>();

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net7.0-windows</TargetFramework> <TargetFramework>net8.0-windows</TargetFramework>
<Platforms>x64</Platforms> <Platforms>x64</Platforms>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<LangVersion>preview</LangVersion> <LangVersion>preview</LangVersion>

View File

@ -30,12 +30,12 @@ internal class LocalizationManager : IDisposable
{ {
try try
{ {
PluginLog.Information($"Loading Localization for {languageCode}"); //PluginLog.Information($"Loading Localization for {languageCode}");
Strings.Culture = new CultureInfo(languageCode); Strings.Culture = new CultureInfo(languageCode);
} }
catch (Exception ex) catch (Exception ex)
{ {
PluginLog.Error(ex, "Unable to Load Localization"); //PluginLog.Error(ex, "Unable to Load Localization");
} }
} }
} }

View File

@ -1,6 +1,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using Dalamud; using Dalamud;
using Dalamud.Game;
using KamiLib.Caching; using KamiLib.Caching;
using Lumina.Excel.GeneratedSheets; using Lumina.Excel.GeneratedSheets;

View File

@ -6,7 +6,7 @@ namespace KamiLib;
internal class Service internal class Service
{ {
[PluginService] public static DalamudPluginInterface PluginInterface { get; private set; } = null!; [PluginService] public static IDalamudPluginInterface PluginInterface { get; private set; } = null!;
[PluginService] public static ICommandManager Commands { get; private set; } = null!; [PluginService] public static ICommandManager Commands { get; private set; } = null!;
[PluginService] public static IClientState ClientState { get; private set; } = null!; [PluginService] public static IClientState ClientState { get; private set; } = null!;
[PluginService] public static IChatGui Chat { get; private set; } = null!; [PluginService] public static IChatGui Chat { get; private set; } = null!;

View File

@ -88,7 +88,7 @@ public class TeleportManager : IDisposable
} }
else else
{ {
PluginLog.Error("User attempted to teleport to an aetheryte that is not unlocked"); //PluginLog.Error("User attempted to teleport to an aetheryte that is not unlocked");
UserError(Strings.Teleport_NotUnlocked); UserError(Strings.Teleport_NotUnlocked);
} }
} }
@ -98,7 +98,7 @@ public class TeleportManager : IDisposable
return ChatLinkPayloads.First(payload => Equals(payload.Location, targetLocation)).Payload; return ChatLinkPayloads.First(payload => Equals(payload.Location, targetLocation)).Payload;
} }
private void Teleport(AetheryteEntry aetheryte) private void Teleport(IAetheryteEntry aetheryte)
{ {
try try
{ {
@ -116,7 +116,7 @@ public class TeleportManager : IDisposable
} }
catch (IpcNotReadyError) catch (IpcNotReadyError)
{ {
PluginLog.Error("Teleport IPC not found"); //PluginLog.Error("Teleport IPC not found");
UserError(Strings.Teleport_InstallTeleporter); UserError(Strings.Teleport_InstallTeleporter);
} }
} }
@ -127,7 +127,7 @@ public class TeleportManager : IDisposable
Service.Toast.ShowError(error); Service.Toast.ShowError(error);
} }
private string GetAetheryteName(AetheryteEntry aetheryte) private string GetAetheryteName(IAetheryteEntry aetheryte)
{ {
var gameData = aetheryte.AetheryteData.GameData; var gameData = aetheryte.AetheryteData.GameData;
var placeName = gameData?.PlaceName.Value; var placeName = gameData?.PlaceName.Value;
@ -135,7 +135,7 @@ public class TeleportManager : IDisposable
return placeName == null ? "[Name Lookup Failed]" : placeName.Name; return placeName == null ? "[Name Lookup Failed]" : placeName.Name;
} }
private bool AetheryteUnlocked(ExcelRow aetheryte, out AetheryteEntry? entry) private bool AetheryteUnlocked(ExcelRow aetheryte, out IAetheryteEntry? entry)
{ {
if (Service.AetheryteList.Any(entry => entry.AetheryteId == aetheryte.RowId)) if (Service.AetheryteList.Any(entry => entry.AetheryteId == aetheryte.RowId))
{ {