From 55176defb06d44c8129ffab03f241674a31b038a Mon Sep 17 00:00:00 2001 From: weido <71466426+WeidosOddities@users.noreply.github.com> Date: Wed, 15 Oct 2025 12:59:57 -0600 Subject: [PATCH 1/2] Fixed alignment issue & selector uv issue - Fixed an issue with the alignment config option not working as intended - Fixed an issue where the texture of the hot bar selector would be cut off by 1 pixel when the HUD was moved up via other mods --- .../java/nuparu/tinyinv/client/gui/InGameOverlayHelper.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/nuparu/tinyinv/client/gui/InGameOverlayHelper.java b/src/main/java/nuparu/tinyinv/client/gui/InGameOverlayHelper.java index 89a0fce..aba0267 100644 --- a/src/main/java/nuparu/tinyinv/client/gui/InGameOverlayHelper.java +++ b/src/main/java/nuparu/tinyinv/client/gui/InGameOverlayHelper.java @@ -119,7 +119,7 @@ private static void renderHotbarGraphics(GuiGraphics guiGraphics, int hotbarStar Alignment alignment = ClientConfig.hotbarAlignment.get(); while (totalSlots < slots) { int slotsInRow = Math.min(slots - totalSlots, slotsPerRow); - int left = alignment == Alignment.LEFT ? hotbarStart : (alignment == Alignment.CENTER ? middle - (hotbarRowWidth(slotsInRow) / 2) : hotbarEnd - hotbarRowWidth(slotsInRow)); + int left = alignment == Alignment.LEFT ? hotbarStart - 10 * (9 - slots) : (alignment == Alignment.CENTER ? middle - (hotbarRowWidth(slotsInRow) / 2) : hotbarEnd - hotbarRowWidth(slotsInRow) + 10 * (9 - slots)); int top = screenHeight - 1 - (HOTBAR_SLOT_HEIGHT - 1) * (row); renderHotbarRow(guiGraphics, totalSlots, slotsInRow, left, top); totalSlots += slotsInRow; @@ -154,7 +154,7 @@ private static int renderHotbarItems(GuiGraphics guiGraphics, int hotbarStart, i Order order = ClientConfig.hotbarRowOrder.get(); while (totalSlots < slots) { int slotsInRow = Math.min(slots - totalSlots, slotsPerRow); - int left = alignment == Alignment.LEFT ? hotbarStart : (alignment == Alignment.CENTER ? middle - (hotbarRowWidth(slotsInRow) / 2) : hotbarEnd - hotbarRowWidth(slotsInRow)); + int left = alignment == Alignment.LEFT ? hotbarStart - 10 * (9 - slots) : (alignment == Alignment.CENTER ? middle - (hotbarRowWidth(slotsInRow) / 2) : hotbarEnd - hotbarRowWidth(slotsInRow) + 10 * (9 - slots)); int top = screenHeight - 1 - (HOTBAR_SLOT_HEIGHT - 1) * (row); l += renderHotbarItemsRow(guiGraphics, order == Order.NORMAL ? totalSlots : slots - totalSlots - slotsInRow, slotsInRow, left, top, partialTicks, player); totalSlots += slotsInRow; @@ -170,7 +170,7 @@ public static int renderHotbarItemsRow(GuiGraphics guiGraphics, int from, int am int k1 = top + 3; int normalized = SlotUtils.normalizeSlotId(from + slot); if(normalized == player.getInventory().selected){ - guiGraphics.blit(Textures.WIDGETS_LOCATION, j1 - 4, k1 - 4, 0, 22, 24, 23); + guiGraphics.blit(Textures.WIDGETS_LOCATION, j1 - 4, k1 - 4, 0, 22, 24, 24); } renderSlot(guiGraphics, j1, k1, partialTicks, player, player.getInventory().items.get(normalized), l++); } From a7e2747ca4e5a4e5df9a8bd444523b13819ac67b Mon Sep 17 00:00:00 2001 From: weido <71466426+WeidosOddities@users.noreply.github.com> Date: Wed, 15 Oct 2025 14:17:43 -0600 Subject: [PATCH 2/2] Fixed broken layering - Fixed an issue where this change would affect and break the spacing when layered/stacked --- .../nuparu/tinyinv/client/gui/InGameOverlayHelper.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/nuparu/tinyinv/client/gui/InGameOverlayHelper.java b/src/main/java/nuparu/tinyinv/client/gui/InGameOverlayHelper.java index aba0267..c79d04d 100644 --- a/src/main/java/nuparu/tinyinv/client/gui/InGameOverlayHelper.java +++ b/src/main/java/nuparu/tinyinv/client/gui/InGameOverlayHelper.java @@ -117,9 +117,11 @@ private static void renderHotbarGraphics(GuiGraphics guiGraphics, int hotbarStar int totalSlots = 0; int row = 1; Alignment alignment = ClientConfig.hotbarAlignment.get(); + int numberOfRows = (int) Math.ceil((double) slots / slotsPerRow); + int check = (numberOfRows >= 2) ? 0 : 10 * (9 - slots); while (totalSlots < slots) { int slotsInRow = Math.min(slots - totalSlots, slotsPerRow); - int left = alignment == Alignment.LEFT ? hotbarStart - 10 * (9 - slots) : (alignment == Alignment.CENTER ? middle - (hotbarRowWidth(slotsInRow) / 2) : hotbarEnd - hotbarRowWidth(slotsInRow) + 10 * (9 - slots)); + int left = alignment == Alignment.LEFT ? hotbarStart - check : (alignment == Alignment.CENTER ? middle - (hotbarRowWidth(slotsInRow) / 2) : hotbarEnd - hotbarRowWidth(slotsInRow) + check); int top = screenHeight - 1 - (HOTBAR_SLOT_HEIGHT - 1) * (row); renderHotbarRow(guiGraphics, totalSlots, slotsInRow, left, top); totalSlots += slotsInRow; @@ -152,9 +154,11 @@ private static int renderHotbarItems(GuiGraphics guiGraphics, int hotbarStart, i int row = 1; Alignment alignment = ClientConfig.hotbarAlignment.get(); Order order = ClientConfig.hotbarRowOrder.get(); + int numberOfRows = (int) Math.ceil((double) slots / slotsPerRow); + int check = (numberOfRows >= 2) ? 0 : 10 * (9 - slots); while (totalSlots < slots) { int slotsInRow = Math.min(slots - totalSlots, slotsPerRow); - int left = alignment == Alignment.LEFT ? hotbarStart - 10 * (9 - slots) : (alignment == Alignment.CENTER ? middle - (hotbarRowWidth(slotsInRow) / 2) : hotbarEnd - hotbarRowWidth(slotsInRow) + 10 * (9 - slots)); + int left = alignment == Alignment.LEFT ? hotbarStart - check : (alignment == Alignment.CENTER ? middle - (hotbarRowWidth(slotsInRow) / 2) : hotbarEnd - hotbarRowWidth(slotsInRow) + check); int top = screenHeight - 1 - (HOTBAR_SLOT_HEIGHT - 1) * (row); l += renderHotbarItemsRow(guiGraphics, order == Order.NORMAL ? totalSlots : slots - totalSlots - slotsInRow, slotsInRow, left, top, partialTicks, player); totalSlots += slotsInRow;