@Override public void initGui() { super.initGui(); addTab(new TabInfo(this, myInfo).setOffsets(12, 10)); prevOre = new ElementButton(this, 57, 31, "PrevOre", 206, 0, 206, 20, 206, 40, 20, 20, TEX_PATH).setToolTipLocalized(true); nextOre = new ElementButton(this, 129, 31, "NextOre", 226, 0, 226, 20, 226, 40, 20, 20, TEX_PATH).setToolTipLocalized(true); prevName = new ElementButton(this, 20, 81, "PrevName", 206, 0, 206, 20, 206, 40, 20, 20, TEX_PATH).setToolTipLocalized(true); nextName = new ElementButton(this, 166, 81, "NextName", 226, 0, 226, 20, 226, 40, 20, 20, TEX_PATH).setToolTipLocalized(true); transmute = new ElementButton(this, 83, 59, "Transmute", 206, 60, 206, 80, 206, 100, 40, 20, TEX_PATH).setToolTipLocalized(true); addElement(prevOre); addElement(nextOre); addElement(prevName); addElement(nextName); addElement(transmute); }
@Override protected void updateElementInformation() { super.updateElementInformation(); if (baseTile.getStoredInstance().isEmpty()) { lock.setDisabled(); } else { lock.setActive(); } if (baseTile.isLocked()) { lock.setToolTip(StringHelper.localize("info.cofh.locked")); lock.setSheetX(176); lock.setHoverX(176); } else { lock.setToolTip(StringHelper.localize("info.cofh.unlocked")); lock.setSheetX(192); lock.setHoverX(192); } }
@Override protected void updateElementInformation() { if (lexicon.hasMultipleOres()) { prevOre.setActive(); nextOre.setActive(); prevOre.setToolTip("gui.thermalfoundation.lexicon.prevEntry"); nextOre.setToolTip("gui.thermalfoundation.lexicon.nextEntry"); } else { prevOre.setDisabled(); nextOre.setDisabled(); prevOre.setToolTip("gui.thermalfoundation.lexicon.singleEntry"); nextOre.setToolTip("gui.thermalfoundation.lexicon.singleEntry"); } if (lexicon.canSetPreferred()) { setPreferredOre.setActive(); setPreferredOre.setToolTip("gui.thermalfoundation.lexicon.setPreference"); } else { setPreferredOre.setDisabled(); setPreferredOre.clearToolTip(); } if (lexicon.hasPreferredOre()) { clearPreferredOre.setActive(); clearPreferredOre.setToolTip("gui.thermalfoundation.lexicon.clearPreference"); } else { clearPreferredOre.setDisabled(); clearPreferredOre.clearToolTip(); } }
public ElementButton setToolTipLocalized(String tooltip) { return setToolTip(tooltip).setToolTipLocalized(true); }
private void update() { slider.setEnabled(relay.shouldThreshold()); slider.setVisible(relay.shouldThreshold()); buttonType.setSheetX(20 * relay.type); buttonType.setHoverX(20 * relay.type); buttonType.setToolTip("info.thermaldynamics.relay.type." + relay.type); buttonInvert.setSheetX(60 + 20 * relay.invert); buttonInvert.setHoverX(60 + 20 * relay.invert); buttonInvert.setToolTip("info.thermaldynamics.relay.invert." + relay.invert); int colorX = (relay.color % 8) * 20; int colorY = relay.color < 8 ? 124 : 164; buttonColor.setSheetX(colorX); buttonColor.setHoverX(colorX); buttonColor.setSheetY(colorY); buttonColor.setHoverY(colorY + 20); buttonColor.setToolTip("info.thermaldynamics.relay.color." + relay.color); }
private void setButtons() { for (int i = 0; i < flagButtons.length; i++) { if (flagButtons[i] != null) { boolean b = container.filter.getFlag(i); int x = flagButtonsPos[i][0] + (b ? buttonSize : 0); flagButtons[i].setSheetX(x); flagButtons[i].setHoverX(x); flagButtons[i].setToolTip("info.thermaldynamics.filter." + flagButtons[i].getName() + (b ? ".on" : ".off")); } } for (int i = 0; i < levelButtons.length; i++) { if (levelButtons[i] != null) { int level = container.filter.getLevel(i); int x = levelButtonPos[i][0] + level * buttonSize; levelButtons[i].setSheetX(x); levelButtons[i].setHoverX(x); levelButtons[i].setToolTip("info.thermaldynamics.filter." + levelButtons[i].getName() + "." + level); } } }
private void updateButtons() { ContainerSatchelFilter container = (ContainerSatchelFilter) inventorySlots; int x = container.getFlag(IFilterable.FLAG_WHITELIST) ? 176 : 196; buttonList.setSheetX(x); buttonList.setHoverX(x); buttonList.setToolTip("info.cofh.filter.list." + (container.getFlag(IFilterable.FLAG_WHITELIST) ? "on" : "off")); x = container.getFlag(IFilterable.FLAG_ORE_DICT) ? 216 : 236; buttonOre.setSheetX(x); buttonOre.setHoverX(x); buttonOre.setToolTip("info.cofh.filter.oreDict." + (container.getFlag(IFilterable.FLAG_ORE_DICT) ? "on" : "off")); x = container.getFlag(IFilterable.FLAG_METADATA) ? 176 : 196; buttonMeta.setSheetX(x); buttonMeta.setHoverX(x); buttonMeta.setToolTip("info.cofh.filter.metadata." + (container.getFlag(IFilterable.FLAG_METADATA) ? "on" : "off")); x = container.getFlag(IFilterable.FLAG_NBT) ? 216 : 236; buttonNbt.setSheetX(x); buttonNbt.setHoverX(x); buttonNbt.setToolTip("info.cofh.filter.nbt." + (container.getFlag(IFilterable.FLAG_NBT) ? "on" : "off")); }
@Override public void initGui() { super.initGui(); buttonList = new ElementButton(this, 119, 20, "FilterList", 176, 0, 176, 20, 20, 20, TEX_PATH); buttonOre = new ElementButton(this, 145, 20, "FilterOre", 216, 0, 216, 20, 20, 20, TEX_PATH); buttonMeta = new ElementButton(this, 119, 46, "FilterMeta", 176, 60, 176, 80, 20, 20, TEX_PATH); buttonNbt = new ElementButton(this, 145, 46, "FilterNbt", 216, 60, 216, 80, 20, 20, TEX_PATH); addElement(buttonList); addElement(buttonOre); addElement(buttonMeta); addElement(buttonNbt); }
@Override protected void updateElementInformation() { if (lexicon.hasMultipleOres()) { prevOre.setActive(); nextOre.setActive(); } else { prevOre.setDisabled(); nextOre.setDisabled(); } if (lexicon.hasMultipleNames()) { prevName.setActive(); nextName.setActive(); } else { prevName.setDisabled(); nextName.setDisabled(); } if (lexicon.canTransmute()) { transmute.setActive(); } else { transmute.setDisabled(); } }
flagButtons[j] = new ElementButton(this, x0 + button_offset * i, y0, container.filter.flagType(j), flagButtonsPos[j][0], flagButtonsPos[j][1], flagButtonsPos[j][0], flagButtonsPos[j][1] + buttonSize, flagButtonsPos[j][0], flagButtonsPos[j][1] + buttonSize * 2, buttonSize, buttonSize, TEX_PATH); addElement(flagButtons[j]); levelButtons[j] = new ElementButton(this, x0 + button_offset * (i + flagNums.length), y0, FilterLogic.levelNames[j], levelButtonPos[j][0], levelButtonPos[j][1], levelButtonPos[j][0], levelButtonPos[j][1] + buttonSize, buttonSize, buttonSize, TEX_PATH); addElement(levelButtons[j]); decStackSize = new ElementButton(this, 137, 57, "DecStackSize", 216, 120, 216, 134, 216, 148, 14, 14, TEX_PATH).setToolTip("info.thermaldynamics.servo.decStackSize"); incStackSize = new ElementButton(this, 153, 57, "IncStackSize", 230, 120, 230, 134, 230, 148, 14, 14, TEX_PATH).setToolTip("info.thermaldynamics.servo.incStackSize"); decRetainSize = new ElementButton(this, 137, 28, "DecRetainSize", 216, 120, 216, 134, 216, 148, 14, 14, TEX_PATH).setToolTip("info.thermaldynamics.filter.decRetainSize"); incRetainSize = new ElementButton(this, 153, 28, "IncRetainSize", 230, 120, 230, 134, 230, 148, 14, 14, TEX_PATH).setToolTip("info.thermaldynamics.filter.incRetainSize");
@Override protected void updateElementInformation() { int x = myFilter.getFlag(IFilterable.FLAG_WHITELIST) ? 176 : 196; buttonList.setSheetX(x); buttonList.setHoverX(x); buttonList.setToolTip("info.cofh.filter.list." + (myFilter.getFlag(IFilterable.FLAG_WHITELIST) ? "on" : "off")); x = myFilter.getFlag(IFilterable.FLAG_ORE_DICT) ? 216 : 236; buttonOre.setSheetX(x); buttonOre.setHoverX(x); buttonOre.setToolTip("info.cofh.filter.oreDict." + (myFilter.getFlag(IFilterable.FLAG_ORE_DICT) ? "on" : "off")); x = myFilter.getFlag(IFilterable.FLAG_METADATA) ? 176 : 196; buttonMeta.setSheetX(x); buttonMeta.setHoverX(x); buttonMeta.setToolTip("info.cofh.filter.metadata." + (myFilter.getFlag(IFilterable.FLAG_METADATA) ? "on" : "off")); x = myFilter.getFlag(IFilterable.FLAG_NBT) ? 216 : 236; buttonNbt.setSheetX(x); buttonNbt.setHoverX(x); buttonNbt.setToolTip("info.cofh.filter.nbt." + (myFilter.getFlag(IFilterable.FLAG_NBT) ? "on" : "off")); }
@Override public void initGui() { super.initGui(); buttonList = new ElementButton(this, 119, 20, "FilterList", 176, 0, 176, 20, 20, 20, TEX_PATH); buttonOre = new ElementButton(this, 145, 20, "FilterOre", 216, 0, 216, 20, 20, 20, TEX_PATH); buttonMeta = new ElementButton(this, 119, 46, "FilterMeta", 176, 60, 176, 80, 20, 20, TEX_PATH); buttonNbt = new ElementButton(this, 145, 46, "FilterNbt", 216, 60, 216, 80, 20, 20, TEX_PATH); addElement(buttonList); addElement(buttonOre); addElement(buttonMeta); addElement(buttonNbt); }
public void updateButtons() { if (canScrollUpFriend()) { flUp.setActive(); } else { flUp.setDisabled(); } if (canScrollDownFriend()) { flDown.setActive(); } else { flDown.setDisabled(); } if (canScrollUpOnline()) { olUp.setActive(); } else { olUp.setDisabled(); } if (canScrollDownOnline()) { olDown.setActive(); } else { olDown.setDisabled(); } if (RegistrySocial.clientPlayerFriends.contains(tbName.getText().toLowerCase(Locale.US))) { addName.setDisabled(); removeName.setActive(); } else { addName.setActive(); removeName.setDisabled(); } }
@Override public void initGui() { super.initGui(); tankBackground = (ElementSimple) addElement(new ElementSimple(this, 151, 8).setTextureOffsets(176, 104).setSize(18, 62).setTexture(TEX_PATH, 256, 256)); slotInput = (ElementSlotOverlayCrafter) addElement(new ElementSlotOverlayCrafter(this, 8, 77)); slotOutput = addElement(new ElementSlotOverlay(this, 121, 17).setSlotInfo(SlotColor.ORANGE, SlotType.OUTPUT, SlotRender.FULL)); //slotTank = addElement(new ElementSlotOverlay(this, 152, 9).setSlotInfo(SlotColor.BLUE, SlotType.TANK, SlotRender.FULL)); if (!myTile.smallStorage()) { addElement(new ElementEnergyStored(this, 8, 8, myTile.getEnergyStorage())); } progress = (ElementDualScaled) addElement(new ElementDualScaled(this, 92, 21).setMode(1).setSize(24, 16).setTexture(TEX_ARROW_RIGHT, 64, 16)); addElement(new ElementButton(this, 96, 48, "SetRecipe", 176, 0, 176, 16, 176, 32, 16, 16, TEX_PATH).setToolTip("gui.thermalexpansion.machine.crafter.setRecipe")); tank = (ElementFluidTank) addElement(new ElementFluidTank(this, 152, 9, myTile.getTank()).setGauge(1).setAlwaysShow(true)); progressFluid = (ElementFluid) addElement(new ElementFluid(this, 92, 21).setFluid(myTile.getTankFluid()).setSize(24, 16)); progressOverlay = (ElementDualScaled) addElement(new ElementDualScaled(this, 92, 21).setBackground(false).setMode(1).setSize(24, 16).setTexture(TEX_ARROW_FLUID_RIGHT, 64, 16)); tankBackground.setVisible(myTile.augmentTank()); tank.setVisible(myTile.augmentTank()); progressFluid.setVisible(myTile.fluidArrow()); progressOverlay.setVisible(myTile.fluidArrow()); }
@Override protected void updateElementInformation() { super.updateElementInformation(); if (baseTile.getTransferOut()) { output.setToolTip(StringHelper.localize("gui.cofh.transferOutEnabled")); output.setSheetX(176); output.setHoverX(176); } else { output.setToolTip(StringHelper.localize("gui.cofh.transferOutDisabled")); output.setSheetX(192); output.setHoverX(192); } if (baseTile.getTankFluid() == null) { lock.setDisabled(); } else { lock.setActive(); } if (baseTile.isLocked()) { FluidStack fluid = baseTile.getTankFluid(); String color = fluid.getFluid().getRarity().rarityColor.toString(); lock.setToolTip(StringHelper.localize("info.cofh.locked") + ": " + color + StringHelper.localize(fluid.getFluid().getLocalizedName(fluid)) + StringHelper.END); lock.setSheetX(176); lock.setHoverX(176); } else { lock.setToolTip(StringHelper.localize("info.cofh.unlocked")); lock.setSheetX(192); lock.setHoverX(192); } }
decInput.setActive(); decInput.setToolTip(StringHelper.localize("gui.thermalexpansion.device.item_buffer.decInput") + " " + StringHelper.formatNumber(change) + "/" + StringHelper.formatNumber(change2)); } else { decInput.setDisabled(); decInput.clearToolTip(); incInput.setActive(); incInput.setToolTip(StringHelper.localize("gui.thermalexpansion.device.item_buffer.incInput") + " " + StringHelper.formatNumber(change) + "/" + StringHelper.formatNumber(change2)); } else { incInput.setDisabled(); incInput.clearToolTip(); decOutput.setActive(); decOutput.setToolTip(StringHelper.localize("gui.thermalexpansion.device.item_buffer.decOutput") + " " + StringHelper.formatNumber(change) + "/" + StringHelper.formatNumber(change2)); } else { decOutput.setDisabled(); decOutput.clearToolTip(); incOutput.setActive(); incOutput.setToolTip(StringHelper.localize("gui.thermalexpansion.device.item_buffer.incOutput") + " " + StringHelper.formatNumber(change) + "/" + StringHelper.formatNumber(change2)); } else { incOutput.setDisabled(); incOutput.clearToolTip();
@Override protected void updateElementInformation() { int x = myFilter.getFlag(IFilterable.FLAG_WHITELIST) ? 176 : 196; buttonList.setSheetX(x); buttonList.setHoverX(x); buttonList.setToolTip("info.cofh.filter.list." + (myFilter.getFlag(IFilterable.FLAG_WHITELIST) ? "on" : "off")); x = myFilter.getFlag(IFilterable.FLAG_ORE_DICT) ? 216 : 236; buttonOre.setSheetX(x); buttonOre.setHoverX(x); buttonOre.setToolTip("info.cofh.filter.oreDict." + (myFilter.getFlag(IFilterable.FLAG_ORE_DICT) ? "on" : "off")); x = myFilter.getFlag(IFilterable.FLAG_METADATA) ? 176 : 196; buttonMeta.setSheetX(x); buttonMeta.setHoverX(x); buttonMeta.setToolTip("info.cofh.filter.metadata." + (myFilter.getFlag(IFilterable.FLAG_METADATA) ? "on" : "off")); x = myFilter.getFlag(IFilterable.FLAG_NBT) ? 216 : 236; buttonNbt.setSheetX(x); buttonNbt.setHoverX(x); buttonNbt.setToolTip("info.cofh.filter.nbt." + (myFilter.getFlag(IFilterable.FLAG_NBT) ? "on" : "off")); }
@Override public void initGui() { super.initGui(); ElementSimple infoInput = (ElementSimple) new ElementSimple(this, 24, 16).setSize(20, 20).setTexture(TEX_INFO_INPUT, 20, 20); ElementSimple infoOutput = (ElementSimple) new ElementSimple(this, 132, 16).setSize(20, 20).setTexture(TEX_INFO_OUTPUT, 20, 20); addElement(infoInput); addElement(infoOutput); decInput = new ElementButton(this, 19, 56, "DecInput", 176, 0, 176, 14, 176, 28, 14, 14, TEX_PATH).setToolTipLocalized(true); incInput = new ElementButton(this, 35, 56, "IncInput", 190, 0, 190, 14, 190, 28, 14, 14, TEX_PATH).setToolTipLocalized(true); decOutput = new ElementButton(this, 127, 56, "DecOutput", 176, 0, 176, 14, 176, 28, 14, 14, TEX_PATH).setToolTipLocalized(true); incOutput = new ElementButton(this, 143, 56, "IncOutput", 190, 0, 190, 14, 190, 28, 14, 14, TEX_PATH).setToolTipLocalized(true); addElement(decInput); addElement(incInput); addElement(decOutput); addElement(incOutput); }