world map: consolidate world map points into one

This commit is contained in:
Adam
2021-01-15 12:08:24 -05:00
parent 4b87a08610
commit c997e175a5
17 changed files with 175 additions and 626 deletions

View File

@@ -1,43 +0,0 @@
/*
* Copyright (c) 2018, Morgan Lewis <https://github.com/MESLewis>
* 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());
}
}
}

View File

@@ -1,38 +0,0 @@
/*
* Copyright (c) 2020, Arman S <https://github.com/Rman887>
* 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());
}
}

View File

@@ -1,42 +0,0 @@
/*
* Copyright (c) 2018, Morgan Lewis <https://github.com/MESLewis>
* 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());
}
}
}

View File

@@ -1,39 +0,0 @@
/*
* Copyright (c) 2018, Torkel Velure <https://github.com/TorkelV>
* 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);
}
}

View File

@@ -1,39 +0,0 @@
/*
* Copyright (c) 2020, melky <https://github.com/melkypie>
* 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);
}
}

View File

@@ -1,38 +0,0 @@
/*
* Copyright (c) 2020, melky <https://github.com/melkypie>
* 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());
}
}

View File

@@ -1,37 +0,0 @@
/*
* Copyright (c) 2020, Brooklyn <https://github.com/Broooklyn>
* 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());
}
}

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2020, melky <https://github.com/melkypie> * Copyright (c) 2021, Adam <Adam@sigterm.info>
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@@ -25,18 +25,32 @@
*/ */
package net.runelite.client.plugins.worldmap; 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; 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); TELEPORT,
RUNECRAFT_ALTAR,
if (showTooltip) MINING_SITE,
{ DUNGEON,
setTooltip(data.getTooltip()); HUNTER,
} FISHING,
KOUREND_TASK,
FARMING_PATCH,
TRANSPORTATION,
MINIGAME,
FAIRY_RING,
AGILITY_COURSE,
AGILITY_SHORTCUT,
QUEST,
RARE_TREE
} }
@Getter
private final Type type;
} }

View File

@@ -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());
}
}

View File

@@ -1,38 +0,0 @@
/*
* Copyright (c) 2020, dekvall <https://github.com/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());
}
}

View File

@@ -1,39 +0,0 @@
/*
* Copyright (c) 2018, John James Hamilton <https://github.com/johnhamilto>
* 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);
}
}

View File

@@ -1,44 +0,0 @@
/*
* Copyright (c) 2018, Spedwards <https://github.com/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);
}
}
}

View File

@@ -1,39 +0,0 @@
/*
* Copyright (c) 2019, Dava96 <https://github.com/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());
}
}

View File

@@ -1,39 +0,0 @@
/*
* Copyright (c) 2018, Morgan Lewis <https://github.com/MESLewis>
* 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()));
}
}

View File

@@ -1,47 +0,0 @@
/*
* Copyright (c) 2019, Kyle Sergio <https://github.com/ksergio39>
* Copyright (c) 2019, Bryce Altomare <https://github.com/Twinkiel0ver>
* Copyright (c) 2019, Kyle Stead <http://github.com/kyle1elyk>
* 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());
}
}

View File

@@ -29,21 +29,23 @@ import com.google.inject.Inject;
import com.google.inject.Provides; import com.google.inject.Provides;
import java.awt.image.BufferedImage; import java.awt.image.BufferedImage;
import java.util.Arrays; import java.util.Arrays;
import java.util.function.Predicate;
import net.runelite.api.Client; import net.runelite.api.Client;
import net.runelite.api.GameState; import net.runelite.api.GameState;
import net.runelite.api.Quest; import net.runelite.api.Quest;
import net.runelite.api.QuestState; import net.runelite.api.QuestState;
import net.runelite.api.Skill; import net.runelite.api.Skill;
import net.runelite.client.events.ConfigChanged;
import net.runelite.api.events.StatChanged; import net.runelite.api.events.StatChanged;
import net.runelite.api.events.WidgetLoaded; import net.runelite.api.events.WidgetLoaded;
import net.runelite.api.widgets.WidgetID; import net.runelite.api.widgets.WidgetID;
import net.runelite.client.callback.ClientThread; import net.runelite.client.callback.ClientThread;
import net.runelite.client.config.ConfigManager; import net.runelite.client.config.ConfigManager;
import net.runelite.client.eventbus.Subscribe; import net.runelite.client.eventbus.Subscribe;
import net.runelite.client.events.ConfigChanged;
import net.runelite.client.game.AgilityShortcut; import net.runelite.client.game.AgilityShortcut;
import net.runelite.client.plugins.Plugin; import net.runelite.client.plugins.Plugin;
import net.runelite.client.plugins.PluginDescriptor; 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.ui.overlay.worldmap.WorldMapPointManager;
import net.runelite.client.util.ImageUtil; import net.runelite.client.util.ImageUtil;
@@ -161,18 +163,7 @@ public class WorldMapPlugin extends Plugin
@Override @Override
protected void shutDown() throws Exception protected void shutDown() throws Exception
{ {
worldMapPointManager.removeIf(FairyRingPoint.class::isInstance); worldMapPointManager.removeIf(MapPoint.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);
agilityLevel = 0; agilityLevel = 0;
woodcuttingLevel = 0; woodcuttingLevel = 0;
} }
@@ -229,47 +220,61 @@ public class WorldMapPlugin extends Plugin
private void updateAgilityIcons() private void updateAgilityIcons()
{ {
worldMapPointManager.removeIf(AgilityShortcutPoint.class::isInstance); worldMapPointManager.removeIf(isType(MapPoint.Type.AGILITY_SHORTCUT));
if (config.agilityShortcutLevelIcon() || config.agilityShortcutTooltips()) if (config.agilityShortcutLevelIcon() || config.agilityShortcutTooltips())
{ {
Arrays.stream(AgilityShortcut.values()) Arrays.stream(AgilityShortcut.values())
.filter(value -> value.getWorldMapLocation() != null) .filter(value -> value.getWorldMapLocation() != null)
.map(value -> new AgilityShortcutPoint(value, .map(l ->
agilityLevel > 0 && config.agilityShortcutLevelIcon() && value.getLevel() > agilityLevel ? NOPE_ICON : BLANK_ICON, MapPoint.builder()
config.agilityShortcutTooltips())) .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); .forEach(worldMapPointManager::add);
} }
} }
private void updateAgilityCourseIcons() private void updateAgilityCourseIcons()
{ {
worldMapPointManager.removeIf(AgilityCoursePoint.class::isInstance); worldMapPointManager.removeIf(isType(MapPoint.Type.AGILITY_COURSE));
if (config.agilityCourseTooltip() || config.agilityCourseRooftop()) if (config.agilityCourseTooltip() || config.agilityCourseRooftop())
{ {
Arrays.stream(AgilityCourseLocation.values()) Arrays.stream(AgilityCourseLocation.values())
.filter(value -> value.getLocation() != null) .filter(value -> value.getLocation() != null)
.map(value -> new AgilityCoursePoint(value, .map(l ->
config.agilityCourseRooftop() && value.isRooftopCourse() ? ROOFTOP_COURSE_ICON : BLANK_ICON, MapPoint.builder()
config.agilityCourseTooltip())) .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); .forEach(worldMapPointManager::add);
} }
} }
private void updateRareTreeIcons() private void updateRareTreeIcons()
{ {
worldMapPointManager.removeIf(RareTreePoint.class::isInstance); worldMapPointManager.removeIf(isType(MapPoint.Type.RARE_TREE));
if (config.rareTreeLevelIcon() || config.rareTreeTooltips()) if (config.rareTreeLevelIcon() || config.rareTreeTooltips())
{ {
Arrays.stream(RareTreeLocation.values()).forEach(rareTree -> Arrays.stream(RareTreeLocation.values()).forEach(rareTree ->
Arrays.stream(rareTree.getLocations()) Arrays.stream(rareTree.getLocations())
.map(point -> new RareTreePoint(point, .map(point ->
rareTree.getTooltip(), MapPoint.builder()
woodcuttingLevel > 0 && config.rareTreeLevelIcon() && .type(MapPoint.Type.RARE_TREE)
rareTree.getLevelReq() > woodcuttingLevel ? NOPE_ICON : BLANK_ICON, .worldPoint(point)
config.rareTreeTooltips())) .image(woodcuttingLevel > 0 && config.rareTreeLevelIcon() &&
rareTree.getLevelReq() > woodcuttingLevel ? NOPE_ICON : BLANK_ICON)
.tooltip(config.rareTreeTooltips() ? rareTree.getTooltip() : null)
.build()
)
.forEach(worldMapPointManager::add)); .forEach(worldMapPointManager::add));
} }
} }
@@ -281,43 +286,71 @@ public class WorldMapPlugin extends Plugin
updateRareTreeIcons(); updateRareTreeIcons();
updateQuestStartPointIcons(); updateQuestStartPointIcons();
worldMapPointManager.removeIf(FairyRingPoint.class::isInstance); worldMapPointManager.removeIf(isType(MapPoint.Type.FAIRY_RING));
if (config.fairyRingIcon() || config.fairyRingTooltips()) if (config.fairyRingIcon() || config.fairyRingTooltips())
{ {
Arrays.stream(FairyRingLocation.values()) Arrays.stream(FairyRingLocation.values())
.map(value -> new FairyRingPoint(value, .map(l ->
config.fairyRingIcon() ? FAIRY_TRAVEL_ICON : BLANK_ICON, MapPoint.builder()
config.fairyRingTooltips())) .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); .forEach(worldMapPointManager::add);
} }
worldMapPointManager.removeIf(MinigamePoint.class::isInstance); worldMapPointManager.removeIf(isType(MapPoint.Type.MINIGAME));
if (config.minigameTooltip()) if (config.minigameTooltip())
{ {
Arrays.stream(MinigameLocation.values()) 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); .forEach(worldMapPointManager::add);
} }
worldMapPointManager.removeIf(TransportationPoint.class::isInstance); worldMapPointManager.removeIf(isType(MapPoint.Type.TRANSPORTATION));
if (config.transportationTeleportTooltips()) if (config.transportationTeleportTooltips())
{ {
Arrays.stream(TransportationPointLocation.values()) Arrays.stream(TransportationPointLocation.values())
.map(value -> new TransportationPoint(value, BLANK_ICON)) .map(l ->
.forEach((worldMapPointManager::add)); 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()) if (config.farmingPatchTooltips())
{ {
Arrays.stream(FarmingPatchLocation.values()).forEach(location -> Arrays.stream(FarmingPatchLocation.values()).forEach(location ->
Arrays.stream(location.getLocations()) 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) .forEach(worldMapPointManager::add)
); );
} }
worldMapPointManager.removeIf(TeleportPoint.class::isInstance); worldMapPointManager.removeIf(isType(MapPoint.Type.TELEPORT));
Arrays.stream(TeleportLocationData.values()) Arrays.stream(TeleportLocationData.values())
.filter(data -> .filter(data ->
{ {
@@ -340,63 +373,113 @@ public class WorldMapPlugin extends Plugin
default: default:
return false; 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); .forEach(worldMapPointManager::add);
worldMapPointManager.removeIf(RunecraftingAltarPoint.class::isInstance); worldMapPointManager.removeIf(isType(MapPoint.Type.RUNECRAFT_ALTAR));
if (config.runecraftingAltarIcon()) if (config.runecraftingAltarIcon())
{ {
Arrays.stream(RunecraftingAltarLocation.values()) 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); .forEach(worldMapPointManager::add);
} }
worldMapPointManager.removeIf(MiningSitePoint.class::isInstance); worldMapPointManager.removeIf(isType(MapPoint.Type.MINING_SITE));
if (config.miningSiteTooltips()) if (config.miningSiteTooltips())
{ {
Arrays.stream(MiningSiteLocation.values()) 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); .forEach(worldMapPointManager::add);
} }
worldMapPointManager.removeIf(DungeonPoint.class::isInstance); worldMapPointManager.removeIf(isType(MapPoint.Type.DUNGEON));
if (config.dungeonTooltips()) if (config.dungeonTooltips())
{ {
Arrays.stream(DungeonLocation.values()) 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); .forEach(worldMapPointManager::add);
} }
worldMapPointManager.removeIf(HunterAreaPoint.class::isInstance); worldMapPointManager.removeIf(isType(MapPoint.Type.HUNTER));
if (config.hunterAreaTooltips()) if (config.hunterAreaTooltips())
{ {
Arrays.stream(HunterAreaLocation.values()) 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); .forEach(worldMapPointManager::add);
} }
worldMapPointManager.removeIf(FishingSpotPoint.class::isInstance); worldMapPointManager.removeIf(isType(MapPoint.Type.FISHING));
if (config.fishingSpotTooltips()) if (config.fishingSpotTooltips())
{ {
Arrays.stream(FishingSpotLocation.values()).forEach(location -> Arrays.stream(FishingSpotLocation.values()).forEach(location ->
Arrays.stream(location.getLocations()) 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) .forEach(worldMapPointManager::add)
); );
} }
worldMapPointManager.removeIf(KourendTaskPoint.class::isInstance); worldMapPointManager.removeIf(isType(MapPoint.Type.KOUREND_TASK));
if (config.kourendTaskTooltips()) if (config.kourendTaskTooltips())
{ {
Arrays.stream(KourendTaskLocation.values()) 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); .forEach(worldMapPointManager::add);
} }
} }
private void updateQuestStartPointIcons() private void updateQuestStartPointIcons()
{ {
worldMapPointManager.removeIf(QuestStartPoint.class::isInstance); worldMapPointManager.removeIf(isType(MapPoint.Type.QUEST));
if (!config.questStartTooltips()) 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(); 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<WorldMapPoint> isType(MapPoint.Type type)
{
return w -> w instanceof MapPoint && ((MapPoint) w).getType() == type;
} }
} }

View File

@@ -27,12 +27,14 @@ package net.runelite.client.ui.overlay.worldmap;
import java.awt.Rectangle; import java.awt.Rectangle;
import java.awt.event.MouseEvent; import java.awt.event.MouseEvent;
import java.awt.image.BufferedImage; import java.awt.image.BufferedImage;
import javax.annotation.Nullable;
import lombok.Data; import lombok.Data;
import lombok.experimental.SuperBuilder;
import net.runelite.api.Point; import net.runelite.api.Point;
import net.runelite.api.coords.WorldPoint; import net.runelite.api.coords.WorldPoint;
import javax.annotation.Nullable;
@Data @Data
@SuperBuilder
public class WorldMapPoint public class WorldMapPoint
{ {
private BufferedImage image; private BufferedImage image;