mirror of
https://github.com/GTNewHorizons/Applied-Energistics-2-Unofficial.git
synced 2026-10-25 20:22:23 +00:00
Hide config slots if oredict filter is present (#1177)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Martin Robertz <dream-master@gmx.net>
This commit is contained in:
4 files changed
+27
-51
No files matched your search
@@ -4,7 +4,6 @@ import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
|
||||
import org.lwjgl.input.Mouse;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import appeng.api.config.SchedulingMode;
|
||||
import appeng.api.config.Settings;
|
||||
@@ -95,38 +94,18 @@ public class GuiBusIO extends GuiUpgradeable {
|
||||
super.drawBG(offsetX, offsetY, mouseX, mouseY);
|
||||
|
||||
final int capacity = this.cvb.getUpgradeable().getInstalledUpgrades(Upgrades.CAPACITY);
|
||||
if (capacity < 1) {
|
||||
GL11.glPushAttrib(GL11.GL_ALL_ATTRIB_BITS);
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.4F);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
final boolean hasOreFilter = this.cvb.getUpgradeable().getInstalledUpgrades(Upgrades.ORE_FILTER) != 0;
|
||||
final boolean hasFirstTier = capacity > 0;
|
||||
final boolean hasSecondTier = capacity > 1;
|
||||
|
||||
for (int y = 0; y < 3; y++) {
|
||||
for (int x = 0; x < 3; x++) {
|
||||
final int slotTextureX = hasOreFilter // true == inactive
|
||||
|| (!hasSecondTier && slotSequence[x + y * 3] > 4)
|
||||
|| (!hasFirstTier && slotSequence[x + y * 3] != 0) ? 79 : 61;
|
||||
this.drawTexturedModalRect(offsetX + 61 + (18 * x), offsetY + 21 + (18 * y), slotTextureX, 21, 18, 18);
|
||||
}
|
||||
}
|
||||
|
||||
this.drawTexturedModalRect(offsetX + 61, offsetY + 39, 79, 39, 18, 18);
|
||||
this.drawTexturedModalRect(offsetX + 79, offsetY + 21, 79, 39, 18, 18);
|
||||
this.drawTexturedModalRect(offsetX + 97, offsetY + 39, 79, 39, 18, 18);
|
||||
this.drawTexturedModalRect(offsetX + 79, offsetY + 57, 79, 39, 18, 18);
|
||||
|
||||
if (capacity < 1) {
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
GL11.glPopAttrib();
|
||||
}
|
||||
|
||||
if (capacity < 2) {
|
||||
GL11.glPushAttrib(GL11.GL_ALL_ATTRIB_BITS);
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.4F);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
}
|
||||
|
||||
this.drawTexturedModalRect(offsetX + 61, offsetY + 21, 79, 39, 18, 18);
|
||||
this.drawTexturedModalRect(offsetX + 61, offsetY + 57, 79, 39, 18, 18);
|
||||
this.drawTexturedModalRect(offsetX + 97, offsetY + 21, 79, 39, 18, 18);
|
||||
this.drawTexturedModalRect(offsetX + 97, offsetY + 57, 79, 39, 18, 18);
|
||||
|
||||
if (capacity < 2) {
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
GL11.glPopAttrib();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -134,8 +113,11 @@ public class GuiBusIO extends GuiUpgradeable {
|
||||
super.handleButtonVisibility();
|
||||
|
||||
final int capacity = this.cvb.getUpgradeable().getInstalledUpgrades(Upgrades.CAPACITY);
|
||||
final boolean firstTier = capacity > 0;
|
||||
final boolean secondTier = capacity > 1;
|
||||
final boolean hasOreFilter = this.cvb.getUpgradeable().getInstalledUpgrades(Upgrades.ORE_FILTER) != 0;
|
||||
final boolean firstTier = capacity > 0 && !hasOreFilter;
|
||||
final boolean secondTier = capacity > 1 && !hasOreFilter;
|
||||
|
||||
this.virtualSlots[0].setHidden(hasOreFilter);
|
||||
|
||||
this.virtualSlots[1].setHidden(!firstTier);
|
||||
this.virtualSlots[2].setHidden(!firstTier);
|
||||
|
||||
@@ -14,8 +14,6 @@ import java.io.IOException;
|
||||
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import org.lwjgl.input.Mouse;
|
||||
|
||||
@@ -24,7 +22,6 @@ import appeng.api.config.CopyMode;
|
||||
import appeng.api.config.FuzzyMode;
|
||||
import appeng.api.config.Settings;
|
||||
import appeng.api.config.Upgrades;
|
||||
import appeng.api.implementations.items.IUpgradeModule;
|
||||
import appeng.api.implementations.tiles.ICellWorkbench;
|
||||
import appeng.api.storage.data.IAEStackType;
|
||||
import appeng.client.gui.slots.VirtualMEPhantomSlot;
|
||||
@@ -98,6 +95,12 @@ public class GuiCellWorkbench extends GuiUpgradeable {
|
||||
|
||||
this.bindTexture(this.getBackground());
|
||||
this.drawTexturedModalRect(offsetX, offsetY, 0, 0, 211 - 34, this.ySize);
|
||||
|
||||
final int slotsTextureY = this.cvb.getUpgradeable().getInstalledUpgrades(Upgrades.ORE_FILTER) != 0 ? 46 : 28;
|
||||
|
||||
for (int i = 0; i < 7; i++)
|
||||
this.drawTexturedModalRect(offsetX + 7, offsetY + 28 + (18 * i), 7, slotsTextureY, 162, 18);
|
||||
|
||||
if (this.drawUpgrades()) {
|
||||
if (this.workbench.availableUpgrades() <= 8) {
|
||||
this.drawTexturedModalRect(
|
||||
@@ -193,23 +196,14 @@ public class GuiCellWorkbench extends GuiUpgradeable {
|
||||
protected void handleButtonVisibility() {
|
||||
this.copyMode.setState(this.workbench.getCopyMode() == CopyMode.CLEAR_ON_REMOVE);
|
||||
|
||||
boolean hasFuzzy = false;
|
||||
boolean hasOreFilter = false;
|
||||
final IInventory inv = this.workbench.getCellUpgradeInventory();
|
||||
for (int x = 0; x < inv.getSizeInventory(); x++) {
|
||||
final ItemStack is = inv.getStackInSlot(x);
|
||||
if (is != null && is.getItem() instanceof IUpgradeModule) {
|
||||
if (((IUpgradeModule) is.getItem()).getType(is) == Upgrades.FUZZY) {
|
||||
hasFuzzy = true;
|
||||
}
|
||||
if (((IUpgradeModule) is.getItem()).getType(is) == Upgrades.ORE_FILTER) {
|
||||
hasOreFilter = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
final boolean hasFuzzy = this.cvb.getUpgradeable().getInstalledUpgrades(Upgrades.FUZZY) != 0;
|
||||
final boolean hasOreFilter = this.cvb.getUpgradeable().getInstalledUpgrades(Upgrades.ORE_FILTER) != 0;
|
||||
|
||||
this.fuzzyMode.setVisibility(!hasOreFilter && hasFuzzy);
|
||||
this.oreFilter.setVisibility(hasOreFilter);
|
||||
this.cellRestriction.setVisibility(this.workbench.haveCellRestrictAble());
|
||||
|
||||
for (VirtualMEPhantomSlot configSlot : this.configSlots) configSlot.setHidden(hasOreFilter);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 869 B |
Binary file not shown.
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 910 B |
Reference in new issue
Block a user