diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/AgilityShortcutPoint.java b/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/AgilityShortcutPoint.java deleted file mode 100644 index c99979f103..0000000000 --- a/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/AgilityShortcutPoint.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2018, Morgan Lewis - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -package net.runelite.client.plugins.worldmap; - -import java.awt.image.BufferedImage; -import net.runelite.client.ui.overlay.worldmap.WorldMapPoint; -import net.runelite.client.game.AgilityShortcut; - -class AgilityShortcutPoint extends WorldMapPoint -{ - AgilityShortcutPoint(AgilityShortcut data, BufferedImage icon, boolean showTooltip) - { - super(data.getWorldMapLocation(), icon); - - if (showTooltip) - { - setTooltip(data.getTooltip()); - } - } -} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/DungeonPoint.java b/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/DungeonPoint.java deleted file mode 100644 index 9d50ec322f..0000000000 --- a/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/DungeonPoint.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2020, Arman S - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -package net.runelite.client.plugins.worldmap; - -import java.awt.image.BufferedImage; -import net.runelite.client.ui.overlay.worldmap.WorldMapPoint; - -class DungeonPoint extends WorldMapPoint -{ - DungeonPoint(DungeonLocation data, BufferedImage icon) - { - super(data.getLocation(), icon); - setTooltip(data.getTooltip()); - } -} \ No newline at end of file diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/FairyRingPoint.java b/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/FairyRingPoint.java deleted file mode 100644 index ef4e55da92..0000000000 --- a/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/FairyRingPoint.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) 2018, Morgan Lewis - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -package net.runelite.client.plugins.worldmap; - -import java.awt.image.BufferedImage; -import net.runelite.client.ui.overlay.worldmap.WorldMapPoint; - -class FairyRingPoint extends WorldMapPoint -{ - FairyRingPoint(FairyRingLocation data, BufferedImage icon, boolean showTooltip) - { - super(data.getLocation(), icon); - - if (showTooltip) - { - setTooltip("Fairy Ring - " + data.getCode()); - } - } -} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/FarmingPatchPoint.java b/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/FarmingPatchPoint.java deleted file mode 100644 index 79b380c220..0000000000 --- a/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/FarmingPatchPoint.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2018, Torkel Velure - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -package net.runelite.client.plugins.worldmap; - -import java.awt.image.BufferedImage; -import net.runelite.api.coords.WorldPoint; -import net.runelite.client.ui.overlay.worldmap.WorldMapPoint; - -class FarmingPatchPoint extends WorldMapPoint -{ - FarmingPatchPoint(WorldPoint point, String tooltip, BufferedImage icon) - { - super(point, icon); - setTooltip(tooltip); - } -} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/FishingSpotPoint.java b/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/FishingSpotPoint.java deleted file mode 100644 index fa32c86ffe..0000000000 --- a/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/FishingSpotPoint.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2020, melky - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -package net.runelite.client.plugins.worldmap; - -import java.awt.image.BufferedImage; -import net.runelite.api.coords.WorldPoint; -import net.runelite.client.ui.overlay.worldmap.WorldMapPoint; - -class FishingSpotPoint extends WorldMapPoint -{ - FishingSpotPoint(WorldPoint point, String tooltip, BufferedImage icon) - { - super(point, icon); - setTooltip(tooltip); - } -} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/HunterAreaPoint.java b/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/HunterAreaPoint.java deleted file mode 100644 index 2725f3de11..0000000000 --- a/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/HunterAreaPoint.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2020, melky - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -package net.runelite.client.plugins.worldmap; - -import java.awt.image.BufferedImage; -import net.runelite.client.ui.overlay.worldmap.WorldMapPoint; - -class HunterAreaPoint extends WorldMapPoint -{ - HunterAreaPoint(HunterAreaLocation data, BufferedImage icon) - { - super(data.getLocation(), icon); - setTooltip(data.getTooltip()); - } -} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/KourendTaskPoint.java b/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/KourendTaskPoint.java deleted file mode 100644 index 21170e0789..0000000000 --- a/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/KourendTaskPoint.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2020, Brooklyn - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -package net.runelite.client.plugins.worldmap; - -import net.runelite.client.ui.overlay.worldmap.WorldMapPoint; - -public class KourendTaskPoint extends WorldMapPoint -{ - KourendTaskPoint(KourendTaskLocation data) - { - super(data.getLocation(), WorldMapPlugin.BLANK_ICON); - setTooltip(data.getTooltip()); - } -} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/AgilityCoursePoint.java b/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/MapPoint.java similarity index 77% rename from runelite-client/src/main/java/net/runelite/client/plugins/worldmap/AgilityCoursePoint.java rename to runelite-client/src/main/java/net/runelite/client/plugins/worldmap/MapPoint.java index 982f8db975..161c669604 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/AgilityCoursePoint.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/MapPoint.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, melky + * Copyright (c) 2021, Adam * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -25,18 +25,32 @@ */ package net.runelite.client.plugins.worldmap; -import java.awt.image.BufferedImage; +import lombok.Getter; +import lombok.experimental.SuperBuilder; import net.runelite.client.ui.overlay.worldmap.WorldMapPoint; -class AgilityCoursePoint extends WorldMapPoint +@SuperBuilder +class MapPoint extends WorldMapPoint { - AgilityCoursePoint(AgilityCourseLocation data, BufferedImage icon, boolean showTooltip) + enum Type { - super(data.getLocation(), icon); - - if (showTooltip) - { - setTooltip(data.getTooltip()); - } + TELEPORT, + RUNECRAFT_ALTAR, + MINING_SITE, + DUNGEON, + HUNTER, + FISHING, + KOUREND_TASK, + FARMING_PATCH, + TRANSPORTATION, + MINIGAME, + FAIRY_RING, + AGILITY_COURSE, + AGILITY_SHORTCUT, + QUEST, + RARE_TREE } + + @Getter + private final Type type; } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/MinigamePoint.java b/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/MinigamePoint.java deleted file mode 100644 index bd670aa023..0000000000 --- a/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/MinigamePoint.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2018, Magic fTail - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -package net.runelite.client.plugins.worldmap; - -import java.awt.image.BufferedImage; -import net.runelite.client.ui.overlay.worldmap.WorldMapPoint; - -class MinigamePoint extends WorldMapPoint -{ - MinigamePoint(MinigameLocation data, BufferedImage icon) - { - super(data.getLocation(), icon); - setTooltip(data.getTooltip()); - } -} \ No newline at end of file diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/MiningSitePoint.java b/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/MiningSitePoint.java deleted file mode 100644 index 3a09a1b298..0000000000 --- a/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/MiningSitePoint.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2020, dekvall - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -package net.runelite.client.plugins.worldmap; - -import java.awt.image.BufferedImage; -import net.runelite.client.ui.overlay.worldmap.WorldMapPoint; - -class MiningSitePoint extends WorldMapPoint -{ - MiningSitePoint(MiningSiteLocation point, BufferedImage icon) - { - super(point.getLocation(), icon); - setTooltip(point.getTooltip()); - } -} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/QuestStartPoint.java b/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/QuestStartPoint.java deleted file mode 100644 index 681015b98e..0000000000 --- a/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/QuestStartPoint.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2018, John James Hamilton - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -package net.runelite.client.plugins.worldmap; - -import net.runelite.api.coords.WorldPoint; -import net.runelite.client.ui.overlay.worldmap.WorldMapPoint; -import java.awt.image.BufferedImage; - -class QuestStartPoint extends WorldMapPoint -{ - QuestStartPoint(WorldPoint location, BufferedImage icon, String tooltip) - { - super(location, icon); - setTooltip(tooltip); - } -} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/RareTreePoint.java b/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/RareTreePoint.java deleted file mode 100644 index 0dd42013bd..0000000000 --- a/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/RareTreePoint.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2018, Spedwards - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -package net.runelite.client.plugins.worldmap; - -import net.runelite.api.coords.WorldPoint; -import net.runelite.client.ui.overlay.worldmap.WorldMapPoint; - -import java.awt.image.BufferedImage; - -class RareTreePoint extends WorldMapPoint -{ - RareTreePoint(WorldPoint point, String tooltip, BufferedImage icon, boolean showTooltip) - { - super(point, icon); - - if (showTooltip) - { - setTooltip(tooltip); - } - } -} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/RunecraftingAltarPoint.java b/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/RunecraftingAltarPoint.java deleted file mode 100644 index d09ced3ce9..0000000000 --- a/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/RunecraftingAltarPoint.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2019, Dava96 - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -package net.runelite.client.plugins.worldmap; - -import net.runelite.client.ui.overlay.worldmap.WorldMapPoint; -import net.runelite.client.util.ImageUtil; - -class RunecraftingAltarPoint extends WorldMapPoint -{ - RunecraftingAltarPoint(RunecraftingAltarLocation point) - { - super(point.getLocation(), WorldMapPlugin.BLANK_ICON); - setImage(ImageUtil.loadImageResource(WorldMapPlugin.class, point.getIconPath())); - setTooltip(point.getTooltip()); - } -} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/TeleportPoint.java b/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/TeleportPoint.java deleted file mode 100644 index a1171cfbc6..0000000000 --- a/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/TeleportPoint.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2018, Morgan Lewis - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -package net.runelite.client.plugins.worldmap; - -import net.runelite.client.ui.overlay.worldmap.WorldMapPoint; -import net.runelite.client.util.ImageUtil; - -class TeleportPoint extends WorldMapPoint -{ - TeleportPoint(TeleportLocationData data) - { - super(data.getLocation(), WorldMapPlugin.BLANK_ICON); - setTooltip(data.getTooltip()); - setImage(ImageUtil.loadImageResource(WorldMapPlugin.class, data.getIconPath())); - } -} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/TransportationPoint.java b/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/TransportationPoint.java deleted file mode 100644 index 2996794212..0000000000 --- a/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/TransportationPoint.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2019, Kyle Sergio - * Copyright (c) 2019, Bryce Altomare - * Copyright (c) 2019, Kyle Stead - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -package net.runelite.client.plugins.worldmap; - -import net.runelite.api.coords.WorldPoint; -import net.runelite.client.ui.overlay.worldmap.WorldMapPoint; -import java.awt.image.BufferedImage; - -class TransportationPoint extends WorldMapPoint -{ - TransportationPoint(TransportationPointLocation data, BufferedImage icon) - { - super(data.getLocation(), icon); - final WorldPoint target = data.getTarget(); - if (target != null) - { - setTarget(target); - setJumpOnClick(true); - } - setTooltip(data.getTooltip()); - } -} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/WorldMapPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/WorldMapPlugin.java index 518edd0668..1114d56720 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/WorldMapPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/WorldMapPlugin.java @@ -29,21 +29,23 @@ import com.google.inject.Inject; import com.google.inject.Provides; import java.awt.image.BufferedImage; import java.util.Arrays; +import java.util.function.Predicate; import net.runelite.api.Client; import net.runelite.api.GameState; import net.runelite.api.Quest; import net.runelite.api.QuestState; import net.runelite.api.Skill; -import net.runelite.client.events.ConfigChanged; import net.runelite.api.events.StatChanged; import net.runelite.api.events.WidgetLoaded; import net.runelite.api.widgets.WidgetID; import net.runelite.client.callback.ClientThread; import net.runelite.client.config.ConfigManager; import net.runelite.client.eventbus.Subscribe; +import net.runelite.client.events.ConfigChanged; import net.runelite.client.game.AgilityShortcut; import net.runelite.client.plugins.Plugin; import net.runelite.client.plugins.PluginDescriptor; +import net.runelite.client.ui.overlay.worldmap.WorldMapPoint; import net.runelite.client.ui.overlay.worldmap.WorldMapPointManager; import net.runelite.client.util.ImageUtil; @@ -161,18 +163,7 @@ public class WorldMapPlugin extends Plugin @Override protected void shutDown() throws Exception { - worldMapPointManager.removeIf(FairyRingPoint.class::isInstance); - worldMapPointManager.removeIf(AgilityShortcutPoint.class::isInstance); - worldMapPointManager.removeIf(QuestStartPoint.class::isInstance); - worldMapPointManager.removeIf(TeleportPoint.class::isInstance); - worldMapPointManager.removeIf(TransportationPoint.class::isInstance); - worldMapPointManager.removeIf(MinigamePoint.class::isInstance); - worldMapPointManager.removeIf(FarmingPatchPoint.class::isInstance); - worldMapPointManager.removeIf(RareTreePoint.class::isInstance); - worldMapPointManager.removeIf(RunecraftingAltarPoint.class::isInstance); - worldMapPointManager.removeIf(DungeonPoint.class::isInstance); - worldMapPointManager.removeIf(FishingSpotPoint.class::isInstance); - worldMapPointManager.removeIf(AgilityCoursePoint.class::isInstance); + worldMapPointManager.removeIf(MapPoint.class::isInstance); agilityLevel = 0; woodcuttingLevel = 0; } @@ -229,47 +220,61 @@ public class WorldMapPlugin extends Plugin private void updateAgilityIcons() { - worldMapPointManager.removeIf(AgilityShortcutPoint.class::isInstance); + worldMapPointManager.removeIf(isType(MapPoint.Type.AGILITY_SHORTCUT)); if (config.agilityShortcutLevelIcon() || config.agilityShortcutTooltips()) { Arrays.stream(AgilityShortcut.values()) .filter(value -> value.getWorldMapLocation() != null) - .map(value -> new AgilityShortcutPoint(value, - agilityLevel > 0 && config.agilityShortcutLevelIcon() && value.getLevel() > agilityLevel ? NOPE_ICON : BLANK_ICON, - config.agilityShortcutTooltips())) + .map(l -> + MapPoint.builder() + .type(MapPoint.Type.AGILITY_SHORTCUT) + .worldPoint(l.getWorldMapLocation()) + .image(agilityLevel > 0 && config.agilityShortcutLevelIcon() && l.getLevel() > agilityLevel ? NOPE_ICON : BLANK_ICON) + .tooltip(config.agilityShortcutTooltips() ? l.getTooltip() : null) + .build() + ) .forEach(worldMapPointManager::add); } } private void updateAgilityCourseIcons() { - worldMapPointManager.removeIf(AgilityCoursePoint.class::isInstance); + worldMapPointManager.removeIf(isType(MapPoint.Type.AGILITY_COURSE)); if (config.agilityCourseTooltip() || config.agilityCourseRooftop()) { Arrays.stream(AgilityCourseLocation.values()) .filter(value -> value.getLocation() != null) - .map(value -> new AgilityCoursePoint(value, - config.agilityCourseRooftop() && value.isRooftopCourse() ? ROOFTOP_COURSE_ICON : BLANK_ICON, - config.agilityCourseTooltip())) + .map(l -> + MapPoint.builder() + .type(MapPoint.Type.AGILITY_COURSE) + .worldPoint(l.getLocation()) + .image(config.agilityCourseRooftop() && l.isRooftopCourse() ? ROOFTOP_COURSE_ICON : BLANK_ICON) + .tooltip(config.agilityCourseTooltip() ? l.getTooltip() : null) + .build() + ) .forEach(worldMapPointManager::add); } } private void updateRareTreeIcons() { - worldMapPointManager.removeIf(RareTreePoint.class::isInstance); + worldMapPointManager.removeIf(isType(MapPoint.Type.RARE_TREE)); if (config.rareTreeLevelIcon() || config.rareTreeTooltips()) { Arrays.stream(RareTreeLocation.values()).forEach(rareTree -> Arrays.stream(rareTree.getLocations()) - .map(point -> new RareTreePoint(point, - rareTree.getTooltip(), - woodcuttingLevel > 0 && config.rareTreeLevelIcon() && - rareTree.getLevelReq() > woodcuttingLevel ? NOPE_ICON : BLANK_ICON, - config.rareTreeTooltips())) + .map(point -> + MapPoint.builder() + .type(MapPoint.Type.RARE_TREE) + .worldPoint(point) + .image(woodcuttingLevel > 0 && config.rareTreeLevelIcon() && + rareTree.getLevelReq() > woodcuttingLevel ? NOPE_ICON : BLANK_ICON) + .tooltip(config.rareTreeTooltips() ? rareTree.getTooltip() : null) + .build() + ) .forEach(worldMapPointManager::add)); } } @@ -281,43 +286,71 @@ public class WorldMapPlugin extends Plugin updateRareTreeIcons(); updateQuestStartPointIcons(); - worldMapPointManager.removeIf(FairyRingPoint.class::isInstance); + worldMapPointManager.removeIf(isType(MapPoint.Type.FAIRY_RING)); if (config.fairyRingIcon() || config.fairyRingTooltips()) { Arrays.stream(FairyRingLocation.values()) - .map(value -> new FairyRingPoint(value, - config.fairyRingIcon() ? FAIRY_TRAVEL_ICON : BLANK_ICON, - config.fairyRingTooltips())) + .map(l -> + MapPoint.builder() + .type(MapPoint.Type.FAIRY_RING) + .worldPoint(l.getLocation()) + .image(config.fairyRingIcon() ? FAIRY_TRAVEL_ICON : BLANK_ICON) + .tooltip(config.fairyRingTooltips() ? "Fairy Ring - " + l.getCode() : null) + .build() + ) .forEach(worldMapPointManager::add); } - worldMapPointManager.removeIf(MinigamePoint.class::isInstance); + worldMapPointManager.removeIf(isType(MapPoint.Type.MINIGAME)); if (config.minigameTooltip()) { Arrays.stream(MinigameLocation.values()) - .map(value -> new MinigamePoint(value, BLANK_ICON)) + .map(l -> + MapPoint.builder() + .type(MapPoint.Type.MINIGAME) + .worldPoint(l.getLocation()) + .image(BLANK_ICON) + .tooltip(l.getTooltip()) + .build() + ) .forEach(worldMapPointManager::add); } - worldMapPointManager.removeIf(TransportationPoint.class::isInstance); + worldMapPointManager.removeIf(isType(MapPoint.Type.TRANSPORTATION)); if (config.transportationTeleportTooltips()) { Arrays.stream(TransportationPointLocation.values()) - .map(value -> new TransportationPoint(value, BLANK_ICON)) - .forEach((worldMapPointManager::add)); + .map(l -> + MapPoint.builder() + .type(MapPoint.Type.TRANSPORTATION) + .worldPoint(l.getLocation()) + .image(BLANK_ICON) + .target(l.getTarget()) + .jumpOnClick(l.getTarget() != null) + .tooltip(l.getTooltip()) + .build() + ) + .forEach((worldMapPointManager::add)); } - worldMapPointManager.removeIf(FarmingPatchPoint.class::isInstance); + worldMapPointManager.removeIf(isType(MapPoint.Type.FARMING_PATCH)); if (config.farmingPatchTooltips()) { Arrays.stream(FarmingPatchLocation.values()).forEach(location -> Arrays.stream(location.getLocations()) - .map(point -> new FarmingPatchPoint(point, location.getTooltip(), BLANK_ICON)) + .map(point -> + MapPoint.builder() + .type(MapPoint.Type.FARMING_PATCH) + .worldPoint(point) + .image(BLANK_ICON) + .tooltip(location.getTooltip()) + .build() + ) .forEach(worldMapPointManager::add) ); } - worldMapPointManager.removeIf(TeleportPoint.class::isInstance); + worldMapPointManager.removeIf(isType(MapPoint.Type.TELEPORT)); Arrays.stream(TeleportLocationData.values()) .filter(data -> { @@ -340,63 +373,113 @@ public class WorldMapPlugin extends Plugin default: return false; } - }).map(TeleportPoint::new) + }) + .map(l -> + MapPoint.builder() + .type(MapPoint.Type.TELEPORT) + .worldPoint(l.getLocation()) + .tooltip(l.getTooltip()) + .image(ImageUtil.loadImageResource(WorldMapPlugin.class, l.getIconPath())) + .build() + ) .forEach(worldMapPointManager::add); - worldMapPointManager.removeIf(RunecraftingAltarPoint.class::isInstance); + worldMapPointManager.removeIf(isType(MapPoint.Type.RUNECRAFT_ALTAR)); if (config.runecraftingAltarIcon()) { Arrays.stream(RunecraftingAltarLocation.values()) - .map(RunecraftingAltarPoint::new) + .map(l -> + MapPoint.builder() + .type(MapPoint.Type.RUNECRAFT_ALTAR) + .worldPoint(l.getLocation()) + .image(ImageUtil.loadImageResource(WorldMapPlugin.class, l.getIconPath())) + .tooltip(l.getTooltip()) + .build() + ) .forEach(worldMapPointManager::add); } - worldMapPointManager.removeIf(MiningSitePoint.class::isInstance); + worldMapPointManager.removeIf(isType(MapPoint.Type.MINING_SITE)); if (config.miningSiteTooltips()) { Arrays.stream(MiningSiteLocation.values()) - .map(value -> new MiningSitePoint(value, value.isIconRequired() ? MINING_SITE_ICON : BLANK_ICON)) + .map(l -> + MapPoint.builder() + .type(MapPoint.Type.MINING_SITE) + .worldPoint(l.getLocation()) + .image(l.isIconRequired() ? MINING_SITE_ICON : BLANK_ICON) + .tooltip(l.getTooltip()) + .build() + ) .forEach(worldMapPointManager::add); } - worldMapPointManager.removeIf(DungeonPoint.class::isInstance); + worldMapPointManager.removeIf(isType(MapPoint.Type.DUNGEON)); if (config.dungeonTooltips()) { Arrays.stream(DungeonLocation.values()) - .map(value -> new DungeonPoint(value, BLANK_ICON)) + .map(l -> + MapPoint.builder() + .type(MapPoint.Type.DUNGEON) + .worldPoint(l.getLocation()) + .image(BLANK_ICON) + .tooltip(l.getTooltip()) + .build() + ) .forEach(worldMapPointManager::add); } - worldMapPointManager.removeIf(HunterAreaPoint.class::isInstance); + worldMapPointManager.removeIf(isType(MapPoint.Type.HUNTER)); if (config.hunterAreaTooltips()) { Arrays.stream(HunterAreaLocation.values()) - .map(value -> new HunterAreaPoint(value, BLANK_ICON)) + .map(l -> + MapPoint.builder() + .type(MapPoint.Type.HUNTER) + .worldPoint(l.getLocation()) + .image(BLANK_ICON) + .tooltip(l.getTooltip()) + .build() + ) .forEach(worldMapPointManager::add); } - worldMapPointManager.removeIf(FishingSpotPoint.class::isInstance); + worldMapPointManager.removeIf(isType(MapPoint.Type.FISHING)); if (config.fishingSpotTooltips()) { Arrays.stream(FishingSpotLocation.values()).forEach(location -> Arrays.stream(location.getLocations()) - .map(point -> new FishingSpotPoint(point, location.getTooltip(), BLANK_ICON)) + .map(point -> + MapPoint.builder() + .type(MapPoint.Type.FISHING) + .worldPoint(point) + .image(BLANK_ICON) + .tooltip(location.getTooltip()) + .build() + ) .forEach(worldMapPointManager::add) ); } - worldMapPointManager.removeIf(KourendTaskPoint.class::isInstance); + worldMapPointManager.removeIf(isType(MapPoint.Type.KOUREND_TASK)); if (config.kourendTaskTooltips()) { Arrays.stream(KourendTaskLocation.values()) - .map(KourendTaskPoint::new) + .map(l -> + MapPoint.builder() + .type(MapPoint.Type.KOUREND_TASK) + .worldPoint(l.getLocation()) + .image(BLANK_ICON) + .tooltip(l.getTooltip()) + .build() + ) .forEach(worldMapPointManager::add); } } private void updateQuestStartPointIcons() { - worldMapPointManager.removeIf(QuestStartPoint.class::isInstance); + worldMapPointManager.removeIf(isType(MapPoint.Type.QUEST)); if (!config.questStartTooltips()) { @@ -418,7 +501,7 @@ public class WorldMapPlugin extends Plugin }); } - private QuestStartPoint createQuestStartPoint(QuestStartLocation data) + private MapPoint createQuestStartPoint(QuestStartLocation data) { Quest[] quests = data.getQuests(); @@ -459,6 +542,16 @@ public class WorldMapPlugin extends Plugin } } - return new QuestStartPoint(data.getLocation(), icon, tooltip); + return MapPoint.builder() + .type(MapPoint.Type.QUEST) + .worldPoint(data.getLocation()) + .image(icon) + .tooltip(tooltip) + .build(); + } + + private static Predicate isType(MapPoint.Type type) + { + return w -> w instanceof MapPoint && ((MapPoint) w).getType() == type; } } diff --git a/runelite-client/src/main/java/net/runelite/client/ui/overlay/worldmap/WorldMapPoint.java b/runelite-client/src/main/java/net/runelite/client/ui/overlay/worldmap/WorldMapPoint.java index 878b0125a0..836bcd1ef5 100644 --- a/runelite-client/src/main/java/net/runelite/client/ui/overlay/worldmap/WorldMapPoint.java +++ b/runelite-client/src/main/java/net/runelite/client/ui/overlay/worldmap/WorldMapPoint.java @@ -27,12 +27,14 @@ package net.runelite.client.ui.overlay.worldmap; import java.awt.Rectangle; import java.awt.event.MouseEvent; import java.awt.image.BufferedImage; +import javax.annotation.Nullable; import lombok.Data; +import lombok.experimental.SuperBuilder; import net.runelite.api.Point; import net.runelite.api.coords.WorldPoint; -import javax.annotation.Nullable; @Data +@SuperBuilder public class WorldMapPoint { private BufferedImage image;