barrows: fix brothers slain overlay flashing

This was assuming there is always a tick between each frame to unhide the barrows potential
This commit is contained in:
Adam
2021-10-28 18:12:48 -04:00
parent 3c7339771d
commit f21596bc47

View File

@@ -61,18 +61,18 @@ public class BarrowsBrotherSlainOverlay extends OverlayPanel
@Override @Override
public Dimension render(Graphics2D graphics) public Dimension render(Graphics2D graphics)
{ {
// Do not display overlay if potential is null/hidden final Widget barrowsBrothers = client.getWidget(WidgetInfo.BARROWS_BROTHERS);
final Widget potential = client.getWidget(WidgetInfo.BARROWS_POTENTIAL); if (barrowsBrothers == null)
if (potential == null || potential.isHidden())
{ {
return null; return null;
} }
// Hide original overlay // Hide original brother and potential overlays
final Widget barrowsBrothers = client.getWidget(WidgetInfo.BARROWS_BROTHERS); barrowsBrothers.setHidden(true);
if (barrowsBrothers != null)
final Widget potential = client.getWidget(WidgetInfo.BARROWS_POTENTIAL);
if (potential != null)
{ {
barrowsBrothers.setHidden(true);
potential.setHidden(true); potential.setHidden(true);
} }