@Override
public void drawButton(@Nonnull Minecraft mc, int mouseX, int mouseY){
if (this.visible)
{
if(mc.currentScreen instanceof InventoryEffectRenderer) {
if (deltaY != 0) {
this.yPosition -= deltaY;
deltaY = 0;
}
int size = mc.player.getActivePotionEffects().size();
if (size > 0) {
int off = 33;
if (size > 4) {
off = -2 * height;
size = 1;
}
deltaY = off * size;
this.yPosition += deltaY;
}
}
this.hovered = mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height;
int k = this.getHoverState(this.hovered);
drawTextureBox(k);
this.mouseDragged(mc, mouseX, mouseY);
int color = 14737632;
if (packedFGColour != 0)
{
color = packedFGColour;
}
else if (!this.enabled)
{
color = 10526880;
} else if (this.hovered)
{
color = 16777120;
}
this.drawCenteredString(mc.fontRenderer, this.displayString, this.xPosition + this.width / 2, this.yPosition + (this.height - 8) / 2, color);
}
}
GuiPlaceableButton.java 文件源码
java
阅读 17
收藏 0
点赞 0
评论 0
项目:Battlegear2
作者:
评论列表
文章目录