Arranged buttons in the change extraction GUI.
This commit is contained in:
parent
fe29f822d3
commit
374855f901
@ -18,6 +18,7 @@ import boilerplate.client.BaseContainerGui;
|
|||||||
import net.minecraft.client.gui.GuiButton;
|
import net.minecraft.client.gui.GuiButton;
|
||||||
import net.minecraft.entity.player.InventoryPlayer;
|
import net.minecraft.entity.player.InventoryPlayer;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
import steamcraft.common.lib.ModInfo;
|
import steamcraft.common.lib.ModInfo;
|
||||||
import steamcraft.common.tiles.TileCopperPipe;
|
import steamcraft.common.tiles.TileCopperPipe;
|
||||||
import steamcraft.common.tiles.container.ContainerPipeConnections;
|
import steamcraft.common.tiles.container.ContainerPipeConnections;
|
||||||
@ -47,6 +48,12 @@ public class GuiPipeConnections extends BaseContainerGui
|
|||||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_)
|
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_)
|
||||||
{
|
{
|
||||||
this.fontRendererObj.drawString("Change Extraction", 60, 6, 4210752);
|
this.fontRendererObj.drawString("Change Extraction", 60, 6, 4210752);
|
||||||
|
this.fontRendererObj.drawString("North:", 20, 26, 4210752);
|
||||||
|
this.fontRendererObj.drawString("South:", 115, 26, 4210752);
|
||||||
|
this.fontRendererObj.drawString("West:", 20, 56, 4210752);
|
||||||
|
this.fontRendererObj.drawString("East:", 115, 56, 4210752);
|
||||||
|
this.fontRendererObj.drawString("Up:", 20, 86, 4210752);
|
||||||
|
this.fontRendererObj.drawString("Down:", 115, 86, 4210752);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -64,18 +71,43 @@ public class GuiPipeConnections extends BaseContainerGui
|
|||||||
super.initGui();
|
super.initGui();
|
||||||
buttonList.clear();
|
buttonList.clear();
|
||||||
|
|
||||||
buttonList.add(new GuiButton(0, guiLeft + 50, guiTop + 20, 40, 20, "North"));
|
ForgeDirection[] connections = tile.getConnections();
|
||||||
buttonList.add(new GuiButton(1, guiLeft + 50, guiTop + 80, 40, 20, "South"));
|
|
||||||
buttonList.add(new GuiButton(2, guiLeft + 10, guiTop + 50, 40, 20, "East"));
|
GuiButton north = new GuiButton(0, guiLeft + 55, guiTop + 20, 44, 20, "Insert");
|
||||||
buttonList.add(new GuiButton(3, guiLeft + 90, guiTop + 50, 40, 20, "West"));
|
GuiButton south = new GuiButton(4, guiLeft + 150, guiTop + 20, 44, 20, "Insert");
|
||||||
buttonList.add(new GuiButton(4, guiLeft + 150, guiTop + 20, 40, 20, "Up"));
|
if (connections[2] == null)
|
||||||
buttonList.add(new GuiButton(5, guiLeft + 150, guiTop + 80, 40, 20, "Down"));
|
north.enabled = false;
|
||||||
|
if (connections[3] == null)
|
||||||
|
south.enabled = false;
|
||||||
|
|
||||||
|
GuiButton west = new GuiButton(2, guiLeft + 55, guiTop + 50, 44, 20, "Insert");
|
||||||
|
GuiButton east = new GuiButton(3, guiLeft + 150, guiTop + 50, 44, 20, "Insert");
|
||||||
|
if (connections[4] == null)
|
||||||
|
west.enabled = false;
|
||||||
|
if (connections[5] == null)
|
||||||
|
east.enabled = false;
|
||||||
|
|
||||||
|
GuiButton up = new GuiButton(1, guiLeft + 55, guiTop + 80, 44, 20, "Insert");
|
||||||
|
GuiButton down = new GuiButton(5, guiLeft + 150, guiTop + 80, 44, 20, "Insert");
|
||||||
|
if (connections[0] == null)
|
||||||
|
up.enabled = false;
|
||||||
|
if (connections[1] == null)
|
||||||
|
down.enabled = false;
|
||||||
|
|
||||||
|
buttonList.add(north);
|
||||||
|
buttonList.add(south);
|
||||||
|
buttonList.add(west);
|
||||||
|
buttonList.add(east);
|
||||||
|
buttonList.add(up);
|
||||||
|
buttonList.add(down);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void actionPerformed(GuiButton button)
|
protected void actionPerformed(GuiButton button)
|
||||||
{
|
{
|
||||||
if (button.id == 0)
|
if (button.id == 0)
|
||||||
System.out.println("Button 0 pressed");
|
{
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -65,8 +65,8 @@ public class TileCopperPipe extends TileEntity implements IFluidHandler, ISpanne
|
|||||||
private int ticksSinceUpdate = ticksTillFluidUpdate / 2; // first time
|
private int ticksSinceUpdate = ticksTillFluidUpdate / 2; // first time
|
||||||
// update faster
|
// update faster
|
||||||
|
|
||||||
public ForgeDirection extract = null;
|
|
||||||
public ForgeDirection[] connections = new ForgeDirection[6];
|
public ForgeDirection[] connections = new ForgeDirection[6];
|
||||||
|
public ForgeDirection extract = null;
|
||||||
private Coords masterCoords = null;
|
private Coords masterCoords = null;
|
||||||
|
|
||||||
private static float pixel = 1F / 16f;
|
private static float pixel = 1F / 16f;
|
||||||
@ -270,6 +270,11 @@ public class TileCopperPipe extends TileEntity implements IFluidHandler, ISpanne
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ForgeDirection[] getConnections()
|
||||||
|
{
|
||||||
|
return this.connections;
|
||||||
|
}
|
||||||
|
|
||||||
private void removeConnections(int i)
|
private void removeConnections(int i)
|
||||||
{
|
{
|
||||||
if ((this.connections[i] != null) && !this.worldObj.isRemote)
|
if ((this.connections[i] != null) && !this.worldObj.isRemote)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user