diff --git a/HeelsPlugin/ConfigModel.cs b/HeelsPlugin/ConfigModel.cs index 5b15202..0195661 100644 --- a/HeelsPlugin/ConfigModel.cs +++ b/HeelsPlugin/ConfigModel.cs @@ -12,5 +12,10 @@ public class ConfigModel public bool Enabled; public Sexes SexFilter = (Sexes)255; public Races RaceFilter = (Races)255; + + public ConfigModel() + { + Name = ""; + } } } diff --git a/HeelsPlugin/Gui/ConfigItem.cs b/HeelsPlugin/Gui/ConfigItem.cs index 7a1ba30..c527750 100644 --- a/HeelsPlugin/Gui/ConfigItem.cs +++ b/HeelsPlugin/Gui/ConfigItem.cs @@ -11,7 +11,7 @@ public class ConfigItem private readonly int key = 0; private readonly ComboWithFilter combo; private readonly ConfigModel config; - private string ItemName + private string? ItemName { get { @@ -31,7 +31,7 @@ private string ItemName (short)item.ModelMain == config.Model; }); if (foundItem != null) - return foundItem?.Name; + return foundItem.Name ?? ""; return "(Invalid item found)"; } } diff --git a/HeelsPlugin/HeelsPlugin.csproj b/HeelsPlugin/HeelsPlugin.csproj index 05a3844..1652d5a 100644 --- a/HeelsPlugin/HeelsPlugin.csproj +++ b/HeelsPlugin/HeelsPlugin.csproj @@ -1,8 +1,8 @@  - 1.1.8 - net5.0-windows + 1.1.9 + net6.0-windows latest true enable @@ -12,7 +12,7 @@ false false false - $(AppData)\XIVLauncher\devPlugins\BDTHPlugin + $(AppData)\XIVLauncher\devPlugins\HeelsPlugin diff --git a/HeelsPlugin/HeelsPlugin.json b/HeelsPlugin/HeelsPlugin.json index 5965b9f..925b4c6 100644 --- a/HeelsPlugin/HeelsPlugin.json +++ b/HeelsPlugin/HeelsPlugin.json @@ -3,10 +3,10 @@ "Name": "Heels Plugin", "Description": "Offsets your character off the ground for when wearing heels.", "InternalName": "HeelsPlugin", - "AssemblyVersion": "1.1.8", + "AssemblyVersion": "1.1.9", "RepoUrl": "https://github.com/LeonBlade/HeelsPlugin", "ApplicableVersion": "any", "Tags": ["heels", "high heels", "height", "offset", "leonblade"], - "DalamudApiLevel": 6, + "DalamudApiLevel": 7, "IconUrl": "https://github.com/LeonBlade/HeelsPlugin/raw/main/icon.png" } diff --git a/HeelsPlugin/PluginMemory.cs b/HeelsPlugin/PluginMemory.cs index 817ab44..99d6cfe 100644 --- a/HeelsPlugin/PluginMemory.cs +++ b/HeelsPlugin/PluginMemory.cs @@ -1,6 +1,4 @@ using Dalamud.Game.ClientState.Objects.Enums; -using Dalamud.Game.ClientState.Objects.SubKinds; -using Dalamud.Game.ClientState.Objects.Types; using Dalamud.Hooking; using Dalamud.Logging; using System; @@ -19,10 +17,7 @@ public class PluginMemory public PluginMemory() { playerMovementFunc = Plugin.SigScanner.ScanText("E8 ?? ?? ?? ?? 48 8B CB E8 ?? ?? ?? ?? 48 8B CB E8 ?? ?? ?? ?? 48 8B 03 48 8B CB FF 50 ?? 83 F8 ?? 75 ??"); - playerMovementHook = new Hook( - playerMovementFunc, - new PlayerMovementDelegate(PlayerMovementHook) - ); + playerMovementHook = Hook.FromAddress(playerMovementFunc, new PlayerMovementDelegate(PlayerMovementHook)); playerMovementHook.Enable(); } @@ -43,7 +38,7 @@ public void Dispose() } } - private ConfigModel GetConfigForModelId(EquipItem inModel) + private ConfigModel? GetConfigForModelId(EquipItem inModel) { var foundConfig = Plugin.Configuration.Configs.Where(config => { @@ -80,7 +75,7 @@ public EquipItem GetPlayerFeet() public EquipItem GetPlayerFeet(IntPtr player) { - var feet = (uint)Marshal.ReadInt32(player + 0x808 + 0x10); + var feet = (uint)Marshal.ReadInt32(player + 0x818 + 0x10); return new EquipItem(feet); } diff --git a/HeelsPlugin/PluginUI.cs b/HeelsPlugin/PluginUI.cs index ed9c9bf..679b739 100644 --- a/HeelsPlugin/PluginUI.cs +++ b/HeelsPlugin/PluginUI.cs @@ -74,7 +74,7 @@ private ComboWithFilter CreateCombo(int id) var model = new EquipItem((uint)item.ModelMain); var ids = $"{model.Main}, {model.Variant}"; var size = ImGui.CalcTextSize(ids).X; - ImGui.SameLine(ImGui.GetWindowContentRegionWidth() - size - ImGui.GetStyle().ItemInnerSpacing.X); + ImGui.SameLine(ImGui.GetWindowContentRegionMax().X - size - ImGui.GetStyle().ItemInnerSpacing.X); ImGui.TextColored(GreyVector, ids); return ret; }