mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-10-25 20:32:32 +00:00
Fixes Inventory Tab Pixels (#259)
This commit is contained in:
1 parent
f3111fed19
commit
4f59ed6ea0
2 files changed
+21
No files matched your search
@@ -45,6 +45,9 @@ public abstract class AbstractTab extends GuiButton {
|
||||
|
||||
mc.renderEngine.bindTexture(this.texture);
|
||||
this.drawTexturedModalRect(this.xPosition, yPos, xOffset * 28, yTexPos, 28, ySize);
|
||||
if (this.enabled) {
|
||||
this.drawUnselectedTabDecorations(mc, xOffset, yTexPos, yPos, ySize);
|
||||
}
|
||||
|
||||
RenderHelper.enableGUIStandardItemLighting();
|
||||
this.zLevel = 100.0F;
|
||||
@@ -69,6 +72,9 @@ public abstract class AbstractTab extends GuiButton {
|
||||
}
|
||||
}
|
||||
|
||||
protected void drawUnselectedTabDecorations(Minecraft mc, int textureXOffset, int textureYStart, int tabTopY,
|
||||
int tabHeight) {}
|
||||
|
||||
@Override
|
||||
public boolean mousePressed(Minecraft mc, int mouseX, int mouseY) {
|
||||
boolean inWindow = this.enabled && this.visible
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package tconstruct.client.tabs;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
@@ -18,4 +19,18 @@ public class InventoryTabVanilla extends AbstractTab {
|
||||
public boolean shouldAddToList() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawUnselectedTabDecorations(Minecraft mc, int textureXOffset, int textureYStart, int tabTopY,
|
||||
int tabHeight) {
|
||||
int textureX = textureXOffset * 28;
|
||||
int sourceY = 29;
|
||||
int targetY = tabTopY + tabHeight;
|
||||
|
||||
// Extend the bottom-left corner on the unselected vanilla tab.
|
||||
// 0,29 -> two extra pixels down; 1,29 -> one extra pixel down.
|
||||
this.drawTexturedModalRect(this.xPosition, targetY, textureX, sourceY, 1, 1);
|
||||
this.drawTexturedModalRect(this.xPosition, targetY + 1, textureX, sourceY, 1, 1);
|
||||
this.drawTexturedModalRect(this.xPosition + 1, targetY, textureX + 1, sourceY, 1, 1);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user