@Override public void initGui() { super.initGui(); this.name = new GuiTextField( 0, this.fontRenderer, this.guiLeft + 24, this.guiTop + 32, 79, this.fontRenderer.FONT_HEIGHT ); this.name.setEnableBackgroundDrawing( false ); this.name.setMaxStringLength( 32 ); this.name.setTextColor( 0xFFFFFF ); this.name.setVisible( true ); this.name.setFocused( true ); }
@Override public void initGui() { super.initGui(); helpTextProviders.clear(); this.buttonList.add(buttonHelp = new GuiButtonHelp(100, this.guiLeft + this.xSize - 16, this.guiTop + 4)); //The parameters of GuiButton are(id, x, y, width, height, text); this.buttonList.add(buttonSave = createAndAddButton(0, 79, 17, 30, 20, "Save")); this.buttonList.add(buttonLoad = createAndAddButton(1, 137, 17, 30, 20, "Load")); this.buttonList.add(buttonCopy = createAndAddButton(2, 79, 61, 30, 20, "Copy")); this.buttonList.add(buttonPaste = createAndAddButton(3, 135, 61, 34, 20, "Paste")); this.nameField = new GuiTextField(0, this.fontRenderer, this.guiLeft + 8, this.guiTop + 6, 149, this.fontRenderer.FONT_HEIGHT); this.nameField.setMaxStringLength(50); this.nameField.setVisible(true); helpTextProviders.add(new AreaHelpText(nameField, "field.template_name")); helpTextProviders.add(new AreaHelpText(inventorySlots.getSlot(0), guiLeft, guiTop, "slot.gadget")); helpTextProviders.add(new AreaHelpText(inventorySlots.getSlot(1), guiLeft, guiTop, "slot.template")); helpTextProviders.add(new AreaHelpText(guiLeft + 112, guiTop + 41, 22, 15, "arrow.data_flow")); helpTextProviders.add(new AreaHelpText(panel, guiLeft, guiTop + 10, "preview")); //NOTE: the id always has to be different or else it might get called twice or never! }
private void updateVisibility() { boolean isMine = ctr.tile.isClaimedBy(ModCyclic.proxy.getClientPlayer()); boolean visible = !ctr.tile.isClaimedBySomeone() || isMine; if (txtPassword != null) { txtPassword.setVisible(visible); txtPassword.setEnabled(visible); } buttonActiveType.visible = visible; buttonUserClaim.visible = visible; buttonUserPerm.visible = isMine; }
@Override public void initGui() { super.initGui(); X = new GuiTextField(0, this.fontRenderer, this.guiLeft + 80, this.guiTop + 100, 40, this.fontRenderer.FONT_HEIGHT); X.setMaxStringLength(50); X.setVisible(true); Y = new GuiTextField(1, this.fontRenderer, this.guiLeft + 200, this.guiTop + 100, 40, this.fontRenderer.FONT_HEIGHT); Y.setMaxStringLength(50); Y.setVisible(true); Z = new GuiTextField(2, this.fontRenderer, this.guiLeft + 320, this.guiTop + 100, 40, this.fontRenderer.FONT_HEIGHT); Z.setMaxStringLength(50); Z.setVisible(true); nullCheckTextBoxes(); //NOTE: the id always has to be different or else it might get called twice or never! this.buttonList.add(new GuiButton(1, this.guiLeft + 80, this.guiTop + 125, 40, 20, "Ok")); //this.buttonList.add(new GuiButton(2, this.guiLeft + 200, this.guiTop + 125, 40, 20, "Cancel")); this.buttonList.add(new DireButton(3, this.guiLeft + 65, this.guiTop + 99, 10, 10, "-")); this.buttonList.add(new DireButton(4, this.guiLeft + 125, this.guiTop + 99, 10, 10, "+")); this.buttonList.add(new DireButton(5, this.guiLeft + 185, this.guiTop + 99, 10, 10, "-")); this.buttonList.add(new DireButton(6, this.guiLeft + 245, this.guiTop + 99, 10, 10, "+")); this.buttonList.add(new DireButton(7, this.guiLeft + 305, this.guiTop + 99, 10, 10, "-")); this.buttonList.add(new DireButton(8, this.guiLeft + 365, this.guiTop + 99, 10, 10, "+")); this.buttonList.add(new GuiButton(9, this.guiLeft + 320, this.guiTop + 125, 40, 20, "Reset")); }
private void deselectFilter() { this.selection.setProvider(null); if (searchField != null) { searchField.setEnabled(false); searchField.setVisible(false); } scrollBar.setVisible(false); for (Slot slot : inventorySlots.inventorySlots) { if (slot instanceof SlotGeneticFilter) { SlotGeneticFilter filter = (SlotGeneticFilter) slot; filter.setEnabled(true); } } }
left.setVisible(true); right.setVisible(true); up.setVisible(true); down.setVisible(true); depth.setVisible(true);
private <S> void selectFilter(ISelectableProvider<S> provider) { selection.setProvider(provider); if (searchField != null) { searchField.setEnabled(true); searchField.setVisible(true); } selection.filterEntries(searchField != null ? searchField.getText() : ""); for (Slot slot : inventorySlots.inventorySlots) { if (slot instanceof SlotGeneticFilter) { SlotGeneticFilter filter = (SlotGeneticFilter) slot; filter.setEnabled(false); } } }
startX.setVisible(true); startY.setVisible(true); startZ.setVisible(true); endX.setVisible(true); endY.setVisible(true); endZ.setVisible(true);
amountField.setVisible(true); amountField.setText(String.valueOf(getDefaultAmount())); amountField.setTextColor(16777215);
commentField.setVisible(false); commentField.setMaxStringLength(500);
private void closeComment(boolean save) { SpellPiece piece = null; if(selectedX != -1 && selectedY != -1) piece = programmer.spell.grid.gridData[selectedX][selectedY]; if(save && piece != null) { String text = commentField.getText(); pushState(true); piece.comment = text; onSpellChanged(false); } spellNameField.setEnabled(!spectator && (piece == null || !piece.interceptKeystrokes())); commentField.setFocused(false); commentField.setVisible(false); commentField.setEnabled(false); commentField.setText(""); commentEnabled = false; }
@Override public void init(int x, int y) { addSideButton(new SideButtonRedstoneMode(this, readerWriter.getRedstoneModeParameter())); add = addButton(x + 128, y + 15, 20, 20, "+"); remove = addButton(x + 150, y + 15, 20, 20, "-"); name = new GuiTextField(0, fontRenderer, x + 8 + 1, y + 20 + 1, 107, fontRenderer.FONT_HEIGHT); name.setEnableBackgroundDrawing(false); name.setVisible(true); name.setTextColor(16777215); name.setCanLoseFocus(true); name.setFocused(false); }
@Override public void init(int x, int y) { addSideButton(new SideButtonType(this, TileDetector.TYPE)); addSideButton(new SideButtonDetectorMode(this)); addSideButton(new SideButtonCompare(this, TileDetector.COMPARE, IComparer.COMPARE_DAMAGE)); addSideButton(new SideButtonCompare(this, TileDetector.COMPARE, IComparer.COMPARE_NBT)); amount = new GuiTextField(0, fontRenderer, x + 41 + 1, y + 23 + 1, 50, fontRenderer.FONT_HEIGHT); amount.setText(String.valueOf(TileDetector.AMOUNT.getValue())); amount.setEnableBackgroundDrawing(false); amount.setVisible(true); amount.setTextColor(16777215); amount.setCanLoseFocus(true); amount.setFocused(false); }
@Override public void init(int x, int y) { compareNbt = addCheckBox(x + 7, y + 77, t("gui.refinedstorage:filter.compare_nbt"), (compare & IComparer.COMPARE_NBT) == IComparer.COMPARE_NBT); compareDamage = addCheckBox(x + 7 + compareNbt.getButtonWidth() + 4, y + 77, t("gui.refinedstorage:filter.compare_damage"), (compare & IComparer.COMPARE_DAMAGE) == IComparer.COMPARE_DAMAGE); compareDamage.visible = type == IType.ITEMS; toggleModFilter = addCheckBox(0, y + 71 + 25, t("gui.refinedstorage:filter.mod_filter"), modFilter); toggleMode = addButton(x + 7, y + 71 + 21, 0, 20, ""); updateModeButton(mode); nameField = new GuiTextField(0, fontRenderer, x + 34, y + 121, 137 - 6, fontRenderer.FONT_HEIGHT); nameField.setText(name); nameField.setEnableBackgroundDrawing(false); nameField.setVisible(true); nameField.setCanLoseFocus(true); nameField.setFocused(false); nameField.setTextColor(16777215); addSideButton(new SideButtonFilterType(this)); }
case Keyboard.KEY_D: if(piece != null) { commentField.setVisible(true); commentField.setFocused(true); commentField.setEnabled(true);
@Override public void initGui() { super.initGui(); this.searchField = new GuiTextField(0, this.fontRenderer, this.getGuiLeft() + 98, this.getGuiTop() + 6, 70, 10); this.searchField.setEnableBackgroundDrawing(false); this.searchField.setVisible(true); this.searchField.setMaxStringLength(25); this.searchField.setTextColor(0xFFFFFF); IConfigManager cm = ((IConfigurableObject) this.inventorySlots).getConfigManager(); // FIXME: Don't use AE Core classes this.sortByButton = new GuiImgButton(this.getGuiLeft() - 18, this.getGuiTop() + 8, Settings.SORT_BY, cm.getSetting(Settings.SORT_BY)); this.viewItemsButton = new GuiImgButton(this.getGuiLeft() - 18, this.getGuiTop() + 48, Settings.VIEW_MODE, cm.getSetting(Settings.VIEW_MODE)); this.sortDirButton = new GuiImgButton(this.getGuiLeft() - 18, this.getGuiTop() + 28, Settings.SORT_DIRECTION, cm.getSetting(Settings.SORT_DIRECTION)); this.clearButton = new GuiImgButton(this.getGuiLeft() + 87, this.getGuiTop() + 142, Settings.ACTIONS, ActionItems.STASH); this.clearButton.setHalfSize(true); this.addButton(this.sortByButton); this.addButton(this.viewItemsButton); this.addButton(this.sortDirButton); this.addButton(this.clearButton); }