Remove the yellow coloring on hover in ExtendedButton to match vanilla behavior. Closes #6714 Closes #6713

This commit is contained in:
LexManos 2020-06-12 16:36:58 -07:00
parent 07b62b77e6
commit 457909b6d5

View file

@ -20,7 +20,6 @@
package net.minecraftforge.fml.client.gui.widget;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.widget.Widget;
import net.minecraft.client.gui.widget.button.Button;
import net.minecraftforge.fml.client.gui.GuiUtils;
@ -54,10 +53,6 @@ public class ExtendedButton extends Button
int k = this.getYImage(this.isHovered);
GuiUtils.drawContinuousTexturedBox(WIDGETS_LOCATION, this.x, this.y, 0, 46 + k * 20, this.width, this.height, 200, 20, 2, 3, 2, 2, this.getBlitOffset());
this.renderBg(mc, mouseX, mouseY);
int color = getFGColor();
if (this.isHovered && this.packedFGColor == Widget.UNSET_FG_COLOR)
color = 0xFFFFA0; // Slightly Yellow
String buttonText = this.getMessage();
int strWidth = mc.fontRenderer.getStringWidth(buttonText);
@ -66,7 +61,7 @@ public class ExtendedButton extends Button
if (strWidth > width - 6 && strWidth > ellipsisWidth)
buttonText = mc.fontRenderer.trimStringToWidth(buttonText, width - 6 - ellipsisWidth).trim() + "...";
this.drawCenteredString(mc.fontRenderer, buttonText, this.x + this.width / 2, this.y + (this.height - 8) / 2, color);
this.drawCenteredString(mc.fontRenderer, buttonText, this.x + this.width / 2, this.y + (this.height - 8) / 2, getFGColor());
}
}
}