Cursor based positioning for shader setting tooltips (#711)

This commit is contained in:
Darren Eberly authored and GitHub committed 2024-10-31 16:31:33 -04:00
1 parent 0e66bcf42f
commit 762275a6da
1 file changed
+5 -3
@@ -140,8 +140,10 @@ public class ShaderPackScreen extends GuiScreen implements HudHideable {
if (this.isDisplayingComment()) {
// Determine panel height and position
final int panelHeight = Math.max(50, 18 + (this.hoveredElementCommentBody.size() * 10));
final int x = (int) (0.5 * this.width) - 157;
final int y = this.height - (panelHeight + 4);
int x = mouseX + 5;
if (x + 314 >= (this.width - 4)) x = this.width - (318);
int y = mouseY + 8;
if (y + panelHeight >= (this.height - 4)) y = this.height - (panelHeight + 4);
// Draw panel
GuiUtil.drawPanel(x, y, COMMENT_PANEL_WIDTH, panelHeight);
// Draw text
@@ -381,7 +383,7 @@ public class ShaderPackScreen extends GuiScreen implements HudHideable {
final ShaderPackEntry entry = this.shaderPackList.getSelected();
if (entry == null) return;
this.shaderPackList.setApplied(entry);
final String name = entry.getPackName();