From ad61c0a7e25e14ef8375a28df1e85860d8950ccf Mon Sep 17 00:00:00 2001 From: shedaniel Date: Mon, 20 Jun 2022 22:30:40 +0800 Subject: Add black outline to search field --- .../rei/impl/client/gui/widget/basewidgets/TextFieldWidget.java | 9 ++++----- .../rei/impl/client/gui/widget/search/OverlaySearchField.java | 9 ++++++--- 2 files changed, 10 insertions(+), 8 deletions(-) (limited to 'runtime/src/main/java') 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 f9a6dec06..289f68a03 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 @@ -409,11 +409,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 bb4d236fa..08f0bc2fe 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 @@ -237,15 +237,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) { -- cgit