From ef567e364faa021b53e1e38ac88fa4f38b5c39e9 Mon Sep 17 00:00:00 2001 From: Alexsuperfly Date: Fri, 23 Nov 2018 07:23:57 -0500 Subject: [PATCH] MLM Plugin: Add toggle for rocks highlighting (#6181) Splits the showRocks config into showVeins and showRocks so that the user can decide to show only Veins without the visual clutter of the RockFalls forced highlighting. --- .../plugins/motherlode/MotherlodeConfig.java | 14 +++++++-- .../motherlode/MotherlodeRocksOverlay.java | 30 ++++++++++++------- 2 files changed, 31 insertions(+), 13 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/motherlode/MotherlodeConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/motherlode/MotherlodeConfig.java index e71afa5076..4896dcf34b 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/motherlode/MotherlodeConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/motherlode/MotherlodeConfig.java @@ -33,11 +33,21 @@ import net.runelite.client.config.ConfigItem; public interface MotherlodeConfig extends Config { @ConfigItem( - keyName = "showRocks", + keyName = "showVeins", name = "Show pay-dirt mining spots", description = "Configures whether or not the pay-dirt mining spots are displayed." ) - default boolean showRocks() + default boolean showVeins() + { + return true; + } + + @ConfigItem( + keyName = "showRocks", + name = "Show rocks obstacles", + description = "Configures whether or not the fallen rocks obstacles are displayed." + ) + default boolean showRockFalls() { return true; } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/motherlode/MotherlodeRocksOverlay.java b/runelite-client/src/main/java/net/runelite/client/plugins/motherlode/MotherlodeRocksOverlay.java index e79f10335b..28b131aa06 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/motherlode/MotherlodeRocksOverlay.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/motherlode/MotherlodeRocksOverlay.java @@ -71,7 +71,7 @@ class MotherlodeRocksOverlay extends Overlay @Override public Dimension render(Graphics2D graphics) { - if (!config.showRocks() || !plugin.isInMlm()) + if ((!config.showVeins() && !config.showRockFalls()) || !plugin.isInMlm()) { return null; } @@ -86,27 +86,35 @@ class MotherlodeRocksOverlay extends Overlay private void renderTiles(Graphics2D graphics, Player local) { LocalPoint localLocation = local.getLocalLocation(); - for (WallObject vein : plugin.getVeins()) + + if (config.showVeins()) { - LocalPoint location = vein.getLocalLocation(); - if (localLocation.distanceTo(location) <= MAX_DISTANCE) + for (WallObject vein : plugin.getVeins()) { - // Only draw veins on the same level - if (plugin.isUpstairs(localLocation) == plugin.isUpstairs(vein.getLocalLocation())) + LocalPoint location = vein.getLocalLocation(); + if (localLocation.distanceTo(location) <= MAX_DISTANCE) { - renderVein(graphics, vein); + // Only draw veins on the same level + if (plugin.isUpstairs(localLocation) == plugin.isUpstairs(vein.getLocalLocation())) + { + renderVein(graphics, vein); + } } } } - for (GameObject rock : plugin.getRocks()) + if (config.showRockFalls()) { - LocalPoint location = rock.getLocalLocation(); - if (localLocation.distanceTo(location) <= MAX_DISTANCE) + for (GameObject rock : plugin.getRocks()) { - renderRock(graphics, rock); + LocalPoint location = rock.getLocalLocation(); + if (localLocation.distanceTo(location) <= MAX_DISTANCE) + { + renderRock(graphics, rock); + } } } + } private void renderVein(Graphics2D graphics, WallObject vein)