From 5e81e792cc52f41f6618abad5113ea361f2e1e1d Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 1 Nov 2026 10:52:46 +0000 Subject: [PATCH 1/2] Fix the script editor scrollbar being drawn over completions On 26.x, GUI elements no longer have depth, so the scrollbar, and the slots below the editor, were drawn over the completions and signature popups. The screen now draws these popups last, above everything else. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_018MRyTdV3fSV5Q5NPGep4q9 --- .../gui/component/input/WidgetTextArea.java | 32 +++++++++++-------- .../ContainerScreenTerminalScripting.java | 10 ++++++ 2 files changed, 29 insertions(+), 13 deletions(-) diff --git a/src/main/java/org/cyclops/integratedscripting/client/gui/component/input/WidgetTextArea.java b/src/main/java/org/cyclops/integratedscripting/client/gui/component/input/WidgetTextArea.java index 5b3fc9cbb..7f412c6ec 100644 --- a/src/main/java/org/cyclops/integratedscripting/client/gui/component/input/WidgetTextArea.java +++ b/src/main/java/org/cyclops/integratedscripting/client/gui/component/input/WidgetTextArea.java @@ -938,19 +938,6 @@ public void extractWidgetRenderState(GuiGraphicsExtractor guiGraphics, int mouse this.renderHighlight(guiGraphics, displayCache.selection); if (displayCache.cursor != null) { this.renderCursor(guiGraphics, displayCache.cursor, displayCache.cursorAtEnd); - - // Show completions while typing, or else the signature of the call at the cursor - if (this.isFocused()) { - Pos2i cursor = this.convertLocalToScreen(displayCache.cursor); - if (this.completions != null) { - this.renderCompletions(guiGraphics, cursor); - } else if (this.signatureProvider != null) { - Component signature = this.signatureProvider.apply(this.getValue(), this.getCursorPos()); - if (signature != null) { - this.renderSignature(guiGraphics, cursor, signature); - } - } - } } // Render scrollbar @@ -973,6 +960,25 @@ public void extractWidgetRenderState(GuiGraphicsExtractor guiGraphics, int mouse } } + /** + * Draw the completions while typing, or else the signature of the call at the cursor. + * The using screen must call this after drawing everything else that may overlap them, such as slots. + */ + public void extractPopups(GuiGraphicsExtractor guiGraphics) { + DisplayCache displayCache = this.getDisplayCache(); + if (displayCache.cursor != null && this.isFocused() && this.visible) { + Pos2i cursor = this.convertLocalToScreen(displayCache.cursor); + if (this.completions != null) { + this.renderCompletions(guiGraphics, cursor); + } else if (this.signatureProvider != null) { + Component signature = this.signatureProvider.apply(this.getValue(), this.getCursorPos()); + if (signature != null) { + this.renderSignature(guiGraphics, cursor, signature); + } + } + } + } + private void renderSyntaxError(GuiGraphicsExtractor guiGraphics, DisplayCache displayCache, List lines, int mouseX, int mouseY) { String value = this.getValue(); // Underline the character at the error position diff --git a/src/main/java/org/cyclops/integratedscripting/client/gui/container/ContainerScreenTerminalScripting.java b/src/main/java/org/cyclops/integratedscripting/client/gui/container/ContainerScreenTerminalScripting.java index 31fd7a371..0c0c9dc9a 100644 --- a/src/main/java/org/cyclops/integratedscripting/client/gui/container/ContainerScreenTerminalScripting.java +++ b/src/main/java/org/cyclops/integratedscripting/client/gui/container/ContainerScreenTerminalScripting.java @@ -418,11 +418,21 @@ protected void drawCurrentScreen(GuiGraphicsExtractor guiGraphics, int mouseX, i for (Renderable renderable : this.renderables) { renderable.extractRenderState(guiGraphics, mouseX, mouseY, partialTicks); } + guiGraphics.nextStratum(); + textArea.extractPopups(guiGraphics); } else { super.drawCurrentScreen(guiGraphics, mouseX, mouseY, partialTicks); } } + @Override + public void extractContents(GuiGraphicsExtractor guiGraphics, int mouseX, int mouseY, float partialTicks) { + super.extractContents(guiGraphics, mouseX, mouseY, partialTicks); + // Above the slots and the scrollbar, which are drawn after the editor + guiGraphics.nextStratum(); + textArea.extractPopups(guiGraphics); + } + @Override protected void extractTooltip(GuiGraphicsExtractor guiGraphics, int x, int y) { // Slots are hidden in focus mode From 65e0798eb98c4ef5881717c22842ec48239f4ae1 Mon Sep 17 00:00:00 2001 From: Ruben Taelman Date: Sun, 1 Nov 2026 13:10:15 +0100 Subject: [PATCH 2/2] Apply suggestion from @rubensworks --- .../client/gui/container/ContainerScreenTerminalScripting.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/java/org/cyclops/integratedscripting/client/gui/container/ContainerScreenTerminalScripting.java b/src/main/java/org/cyclops/integratedscripting/client/gui/container/ContainerScreenTerminalScripting.java index 0c0c9dc9a..1e1d65cd2 100644 --- a/src/main/java/org/cyclops/integratedscripting/client/gui/container/ContainerScreenTerminalScripting.java +++ b/src/main/java/org/cyclops/integratedscripting/client/gui/container/ContainerScreenTerminalScripting.java @@ -428,7 +428,6 @@ protected void drawCurrentScreen(GuiGraphicsExtractor guiGraphics, int mouseX, i @Override public void extractContents(GuiGraphicsExtractor guiGraphics, int mouseX, int mouseY, float partialTicks) { super.extractContents(guiGraphics, mouseX, mouseY, partialTicks); - // Above the slots and the scrollbar, which are drawn after the editor guiGraphics.nextStratum(); textArea.extractPopups(guiGraphics); }