|
4 | 4 | import net.minecraft.entity.player.InventoryPlayer; |
5 | 5 |
|
6 | 6 | import org.lwjgl.input.Mouse; |
7 | | -import org.lwjgl.opengl.GL11; |
8 | 7 |
|
9 | 8 | import appeng.api.config.SchedulingMode; |
10 | 9 | import appeng.api.config.Settings; |
@@ -95,47 +94,30 @@ public void drawBG(int offsetX, int offsetY, int mouseX, int mouseY) { |
95 | 94 | super.drawBG(offsetX, offsetY, mouseX, mouseY); |
96 | 95 |
|
97 | 96 | final int capacity = this.cvb.getUpgradeable().getInstalledUpgrades(Upgrades.CAPACITY); |
98 | | - if (capacity < 1) { |
99 | | - GL11.glPushAttrib(GL11.GL_ALL_ATTRIB_BITS); |
100 | | - GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.4F); |
101 | | - GL11.glEnable(GL11.GL_BLEND); |
102 | | - } |
103 | | - |
104 | | - this.drawTexturedModalRect(offsetX + 61, offsetY + 39, 79, 39, 18, 18); |
105 | | - this.drawTexturedModalRect(offsetX + 79, offsetY + 21, 79, 39, 18, 18); |
106 | | - this.drawTexturedModalRect(offsetX + 97, offsetY + 39, 79, 39, 18, 18); |
107 | | - this.drawTexturedModalRect(offsetX + 79, offsetY + 57, 79, 39, 18, 18); |
108 | | - |
109 | | - if (capacity < 1) { |
110 | | - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); |
111 | | - GL11.glPopAttrib(); |
112 | | - } |
113 | | - |
114 | | - if (capacity < 2) { |
115 | | - GL11.glPushAttrib(GL11.GL_ALL_ATTRIB_BITS); |
116 | | - GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.4F); |
117 | | - GL11.glEnable(GL11.GL_BLEND); |
118 | | - } |
| 97 | + final boolean hasOreFilter = this.cvb.getUpgradeable().getInstalledUpgrades(Upgrades.ORE_FILTER) != 0; |
| 98 | + final boolean hasFirstTier = capacity > 0; |
| 99 | + final boolean hasSecondTier = capacity > 1; |
119 | 100 |
|
120 | | - this.drawTexturedModalRect(offsetX + 61, offsetY + 21, 79, 39, 18, 18); |
121 | | - this.drawTexturedModalRect(offsetX + 61, offsetY + 57, 79, 39, 18, 18); |
122 | | - this.drawTexturedModalRect(offsetX + 97, offsetY + 21, 79, 39, 18, 18); |
123 | | - this.drawTexturedModalRect(offsetX + 97, offsetY + 57, 79, 39, 18, 18); |
124 | | - |
125 | | - if (capacity < 2) { |
126 | | - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); |
127 | | - GL11.glPopAttrib(); |
| 101 | + for (int y = 0; y < 3; y++) { |
| 102 | + for (int x = 0; x < 3; x++) { |
| 103 | + final int slotTextureX = hasOreFilter // true == inactive |
| 104 | + || (!hasSecondTier && slotSequence[x + y * 3] > 4) |
| 105 | + || (!hasFirstTier && slotSequence[x + y * 3] != 0) ? 79 : 61; |
| 106 | + this.drawTexturedModalRect(offsetX + 61 + (18 * x), offsetY + 21 + (18 * y), slotTextureX, 21, 18, 18); |
| 107 | + } |
128 | 108 | } |
129 | | - |
130 | 109 | } |
131 | 110 |
|
132 | 111 | @Override |
133 | 112 | protected void handleButtonVisibility() { |
134 | 113 | super.handleButtonVisibility(); |
135 | 114 |
|
136 | 115 | final int capacity = this.cvb.getUpgradeable().getInstalledUpgrades(Upgrades.CAPACITY); |
137 | | - final boolean firstTier = capacity > 0; |
138 | | - final boolean secondTier = capacity > 1; |
| 116 | + final boolean hasOreFilter = this.cvb.getUpgradeable().getInstalledUpgrades(Upgrades.ORE_FILTER) != 0; |
| 117 | + final boolean firstTier = capacity > 0 && !hasOreFilter; |
| 118 | + final boolean secondTier = capacity > 1 && !hasOreFilter; |
| 119 | + |
| 120 | + this.virtualSlots[0].setHidden(hasOreFilter); |
139 | 121 |
|
140 | 122 | this.virtualSlots[1].setHidden(!firstTier); |
141 | 123 | this.virtualSlots[2].setHidden(!firstTier); |
|
0 commit comments