GUI refactor

This commit is contained in:
Raoul Van den Berge
2015-12-20 11:39:19 +01:00
parent 414d40499b
commit bbcce0598f
8 changed files with 326 additions and 193 deletions

View File

@@ -1,32 +1,25 @@
package storagecraft.gui;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
import storagecraft.container.ContainerDrive;
import storagecraft.tile.TileDrive;
public class GuiDrive extends GuiMachine {
public static final ResourceLocation DRIVE_RESOURCE = new ResourceLocation("storagecraft:textures/gui/drive.png");
public GuiDrive(ContainerDrive container, TileDrive drive) {
super(container, drive);
this.xSize = 176;
this.ySize = 190;
super(container, 176, 190, drive);
}
@Override
protected void drawGuiContainerBackgroundLayer(float renderPartialTicks, int mouseX, int mouseY) {
mc.getTextureManager().bindTexture(DRIVE_RESOURCE);
public void drawBackground(int x, int y, int mouseX, int mouseY) {
bindTexture("gui/drive.png");
drawTexturedModalRect((this.width - xSize) / 2, (this.height - ySize) / 2, 0, 0, xSize, ySize);
drawTexturedModalRect(x, y, 0, 0, xSize, ySize);
}
@Override
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
super.drawGuiContainerForegroundLayer(mouseX, mouseY);
public void drawForeground(int mouseX, int mouseY) {
super.drawForeground(mouseX, mouseY);
fontRendererObj.drawString(StatCollector.translateToLocal("gui.storagecraft:drive"), 7, 7, 4210752);
fontRendererObj.drawString(StatCollector.translateToLocal("container.inventory"), 7, 96, 4210752);
drawString(7, 7, t("gui.storagecraft:drive"));
drawString(7, 96, t("container.inventory"));
}
}