public class GuiNextQuestButton extends GuiButton {
public GuiNextQuestButton(int p_i1021_1_, int p_i1021_2_, int p_i1021_3_,
int p_i1021_4_, int p_i1021_5_, String p_i1021_6_) {
super(p_i1021_1_, p_i1021_2_, p_i1021_3_, p_i1021_4_, p_i1021_5_, p_i1021_6_);
}
public static final ResourceLocation background =
new ResourceLocation(MODID,"textures/gui/quest.png");
public void drawButton(Minecraft mc, int xx, int yy)
{
if (this.visible)
{
FontRenderer fontrenderer = mc.fontRendererObj;
mc.getTextureManager().bindTexture(background);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.hovered = xx >= this.xPosition && yy >= this.yPosition && xx < this.xPosition + this.width && yy < this.yPosition + this.height;
int k = this.getHoverState(this.hovered);
GlStateManager.enableBlend();
GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
GlStateManager.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA);
//Если мышка наведена и если не наведена на кнопку(где что не помню)
if (k==1) {
this.drawTexturedModalRect(this.xPosition, this.yPosition, u, v, width, height);
} else {
this.drawTexturedModalRect(this.xPosition, this.yPosition, u, v, width, height);
}
//ЕСЛИ ЕСТЬ ТЕКСТ
this.drawString(fontrenderer, this.displayString, this.xPosition, this.yPosition, 0xfafa20);
this.mouseDragged(mc, xx, yy);
GlStateManager.disableBlend();
}
}
}