fix: adapt quest tracker height to content

This commit is contained in:
postyizhan committed 2026-08-02 22:32:00 +08:00
1 parent 4a7c7b09c7
commit 322626015d
1 file changed
+14
@@ -39,6 +39,7 @@ public class QuestTrackingComponent extends HudComponent {
if (turnIn != null && !turnIn.isEmpty()) {
turnInLines.add(convertColorCodes(turnIn));
}
updateOverlayHeight();
}
/**
@@ -239,6 +240,19 @@ public class QuestTrackingComponent extends HudComponent {
}
// ---------- Helper rendering methods ----------- (methods unchanged) ...
private void updateOverlayHeight() {
int lineHeight = mc.fontRenderer.FONT_HEIGHT + 4;
int contentHeight = 5;
contentHeight += questTitleLines.size() * lineHeight + 8;
contentHeight += questCategoryLines.size() * lineHeight + 8;
contentHeight += objectiveLines.size() * lineHeight;
if (!turnInLines.isEmpty()) {
contentHeight += 8;
}
contentHeight += turnInLines.size() * lineHeight;
overlayHeight = contentHeight;
}
private int renderTextBlock(List<String> lines, int startY, int align, int color) {
int y = startY;
FontRenderer font = mc.fontRenderer;