Closed AwertaDreams closed 1 month ago
Hello. My first ImGui window stops being responsive after i open a new one via a imgui.checkbox.
public class ImGuiScreen { private static boolean drawMainMenu = false; private static boolean drawAutoEnchant = false; private static int[] intervalHolder = { (int) (CHECK_INTERVAL / 1000) }; public static void drawHud(DrawContext context, RenderTickCounter tickCounter) { if (drawMainMenu) { ImGuiImpl.draw(io -> { ImGui.begin("EntityFix // 0.0.1 "); if (ImGui.beginTabBar("TabBar")) { if (ImGui.beginTabItem("Entity Scan")) { if (ImGui.sliderInt("Interval (in seconds)", intervalHolder, 1, 120)) { CHECK_INTERVAL = intervalHolder[0] * 1000L; }; ImGui.endTabItem(); } if (ImGui.beginTabItem("Auto Enchanter")) { if (ImGui.checkbox("open overlay", drawAutoEnchant)) { } ImGui.endTabItem(); } } ImGui.endTabBar(); ImGui.end(); }); } if (drawAutoEnchant) { ImGuiImpl.draw(io -> { ImGui.begin("tbox"); ImGui.text("helol"); ImGui.end(); }); } } public static void toggleMainMenu() { drawMainMenu = !drawMainMenu; } }
This is how i use a Mixin to render the ImGui
@Mixin(InGameHud.class) public class InGameHudMixin { private MinecraftClient client = MinecraftClient.getInstance(); @Inject(method="renderStatusEffectOverlay", at=@At("RETURN")) private void onRenderStatusEffectsOverlay(DrawContext context, RenderTickCounter tickCounter, CallbackInfo ci) { drawHud(context, tickCounter); } }
You can only have one ImGuiImpl.draw() invoke at the same time, move both windows into the same call.
ImGuiImpl.draw()
Oh, thank you haha
Hello. My first ImGui window stops being responsive after i open a new one via a imgui.checkbox.
This is how i use a Mixin to render the ImGui