aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/me/shedaniel/rei/api/DisplayHelper.java
diff options
context:
space:
mode:
authorshedaniel <daniel@shedaniel.me>2019-12-20 17:31:30 +0800
committershedaniel <daniel@shedaniel.me>2019-12-20 17:31:30 +0800
commitb2d0af7a9fb0d16f14b294802f6718ac315d0de8 (patch)
tree239aeb17bc098158bf2e63737253247ba3e687fe /src/main/java/me/shedaniel/rei/api/DisplayHelper.java
parente0a4a4692f8cb465c32ef589e15cea83d2432f99 (diff)
downloadRoughlyEnoughItems-b2d0af7a9fb0d16f14b294802f6718ac315d0de8.tar.gz
RoughlyEnoughItems-b2d0af7a9fb0d16f14b294802f6718ac315d0de8.tar.bz2
RoughlyEnoughItems-b2d0af7a9fb0d16f14b294802f6718ac315d0de8.zip
3.2.27
Diffstat (limited to 'src/main/java/me/shedaniel/rei/api/DisplayHelper.java')
-rw-r--r--src/main/java/me/shedaniel/rei/api/DisplayHelper.java36
1 files changed, 32 insertions, 4 deletions
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
@@ -87,16 +87,31 @@ public interface DisplayHelper {
/**
* 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
+ *
* @param isOnRightSide whether the user has set the overlay to the right
* @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
+ * @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);
}
/**