Little more work on pda lots more to do

This commit is contained in:
Gig 2015-06-20 11:24:04 +01:00
parent 95c57bccf0
commit c6bc7f6fb8
5 changed files with 74 additions and 7 deletions

View file

@ -0,0 +1,10 @@
package techreborn.api;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
public interface IpdaItem
{
//TODO
}

View file

@ -248,7 +248,7 @@ public class GuiHandler implements IGuiHandler {
(TileChemicalReactor) world.getTileEntity(x, y, z));
} else if (ID == pdaID)
{
return new GuiPda(player);
return new GuiPda(player, new ContainerPda(player));
} else if (ID == destructoPackID) {
return new GuiDestructoPack(new ContainerDestructoPack(player));
} else if (ID == lesuID) {

View file

@ -0,0 +1,23 @@
package techreborn.client.container;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Slot;
import techreborn.api.recipe.RecipeCrafter;
import techreborn.client.SlotOutput;
import techreborn.tiles.TileAlloySmelter;
public class ContainerPda extends TechRebornContainer {
EntityPlayer player;
public ContainerPda(EntityPlayer player)
{
}
@Override
public boolean canInteractWith(EntityPlayer player)
{
return true;
}
}

View file

@ -1,20 +1,27 @@
package techreborn.pda;
import java.awt.Container;
import techreborn.client.container.ContainerPda;
import techreborn.cofhLib.gui.GuiBase;
import techreborn.cofhLib.gui.GuiColor;
import techreborn.cofhLib.gui.element.ElementSlider;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
public class GuiPda extends GuiScreen {
public class GuiPda extends GuiBase {
public final int guiHeight = 256;
public final int guiWidth = 256;
public final int guiHeight = 180;
private int guiLeft, guiTop;
private ElementSlider slider;
private static final ResourceLocation pdaGuipages = new ResourceLocation(
"techreborn:" + "textures/gui/pda.png");
private static final ResourceLocation pdaGuipages = new ResourceLocation("techreborn:" + "textures/gui/pda.png");
public GuiPda(EntityPlayer player)
public GuiPda(EntityPlayer player, ContainerPda container)
{
super(container);
}
@Override
@ -23,6 +30,27 @@ public class GuiPda extends GuiScreen {
super.initGui();
this.guiLeft = this.width / 2 - this.guiWidth / 2;
this.guiTop = this.height / 2 - this.guiHeight / 2;
//TODO fix
slider = new ElementSlider(this, "scrollBar", 239, 36, 12, 201, 187, 0)
{
@Override
protected void dragSlider(int x, int y)
{
if (y > _value)
{
setValue(_value + 1);
}
else
{
setValue(_value - 1);
}
}
};
slider.backgroundColor = new GuiColor(0, 0, 0, 0).getColor();
slider.borderColor = new GuiColor(0, 0, 0, 0).getColor();
slider.setSliderSize(12, 15);
addElement(slider);
}
@Override
@ -30,7 +58,13 @@ public class GuiPda extends GuiScreen {
{
mc.getTextureManager().bindTexture(pdaGuipages);
drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, this.guiWidth,this.guiHeight);
super.drawScreen(mouseX, mouseY, partialTicks);
// super.drawScreen(mouseX, mouseY, partialTicks);
}
@Override
public boolean doesGuiPauseGame()
{
return false;
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB