Skip to content

Commit

Permalink
Add Agility shortcut highlight toggle
Browse files Browse the repository at this point in the history
  • Loading branch information
BFGD committed Apr 27, 2018
1 parent 9a1f744 commit dafd1d6
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,14 @@ default Color getMarkColor()
return Color.ORANGE;
}

@ConfigItem(
keyName = "highlightShortcuts",
name = "Highlight Agility Shortcuts",
description = "Enable/disable the highlighting of Agility shortcuts",
position = 6
)
default boolean highlightShortcuts()
{
return true;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ public Dimension render(Graphics2D graphics)
final Tile markOfGrace = plugin.getMarkOfGrace();
plugin.getObstacles().forEach((object, tile) ->
{
if (Obstacles.SHORTCUT_OBSTACLE_IDS.contains(object.getId()) && !config.highlightShortcuts())
{
return;
}

if (tile.getPlane() == client.getPlane()
&& object.getLocalLocation().distanceTo(playerLocation) < MAX_DISTANCE)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,13 @@ private void onTileObject(Tile tile, TileObject oldObject, TileObject newObject)
{
obstacles.remove(oldObject);

if (newObject != null && Obstacles.OBSTACLE_IDS.contains(newObject.getId()))
if (newObject == null)
{
return;
}

if (Obstacles.COURSE_OBSTACLE_IDS.contains(newObject.getId()) ||
Obstacles.SHORTCUT_OBSTACLE_IDS.contains(newObject.getId()))
{
obstacles.put(newObject, tile);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

public class Obstacles
{
public static final Set<Integer> OBSTACLE_IDS = Sets.newHashSet(
public static final Set<Integer> COURSE_OBSTACLE_IDS = Sets.newHashSet(
// Gnome
OBSTACLE_NET_23134, TREE_BRANCH_23559, TREE_BRANCH_23560, OBSTACLE_NET_23135, OBSTACLE_PIPE_23138,
OBSTACLE_PIPE_23139, LOG_BALANCE_23145, BALANCING_ROPE_23557,
Expand Down Expand Up @@ -73,10 +73,10 @@ public class Obstacles
// Rellaka
ROUGH_WALL_11391, GAP_11392, TIGHTROPE_11393, GAP_11395, GAP_11396, TIGHTROPE_11397, PILE_OF_FISH,
// Ardougne
GAP_11406, GAP_11429, GAP_11430, STEEP_ROOF, GAP_11630, PLANK_11631, WOODEN_BEAMS,

// Shortcuts
GAP_11406, GAP_11429, GAP_11430, STEEP_ROOF, GAP_11630, PLANK_11631, WOODEN_BEAMS
);

public static final Set<Integer> SHORTCUT_OBSTACLE_IDS = Sets.newHashSet(
// Grand Exchange
UNDERWALL_TUNNEL_16529, UNDERWALL_TUNNEL_16530,
// South Varrock
Expand Down

0 comments on commit dafd1d6

Please sign in to comment.