Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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<LineInfo> lines, int mouseX, int mouseY) {
String value = this.getValue();
// Underline the character at the error position
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading