Format
This commit is contained in:
parent
6e0ec1d861
commit
4ac26ac086
137 changed files with 10339 additions and 7322 deletions
|
@ -12,9 +12,9 @@ public class GuiButtonCustomTexture extends GuiButtonExt {
|
|||
public int textureU;
|
||||
public int textureV;
|
||||
public ResourceLocation texture;
|
||||
|
||||
public GuiButtonCustomTexture(int id, int xPos, int yPos, int u, int v, int width,
|
||||
int height, ResourceLocation loc)
|
||||
|
||||
public GuiButtonCustomTexture(int id, int xPos, int yPos, int u, int v,
|
||||
int width, int height, ResourceLocation loc)
|
||||
{
|
||||
super(id, xPos, yPos, width, height, "_");
|
||||
textureU = u;
|
||||
|
@ -22,23 +22,26 @@ public class GuiButtonCustomTexture extends GuiButtonExt {
|
|||
texture = loc;
|
||||
}
|
||||
|
||||
public void drawButton(Minecraft mc, int mouseX, int mouseY)
|
||||
{
|
||||
if (this.visible)
|
||||
{
|
||||
boolean flag = mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height;
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
mc.getTextureManager().bindTexture(texture);
|
||||
int u = textureU;
|
||||
int v = textureV;
|
||||
public void drawButton(Minecraft mc, int mouseX, int mouseY)
|
||||
{
|
||||
if (this.visible)
|
||||
{
|
||||
boolean flag = mouseX >= this.xPosition && mouseY >= this.yPosition
|
||||
&& mouseX < this.xPosition + this.width
|
||||
&& mouseY < this.yPosition + this.height;
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
mc.getTextureManager().bindTexture(texture);
|
||||
int u = textureU;
|
||||
int v = textureV;
|
||||
|
||||
if (flag)
|
||||
{
|
||||
u += width;
|
||||
}
|
||||
if (flag)
|
||||
{
|
||||
u += width;
|
||||
}
|
||||
|
||||
this.drawTexturedModalRect(this.xPosition, this.yPosition, u, v, width, height);
|
||||
}
|
||||
}
|
||||
this.drawTexturedModalRect(this.xPosition, this.yPosition, u, v,
|
||||
width, height);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,44 +1,46 @@
|
|||
package techreborn.pda;
|
||||
|
||||
import techreborn.init.ModBlocks;
|
||||
import cpw.mods.fml.client.config.GuiButtonExt;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class GuiPda extends GuiScreen{
|
||||
|
||||
public final int guiWidth = 256;
|
||||
public final int guiHeight = 180;
|
||||
private int guiLeft, guiTop;
|
||||
|
||||
private static final ResourceLocation pdaGuipages = new ResourceLocation("techreborn:" + "textures/gui/pda.png");
|
||||
public static final ResourceLocation buttonOre = new ResourceLocation("techreborn:" + "textures/blocks/ore/book_of_revealing");
|
||||
public class GuiPda extends GuiScreen {
|
||||
|
||||
public GuiPda(EntityPlayer player) {}
|
||||
public final int guiWidth = 256;
|
||||
public final int guiHeight = 180;
|
||||
private int guiLeft, guiTop;
|
||||
|
||||
private static final ResourceLocation pdaGuipages = new ResourceLocation(
|
||||
"techreborn:" + "textures/gui/pda.png");
|
||||
public static final ResourceLocation buttonOre = new ResourceLocation(
|
||||
"techreborn:" + "textures/blocks/ore/book_of_revealing");
|
||||
|
||||
public GuiPda(EntityPlayer player)
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initGui()
|
||||
public void initGui()
|
||||
{
|
||||
super.initGui();
|
||||
this.guiLeft = this.width / 2 - this.guiWidth / 2;
|
||||
this.guiTop = this.height / 2 - this.guiHeight / 2;
|
||||
GuiButtonCustomTexture oresButton = new GuiButtonCustomTexture(1, guiLeft +20, guiTop +20, 0, 224, 16, 16, buttonOre);
|
||||
this.guiLeft = this.width / 2 - this.guiWidth / 2;
|
||||
this.guiTop = this.height / 2 - this.guiHeight / 2;
|
||||
GuiButtonCustomTexture oresButton = new GuiButtonCustomTexture(1,
|
||||
guiLeft + 20, guiTop + 20, 0, 224, 16, 16, buttonOre);
|
||||
|
||||
buttonList.add(oresButton);
|
||||
buttonList.add(oresButton);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void drawScreen(int mouseX, int mouseY, float partialTicks)
|
||||
public void drawScreen(int mouseX, int mouseY, float partialTicks)
|
||||
{
|
||||
|
||||
mc.getTextureManager().bindTexture(pdaGuipages);
|
||||
drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, this.guiWidth, this.guiHeight);
|
||||
mc.renderEngine.bindTexture(buttonOre);
|
||||
|
||||
|
||||
mc.getTextureManager().bindTexture(pdaGuipages);
|
||||
drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, this.guiWidth,
|
||||
this.guiHeight);
|
||||
mc.renderEngine.bindTexture(buttonOre);
|
||||
|
||||
super.drawScreen(mouseX, mouseY, partialTicks);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue