A load of work on the system, seams a lot is broken.
This commit is contained in:
parent
d8e6e88797
commit
598badc375
17 changed files with 268 additions and 53 deletions
|
@ -1,14 +1,13 @@
|
|||
package techreborn.client;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import techreborn.client.container.*;
|
||||
import techreborn.client.gui.*;
|
||||
import techreborn.pda.GuiPda;
|
||||
import techreborn.tiles.*;
|
||||
import cpw.mods.fml.common.network.IGuiHandler;
|
||||
import techreborn.tiles.iesu.TileIDSU;
|
||||
import techreborn.tiles.idsu.TileIDSU;
|
||||
import techreborn.tiles.lesu.TileLesu;
|
||||
|
||||
public class GuiHandler implements IGuiHandler {
|
||||
|
|
|
@ -1,12 +1,8 @@
|
|||
package techreborn.client.container;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.ICrafting;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import techreborn.tiles.TileAesu;
|
||||
import techreborn.tiles.iesu.TileIDSU;
|
||||
import techreborn.tiles.idsu.TileIDSU;
|
||||
|
||||
|
||||
public class ContainerIDSU extends TechRebornContainer {
|
||||
|
|
|
@ -1,22 +1,20 @@
|
|||
package techreborn.client.gui;
|
||||
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import org.lwjgl.input.Mouse;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import net.minecraft.world.World;
|
||||
import techreborn.client.container.ContainerIDSU;
|
||||
import techreborn.cofhLib.gui.GuiBase;
|
||||
import techreborn.cofhLib.gui.element.ElementListBox;
|
||||
import techreborn.cofhLib.gui.element.ElementTextFieldLimited;
|
||||
import techreborn.cofhLib.gui.element.listbox.ListBoxElementText;
|
||||
import techreborn.tiles.iesu.TileIDSU;
|
||||
|
||||
import java.awt.*;
|
||||
import java.util.ArrayList;
|
||||
import techreborn.packets.PacketHandler;
|
||||
import techreborn.packets.PacketIdsu;
|
||||
import techreborn.tiles.idsu.ClientSideIDSUManager;
|
||||
import techreborn.tiles.idsu.IDSUManager;
|
||||
import techreborn.tiles.idsu.TileIDSU;
|
||||
|
||||
public class GuiIDSU extends GuiBase {
|
||||
|
||||
|
@ -40,32 +38,59 @@ public class GuiIDSU extends GuiBase {
|
|||
this.containerIDSU = (ContainerIDSU) this.inventorySlots;
|
||||
texture = new ResourceLocation(
|
||||
"techreborn", "textures/gui/aesu.png");
|
||||
drawTitle = true;
|
||||
drawInventory = true;
|
||||
drawTitle = false;
|
||||
drawInventory = false;
|
||||
name = StatCollector.translateToLocal("tile.techreborn.aesu.name");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initGui() {
|
||||
super.initGui();
|
||||
// this.buttonList.clear();
|
||||
// int k = (this.width - this.xSize) / 2;
|
||||
// int l = (this.height - this.ySize) / 2;
|
||||
// this.buttonList.add(new GuiButton(0, k + 96, l + 8, 18, 20, "++"));
|
||||
// this.buttonList.add(new GuiButton(1, k + 96, l + 8 + 22, 18, 20, "+"));
|
||||
// this.buttonList.add(new GuiButton(2, k + 96, l + 8 + (22*2), 18, 20, "-"));
|
||||
// this.buttonList.add(new GuiButton(3, k + 96, l + 8 + (22*3), 18, 20, "--"));
|
||||
|
||||
listBox = new ElementListBox(this, 20, 20, 60, 60);
|
||||
for (int i = 0; i < 15; i++) {
|
||||
listBox.add(new ListBoxElementText("Name " + i));
|
||||
this.buttonList.clear();
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
this.buttonList.add(new GuiButton(0, k + 96, l + 8, 18, 20, "++"));
|
||||
this.buttonList.add(new GuiButton(1, k + 96, l + 8 + 22, 18, 20, "+"));
|
||||
this.buttonList.add(new GuiButton(2, k + 96, l + 8 + (22*2), 18, 20, "-"));
|
||||
this.buttonList.add(new GuiButton(3, k + 96, l + 8 + (22*3), 18, 20, "--"));
|
||||
this.buttonList.add(new GuiButton(4, k + 40, l + 10, 10, 10, "+"));
|
||||
|
||||
listBox = new ElementListBox(this, 10, 28, 80, 60);
|
||||
|
||||
if(idsu.getWorldObj() != null){
|
||||
|
||||
for(World world : ClientSideIDSUManager.CLIENT.worldData.keySet()){
|
||||
// System.out.println(world.n + ":" + idsu.getWorldObj().getProviderName());
|
||||
//if(world.getProviderName().equals(idsu.getWorldObj().getProviderName())){
|
||||
IDSUManager.IDSUWorldSaveData saveData = ClientSideIDSUManager.CLIENT.getWorldDataFormWorld(world);
|
||||
for(Integer id : saveData.idsuValues.keySet()){
|
||||
IDSUManager.IDSUValueSaveData valueSaveData = saveData.idsuValues.get(id);
|
||||
if(valueSaveData.name != ""){
|
||||
listBox.add(new ListBoxElementText(valueSaveData.name + " - " + id));
|
||||
} else {
|
||||
listBox.add(new ListBoxElementText(id.toString()));
|
||||
}
|
||||
}
|
||||
// }
|
||||
}
|
||||
}
|
||||
// listBox.borderColor = new GuiColor(120, 120, 120, 0).getColor();
|
||||
// listBox.backgroundColor = new GuiColor(0, 0, 0, 32).getColor();
|
||||
addElement(listBox);
|
||||
|
||||
idFeild = new ElementTextFieldLimited(this, 20, 10, 20, 10);
|
||||
idFeild = new ElementTextFieldLimited(this, 10, 10, 30, 10, (short) 4);
|
||||
idFeild.setFilter("1234567890", false);
|
||||
|
||||
addElement(idFeild);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void actionPerformed(GuiButton button) {
|
||||
super.actionPerformed(button);
|
||||
PacketHandler.sendPacketToServer(new PacketIdsu(button.id, idsu, Integer.parseInt(idFeild.getText()), "TestName"));
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue