GUI Scaling

* Recipe GUI now scales with window size, and displays more than 2 recipes per page, depending on height.
* Hacks to implement recipes per page, based on some assumptions since the height of the handlers are not exposed and are hardcoded
* _Temporarily_ disabled the overlay buttons; they were hardcoded to expect at most 2, need to make them dynamic and actually work again.
This commit is contained in:
Jason Mitchell authored and Jason Mitchell committed 2021-04-12 20:20:36 -07:00
1 parent a6b306263d
commit 509078da35
4 files changed
+139 -75

No files matched your search

@@ -43,14 +43,14 @@ public class DrawableResource extends Image {
public void draw(int xOffset, int yOffset, int maskTop, int maskBottom, int maskLeft, int maskRight) {
Minecraft.getMinecraft().getTextureManager().bindTexture(this.resourceLocation);
int x = xOffset + this.paddingLeft + maskLeft;
int y = yOffset + this.paddingTop + maskTop;
int u = this.x + maskLeft;
int v = this.y + maskTop;
int width = this.width - maskRight - maskLeft;
int height = this.height - maskBottom - maskTop;
final int x = xOffset + this.paddingLeft + maskLeft;
final int y = yOffset + this.paddingTop + maskTop;
final int textureX = this.x + maskLeft;
final int textureY = this.y + maskTop;
final int width = this.width - maskRight - maskLeft;
final int height = this.height - maskBottom - maskTop;
// drawModalRectWithCustomSizedTexture
Gui.func_146110_a(x, y, u, v, width, height, textureWidth, textureHeight);
Gui.func_146110_a(x, y, textureX, textureY, width, height, textureWidth, textureHeight);
}
}