agility: Add config for Sepulchre obstacles and skill obstacles

This commit moves Sepulchre obstacle IDs into a separate set so their
highlighting can be toggled separately. It also adds a toggle to
highlight Sepulchre skill obstacles.
This commit is contained in:
Broooklyn
2020-06-15 13:47:54 -04:00
committed by Jordan Atwood
parent 31d76e0530
commit 8b20626a3b
4 changed files with 45 additions and 10 deletions

View File

@@ -225,7 +225,7 @@ public interface AgilityConfig extends Config
keyName = "highlightSepulchreNpcs", keyName = "highlightSepulchreNpcs",
name = "Highlight Sepulchre Projectiles", name = "Highlight Sepulchre Projectiles",
description = "Highlights arrows and swords in the Sepulchre", description = "Highlights arrows and swords in the Sepulchre",
position = 15 position = 17
) )
default boolean highlightSepulchreNpcs() default boolean highlightSepulchreNpcs()
{ {
@@ -236,10 +236,32 @@ public interface AgilityConfig extends Config
keyName = "sepulchreHighlightColor", keyName = "sepulchreHighlightColor",
name = "Sepulchre Highlight", name = "Sepulchre Highlight",
description = "Overlay color for arrows and swords", description = "Overlay color for arrows and swords",
position = 16 position = 18
) )
default Color sepulchreHighlightColor() default Color sepulchreHighlightColor()
{ {
return Color.GREEN; return Color.GREEN;
} }
@ConfigItem(
keyName = "highlightSepulchreObstacles",
name = "Highlight Sepulchre Obstacles",
description = "Highlights pillars and stairs in the Sepulchre",
position = 19
)
default boolean highlightSepulchreObstacles()
{
return true;
}
@ConfigItem(
keyName = "highlightSepulchreSkilling",
name = "Highlight Sepulchre Skill Challenges",
description = "Highlights skilling challenges in the Sepulchre",
position = 20
)
default boolean highlightSepulchreSkilling()
{
return true;
}
} }

View File

@@ -78,7 +78,9 @@ class AgilityOverlay extends Overlay
{ {
if (Obstacles.SHORTCUT_OBSTACLE_IDS.containsKey(object.getId()) && !config.highlightShortcuts() || if (Obstacles.SHORTCUT_OBSTACLE_IDS.containsKey(object.getId()) && !config.highlightShortcuts() ||
Obstacles.TRAP_OBSTACLE_IDS.contains(object.getId()) && !config.showTrapOverlay() || Obstacles.TRAP_OBSTACLE_IDS.contains(object.getId()) && !config.showTrapOverlay() ||
Obstacles.COURSE_OBSTACLE_IDS.contains(object.getId()) && !config.showClickboxes()) Obstacles.COURSE_OBSTACLE_IDS.contains(object.getId()) && !config.showClickboxes() ||
Obstacles.SEPULCHRE_OBSTACLE_IDS.contains(object.getId()) && !config.highlightSepulchreObstacles() ||
Obstacles.SEPULCHRE_SKILL_OBSTACLE_IDS.contains(object.getId()) && !config.highlightSepulchreSkilling())
{ {
return; return;
} }

View File

@@ -438,7 +438,9 @@ public class AgilityPlugin extends Plugin
if (Obstacles.COURSE_OBSTACLE_IDS.contains(newObject.getId()) || if (Obstacles.COURSE_OBSTACLE_IDS.contains(newObject.getId()) ||
Obstacles.PORTAL_OBSTACLE_IDS.contains(newObject.getId()) || Obstacles.PORTAL_OBSTACLE_IDS.contains(newObject.getId()) ||
(Obstacles.TRAP_OBSTACLE_IDS.contains(newObject.getId()) (Obstacles.TRAP_OBSTACLE_IDS.contains(newObject.getId())
&& Obstacles.TRAP_OBSTACLE_REGIONS.contains(newObject.getWorldLocation().getRegionID()))) && Obstacles.TRAP_OBSTACLE_REGIONS.contains(newObject.getWorldLocation().getRegionID())) ||
Obstacles.SEPULCHRE_OBSTACLE_IDS.contains(newObject.getId()) ||
Obstacles.SEPULCHRE_SKILL_OBSTACLE_IDS.contains(newObject.getId()))
{ {
obstacles.put(newObject, new Obstacle(tile, null)); obstacles.put(newObject, new Obstacle(tile, null));
} }

View File

@@ -95,12 +95,7 @@ class Obstacles
ZIP_LINE_11645, ZIP_LINE_11646, ZIP_LINE_11645, ZIP_LINE_11646,
// Prifddinas // Prifddinas
LADDER_36221, TIGHTROPE_36225, CHIMNEY_36227, ROOF_EDGE, DARK_HOLE_36229, LADDER_36231, LADDER_36232, LADDER_36221, TIGHTROPE_36225, CHIMNEY_36227, ROOF_EDGE, DARK_HOLE_36229, LADDER_36231, LADDER_36232,
ROPE_BRIDGE_36233, TIGHTROPE_36234, ROPE_BRIDGE_36235, TIGHTROPE_36236, TIGHTROPE_36237, DARK_HOLE_36238, ROPE_BRIDGE_36233, TIGHTROPE_36234, ROPE_BRIDGE_36235, TIGHTROPE_36236, TIGHTROPE_36237, DARK_HOLE_36238
// Hallowed Sepulchre
GATE_38460, PLATFORM_38455, PLATFORM_38456, PLATFORM_38457, PLATFORM_38458, PLATFORM_38459,
PLATFORM_38470, PLATFORM_38477, STAIRS_38462, STAIRS_38463, STAIRS_38464, STAIRS_38465,
STAIRS_38466, STAIRS_38467, STAIRS_38468, STAIRS_38469, STAIRS_38471, STAIRS_38472,
STAIRS_38473, STAIRS_38474, STAIRS_38475, STAIRS_38476
); );
static final Set<Integer> PORTAL_OBSTACLE_IDS = ImmutableSet.of( static final Set<Integer> PORTAL_OBSTACLE_IDS = ImmutableSet.of(
@@ -129,4 +124,18 @@ class Obstacles
} }
SHORTCUT_OBSTACLE_IDS = builder.build(); SHORTCUT_OBSTACLE_IDS = builder.build();
} }
static final Set<Integer> SEPULCHRE_OBSTACLE_IDS = ImmutableSet.of(
// Stairs and Platforms (and one Gate)
GATE_38460, PLATFORM_38455, PLATFORM_38456, PLATFORM_38457, PLATFORM_38458, PLATFORM_38459,
PLATFORM_38470, PLATFORM_38477, STAIRS_38462, STAIRS_38463, STAIRS_38464, STAIRS_38465,
STAIRS_38466, STAIRS_38467, STAIRS_38468, STAIRS_38469, STAIRS_38471, STAIRS_38472,
STAIRS_38473, STAIRS_38474, STAIRS_38475, STAIRS_38476
);
static final Set<Integer> SEPULCHRE_SKILL_OBSTACLE_IDS = ImmutableSet.of(
// Grapple, Portal, and Bridge skill obstacles
// They are multilocs, thus we use the NullObjectID
NULL_39524, NULL_39525, NULL_39526, NULL_39527, NULL_39528, NULL_39533
);
} }