diff --git a/CustomizePlus/Core/Data/Constants.cs b/CustomizePlus/Core/Data/Constants.cs index 73307e9..84fa932 100644 --- a/CustomizePlus/Core/Data/Constants.cs +++ b/CustomizePlus/Core/Data/Constants.cs @@ -82,7 +82,7 @@ internal static class Constants /// /// Movement hook address, used for position offset and other changes which cannot be done in main hook /// - public const string MovementHookAddress = "E8 ?? ?? ?? ?? 84 DB 74 45"; + public const string MovementHookAddress = "E8 ?? ?? ?? ?? 84 DB 74 3A"; internal static class Colors { diff --git a/CustomizePlus/Core/Helpers/CtrlHelper.cs b/CustomizePlus/Core/Helpers/CtrlHelper.cs index 52731fb..c852ab9 100644 --- a/CustomizePlus/Core/Helpers/CtrlHelper.cs +++ b/CustomizePlus/Core/Helpers/CtrlHelper.cs @@ -2,6 +2,7 @@ using Dalamud.Interface; using Dalamud.Utility; using Dalamud.Bindings.ImGui; +using System.Text; namespace CustomizePlus.Core.Helpers; @@ -67,14 +68,20 @@ public static class CtrlHelper public static bool ArrowToggle(string label, ref bool value) {//ImGuiNative.ArrowButton(label, value ? ImGuiDir.Down : ImGuiDir.Right); - var toggled = false; - - if (toggled) + unsafe // temporary fix { - value = !value; - } + var utf8Label = Encoding.UTF8.GetBytes(label + "\0"); - return value; + fixed (byte* labelPtr = utf8Label) + { + bool toggled = ImGuiNative.ArrowButton(labelPtr, value ? ImGuiDir.Down : ImGuiDir.Right) != 0; + + if (toggled) + value = !value; + + return value; + } + } } public static void AddHoverText(string text) diff --git a/CustomizePlus/Core/Services/HookingService.cs b/CustomizePlus/Core/Services/HookingService.cs index edea53a..e93e2ae 100644 --- a/CustomizePlus/Core/Services/HookingService.cs +++ b/CustomizePlus/Core/Services/HookingService.cs @@ -92,25 +92,25 @@ public class HookingService : IDisposable _logger.Debug("Render hook established"); } - /*if (_gameObjectMovementHook == null) + if (_gameObjectMovementHook == null) { var movementAddress = _sigScanner.ScanText(Constants.MovementHookAddress); _gameObjectMovementHook = _hooker.HookFromAddress(movementAddress, OnGameObjectMove); _logger.Debug("Movement hook established"); - }*/ + } _logger.Debug("Hooking render manager"); _renderManagerHook.Enable(); - // _logger.Debug("Hooking movement functions"); - // _gameObjectMovementHook.Enable(); + _logger.Debug("Hooking movement functions"); + _gameObjectMovementHook.Enable(); } else { _logger.Debug("Unhooking..."); _renderManagerHook?.Disable(); - // _gameObjectMovementHook?.Disable(); + _gameObjectMovementHook?.Disable(); } } catch (Exception e)