aboutsummaryrefslogtreecommitdiff
path: root/api/src/main/java/me
diff options
context:
space:
mode:
authorshedaniel <daniel@shedaniel.me>2022-09-11 02:32:57 +0800
committershedaniel <daniel@shedaniel.me>2022-09-11 02:32:57 +0800
commit229b1fecdac427d3debe68f52ed7276e54a11cd0 (patch)
treedad0bbe34d45fd2ec3424890f3f4085f116ad584 /api/src/main/java/me
parentfb91ed996b01f986492de4007cb86be5e68ad192 (diff)
downloadRoughlyEnoughItems-229b1fecdac427d3debe68f52ed7276e54a11cd0.tar.gz
RoughlyEnoughItems-229b1fecdac427d3debe68f52ed7276e54a11cd0.tar.bz2
RoughlyEnoughItems-229b1fecdac427d3debe68f52ed7276e54a11cd0.zip
Improve Overlay Menus
Diffstat (limited to 'api/src/main/java/me')
-rw-r--r--api/src/main/java/me/shedaniel/rei/api/client/gui/widgets/Widget.java8
-rw-r--r--api/src/main/java/me/shedaniel/rei/api/client/overlay/ScreenOverlay.java11
2 files changed, 15 insertions, 4 deletions
diff --git a/api/src/main/java/me/shedaniel/rei/api/client/gui/widgets/Widget.java b/api/src/main/java/me/shedaniel/rei/api/client/gui/widgets/Widget.java
index 2e683f51a..9f7fe44b9 100644
--- a/api/src/main/java/me/shedaniel/rei/api/client/gui/widgets/Widget.java
+++ b/api/src/main/java/me/shedaniel/rei/api/client/gui/widgets/Widget.java
@@ -57,18 +57,18 @@ public abstract class Widget extends AbstractContainerEventHandler implements ne
* The font for rendering text
*/
protected final Font font = minecraft.font;
- private static final Stack<Point> mouseStack = new Stack<>();
+ private static final Stack<Point> MOUSE_STACK = new Stack<>();
public static Point mouse() {
- return mouseStack.empty() ? PointHelper.ofMouse() : mouseStack.peek();
+ return MOUSE_STACK.empty() ? PointHelper.ofMouse() : MOUSE_STACK.peek();
}
public static Point pushMouse(Point mouse) {
- return mouseStack.push(mouse);
+ return MOUSE_STACK.push(mouse);
}
public static Point popMouse() {
- return mouseStack.pop();
+ return MOUSE_STACK.pop();
}
public static Point translateMouse(PoseStack poses) {
diff --git a/api/src/main/java/me/shedaniel/rei/api/client/overlay/ScreenOverlay.java b/api/src/main/java/me/shedaniel/rei/api/client/overlay/ScreenOverlay.java
index 9954a57a9..496fb72d9 100644
--- a/api/src/main/java/me/shedaniel/rei/api/client/overlay/ScreenOverlay.java
+++ b/api/src/main/java/me/shedaniel/rei/api/client/overlay/ScreenOverlay.java
@@ -31,6 +31,7 @@ import me.shedaniel.rei.api.client.gui.widgets.TextField;
import me.shedaniel.rei.api.client.gui.widgets.Tooltip;
import me.shedaniel.rei.api.client.gui.widgets.WidgetWithBounds;
import me.shedaniel.rei.api.client.search.SearchFilter;
+import me.shedaniel.rei.api.common.display.Display;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import org.jetbrains.annotations.ApiStatus;
@@ -134,4 +135,14 @@ public abstract class ScreenOverlay extends WidgetWithBounds {
* @param tooltip the tooltip
*/
public abstract void renderTooltip(PoseStack matrices, Tooltip tooltip);
+
+ /**
+ * Returns whether slot highlighting is on for the current search filter.
+ *
+ * @return whether slot highlighting is on for the current search filter.
+ */
+ public abstract boolean isHighlighting();
+
+ @ApiStatus.Experimental
+ public abstract boolean submitDisplayHistory(Display display, @Nullable Rectangle fromBounds);
}