menu swapper: add global npc shift-click swap
This commit is contained in:
@@ -151,7 +151,7 @@ public interface MenuEntrySwapperConfig extends Config
|
||||
}
|
||||
|
||||
@ConfigItem(
|
||||
position = -2,
|
||||
position = -3,
|
||||
keyName = "npcLeftClickCustomization",
|
||||
name = "Customizable left-click",
|
||||
description = "Allows customization of left-clicks on NPCs",
|
||||
@@ -162,6 +162,18 @@ public interface MenuEntrySwapperConfig extends Config
|
||||
return true;
|
||||
}
|
||||
|
||||
@ConfigItem(
|
||||
position = -2,
|
||||
keyName = "npcShiftClickWalkHere",
|
||||
name = "Shift click Walk here",
|
||||
description = "Swaps Walk here on shift click on all NPCs",
|
||||
section = npcSection
|
||||
)
|
||||
default boolean npcShiftClickWalkHere()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@ConfigItem(
|
||||
keyName = "swapAdmire",
|
||||
name = "Admire",
|
||||
|
||||
@@ -1174,9 +1174,18 @@ public class MenuEntrySwapperPlugin extends Plugin
|
||||
final NPC npc = menuEntry.getNpc();
|
||||
assert npc != null;
|
||||
final NPCComposition composition = npc.getTransformedComposition();
|
||||
assert composition != null;
|
||||
|
||||
Integer customOption = getNpcSwapConfig(shiftModifier(), composition.getId());
|
||||
if (customOption != null)
|
||||
if (customOption == null)
|
||||
{
|
||||
if (shiftModifier() && config.npcShiftClickWalkHere())
|
||||
{
|
||||
// we can achieve this by just deprioritizing the normal npc menus
|
||||
menuEntry.setDeprioritized(true);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Walk here swap
|
||||
if (customOption == -1)
|
||||
|
||||
Reference in New Issue
Block a user