From b2d0af7a9fb0d16f14b294802f6718ac315d0de8 Mon Sep 17 00:00:00 2001 From: shedaniel Date: Fri, 20 Dec 2019 17:31:30 +0800 Subject: 3.2.27 --- .../java/me/shedaniel/rei/api/DisplayHelper.java | 36 +++++++++++++++++++--- 1 file changed, 32 insertions(+), 4 deletions(-) (limited to 'src/main/java/me/shedaniel/rei/api/DisplayHelper.java') diff --git a/src/main/java/me/shedaniel/rei/api/DisplayHelper.java b/src/main/java/me/shedaniel/rei/api/DisplayHelper.java index e2a152488..1589ae43d 100644 --- a/src/main/java/me/shedaniel/rei/api/DisplayHelper.java +++ b/src/main/java/me/shedaniel/rei/api/DisplayHelper.java @@ -84,6 +84,20 @@ public interface DisplayHelper { */ Rectangle getRightBounds(T screen); + /** + * Checks if item slot can fit the screen + * + * @param left the left x coordinates of the stack + * @param top the top y coordinates for the stack + * @param screen the current screen + * @param fullBounds the current bounds + * @return whether the item slot can fit + * @see BaseBoundsHandler#registerExclusionZones(Class, BaseBoundsHandler.ExclusionZoneSupplier) for easier api + */ + default ActionResult canItemSlotWidgetFit(int left, int top, T screen, Rectangle fullBounds) { + return PASS; + } + /** * Checks if item slot can fit the screen * @@ -93,10 +107,11 @@ public interface DisplayHelper { * @param screen the current screen * @param fullBounds the current bounds * @return whether the item slot can fit - * @see BaseBoundsHandler#registerExclusionZones(Class, BaseBoundsHandler.ExclusionZoneSupplier) for easier api + * @deprecated use {@link #canItemSlotWidgetFit(int, int, Object, Rectangle)} */ + @Deprecated default ActionResult canItemSlotWidgetFit(boolean isOnRightSide, int left, int top, T screen, Rectangle fullBounds) { - return PASS; + return canItemSlotWidgetFit(left, top, screen, fullBounds); } /** @@ -106,8 +121,21 @@ public interface DisplayHelper { * @param mouseX mouse's x coordinates * @param mouseY mouse's y coordinates * @return whether mouse is inside the overlay + * @deprecated use {@link #isInZone(double, double)} */ + @Deprecated default ActionResult isInZone(boolean isOnRightSide, double mouseX, double mouseY) { + return isInZone(mouseX, mouseY); + } + + /** + * Checks if mouse is inside the overlay + * + * @param mouseX mouse's x coordinates + * @param mouseY mouse's y coordinates + * @return whether mouse is inside the overlay + */ + default ActionResult isInZone(double mouseX, double mouseY) { return PASS; } @@ -120,10 +148,10 @@ public interface DisplayHelper { default Rectangle getItemListArea(Rectangle rectangle) { return new Rectangle(rectangle.x + 1, rectangle.y + 2 + (ConfigObject.getInstance().getSearchFieldLocation() == SearchFieldLocation.TOP_SIDE ? 24 : 0) + (ConfigObject.getInstance().isEntryListWidgetScrolled() ? 0 : 22), rectangle.width - 2, rectangle.height - (ConfigObject.getInstance().getSearchFieldLocation() != SearchFieldLocation.CENTER ? 27 + 22 : 27) + (!ConfigObject.getInstance().isEntryListWidgetScrolled() ? 0 : 22)); } - + default Rectangle getFavoritesListArea(Rectangle rectangle) { int offset = 31 + (ConfigObject.getInstance().doesShowUtilsButtons() ? 25 : 0); - return new Rectangle(rectangle.x + 1, rectangle.y + 2 + offset, rectangle.width - 2, rectangle.height - 5- offset); + return new Rectangle(rectangle.x + 1, rectangle.y + 2 + offset, rectangle.width - 2, rectangle.height - 5 - offset); } /** -- cgit