From bd8a31cc0b9bac73a4a31a374c1f5708b0f70f8c Mon Sep 17 00:00:00 2001 From: Adam Date: Tue, 20 Aug 2019 19:44:03 -0400 Subject: [PATCH] fishing plugin: deduplicate spot overlay color logic --- .../plugins/fishing/FishingSpotOverlay.java | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/fishing/FishingSpotOverlay.java b/runelite-client/src/main/java/net/runelite/client/plugins/fishing/FishingSpotOverlay.java index 80cdaec1e4..ca5e289b8a 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/fishing/FishingSpotOverlay.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/fishing/FishingSpotOverlay.java @@ -95,7 +95,19 @@ class FishingSpotOverlay extends Overlay continue; } - Color color = npc.getGraphic() == GraphicID.FLYING_FISH ? Color.RED : Color.CYAN; + Color color; + if (npc.getGraphic() == GraphicID.FLYING_FISH) + { + color = Color.RED; + } + else if (spot == FishingSpot.COMMON_TENCH && npc.getWorldLocation().distanceTo2D(client.getLocalPlayer().getWorldLocation()) <= ONE_TICK_AERIAL_FISHING) + { + color = Color.GREEN; + } + else + { + color = Color.CYAN; + } if (spot == FishingSpot.MINNOW && config.showMinnowOverlay()) { @@ -127,12 +139,6 @@ class FishingSpotOverlay extends Overlay { Polygon poly = npc.getCanvasTilePoly(); - if (spot == FishingSpot.COMMON_TENCH - && npc.getWorldLocation().distanceTo2D(client.getLocalPlayer().getWorldLocation()) <= ONE_TICK_AERIAL_FISHING) - { - color = Color.GREEN; - } - if (poly != null) { OverlayUtil.renderPolygon(graphics, poly, color.darker()); @@ -164,12 +170,6 @@ class FishingSpotOverlay extends Overlay String text = spot.getName(); Point textLocation = npc.getCanvasTextLocation(graphics, text, npc.getLogicalHeight() + 40); - if (spot == FishingSpot.COMMON_TENCH - && npc.getWorldLocation().distanceTo2D(client.getLocalPlayer().getWorldLocation()) <= ONE_TICK_AERIAL_FISHING) - { - color = Color.GREEN; - } - if (textLocation != null) { OverlayUtil.renderTextLocation(graphics, textLocation, text, color.darker());