Skip to content

Commit

Permalink
Attempt 2 at Wizcraft hud compatibility
Browse files Browse the repository at this point in the history
REFACTOR: Width and height are different from xLimit and yLimit
  • Loading branch information
Superkat32 committed Jan 3, 2024
1 parent 42b42f3 commit 0ed1fbb
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -305,9 +305,9 @@ public static void occupyHudRegion() {

int x = windowWidth / 2 - titleTextWidth / 2 - titleTextWidth / 4;
int y = 3;
int xLimit = windowWidth / 2 + titleTextWidth / 4 + client.textRenderer.getWidth(quotaTitle);
int yLimit = client.textRenderer.getWrappedLinesHeight(title, 114) * 4;
LibHudCompat.forceOccupyRegion(Identifier.tryParse(MOD_ID), x, y, xLimit, yLimit);
int width = titleTextWidth / 4 + client.textRenderer.getWidth(quotaTitle);
int height = client.textRenderer.getWrappedLinesHeight(title, 114) * 4;
LibHudCompat.forceOccupyRegion(Identifier.tryParse(MOD_ID), x, y, width, height);
}

public static void freeHudRegion() {
Expand Down

0 comments on commit 0ed1fbb

Please sign in to comment.