aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/me/shedaniel/rei/api/DisplayHelper.java
diff options
context:
space:
mode:
authorshedaniel <daniel@shedaniel.me>2019-12-24 11:31:40 +0800
committershedaniel <daniel@shedaniel.me>2019-12-24 11:31:40 +0800
commit08d80d588a36598114087a79917e36e9d2cc97c3 (patch)
tree95cde698bbf1eca2f83143d39fd206cf2dc803f2 /src/main/java/me/shedaniel/rei/api/DisplayHelper.java
parent7d438f554c4173880a407a6bb8fc80b8a4723845 (diff)
downloadRoughlyEnoughItems-08d80d588a36598114087a79917e36e9d2cc97c3.tar.gz
RoughlyEnoughItems-08d80d588a36598114087a79917e36e9d2cc97c3.tar.bz2
RoughlyEnoughItems-08d80d588a36598114087a79917e36e9d2cc97c3.zip
Finishing workstation usage and close #220
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, 18 insertions, 18 deletions
diff --git a/src/main/java/me/shedaniel/rei/api/DisplayHelper.java b/src/main/java/me/shedaniel/rei/api/DisplayHelper.java
index 1589ae43d..25c04295d 100644
--- a/src/main/java/me/shedaniel/rei/api/DisplayHelper.java
+++ b/src/main/java/me/shedaniel/rei/api/DisplayHelper.java
@@ -15,12 +15,12 @@ import java.util.List;
import static net.minecraft.util.ActionResult.PASS;
public interface DisplayHelper {
-
+
@SuppressWarnings("deprecation")
static DisplayHelper getInstance() {
return RoughlyEnoughItemsCore.getDisplayHelper();
}
-
+
/**
* Gets the sorted version of all responsible bounds handlers
*
@@ -29,14 +29,14 @@ public interface DisplayHelper {
* @see DisplayHelper#getResponsibleBoundsHandler(Class) for the unsorted version
*/
List<DisplayBoundsHandler<?>> getSortedBoundsHandlers(Class<?> screenClass);
-
+
/**
* Gets all registered bounds handlers
*
* @return the list of registered bounds handlers
*/
List<DisplayBoundsHandler<?>> getAllBoundsHandlers();
-
+
/**
* Gets all responsible bounds handlers
*
@@ -45,21 +45,21 @@ public interface DisplayHelper {
* @see DisplayHelper#getSortedBoundsHandlers(Class) for the sorted version
*/
DisplayBoundsHandler<?> getResponsibleBoundsHandler(Class<?> screenClass);
-
+
/**
* Registers a bounds handler
*
* @param handler the handler to register
*/
void registerBoundsHandler(DisplayBoundsHandler<?> handler);
-
+
/**
* Gets the base bounds handler api for exclusion zones
*
* @return the base bounds handler
*/
BaseBoundsHandler getBaseBoundsHandler();
-
+
public static interface DisplayBoundsHandler<T> {
/**
* Gets the base supported class for the bounds handler
@@ -67,7 +67,7 @@ public interface DisplayHelper {
* @return the base class
*/
Class<?> getBaseSupportedClass();
-
+
/**
* Gets the left bounds of the overlay
*
@@ -75,7 +75,7 @@ public interface DisplayHelper {
* @return the left bounds
*/
Rectangle getLeftBounds(T screen);
-
+
/**
* Gets the right bounds of the overlay
*
@@ -83,7 +83,7 @@ public interface DisplayHelper {
* @return the right bounds
*/
Rectangle getRightBounds(T screen);
-
+
/**
* Checks if item slot can fit the screen
*
@@ -97,7 +97,7 @@ public interface DisplayHelper {
default ActionResult canItemSlotWidgetFit(int left, int top, T screen, Rectangle fullBounds) {
return PASS;
}
-
+
/**
* Checks if item slot can fit the screen
*
@@ -113,7 +113,7 @@ public interface DisplayHelper {
default ActionResult canItemSlotWidgetFit(boolean isOnRightSide, int left, int top, T screen, Rectangle fullBounds) {
return canItemSlotWidgetFit(left, top, screen, fullBounds);
}
-
+
/**
* Checks if mouse is inside the overlay
*
@@ -127,7 +127,7 @@ public interface DisplayHelper {
default ActionResult isInZone(boolean isOnRightSide, double mouseX, double mouseY) {
return isInZone(mouseX, mouseY);
}
-
+
/**
* Checks if mouse is inside the overlay
*
@@ -138,7 +138,7 @@ public interface DisplayHelper {
default ActionResult isInZone(double mouseX, double mouseY) {
return PASS;
}
-
+
/**
* Gets the item list bounds by the overlay bounds
*
@@ -148,12 +148,12 @@ 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);
}
-
+
/**
* Checks if REI should recalculate the overlay bounds
*
@@ -164,7 +164,7 @@ public interface DisplayHelper {
default boolean shouldRecalculateArea(boolean isOnRightSide, Rectangle rectangle) {
return false;
}
-
+
/**
* Gets the priority of the handler, the higher it is, the earlier it is called.
*
@@ -174,5 +174,5 @@ public interface DisplayHelper {
return 0f;
}
}
-
+
}