Worked on Soul Forge GUI and container. GUI texture is VERY WIP and the slot locations as well as the progress par will change. Don't work on it >:3

This commit is contained in:
WayofTime 2016-01-07 18:05:23 -05:00
parent 8b024e1703
commit fec2236114
8 changed files with 232 additions and 6 deletions

View file

@ -1,13 +1,15 @@
package WayofTime.bloodmagic.client.gui;
import WayofTime.bloodmagic.api.Constants;
import WayofTime.bloodmagic.tile.TileTeleposer;
import WayofTime.bloodmagic.tile.container.ContainerTeleposer;
import net.minecraft.client.multiplayer.WorldClient;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.BlockPos;
import net.minecraft.world.World;
import net.minecraftforge.fml.common.network.IGuiHandler;
import WayofTime.bloodmagic.api.Constants;
import WayofTime.bloodmagic.tile.TileSoulForge;
import WayofTime.bloodmagic.tile.TileTeleposer;
import WayofTime.bloodmagic.tile.container.ContainerSoulForge;
import WayofTime.bloodmagic.tile.container.ContainerTeleposer;
public class GuiHandler implements IGuiHandler
{
@ -20,6 +22,8 @@ public class GuiHandler implements IGuiHandler
{
case Constants.Gui.TELEPOSER_GUI:
return new ContainerTeleposer(player.inventory, (TileTeleposer) world.getTileEntity(pos));
case Constants.Gui.SOUL_FORGE_GUI:
return new ContainerSoulForge(player.inventory, (TileSoulForge) world.getTileEntity(pos));
}
return null;
@ -36,6 +40,8 @@ public class GuiHandler implements IGuiHandler
{
case Constants.Gui.TELEPOSER_GUI:
return new GuiTeleposer(player.inventory, (TileTeleposer) world.getTileEntity(pos));
case Constants.Gui.SOUL_FORGE_GUI:
return new GuiSoulForge(player.inventory, (TileSoulForge) world.getTileEntity(pos));
}
}

View file

@ -0,0 +1,51 @@
package WayofTime.bloodmagic.client.gui;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import WayofTime.bloodmagic.api.Constants;
import WayofTime.bloodmagic.tile.container.ContainerSoulForge;
import WayofTime.bloodmagic.util.helper.TextHelper;
@SideOnly(Side.CLIENT)
public class GuiSoulForge extends GuiContainer
{
public GuiSoulForge(InventoryPlayer playerInventory, IInventory tileTeleposer)
{
super(new ContainerSoulForge(playerInventory, tileTeleposer));
this.xSize = 176;
this.ySize = 157;
}
@Override
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY)
{
this.fontRendererObj.drawString(TextHelper.localize("tile.BloodMagic.soulForge.name"), 64, 23, 4210752);
this.fontRendererObj.drawString(StatCollector.translateToLocal("container.inventory"), 8, 47, 4210752);
}
@Override
protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY)
{
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
ResourceLocation soulForgeGuiTextures = new ResourceLocation(Constants.Mod.MODID + ":textures/gui/soulForge.png");
this.mc.getTextureManager().bindTexture(soulForgeGuiTextures);
int i = (this.width - this.xSize) / 2;
int j = (this.height - this.ySize) / 2;
this.drawTexturedModalRect(i, j, 0, 0, this.xSize, this.ySize);
int l = this.getCookProgressScaled(36);
this.drawTexturedModalRect(i + 79, j + 32, 176, 0, l, 18);
}
public int getCookProgressScaled(int scale)
{
double progress = 1;
return (int) (progress * scale);
}
}