Some small changes to the gui code

This commit is contained in:
modmuss50 2015-06-17 11:14:46 +01:00
parent 90be01753b
commit 74525d260a
2 changed files with 10 additions and 2 deletions

View file

@ -11,6 +11,7 @@ import org.lwjgl.opengl.GL11;
import techreborn.client.container.ContainerIDSU; import techreborn.client.container.ContainerIDSU;
import techreborn.cofhLib.gui.GuiBase; import techreborn.cofhLib.gui.GuiBase;
import techreborn.cofhLib.gui.element.ElementListBox; import techreborn.cofhLib.gui.element.ElementListBox;
import techreborn.cofhLib.gui.element.ElementTextFieldLimited;
import techreborn.cofhLib.gui.element.listbox.ListBoxElementText; import techreborn.cofhLib.gui.element.listbox.ListBoxElementText;
import techreborn.tiles.iesu.TileIDSU; import techreborn.tiles.iesu.TileIDSU;
@ -26,6 +27,8 @@ public class GuiIDSU extends GuiBase {
ElementListBox listBox; ElementListBox listBox;
ElementTextFieldLimited idFeild;
public GuiIDSU(EntityPlayer player, public GuiIDSU(EntityPlayer player,
TileIDSU tileIDSU) TileIDSU tileIDSU)
@ -52,11 +55,16 @@ public class GuiIDSU extends GuiBase {
this.buttonList.add(new GuiButton(1, k + 96, l + 8 + 22, 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(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(3, k + 96, l + 8 + (22*3), 18, 20, "--"));
listBox = new ElementListBox(this, k + 20, l + 20, 60, 60); listBox = new ElementListBox(this, 20, 20, 60, 60);
for (int i = 0; i < 15; i++) { for (int i = 0; i < 15; i++) {
listBox.add(new ListBoxElementText("Name " + i)); listBox.add(new ListBoxElementText("Name " + i));
} }
addElement(listBox); addElement(listBox);
idFeild = new ElementTextFieldLimited(this, 20, 10, 20, 10);
idFeild.setFilter("1234567890", false);
addElement(idFeild);
} }
} }

View file

@ -39,7 +39,7 @@ public class ListBoxElementText implements IListBoxElement
public void draw(ElementListBox listBox, int x, int y, int backColor, int textColor) public void draw(ElementListBox listBox, int x, int y, int backColor, int textColor)
{ {
listBox.getFontRenderer().drawStringWithShadow(_text, x, y, textColor); Minecraft.getMinecraft().fontRenderer.drawString(_text, x, y, textColor);
} }
} }