worldmap: add the ability to indicate rooftop courses

This commit is contained in:
melkypie
2020-05-02 15:33:17 +03:00
parent fa615a07f2
commit 0e5829c97b
4 changed files with 39 additions and 20 deletions

View File

@@ -52,10 +52,12 @@ enum AgilityCourseLocation
private final String tooltip; private final String tooltip;
private final WorldPoint location; private final WorldPoint location;
private final boolean rooftopCourse;
AgilityCourseLocation(String tooltip, WorldPoint location) AgilityCourseLocation(String tooltip, WorldPoint location)
{ {
this.tooltip = tooltip; this.tooltip = tooltip;
this.location = location; this.location = location;
this.rooftopCourse = this.name().contains("ROOFTOP_COURSE");
} }
} }

View File

@@ -87,11 +87,22 @@ public interface WorldMapConfig extends Config
return true; return true;
} }
@ConfigItem(
keyName = WorldMapPlugin.CONFIG_KEY_AGILITY_COURSE_ROOFTOP_ICON,
name = "Indicate rooftop courses",
description = "Replace the agility icon with a mark of grace for rooftop courses",
position = 6
)
default boolean agilityCourseRooftop()
{
return true;
}
@ConfigItem( @ConfigItem(
keyName = WorldMapPlugin.CONFIG_KEY_NORMAL_TELEPORT_ICON, keyName = WorldMapPlugin.CONFIG_KEY_NORMAL_TELEPORT_ICON,
name = "Show Standard Spellbook destinations", name = "Show Standard Spellbook destinations",
description = "Show icons at the destinations for teleports in the Standard Spellbook", description = "Show icons at the destinations for teleports in the Standard Spellbook",
position = 6 position = 7
) )
default boolean normalTeleportIcon() default boolean normalTeleportIcon()
{ {
@@ -102,7 +113,7 @@ public interface WorldMapConfig extends Config
keyName = WorldMapPlugin.CONFIG_KEY_MINIGAME_TOOLTIP, keyName = WorldMapPlugin.CONFIG_KEY_MINIGAME_TOOLTIP,
name = "Show minigame name in tooltip", name = "Show minigame name in tooltip",
description = "Display the name of the minigame in the icon tooltip", description = "Display the name of the minigame in the icon tooltip",
position = 7 position = 8
) )
default boolean minigameTooltip() default boolean minigameTooltip()
{ {
@@ -113,7 +124,7 @@ public interface WorldMapConfig extends Config
keyName = WorldMapPlugin.CONFIG_KEY_ANCIENT_TELEPORT_ICON, keyName = WorldMapPlugin.CONFIG_KEY_ANCIENT_TELEPORT_ICON,
name = "Show Ancient Magicks destinations", name = "Show Ancient Magicks destinations",
description = "Show icons at the destinations for teleports in the Ancient Spellbook", description = "Show icons at the destinations for teleports in the Ancient Spellbook",
position = 8 position = 9
) )
default boolean ancientTeleportIcon() default boolean ancientTeleportIcon()
{ {
@@ -124,7 +135,7 @@ public interface WorldMapConfig extends Config
keyName = WorldMapPlugin.CONFIG_KEY_LUNAR_TELEPORT_ICON, keyName = WorldMapPlugin.CONFIG_KEY_LUNAR_TELEPORT_ICON,
name = "Show Lunar Spellbook destinations", name = "Show Lunar Spellbook destinations",
description = "Show icons at the destinations for teleports in the Lunar Spellbook", description = "Show icons at the destinations for teleports in the Lunar Spellbook",
position = 9 position = 10
) )
default boolean lunarTeleportIcon() default boolean lunarTeleportIcon()
{ {
@@ -135,7 +146,7 @@ public interface WorldMapConfig extends Config
keyName = WorldMapPlugin.CONFIG_KEY_ARCEUUS_TELEPORT_ICON, keyName = WorldMapPlugin.CONFIG_KEY_ARCEUUS_TELEPORT_ICON,
name = "Show Arceuus Spellbook destinations", name = "Show Arceuus Spellbook destinations",
description = "Show icons at the destinations for teleports in the Arceuus Spellbook", description = "Show icons at the destinations for teleports in the Arceuus Spellbook",
position = 10 position = 11
) )
default boolean arceuusTeleportIcon() default boolean arceuusTeleportIcon()
{ {
@@ -146,7 +157,7 @@ public interface WorldMapConfig extends Config
keyName = WorldMapPlugin.CONFIG_KEY_JEWELLERY_TELEPORT_ICON, keyName = WorldMapPlugin.CONFIG_KEY_JEWELLERY_TELEPORT_ICON,
name = "Show jewellery teleport locations", name = "Show jewellery teleport locations",
description = "Show icons at the destinations for teleports from jewellery", description = "Show icons at the destinations for teleports from jewellery",
position = 11 position = 12
) )
default boolean jewelleryTeleportIcon() default boolean jewelleryTeleportIcon()
{ {
@@ -157,7 +168,7 @@ public interface WorldMapConfig extends Config
keyName = WorldMapPlugin.CONFIG_KEY_SCROLL_TELEPORT_ICON, keyName = WorldMapPlugin.CONFIG_KEY_SCROLL_TELEPORT_ICON,
name = "Show teleport scroll locations", name = "Show teleport scroll locations",
description = "Show icons at the destinations for teleports from scrolls", description = "Show icons at the destinations for teleports from scrolls",
position = 12 position = 13
) )
default boolean scrollTeleportIcon() default boolean scrollTeleportIcon()
{ {
@@ -168,7 +179,7 @@ public interface WorldMapConfig extends Config
keyName = WorldMapPlugin.CONFIG_KEY_MISC_TELEPORT_ICON, keyName = WorldMapPlugin.CONFIG_KEY_MISC_TELEPORT_ICON,
name = "Show misc teleport locations", name = "Show misc teleport locations",
description = "Show icons at the destinations for miscellaneous teleport items", description = "Show icons at the destinations for miscellaneous teleport items",
position = 13 position = 14
) )
default boolean miscellaneousTeleportIcon() default boolean miscellaneousTeleportIcon()
{ {
@@ -179,7 +190,7 @@ public interface WorldMapConfig extends Config
keyName = WorldMapPlugin.CONFIG_KEY_QUEST_START_TOOLTIPS, keyName = WorldMapPlugin.CONFIG_KEY_QUEST_START_TOOLTIPS,
name = "Show quest names and status", name = "Show quest names and status",
description = "Indicates the names of quests and shows completion status", description = "Indicates the names of quests and shows completion status",
position = 14 position = 15
) )
default boolean questStartTooltips() default boolean questStartTooltips()
{ {
@@ -190,7 +201,7 @@ public interface WorldMapConfig extends Config
keyName = WorldMapPlugin.CONFIG_KEY_FARMING_PATCH_TOOLTIPS, keyName = WorldMapPlugin.CONFIG_KEY_FARMING_PATCH_TOOLTIPS,
name = "Show farming patch type", name = "Show farming patch type",
description = "Display the type of farming patches in the icon tooltip", description = "Display the type of farming patches in the icon tooltip",
position = 15 position = 16
) )
default boolean farmingPatchTooltips() default boolean farmingPatchTooltips()
{ {
@@ -201,7 +212,7 @@ public interface WorldMapConfig extends Config
keyName = WorldMapPlugin.CONFIG_KEY_RARE_TREE_TOOLTIPS, keyName = WorldMapPlugin.CONFIG_KEY_RARE_TREE_TOOLTIPS,
name = "Show rare tree type", name = "Show rare tree type",
description = "Display the type of rare tree in the icon tooltip", description = "Display the type of rare tree in the icon tooltip",
position = 16 position = 17
) )
default boolean rareTreeTooltips() default boolean rareTreeTooltips()
{ {
@@ -212,7 +223,7 @@ public interface WorldMapConfig extends Config
keyName = WorldMapPlugin.CONFIG_KEY_RARE_TREE_LEVEL_ICON, keyName = WorldMapPlugin.CONFIG_KEY_RARE_TREE_LEVEL_ICON,
name = "Indicate unavailable trees", name = "Indicate unavailable trees",
description = "Indicate rare trees you do not have the level to cut on the icon", description = "Indicate rare trees you do not have the level to cut on the icon",
position = 17 position = 18
) )
default boolean rareTreeLevelIcon() default boolean rareTreeLevelIcon()
{ {
@@ -223,7 +234,7 @@ public interface WorldMapConfig extends Config
keyName = WorldMapPlugin.CONFIG_KEY_TRANSPORATION_TELEPORT_TOOLTIPS, keyName = WorldMapPlugin.CONFIG_KEY_TRANSPORATION_TELEPORT_TOOLTIPS,
name = "Show transporation tooltips", name = "Show transporation tooltips",
description = "Indicates types and destinations of Transporation", description = "Indicates types and destinations of Transporation",
position = 18 position = 19
) )
default boolean transportationTeleportTooltips() default boolean transportationTeleportTooltips()
{ {
@@ -234,7 +245,7 @@ public interface WorldMapConfig extends Config
keyName = WorldMapPlugin.CONFIG_KEY_RUNECRAFTING_ALTAR_ICON, keyName = WorldMapPlugin.CONFIG_KEY_RUNECRAFTING_ALTAR_ICON,
name = "Show runecrafting altar locations", name = "Show runecrafting altar locations",
description = "Show the icons of runecrafting altars", description = "Show the icons of runecrafting altars",
position = 19 position = 20
) )
default boolean runecraftingAltarIcon() default boolean runecraftingAltarIcon()
{ {
@@ -245,7 +256,7 @@ public interface WorldMapConfig extends Config
keyName = WorldMapPlugin.CONFIG_KEY_MINING_SITE_TOOLTIPS, keyName = WorldMapPlugin.CONFIG_KEY_MINING_SITE_TOOLTIPS,
name = "Show mining site tooltips", name = "Show mining site tooltips",
description = "Indicates the ore available at mining sites", description = "Indicates the ore available at mining sites",
position = 20 position = 21
) )
default boolean miningSiteTooltips() default boolean miningSiteTooltips()
{ {
@@ -256,7 +267,7 @@ public interface WorldMapConfig extends Config
keyName = WorldMapPlugin.CONFIG_KEY_DUNGEON_TOOLTIPS, keyName = WorldMapPlugin.CONFIG_KEY_DUNGEON_TOOLTIPS,
name = "Show dungeon tooltips", name = "Show dungeon tooltips",
description = "Indicates the names of dungeons", description = "Indicates the names of dungeons",
position = 21 position = 22
) )
default boolean dungeonTooltips() default boolean dungeonTooltips()
{ {
@@ -267,7 +278,7 @@ public interface WorldMapConfig extends Config
keyName = WorldMapPlugin.CONFIG_KEY_HUNTER_AREA_TOOLTIPS, keyName = WorldMapPlugin.CONFIG_KEY_HUNTER_AREA_TOOLTIPS,
name = "Show hunter area tooltips", name = "Show hunter area tooltips",
description = "Indicates the creatures inside a hunting area", description = "Indicates the creatures inside a hunting area",
position = 22 position = 23
) )
default boolean hunterAreaTooltips() default boolean hunterAreaTooltips()
{ {
@@ -278,7 +289,7 @@ public interface WorldMapConfig extends Config
keyName = WorldMapPlugin.CONFIG_KEY_FISHING_SPOT_TOOLTIPS, keyName = WorldMapPlugin.CONFIG_KEY_FISHING_SPOT_TOOLTIPS,
name = "Show fishing spot tooltips", name = "Show fishing spot tooltips",
description = "Indicates the type of fish fishable at the fishing spot", description = "Indicates the type of fish fishable at the fishing spot",
position = 23 position = 24
) )
default boolean fishingSpotTooltips() default boolean fishingSpotTooltips()
{ {

View File

@@ -61,6 +61,7 @@ public class WorldMapPlugin extends Plugin
private static final BufferedImage STARTED_ICON; private static final BufferedImage STARTED_ICON;
private static final BufferedImage FINISHED_ICON; private static final BufferedImage FINISHED_ICON;
private static final BufferedImage MINING_SITE_ICON; private static final BufferedImage MINING_SITE_ICON;
private static final BufferedImage ROOFTOP_COURSE_ICON;
static final String CONFIG_KEY = "worldmap"; static final String CONFIG_KEY = "worldmap";
static final String CONFIG_KEY_FAIRY_RING_TOOLTIPS = "fairyRingTooltips"; static final String CONFIG_KEY_FAIRY_RING_TOOLTIPS = "fairyRingTooltips";
@@ -68,6 +69,7 @@ public class WorldMapPlugin extends Plugin
static final String CONFIG_KEY_AGILITY_SHORTCUT_TOOLTIPS = "agilityShortcutTooltips"; static final String CONFIG_KEY_AGILITY_SHORTCUT_TOOLTIPS = "agilityShortcutTooltips";
static final String CONFIG_KEY_AGILITY_SHORTCUT_LEVEL_ICON = "agilityShortcutIcon"; static final String CONFIG_KEY_AGILITY_SHORTCUT_LEVEL_ICON = "agilityShortcutIcon";
static final String CONFIG_KEY_AGILITY_COURSE_TOOLTIPS = "agilityCourseTooltips"; static final String CONFIG_KEY_AGILITY_COURSE_TOOLTIPS = "agilityCourseTooltips";
static final String CONFIG_KEY_AGILITY_COURSE_ROOFTOP_ICON = "agilityCourseRooftopIcon";
static final String CONFIG_KEY_NORMAL_TELEPORT_ICON = "standardSpellbookIcon"; static final String CONFIG_KEY_NORMAL_TELEPORT_ICON = "standardSpellbookIcon";
static final String CONFIG_KEY_ANCIENT_TELEPORT_ICON = "ancientSpellbookIcon"; static final String CONFIG_KEY_ANCIENT_TELEPORT_ICON = "ancientSpellbookIcon";
static final String CONFIG_KEY_LUNAR_TELEPORT_ICON = "lunarSpellbookIcon"; static final String CONFIG_KEY_LUNAR_TELEPORT_ICON = "lunarSpellbookIcon";
@@ -120,6 +122,10 @@ public class WorldMapPlugin extends Plugin
MINING_SITE_ICON = new BufferedImage(iconBufferSize, iconBufferSize, BufferedImage.TYPE_INT_ARGB); MINING_SITE_ICON = new BufferedImage(iconBufferSize, iconBufferSize, BufferedImage.TYPE_INT_ARGB);
final BufferedImage miningSiteIcon = ImageUtil.getResourceStreamFromClass(WorldMapPlugin.class, "mining_site_icon.png"); final BufferedImage miningSiteIcon = ImageUtil.getResourceStreamFromClass(WorldMapPlugin.class, "mining_site_icon.png");
MINING_SITE_ICON.getGraphics().drawImage(miningSiteIcon, 1, 1, null); MINING_SITE_ICON.getGraphics().drawImage(miningSiteIcon, 1, 1, null);
ROOFTOP_COURSE_ICON = new BufferedImage(iconBufferSize, iconBufferSize, BufferedImage.TYPE_INT_ARGB);
final BufferedImage rooftopCourseIcon = ImageUtil.getResourceStreamFromClass(WorldMapPlugin.class, "rooftop_course_icon.png");
ROOFTOP_COURSE_ICON.getGraphics().drawImage(rooftopCourseIcon, 1, 1, null);
} }
@Inject @Inject
@@ -239,12 +245,12 @@ public class WorldMapPlugin extends Plugin
{ {
worldMapPointManager.removeIf(AgilityCoursePoint.class::isInstance); worldMapPointManager.removeIf(AgilityCoursePoint.class::isInstance);
if (config.agilityCourseTooltip()) 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(value -> new AgilityCoursePoint(value,
BLANK_ICON, config.agilityCourseRooftop() && value.isRooftopCourse() ? ROOFTOP_COURSE_ICON : BLANK_ICON,
config.agilityCourseTooltip())) config.agilityCourseTooltip()))
.forEach(worldMapPointManager::add); .forEach(worldMapPointManager::add);
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 287 B