Remove overlayManager#overlayId
It is not used outside of OverlayManager so just swap it with direct use of indexOf. Signed-off-by: Tomas Slusny <slusnucky@gmail.com>
This commit is contained in:
@@ -126,7 +126,7 @@ public class OverlayManager
|
||||
|
||||
event.consume();
|
||||
|
||||
Optional<Overlay> optionalOverlay = overlays.stream().filter(o -> overlayId(o) == event.getId()).findAny();
|
||||
Optional<Overlay> optionalOverlay = overlays.stream().filter(o -> overlays.indexOf(o) == event.getId()).findAny();
|
||||
if (optionalOverlay.isPresent())
|
||||
{
|
||||
Overlay overlay = optionalOverlay.get();
|
||||
@@ -141,11 +141,6 @@ public class OverlayManager
|
||||
}
|
||||
}
|
||||
|
||||
int overlayId(Overlay overlay)
|
||||
{
|
||||
return overlays.indexOf(overlay);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets all of the overlays on a layer sorted by priority and position
|
||||
*
|
||||
|
||||
@@ -550,7 +550,7 @@ public class OverlayRenderer extends MouseAdapter implements KeyListener
|
||||
entry.setOption(overlayMenuEntry.getOption());
|
||||
entry.setTarget(ColorUtil.wrapWithColorTag(overlayMenuEntry.getTarget(), JagexColors.MENU_TARGET));
|
||||
entry.setType(MenuAction.RUNELITE_OVERLAY.getId());
|
||||
entry.setIdentifier(overlayManager.overlayId(overlay)); // overlay id
|
||||
entry.setIdentifier(overlayManager.getOverlays().indexOf(overlay)); // overlay id
|
||||
|
||||
entries[i] = entry;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user