Skip to content

Commit

Permalink
GUI Scaling
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
mitchej123 committed Mar 27, 2021
1 parent 5d82f0a commit f0e09e2
Show file tree
Hide file tree
Showing 4 changed files with 139 additions and 75 deletions.
2 changes: 1 addition & 1 deletion build.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ mc_version=1.7.10
forge_version=10.13.4.1614-1.7.10
ccl_version=1.1.3.138
ccc_version=1.0.7.+
mod_version=2.1.0-GTNH-beta4
mod_version=2.1.0-GTNH-beta5
2 changes: 1 addition & 1 deletion src/codechicken/nei/LayoutStyleMinecraft.java
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ else if (NEIClientUtils.isValidGamemode("adventure"))

searchField.y = gui.height - searchField.h - 2;

dropDown.x = itemPanel.x - 150;
dropDown.x = gui.guiLeft;
dropDown.h = 20;
dropDown.w = Math.min(itemPanel.prev.x - dropDown.x - 3, 100);
searchField.h = 20;
Expand Down
14 changes: 7 additions & 7 deletions src/codechicken/nei/drawable/DrawableResource.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@ public void draw(int xOffset, int yOffset) {
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);
}
}

Loading

0 comments on commit f0e09e2

Please sign in to comment.