diff options
| author | shedaniel <daniel@shedaniel.me> | 2020-07-05 15:31:12 +0800 |
|---|---|---|
| committer | shedaniel <daniel@shedaniel.me> | 2020-07-05 15:31:12 +0800 |
| commit | 17150bedcdf80944a64e165976cf2491d409b1c0 (patch) | |
| tree | f71725bf6c37fd2bc82fbf8bf07a4b98ba2d1584 /src/main/java/me/shedaniel/rei/api/OverlayDecider.java | |
| parent | af1b3f780d8edb361c00421cdd991f3f2b86849c (diff) | |
| download | RoughlyEnoughItems-17150bedcdf80944a64e165976cf2491d409b1c0.tar.gz RoughlyEnoughItems-17150bedcdf80944a64e165976cf2491d409b1c0.tar.bz2 RoughlyEnoughItems-17150bedcdf80944a64e165976cf2491d409b1c0.zip | |
Fix #370 and changes to how screens are handled
Signed-off-by: shedaniel <daniel@shedaniel.me>
Diffstat (limited to 'src/main/java/me/shedaniel/rei/api/OverlayDecider.java')
| -rw-r--r-- | src/main/java/me/shedaniel/rei/api/OverlayDecider.java | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/main/java/me/shedaniel/rei/api/OverlayDecider.java b/src/main/java/me/shedaniel/rei/api/OverlayDecider.java index 9f20f8223..500d9f058 100644 --- a/src/main/java/me/shedaniel/rei/api/OverlayDecider.java +++ b/src/main/java/me/shedaniel/rei/api/OverlayDecider.java @@ -23,8 +23,12 @@ package me.shedaniel.rei.api; +import me.shedaniel.math.Rectangle; +import me.shedaniel.rei.gui.config.DisplayPanelLocation; import net.minecraft.util.ActionResult; +import static net.minecraft.util.ActionResult.PASS; + public interface OverlayDecider { boolean isHandingScreen(Class<?> screen); @@ -40,4 +44,26 @@ public interface OverlayDecider { default float getPriority() { return 0f; } + + /** + * Checks if REI should recalculate the overlay bounds + * + * @param location the location of the display panel + * @param rectangle the current overlay bounds + * @return whether REI should recalculate the overlay bounds + */ + default boolean shouldRecalculateArea(DisplayPanelLocation location, Rectangle rectangle) { + return false; + } + + /** + * 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; + } } |
