xp tracker overlay: treat counter=off progressbar=off as hidden

If the xptracker is shown, but both counter and progress bar set to off, the xp tracker layer is not actually hidden but only has hidden children. This causes the overlay renderer to layout things around the invisible xptracker. Avoid this by checking the vars for the xptracker to see if it is hidden or not.
This commit is contained in:
Adam
2021-09-19 15:44:49 -04:00
parent 763db213a2
commit fc183c13af

View File

@@ -204,6 +204,20 @@ public class WidgetOverlay extends Overlay
this.overlayManager = overlayManager;
}
@Override
public Dimension render(Graphics2D graphics)
{
// The xptracker component layer isn't hidden if the counter and process bar are both configured "Off",
// it just has its children hidden.
if (client.getVar(Varbits.EXPERIENCE_TRACKER_COUNTER) == 30 // Off
&& client.getVar(Varbits.EXPERIENCE_TRACKER_PROGRESS_BAR) == 0) // Off
{
return null;
}
return super.render(graphics);
}
/**
* Get the overlay position of the xptracker based on the configured location in-game.
*