@Override public void initGui() { Keyboard.enableRepeatEvents(true); buttonList.clear(); buttonList.add( doneButton = new GuiButton( 1, width / 2 - 40, height / 2 - 10, 80, 20, MCA.getInstance().getLanguageLoader().getString("gui.button.done"))); buttonList.add( randomButton = new GuiButton( 2, width / 2 + 105, height / 2 - 60, 60, 20, MCA.getInstance().getLanguageLoader().getString("gui.button.random"))); babyNameTextField = new GuiTextField(fontRendererObj, width / 2 - 100, height / 2 - 60, 200, 20); babyNameTextField.setMaxStringLength(32); }
/** * Prepare a text field for entry. * * @param field the field * @param length the maximum length of the string * @param text the initial text */ private void initTextField(GuiTextField field, int length, String text) { field.setVisible(true); field.setMaxStringLength(length); field.setEnableBackgroundDrawing(true); field.setCanLoseFocus(true); field.setFocused(false); field.setText(text); }
@Override public void initGui() { super.initGui(); int j = (width - xSize) / 2 + 8; int k = (height - ySize) / 2 - 12; input = new GuiTextField(fontRendererObj, j + xSize / 2 - 6, k + 33, 26, 16); input.setFocused(false); input.setMaxStringLength(3); }
@Override public void initGui() { if (rankList == null) { rankList = new RankList(); } rankList.func_148122_a(width, height, 32, height - 28); if (doneButton == null) { doneButton = new GuiButtonExt(0, 0, 0, 145, 20, I18n.format("gui.done")); } doneButton.xPosition = width / 2 + 10; doneButton.yPosition = height - doneButton.height - 4; if (detailInfo == null) { detailInfo = new GuiCheckBox(1, 0, 5, I18n.format(Caveworld.CONFIG_LANG + "detail"), true); } detailInfo.setIsChecked(CaveConfigGui.detailInfo); detailInfo.xPosition = width / 2 + 95; if (instantFilter == null) { instantFilter = new GuiCheckBox( 2, 0, detailInfo.yPosition + detailInfo.height + 2, I18n.format(Caveworld.CONFIG_LANG + "instant"), true); } instantFilter.setIsChecked(CaveConfigGui.instantFilter); instantFilter.xPosition = detailInfo.xPosition; buttonList.clear(); buttonList.add(doneButton); buttonList.add(detailInfo); buttonList.add(instantFilter); if (filterTextField == null) { filterTextField = new GuiTextField(fontRendererObj, 0, 0, 150, 16); filterTextField.setMaxStringLength(100); } filterTextField.xPosition = width / 2 - filterTextField.width - 5; filterTextField.yPosition = height - filterTextField.height - 6; detailHoverChecker = new HoverChecker(detailInfo, 800); instantHoverChecker = new HoverChecker(instantFilter, 800); }
@Override public void initGui() { super.initGui(); if (stand == null) { mc.displayGuiScreen(null); } else { Keyboard.enableRepeatEvents(true); buttonList.clear(); this.guiLeft = (this.width - this.xSize) / 2; this.guiTop = (this.height - this.ySize) / 2; buttonList.add(new GuiButton(ID_PAGE_LEFT, width / 2 - 6, height / 2 + 54, 20, 20, "<")); buttonList.add(new GuiButton(ID_PAGE_RIGHT, width / 2 + 62, height / 2 + 54, 20, 20, ">")); buttonList.add( new GuiButton( ID_DONE_SELECT, width / 2 + 16, height / 2 + 54, 44, 20, I18n.format("gui.done"))); // 4, 5, 6, 7, 8 = taken. addToolButton(ID_NONE, 0); addToolButton(ID_HAT_COLOUR_SWAP, 1); addToolButton(ID_RANDOM, 2); buttonList.add(new GuiButton(ID_CLOSE, width - 22, 2, 20, 20, "X")); pageNumber = 0; if (!stand.hatName.equalsIgnoreCase("")) { for (int i = 0; i < hatsToShow.size(); i++) { String hatName = (String) hatsToShow.get(i); if (hatName.equalsIgnoreCase(stand.hatName)) { i -= i % 6; pageNumber = i / 6; break; } } } updateButtonList(); searchBar = new GuiTextField(0, this.fontRendererObj, this.width / 2 - 65, height - 24, 150, 20); searchBar.setMaxStringLength(255); searchBar.setText(StatCollector.translateToLocal("hats.gui.search")); searchBar.setTextColor(0xAAAAAA); searchBar.setVisible(enabledSearchBar); } }
@Override public void initGui() { // used to offset buttons int offSetX = 150; int offSetY = 250; int posX = (this.width) / 2; int posY = (this.height) / 2; this.buttonList.clear(); System.out.println("The channel for this telepad is : " + te.TELEPORTCHANNEL); channelField = new GuiTextField(fontRendererObj, posX - 50, posY - 130, 150, 20); if (channelField != null) { channelField.setText(channelName); channelField.setMaxStringLength(50); } ArrayList<int[]> allCoords = TelepadWorldData.get(thePlayer.worldObj).getCoordsForChannel(te.TELEPORTCHANNEL); int c = allCoords.size(); if (c < 1) { return; } for (int i = 0; i < c; i++) { String name = TelepadWorldData.get(thePlayer.worldObj).getPadName(allCoords.get(i)); this.buttonList.add( new GuiButton( i, /*x*/ posX - 200 + (i / 10 > 0 && i % 10 >= 0 ? 120 * (i / 10) : 0), /*y*/ posY + ((i * 25)) - (i / 10 > 0 && i % 10 >= 0 ? (250 * (i / 10)) + 100 : 100), /*size*/ 100, 20, /**/ name)); } this.buttonList.add(new GuiButton(EXIT_BUTTON, posX - 200, posY - 120, 20, 20, "X")); }
@SuppressWarnings("unchecked") @Override public void initGui() { super.initGui(); this.buttonList.clear(); FontRenderer fontRenderer = Minecraft.getMinecraft().fontRenderer; String mobsButton = "Attack Mobs: " + (base.isAttacksMobs() ? "\u00A72Yes" : "\u00A7cNo"); String neutralsButton = "Attack Neutrals: " + (base.isAttacksNeutrals() ? "\u00A72Yes" : "\u00A7cNo"); String playersButton = "Attack Players: " + (base.isAttacksPlayers() ? "\u00A72Yes" : "\u00A7cNo"); int x = (width - xSize) / 2; int y = (height - ySize) / 2; textFieldAddTrustedPlayer = new GuiTextField(fontRenderer, 11, 99, 100, 18); textFieldAddTrustedPlayer.setMaxStringLength(50); textFieldAddTrustedPlayer.setFocused(true); this.buttonList.add(new GuiButton(1, x + 10, y + 20, 155, 20, mobsButton)); this.buttonList.add(new GuiButton(2, x + 10, y + 40, 155, 20, neutralsButton)); this.buttonList.add(new GuiButton(3, x + 10, y + 60, 155, 20, playersButton)); this.buttonList.add(new GuiButton(4, x + 114, y + 98, 51, 20, "+")); this.buttonList.add(new GuiButton(5, x + 35, y + 135, 30, 20, "-")); this.buttonList.add(new GuiButton(6, x + 10, y + 135, 20, 20, "<<")); this.buttonList.add(new GuiButton(7, x + 145, y + 135, 20, 20, ">>")); if (this.base.getTrustedPlayers().size() > 0) { this.buttonList.add( new GuiButton( 8, x + 70, y + 135, 23, 20, this.base.getTrustedPlayers().get(base.trustedPlayerIndex).canOpenGUI ? "\u00A72Y" : "\u00A7cN")); this.buttonList.add( new GuiButton( 9, x + 93, y + 135, 23, 20, this.base.getTrustedPlayers().get(base.trustedPlayerIndex).canChangeTargeting ? "\u00A72Y" : "\u00A7cN")); this.buttonList.add( new GuiButton( 10, x + 116, y + 135, 23, 20, this.base.getTrustedPlayers().get(base.trustedPlayerIndex).admin ? "\u00A72Y" : "\u00A7cN")); } else { this.buttonList.add(new GuiButton(999, x + 70, y + 135, 23, 20, "?")); this.buttonList.add(new GuiButton(999, x + 93, y + 135, 23, 20, "?")); this.buttonList.add(new GuiButton(999, x + 116, y + 135, 23, 20, "?")); } }