mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-14 01:24:09 +00:00
Merge pull request #292 from postyizhan: adapt quest tracker height to content
This commit is contained in:
commit
a71532f49a
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;
|
||||
|
||||
Reference in new issue
Block a user