use of net.minecraft.client.gui.GuiTextField in project SecurityCraft by Geforce132.
the class GuiKeypadSetup method initGui.
public void initGui() {
super.initGui();
Keyboard.enableRepeatEvents(true);
int j = (this.height - this.height) / 2;
this.buttonList.add(this.saveAndContinueButton = new GuiButton(0, this.width / 2 - 48, this.height / 2 + 30 + 10, 100, 20, !this.flag ? "Save & continue." : "Invalid code!"));
this.textboxKeycode = new GuiTextField(this.fontRendererObj, this.width / 2 - 37, this.height / 2 - 47, 77, 12);
this.textboxKeycode.setTextColor(-1);
this.textboxKeycode.setDisabledTextColour(-1);
this.textboxKeycode.setEnableBackgroundDrawing(true);
this.textboxKeycode.setMaxStringLength(11);
this.updateButtonText();
}
use of net.minecraft.client.gui.GuiTextField in project ICBM-Classic by BuiltBrokenModding.
the class GuiCruiseLauncher method initGui.
@Override
public void initGui() {
super.initGui();
this.textFieldX = new GuiTextField(fontRendererObj, 20, 21, 35, 12);
this.textFieldY = new GuiTextField(fontRendererObj, 20, 37, 35, 12);
this.textFieldZ = new GuiTextField(fontRendererObj, 20, 52, 35, 12);
this.textFieldFreq = new GuiTextField(fontRendererObj, 70, 33, 35, 12);
this.textFieldFreq.setMaxStringLength(4);
this.textFieldX.setMaxStringLength(6);
this.textFieldZ.setMaxStringLength(6);
this.textFieldY.setMaxStringLength(6);
this.textFieldFreq.setText(this.tileEntity.getFrequency() + "");
if (this.tileEntity.getTarget() == null) {
this.textFieldX.setText(Math.round(this.tileEntity.xCoord) + "");
this.textFieldZ.setText(Math.round(this.tileEntity.zCoord) + "");
this.textFieldY.setText(Math.round(this.tileEntity.yCoord) + "");
} else {
this.textFieldX.setText(Math.round(this.tileEntity.getTarget().x()) + "");
this.textFieldZ.setText(Math.round(this.tileEntity.getTarget().z()) + "");
this.textFieldY.setText(Math.round(this.tileEntity.getTarget().y()) + "");
}
}
use of net.minecraft.client.gui.GuiTextField in project ArsMagica2 by Mithion.
the class GuiSpellCustomization method initGui.
@Override
public void initGui() {
super.initGui();
int l = (width - xSize) / 2;
int i1 = (height - ySize) / 2;
if (AMCore.config.suggestSpellNames())
spellName = new GuiTextField(fontRendererObj, l + 8, i1 + 8, xSize - 36, 16);
else
spellName = new GuiTextField(fontRendererObj, l + 8, i1 + 8, xSize - 16, 16);
String suggestion = ((ContainerSpellCustomization) this.inventorySlots).getInitialSuggestedName();
spellName.setText(suggestion);
if (!suggestion.equals("")) {
curName = suggestion;
((ContainerSpellCustomization) this.inventorySlots).setNameAndIndex(curName, curIndex);
}
btnPrev = new GuiButtonVariableDims(0, l + 8, i1 + 26, StatCollector.translateToLocal("am2.gui.prev")).setDimensions(48, 20);
btnNext = new GuiButtonVariableDims(1, l + xSize - 56, i1 + 26, StatCollector.translateToLocal("am2.gui.next")).setDimensions(48, 20);
btnRandomName = new GuiButtonVariableDims(2, l + xSize - 24, i1 + 5, "???");
btnRandomName.setDimensions(20, 20);
this.buttonList.add(btnPrev);
this.buttonList.add(btnNext);
if (AMCore.config.suggestSpellNames())
this.buttonList.add(btnRandomName);
int IIcon_start_x = l + 12;
int IIcon_start_y = i1 + 50;
int btnX = IIcon_start_x;
int btnY = IIcon_start_y;
int id = 3;
int IIconCount = 0;
int curPage = 0;
for (IIcon icon : SpellTextureHelper.instance.getAllIcons()) {
GuiSpellImageButton spellButton = new GuiSpellImageButton(id++, btnX, btnY, icon, IIconCount++, curPage);
if (curPage != 0) {
spellButton.visible = false;
}
this.buttonList.add(spellButton);
btnX += 14;
if (btnX > (l + xSize) - 15) {
btnX = IIcon_start_x;
btnY += 14;
if (btnY > (i1 + ySize - 10)) {
btnY = IIcon_start_y;
curPage++;
}
}
}
this.numPages = curPage;
}
use of net.minecraft.client.gui.GuiTextField in project Railcraft by Railcraft.
the class GuiBoxAnalogController method initGui.
@Override
public void initGui() {
if (tile == null)
return;
int w = (width - xSize) / 2;
int h = (height - ySize) / 2;
for (Map.Entry<SignalAspect, BitSet> entry : aspects.entrySet()) {
GuiTextField textField = new GuiTextField(entry.getKey().ordinal(), fontRendererObj, w + 72, h + getYPosFromIndex(entry.getKey().ordinal()), 95, 10);
textField.setMaxStringLength(37);
textField.setText(rangeToString(entry.getValue()));
textBox.put(entry.getKey(), textField);
}
}
use of net.minecraft.client.gui.GuiTextField in project Valkyrien-Warfare-Revamped by ValkyrienWarfare.
the class HovercraftControllerGUI method keyTyped.
@Override
protected void keyTyped(char typedChar, int keyCode) throws IOException {
boolean typed = false;
for (GuiTextField text : textFields) {
typed = typed || text.textboxKeyTyped(typedChar, keyCode);
}
if (!typed) {
updateServer();
super.keyTyped(typedChar, keyCode);
}
}
Aggregations