aboutsummaryrefslogtreecommitdiff
path: root/runtime/src/main/java
diff options
context:
space:
mode:
authorshedaniel <daniel@shedaniel.me>2022-06-20 22:30:40 +0800
committershedaniel <daniel@shedaniel.me>2022-06-28 03:21:12 +0800
commita60248087f671419539a520f26537b540778ad9f (patch)
tree56c328290e7d264ad7fff647b5fdd9eb79bdd3b0 /runtime/src/main/java
parent367fa7c68da50f73978d3ea7b375729dda8773c0 (diff)
downloadRoughlyEnoughItems-a60248087f671419539a520f26537b540778ad9f.tar.gz
RoughlyEnoughItems-a60248087f671419539a520f26537b540778ad9f.tar.bz2
RoughlyEnoughItems-a60248087f671419539a520f26537b540778ad9f.zip
Add black outline to search field
Diffstat (limited to 'runtime/src/main/java')
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/basewidgets/TextFieldWidget.java9
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/search/OverlaySearchField.java9
2 files changed, 10 insertions, 8 deletions
diff --git a/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/basewidgets/TextFieldWidget.java b/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/basewidgets/TextFieldWidget.java
index 8f3d79114..600f68864 100644
--- a/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/basewidgets/TextFieldWidget.java
+++ b/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/basewidgets/TextFieldWidget.java
@@ -407,11 +407,10 @@ public class TextFieldWidget extends WidgetWithBounds implements TickableWidget,
public void renderBorder(PoseStack matrices) {
if (this.hasBorder()) {
- if (containsMouse(mouse()) || focused)
- fill(matrices, this.bounds.x - 1, this.bounds.y - 1, this.bounds.x + this.bounds.width + 1, this.bounds.y + this.bounds.height + 1, -1);
- else
- fill(matrices, this.bounds.x - 1, this.bounds.y - 1, this.bounds.x + this.bounds.width + 1, this.bounds.y + this.bounds.height + 1, -6250336);
- fill(matrices, this.bounds.x, this.bounds.y, this.bounds.x + this.bounds.width, this.bounds.y + this.bounds.height, -16777216);
+ int borderColor = containsMouse(mouse()) || focused ? 0xffffffff : 0xffa0a0a0;
+ fill(matrices, this.bounds.x - 1, this.bounds.y - 1, this.bounds.x + this.bounds.width + 1, this.bounds.y + this.bounds.height + 1, 0xff000000);
+ fill(matrices, this.bounds.x, this.bounds.y, this.bounds.x + this.bounds.width, this.bounds.y + this.bounds.height, borderColor);
+ fill(matrices, this.bounds.x + 1, this.bounds.y + 1, this.bounds.x + this.bounds.width - 1, this.bounds.y + this.bounds.height - 1, 0xff000000);
}
}
diff --git a/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/search/OverlaySearchField.java b/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/search/OverlaySearchField.java
index 4aa8a2c30..08ede73c4 100644
--- a/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/search/OverlaySearchField.java
+++ b/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/search/OverlaySearchField.java
@@ -236,15 +236,18 @@ public class OverlaySearchField extends TextFieldWidget implements TextFieldWidg
@Override
public void renderBorder(PoseStack matrices) {
isHighlighting = isHighlighting && ConfigObject.getInstance().isInventoryHighlightingAllowed();
+ int borderColor;
if (isMain && isHighlighting) {
- fill(matrices, this.getBounds().x - 1, this.getBounds().y - 1, this.getBounds().x + this.getBounds().width + 1, this.getBounds().y + this.getBounds().height + 1, -852212);
+ borderColor = 0xfff2ff0c;
} else if (isMain && ScreenOverlayImpl.getEntryListWidget().getStacks().isEmpty() && !getText().isEmpty()) {
- fill(matrices, this.getBounds().x - 1, this.getBounds().y - 1, this.getBounds().x + this.getBounds().width + 1, this.getBounds().y + this.getBounds().height + 1, -43691);
+ borderColor = 0xffff5555;
} else {
super.renderBorder(matrices);
return;
}
- fill(matrices, this.getBounds().x, this.getBounds().y, this.getBounds().x + this.getBounds().width, this.getBounds().y + this.getBounds().height, -16777216);
+ fill(matrices, this.getBounds().x - 1, this.getBounds().y - 1, this.getBounds().x + this.getBounds().width + 1, this.getBounds().y + this.getBounds().height + 1, 0xff000000);
+ fill(matrices, this.getBounds().x, this.getBounds().y, this.getBounds().x + this.getBounds().width, this.getBounds().y + this.getBounds().height, borderColor);
+ fill(matrices, this.getBounds().x + 1, this.getBounds().y + 1, this.getBounds().x + this.getBounds().width - 1, this.getBounds().y + this.getBounds().height - 1, 0xff000000);
}
public int getManhattanDistance(Point point1, Point point2) {