Skip to content

Commit

Permalink
fishing: make overlay colors configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
alexanderhenne committed Oct 16, 2019
1 parent 69ebb71 commit 2ac1c2e
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
*/
package net.runelite.client.plugins.fishing;

import java.awt.Color;
import net.runelite.client.config.Config;
import net.runelite.client.config.ConfigGroup;
import net.runelite.client.config.ConfigItem;
Expand Down Expand Up @@ -76,7 +77,40 @@ default boolean showSpotNames()
}

@ConfigItem(
position = 4,
keyName = "overlayColor",
name = "Overlay Color",
description = "Color of overlays",
position = 4
)
default Color getOverlayColor()
{
return Color.CYAN;
}

@ConfigItem(
keyName = "minnowsOverlayColor",
name = "Minnows Overlay Color",
description = "Color of overlays for Minnows",
position = 5
)
default Color getMinnowsOverlayColor()
{
return Color.RED;
}

@ConfigItem(
keyName = "aerialOverlayColor",
name = "Aerial Overlay Color",
description = "Color of overlays when 1-tick aerial fishing",
position = 6
)
default Color getAerialOverlayColor()
{
return Color.GREEN;
}

@ConfigItem(
position = 7,
keyName = "statTimeout",
name = "Reset stats (minutes)",
description = "The time until fishing session data is reset in minutes."
Expand All @@ -87,7 +121,7 @@ default int statTimeout()
}

@ConfigItem(
position = 5,
position = 8,
keyName = "showFishingStats",
name = "Show Fishing session stats",
description = "Display the fishing session stats."
Expand All @@ -98,7 +132,7 @@ default boolean showFishingStats()
}

@ConfigItem(
position = 6,
position = 9,
keyName = "showMinnowOverlay",
name = "Show Minnow Movement overlay",
description = "Display the minnow progress pie overlay."
Expand All @@ -109,7 +143,7 @@ default boolean showMinnowOverlay()
}

@ConfigItem(
position = 7,
position = 10,
keyName = "trawlerNotification",
name = "Trawler activity notification",
description = "Send a notification when fishing trawler activity drops below 15%."
Expand All @@ -120,7 +154,7 @@ default boolean trawlerNotification()
}

@ConfigItem(
position = 8,
position = 11,
keyName = "trawlerTimer",
name = "Trawler timer in MM:SS",
description = "Trawler Timer will display a more accurate timer in MM:SS format."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@ public Dimension render(Graphics2D graphics)
continue;
}

Color color = npc.getGraphic() == GraphicID.FLYING_FISH ? Color.RED : Color.CYAN;
Color color = npc.getGraphic() == GraphicID.FLYING_FISH
? config.getMinnowsOverlayColor()
: config.getOverlayColor();

net.runelite.api.Point minimapLocation = npc.getMinimapLocation();
if (minimapLocation != null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,15 +107,15 @@ public Dimension render(Graphics2D graphics)
Color color;
if (npc.getGraphic() == GraphicID.FLYING_FISH)
{
color = Color.RED;
color = config.getMinnowsOverlayColor();
}
else if (spot == FishingSpot.COMMON_TENCH && npc.getWorldLocation().distanceTo2D(client.getLocalPlayer().getWorldLocation()) <= ONE_TICK_AERIAL_FISHING)
{
color = Color.GREEN;
color = config.getAerialOverlayColor();
}
else
{
color = Color.CYAN;
color = config.getOverlayColor();
}

if (spot == FishingSpot.MINNOW && config.showMinnowOverlay())
Expand Down Expand Up @@ -156,12 +156,12 @@ else if (spot == FishingSpot.COMMON_TENCH && npc.getWorldLocation().distanceTo2D

if (config.showSpotIcons())
{
BufferedImage fishImage = itemManager.getImage(spot.getFishSpriteId());;
BufferedImage fishImage = itemManager.getImage(spot.getFishSpriteId());

if (spot == FishingSpot.COMMON_TENCH
&& npc.getWorldLocation().distanceTo2D(client.getLocalPlayer().getWorldLocation()) <= ONE_TICK_AERIAL_FISHING)
{
fishImage = ImageUtil.outlineImage(itemManager.getImage(spot.getFishSpriteId()), Color.GREEN);
fishImage = ImageUtil.outlineImage(itemManager.getImage(spot.getFishSpriteId()), color);
}

if (fishImage != null)
Expand Down

0 comments on commit 2ac1c2e

Please sign in to comment.