private IntPtr HandleItemHoverDetour(IntPtr hoverState, IntPtr a2, IntPtr a3, ulong a4) { var retVal = this.handleItemHoverHook.Original(hoverState, a2, a3, a4); if (retVal.ToInt64() == 22) { var itemId = (ulong)Marshal.ReadInt32(hoverState, 0x138); this.HoveredItem = itemId; try { HoveredItemChanged?.Invoke(this, itemId); } catch (Exception e) { Log.Error(e, "Could not dispatch HoveredItemChanged event."); } Log.Verbose("HoverItemId:{0} this:{1}", itemId, hoverState.ToInt64().ToString("X")); } return(retVal); }
private IntPtr HandleItemOutDetour(IntPtr hoverState, IntPtr a2, IntPtr a3, ulong a4) { var retVal = this.handleItemOutHook.Original(hoverState, a2, a3, a4); if (a3 != IntPtr.Zero && a4 == 1) { var a3Val = Marshal.ReadByte(a3, 0x8); if (a3Val == 255) { this.HoveredItem = 0ul; try { HoveredItemChanged?.Invoke(this, 0ul); } catch (Exception e) { Log.Error(e, "Could not dispatch HoveredItemChanged event."); } Log.Verbose("HoverItemId: 0"); } } return(retVal); }
protected virtual void OnHoveredItemChanged(HoveredItemEventArgs args) { HoveredItemChanged?.Invoke(this, args); }