Skip to content

Commit

Permalink
menu swapper: use left click customization config
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam- committed Jul 11, 2022
1 parent a0fd7fd commit 5e2528f
Showing 1 changed file with 19 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -906,21 +906,27 @@ private void configureItems(MenuOpened event)
final String opName = actions[actionIdx];
if (!Strings.isNullOrEmpty(opName))
{
if (defaultLeftClickOp != actionIdx && (leftClickOp == null || leftClickOp != actionIdx))
if (config.leftClickCustomization())
{
client.createMenuEntry(idx)
.setOption("Swap left click " + opName)
.setTarget(entry.getTarget())
.setType(MenuAction.RUNELITE)
.onClick(heldItemConsumer(itemComposition, opName, actionIdx, false));
if (defaultLeftClickOp != actionIdx && (leftClickOp == null || leftClickOp != actionIdx))
{
client.createMenuEntry(idx)
.setOption("Swap left click " + opName)
.setTarget(entry.getTarget())
.setType(MenuAction.RUNELITE)
.onClick(heldItemConsumer(itemComposition, opName, actionIdx, false));
}
}
if (defaultShiftClickOp != actionIdx && (shiftClickOp == null || shiftClickOp != actionIdx))
if (config.shiftClickCustomization())
{
client.createMenuEntry(idx)
.setOption("Swap shift click " + opName)
.setTarget(entry.getTarget())
.setType(MenuAction.RUNELITE)
.onClick(heldItemConsumer(itemComposition, opName, actionIdx, true));
if (defaultShiftClickOp != actionIdx && (shiftClickOp == null || shiftClickOp != actionIdx))
{
client.createMenuEntry(idx)
.setOption("Swap shift click " + opName)
.setTarget(entry.getTarget())
.setType(MenuAction.RUNELITE)
.onClick(heldItemConsumer(itemComposition, opName, actionIdx, true));
}
}
}

Expand Down Expand Up @@ -1121,7 +1127,7 @@ private void swapMenuEntry(MenuEntry[] menuEntries, int index, MenuEntry menuEnt
}

// Custom left-click item swap
if (itemOp)
if (itemOp && config.leftClickCustomization())
{
Integer swapIndex = getItemSwapConfig(false, menuEntry.getItemId());
if (swapIndex != null)
Expand Down

0 comments on commit 5e2528f

Please sign in to comment.