diff options
| author | shedaniel <daniel@shedaniel.me> | 2022-06-20 22:30:40 +0800 |
|---|---|---|
| committer | shedaniel <daniel@shedaniel.me> | 2023-05-29 21:02:51 +0800 |
| commit | ad61c0a7e25e14ef8375a28df1e85860d8950ccf (patch) | |
| tree | a3695784a6a88b03f47630b2f0031cca32f07c3e /runtime/src/main/java | |
| parent | 79fea6676aabe8f6e31701b22f90a9a5224f78b5 (diff) | |
| download | RoughlyEnoughItems-ad61c0a7e25e14ef8375a28df1e85860d8950ccf.tar.gz RoughlyEnoughItems-ad61c0a7e25e14ef8375a28df1e85860d8950ccf.tar.bz2 RoughlyEnoughItems-ad61c0a7e25e14ef8375a28df1e85860d8950ccf.zip | |
Add black outline to search field
Diffstat (limited to 'runtime/src/main/java')
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 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) { |
