use of net.runelite.client.ui.overlay.infobox.InfoBoxOverlay in project runelite by runelite.
the class OverlayRenderer method rebuildOverlays.
private void rebuildOverlays() {
final List<Overlay> overlays = Stream.concat(pluginManager.getPlugins().stream().filter(pluginManager::isPluginEnabled).flatMap(plugin -> plugin.getOverlays().stream()), Stream.of(infoBoxOverlay, tooltipOverlay)).filter(Objects::nonNull).collect(Collectors.toList());
sortOverlays(overlays);
allOverlays.clear();
allOverlays.addAll(overlays);
final Client client = clientProvider.get();
for (final Overlay overlay : overlays) {
final Point location = loadOverlayLocation(overlay);
if (location != null && client.getCanvas() != null && !client.getCanvas().contains(location)) {
overlay.setPreferredLocation(null);
saveOverlayLocation(overlay);
} else {
overlay.setPreferredLocation(location);
}
final OverlayPosition position = loadOverlayPosition(overlay);
overlay.setPreferredPosition(position);
}
rebuildOverlayLayers();
}
Aggregations