From 0223206994e6dab0355d511c0beca9cb26bbd2a0 Mon Sep 17 00:00:00 2001 From: Tomas Slusny Date: Thu, 21 Jun 2018 11:26:16 +0200 Subject: [PATCH] Check if infobox can render in InfoBoxOverlay Infoboxes have property render that needs to be checked in InfoBoxOverlay. Signed-off-by: Tomas Slusny --- .../client/ui/overlay/infobox/InfoBoxOverlay.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/ui/overlay/infobox/InfoBoxOverlay.java b/runelite-client/src/main/java/net/runelite/client/ui/overlay/infobox/InfoBoxOverlay.java index 25e42b03fa..d3aa9923e7 100644 --- a/runelite-client/src/main/java/net/runelite/client/ui/overlay/infobox/InfoBoxOverlay.java +++ b/runelite-client/src/main/java/net/runelite/client/ui/overlay/infobox/InfoBoxOverlay.java @@ -89,15 +89,20 @@ public class InfoBoxOverlay extends Overlay : PanelComponent.Orientation.HORIZONTAL); panelComponent.setPreferredSize(new Dimension(config.infoBoxSize(), config.infoBoxSize())); - infoBoxes.forEach(box -> + for (InfoBox box : infoBoxes) { + if (!box.render()) + { + continue; + } + final InfoBoxComponent infoBoxComponent = new InfoBoxComponent(); infoBoxComponent.setColor(box.getTextColor()); infoBoxComponent.setImage(box.getScaledImage()); infoBoxComponent.setText(box.getText()); infoBoxComponent.setTooltip(box.getTooltip()); panelComponent.getChildren().add(infoBoxComponent); - }); + } final Dimension dimension = panelComponent.render(graphics); final Client client = clientProvider.get();