Permalink
Browse files

Finished network rack and repulsion generator GUIs

  • Loading branch information...
Ri5ux committed Dec 24, 2017
1 parent 18b5f08 commit d8f8271f2a8ccebea81c7cd9fb9d3f55f31c919b
@@ -299,6 +299,7 @@ public Models models()
public final Texture BLUR_GUNSCOPE = new Texture(AliensVsPredator.Properties.ID, "textures/misc/scope.png");
public final Texture GUI_BASIC = new Texture(AliensVsPredator.Properties.ID, "textures/gui/background.png");
public final Texture GUI_TURRET = new Texture(AliensVsPredator.Properties.ID, "textures/gui/turret.png");
public final Texture GUI_NETWORK_RACK = new Texture(AliensVsPredator.Properties.ID, "textures/gui/networkrack.png");
public final Texture GUI_WRISTBRACER = new Texture(AliensVsPredator.Properties.ID, "textures/gui/wristbracer.png");
public final Texture GUI_LOCKER = new Texture(AliensVsPredator.Properties.ID, "textures/gui/locker.png");
public final Texture GUI_ASSEMBLER = new Texture(AliensVsPredator.Properties.ID, "textures/gui/assembler.png");
@@ -1,8 +1,10 @@
package org.avp.client.gui;
import org.avp.AliensVsPredator;
import org.avp.tile.TileEntityNetworkRack;
import com.arisux.mdx.lib.client.render.Draw;
import com.arisux.mdx.lib.client.render.OpenGL;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.entity.player.EntityPlayer;
@@ -23,24 +25,27 @@ public GuiNetworkRack(EntityPlayer player, TileEntityNetworkRack rack)
@Override
protected void drawGuiContainerBackgroundLayer(float f, int x, int y)
{
drawRect(this.guiLeft, this.guiTop, this.guiLeft + this.xSize, this.guiTop + this.ySize, 0xCC000000);
Draw.drawString(this.rack.inventory.getName(), this.guiLeft + 5, this.guiTop + 5, 0xFFFFFFFF);
Draw.drawResource(AliensVsPredator.resources().GUI_NETWORK_RACK, this.guiLeft, this.guiTop, 256, 256);
for (int idx = 3; idx >= 0; idx--)
{
ItemStack stack = this.rack.inventory.getStackInSlot(idx);
int sW = 16;
int sH = 16;
int sP = 2;
int sX = this.guiLeft + 5;
int sY = this.guiTop + 26 + (sH * idx) + (sP * idx);
drawRect(sX, sY, sX + sW, sY + sH, 0x1AFFFFFF);
int sP = 6;
int sPH = 4;
int sX = this.guiLeft + 26;
int sY = this.guiTop + 19 + (sH * idx) + (sP * idx);
if (stack != null)
{
Draw.drawString(stack.getDisplayName(), sX + sW + (sP * 2), sY + (sH / 4), 0xFFFFFFFF);
float s = 0.5F;
OpenGL.pushMatrix();
OpenGL.scale(s, s, s);
Draw.drawString(stack.getDisplayName(), (sX + sW + (sPH * 2)) * 2, (sY + (sH / 4) + 2) * 2, 0xFFFFFFFF);
OpenGL.popMatrix();
}
}
}
@@ -24,7 +24,7 @@ public GuiRepulsionGenerator(EntityPlayer player, TileEntityRepulsionGenerator g
protected void drawGuiContainerBackgroundLayer(float f, int x, int y)
{
Draw.drawResource(AliensVsPredator.resources().GUI_REPULSION_GENERATOR, this.guiLeft, this.guiTop, 256, 256, 255F, 255F, 255F, 255F, 1F, 1F);
Draw.drawString(this.generator.getProposedSpeed() + "", this.guiLeft, this.guiTop + this.ySize + 10, 0xFFFF0000);
Draw.drawString(this.generator.getRotationSpeed() + "", this.guiLeft, this.guiTop + this.ySize + 20, 0xFFFF0000);
Draw.drawString(Math.round(this.generator.getVoltage()) + "V", this.guiLeft + 50, this.guiTop + this.ySize - 40, 0xFFCC44, false);
Draw.drawString(Math.round(this.generator.getRotationSpeed() * 1000) + " RPM", this.guiLeft + 125, this.guiTop + this.ySize - 40, 0xFFCC44, false);
}
}
@@ -24,12 +24,12 @@ public void initialize()
{
for (byte slot = 0; slot < this.rack.inventory.getSizeInventory(); slot++)
{
addSlotToContainer(new Slot(this.rack.inventory, slot, 5, 26 + (18 * slot)));
addSlotToContainer(new Slot(this.rack.inventory, slot, 26, 19 + (22 * slot)));
}
for (byte slot = 0; slot < 9; slot++)
{
addSlotToContainer(new Slot(player.inventory, slot, 5 + (18 * slot), 182));
addSlotToContainer(new Slot(player.inventory, slot, 8 + (18 * slot), 109));
}
}

0 comments on commit d8f8271

Please sign in to comment.