menu swapper: add climb-up and climb-down swaps

This commit is contained in:
geheur
2022-01-18 12:55:32 -08:00
committed by GitHub
parent 48a6d40418
commit b3e87ee875
2 changed files with 32 additions and 0 deletions

View File

@@ -787,6 +787,35 @@ public interface MenuEntrySwapperConfig extends Config
return false;
}
enum StairsMode
{
CLIMB,
CLIMB_UP,
CLIMB_DOWN,
}
@ConfigItem(
keyName = "swapStairsLeftClick",
name = "Stairs left-click",
description = "Swap this option when left-clicking stairs. Also works on ladders.",
section = objectSection
)
default StairsMode swapStairsLeftClick()
{
return StairsMode.CLIMB;
}
@ConfigItem(
keyName = "swapStairsShiftClick",
name = "Stairs shift-click",
description = "Swap this option when shift-clicking stairs. Also works on ladders.",
section = objectSection
)
default StairsMode swapStairsShiftClick()
{
return StairsMode.CLIMB;
}
@ConfigItem(
keyName = "swapTemporossLeave",
name = "Tempoross Leave",

View File

@@ -415,6 +415,9 @@ public class MenuEntrySwapperPlugin extends Plugin
swap("eat", "guzzle", config::swapRockCake);
swap("travel", "dive", config::swapRowboatDive);
swap("climb", "climb-up", () -> (shiftModifier() ? config.swapStairsShiftClick() : config.swapStairsLeftClick()) == MenuEntrySwapperConfig.StairsMode.CLIMB_UP);
swap("climb", "climb-down", () -> (shiftModifier() ? config.swapStairsShiftClick() : config.swapStairsLeftClick()) == MenuEntrySwapperConfig.StairsMode.CLIMB_DOWN);
}
private void swap(String option, String swappedOption, Supplier<Boolean> enabled)