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..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 @@ -418,11 +418,20 @@ 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); + guiGraphics.nextStratum(); + textArea.extractPopups(guiGraphics); + } + @Override protected void extractTooltip(GuiGraphicsExtractor guiGraphics, int x, int y) { // Slots are hidden in focus mode