mirror of
https://github.com/Ottermandias/Glamourer.git
synced 2025-12-14 20:54:17 +01:00
Fix context menu.
This commit is contained in:
parent
73122ad9bf
commit
71d6a658d6
1 changed files with 10 additions and 16 deletions
|
|
@ -47,11 +47,6 @@ public class ContextMenuService : IDisposable
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Enable()
|
|
||||||
{
|
|
||||||
_contextMenu.OnMenuOpened += OnMenuOpened;
|
|
||||||
}
|
|
||||||
|
|
||||||
private unsafe void OnMenuOpened(MenuOpenedArgs args)
|
private unsafe void OnMenuOpened(MenuOpenedArgs args)
|
||||||
{
|
{
|
||||||
if (args.MenuType is ContextMenuType.Inventory)
|
if (args.MenuType is ContextMenuType.Inventory)
|
||||||
|
|
@ -92,21 +87,14 @@ public class ContextMenuService : IDisposable
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool HandleItem(ItemId id)
|
public void Enable()
|
||||||
{
|
=> _contextMenu.OnMenuOpened += OnMenuOpened;
|
||||||
var itemId = Math.Clamp(id.Id, 0, 500000u);
|
|
||||||
return _items.ItemData.TryGetValue(itemId, EquipSlot.MainHand, out _lastItem);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Disable()
|
public void Disable()
|
||||||
{
|
=> _contextMenu.OnMenuOpened -= OnMenuOpened;
|
||||||
_contextMenu.OnMenuOpened -= OnMenuOpened;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Dispose()
|
public void Dispose()
|
||||||
{
|
=> Disable();
|
||||||
Disable();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnClick(MenuItemClickedArgs _)
|
private void OnClick(MenuItemClickedArgs _)
|
||||||
{
|
{
|
||||||
|
|
@ -129,6 +117,12 @@ public class ContextMenuService : IDisposable
|
||||||
_state.ChangeEquip(state, EquipSlot.OffHand, offhand, _lastStain, ApplySettings.Manual);
|
_state.ChangeEquip(state, EquipSlot.OffHand, offhand, _lastStain, ApplySettings.Manual);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private bool HandleItem(ItemId id)
|
||||||
|
{
|
||||||
|
var itemId = id.Id % 500000u;
|
||||||
|
return _items.ItemData.TryGetValue(itemId, EquipSlot.MainHand, out _lastItem);
|
||||||
|
}
|
||||||
|
|
||||||
private static unsafe bool ValidateChatLogContext(nint agent)
|
private static unsafe bool ValidateChatLogContext(nint agent)
|
||||||
=> *(uint*)(agent + ChatLogContextItemId + 8) == 3;
|
=> *(uint*)(agent + ChatLogContextItemId + 8) == 3;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue