menu swapper: add global npc shift-click swap
This commit is contained in:
@@ -151,7 +151,7 @@ public interface MenuEntrySwapperConfig extends Config
|
|||||||
}
|
}
|
||||||
|
|
||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
position = -2,
|
position = -3,
|
||||||
keyName = "npcLeftClickCustomization",
|
keyName = "npcLeftClickCustomization",
|
||||||
name = "Customizable left-click",
|
name = "Customizable left-click",
|
||||||
description = "Allows customization of left-clicks on NPCs",
|
description = "Allows customization of left-clicks on NPCs",
|
||||||
@@ -162,6 +162,18 @@ public interface MenuEntrySwapperConfig extends Config
|
|||||||
return true;
|
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(
|
@ConfigItem(
|
||||||
keyName = "swapAdmire",
|
keyName = "swapAdmire",
|
||||||
name = "Admire",
|
name = "Admire",
|
||||||
|
|||||||
@@ -1174,9 +1174,18 @@ public class MenuEntrySwapperPlugin extends Plugin
|
|||||||
final NPC npc = menuEntry.getNpc();
|
final NPC npc = menuEntry.getNpc();
|
||||||
assert npc != null;
|
assert npc != null;
|
||||||
final NPCComposition composition = npc.getTransformedComposition();
|
final NPCComposition composition = npc.getTransformedComposition();
|
||||||
|
assert composition != null;
|
||||||
|
|
||||||
Integer customOption = getNpcSwapConfig(shiftModifier(), composition.getId());
|
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
|
// Walk here swap
|
||||||
if (customOption == -1)
|
if (customOption == -1)
|
||||||
|
|||||||
Reference in New Issue
Block a user