diff options
| author | Unknown <shekwancheung0528@gmail.com> | 2019-08-18 18:42:19 +0800 |
|---|---|---|
| committer | Unknown <shekwancheung0528@gmail.com> | 2019-08-18 18:42:19 +0800 |
| commit | d9df40442f9d4ea5277ea4f36f36042073a85f52 (patch) | |
| tree | 41a5e418ac133e7e66fd3f3730b0fa24cc5e178b /src/main/java/me/shedaniel/rei/gui/widget/SearchFieldWidget.java | |
| parent | b6f36732c933c6d406d730e11cd3b7ed390b95ae (diff) | |
| download | RoughlyEnoughItems-d9df40442f9d4ea5277ea4f36f36042073a85f52.tar.gz RoughlyEnoughItems-d9df40442f9d4ea5277ea4f36f36042073a85f52.tar.bz2 RoughlyEnoughItems-d9df40442f9d4ea5277ea4f36f36042073a85f52.zip | |
Close #135
Diffstat (limited to 'src/main/java/me/shedaniel/rei/gui/widget/SearchFieldWidget.java')
| -rw-r--r-- | src/main/java/me/shedaniel/rei/gui/widget/SearchFieldWidget.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/main/java/me/shedaniel/rei/gui/widget/SearchFieldWidget.java b/src/main/java/me/shedaniel/rei/gui/widget/SearchFieldWidget.java index b4f5e2b22..40a54f1df 100644 --- a/src/main/java/me/shedaniel/rei/gui/widget/SearchFieldWidget.java +++ b/src/main/java/me/shedaniel/rei/gui/widget/SearchFieldWidget.java @@ -7,6 +7,7 @@ package me.shedaniel.rei.gui.widget; import com.mojang.blaze3d.platform.GlStateManager; import net.minecraft.client.render.GuiLighting; +import net.minecraft.client.resource.language.I18n; import net.minecraft.client.sound.PositionedSoundInstance; import net.minecraft.sound.SoundEvents; @@ -24,6 +25,7 @@ public class SearchFieldWidget extends TextFieldWidget { GuiLighting.disable(); GlStateManager.disableDepthTest(); setEditableColor(isSearching ? -1313241 : 14737632); + setSuggestion(!isFocused() && getText().isEmpty() ? I18n.translate("text.rei.search.field.suggestion") : null); super.render(int_1, int_2, float_1); GlStateManager.enableDepthTest(); } @@ -32,7 +34,7 @@ public class SearchFieldWidget extends TextFieldWidget { public void renderBorder() { if (!isSearching) super.renderBorder(); - else { + else if (this.hasBorder()) { fill(this.getBounds().x - 1, this.getBounds().y - 1, this.getBounds().x + this.getBounds().width + 1, this.getBounds().y + this.getBounds().height + 1, -1313241); fill(this.getBounds().x, this.getBounds().y, this.getBounds().x + this.getBounds().width, this.getBounds().y + this.getBounds().height, -16777216); } |
