icbm/src/main/java/icbm/gangshao/shimian/GuiButtonArrow.java

48 lines
1.3 KiB
Java
Raw Normal View History

2022-11-09 22:15:45 +01:00
package icbm.gangshao.shimian;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
@SideOnly(Side.CLIENT)
public class GuiButtonArrow extends GuiButton {
boolean isLeft;
2022-11-09 22:16:55 +01:00
public GuiButtonArrow(
final int par1, final int par2, final int par3, final boolean left
) {
2022-11-09 22:15:45 +01:00
super(par1, par2, par3, 10, 10, "");
this.isLeft = false;
this.isLeft = left;
}
@Override
2022-11-09 22:16:55 +01:00
public void
drawButton(final Minecraft par1Minecraft, final int width, final int hight) {
2022-11-09 22:15:45 +01:00
par1Minecraft.renderEngine.bindTexture(
2022-11-09 22:16:55 +01:00
new ResourceLocation("icbm", "textures/gui/gui@.png")
);
2022-11-09 22:15:45 +01:00
GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
2022-11-09 22:16:55 +01:00
final boolean var4 = width >= this.xPosition && hight >= this.yPosition
&& width < this.xPosition + this.width
&& hight < this.yPosition + this.height;
2022-11-09 22:15:45 +01:00
int var5 = 126;
int varWid = 20;
2022-11-09 22:16:55 +01:00
2022-11-09 22:15:45 +01:00
if (this.isLeft) {
varWid += 10;
}
2022-11-09 22:16:55 +01:00
2022-11-09 22:15:45 +01:00
if (var4) {
var5 += this.height;
}
2022-11-09 22:16:55 +01:00
this.drawTexturedModalRect(
this.xPosition, this.yPosition, varWid, var5, this.width, this.height
);
2022-11-09 22:15:45 +01:00
}
}