From ce0be715a2b843569c76deaee4b4a53cf5c81737 Mon Sep 17 00:00:00 2001 From: UnRealDinnerbone Date: Tue, 13 Aug 2024 10:10:31 -0500 Subject: [PATCH] [1.21] Sidebar Fixes (#112) * Don't render overlay in edit mode and making config button last * Fixed formatting and make config last for sure --- .../ftblibrary/sidebar/SidebarGroupGuiButton.java | 14 +++++++------- .../assets/ftblibrary/sidebar_buttons/config.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/common/src/main/java/dev/ftb/mods/ftblibrary/sidebar/SidebarGroupGuiButton.java b/common/src/main/java/dev/ftb/mods/ftblibrary/sidebar/SidebarGroupGuiButton.java index ba46b454..4fc71379 100644 --- a/common/src/main/java/dev/ftb/mods/ftblibrary/sidebar/SidebarGroupGuiButton.java +++ b/common/src/main/java/dev/ftb/mods/ftblibrary/sidebar/SidebarGroupGuiButton.java @@ -138,19 +138,19 @@ private void renderSidebarButtons(GuiGraphics graphics, int mx, int my) { } else { Icons.CANCEL.draw(graphics, button.x + 12, button.y, 4, 4); } + } else { + graphics.pose().pushPose(); + graphics.pose().translate(button.x, button.y, 0); + for (ButtonOverlayRender buttonOverlayRender : button.getSidebarButton().getExtraRenderers()) { + buttonOverlayRender.render(graphics, font, 16); + } + graphics.pose().popPose(); } if (button == mouseOver) { Color4I.WHITE.withAlpha(33).draw(graphics, button.x, button.y, 16, 16); } - graphics.pose().pushPose(); - graphics.pose().translate(button.x, button.y, 0); - for (ButtonOverlayRender buttonOverlayRender : button.getSidebarButton().getExtraRenderers()) { - buttonOverlayRender.render(graphics, font, 16); - } - graphics.pose().popPose(); - } if (!isEditMode && mouseOver == button) { graphics.renderTooltip(font, button.getSidebarButton().getTooltip(Screen.hasShiftDown()), Optional.empty(), mx, Math.max(7, my - 9) + 10); diff --git a/common/src/main/resources/assets/ftblibrary/sidebar_buttons/config.json b/common/src/main/resources/assets/ftblibrary/sidebar_buttons/config.json index 9dc92cc2..48498f96 100644 --- a/common/src/main/resources/assets/ftblibrary/sidebar_buttons/config.json +++ b/common/src/main/resources/assets/ftblibrary/sidebar_buttons/config.json @@ -2,7 +2,7 @@ "icon": [ "ftblibrary:icons/settings" ], - "sort_index": 500, + "sort_index": 2147483647, "click": ["command:/ftblibrary clientconfig"], "required_mods": [ "ftblibrary"