Merge pull request #89 from daviscook477/slayer-highlight-superiors
Slayer highlight superiors
This commit is contained in:
@@ -33,6 +33,7 @@ import net.runelite.client.config.ConfigItem;
|
|||||||
@ConfigGroup("slayer")
|
@ConfigGroup("slayer")
|
||||||
public interface SlayerConfig extends Config
|
public interface SlayerConfig extends Config
|
||||||
{
|
{
|
||||||
|
|
||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
position = 1,
|
position = 1,
|
||||||
keyName = "infobox",
|
keyName = "infobox",
|
||||||
@@ -101,6 +102,17 @@ public interface SlayerConfig extends Config
|
|||||||
|
|
||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
position = 7,
|
position = 7,
|
||||||
|
keyName = "superiorColor",
|
||||||
|
name = "Superior Color",
|
||||||
|
description = "Color of the highlighted superior slayer creatures"
|
||||||
|
)
|
||||||
|
default Color getSuperiorColor()
|
||||||
|
{
|
||||||
|
return Color.MAGENTA;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ConfigItem(
|
||||||
|
position = 8,
|
||||||
keyName = "weaknessPrompt",
|
keyName = "weaknessPrompt",
|
||||||
name = "Show Monster Weakness",
|
name = "Show Monster Weakness",
|
||||||
description = "Show an overlay on a monster when it is weak enough to finish off (Only Lizards, Gargoyles & Rockslugs)"
|
description = "Show an overlay on a monster when it is weak enough to finish off (Only Lizards, Gargoyles & Rockslugs)"
|
||||||
|
|||||||
@@ -133,6 +133,33 @@ public class SlayerPlugin extends Plugin
|
|||||||
private static final Pattern TASK_STRING_VALIDATION = Pattern.compile("[^a-zA-Z0-9' -]");
|
private static final Pattern TASK_STRING_VALIDATION = Pattern.compile("[^a-zA-Z0-9' -]");
|
||||||
private static final int TASK_STRING_MAX_LENGTH = 50;
|
private static final int TASK_STRING_MAX_LENGTH = 50;
|
||||||
|
|
||||||
|
// Superiors
|
||||||
|
@VisibleForTesting
|
||||||
|
static List<String> SUPERIOR_SLAYER_MONSTERS = Arrays.asList(
|
||||||
|
"crushing hand",
|
||||||
|
"chasm crawler",
|
||||||
|
"screaming banshee",
|
||||||
|
"screaming twisted banshee",
|
||||||
|
"giant rockslug",
|
||||||
|
"cockathrice",
|
||||||
|
"flaming pyrelord",
|
||||||
|
"monstrous basilisk",
|
||||||
|
"malevolent mage",
|
||||||
|
"insatiable bloodveld",
|
||||||
|
"insatiable mutated bloodveld",
|
||||||
|
"vitreous jelly",
|
||||||
|
"vitreous warped jelly",
|
||||||
|
"cave abomination",
|
||||||
|
"abhorrent spectre",
|
||||||
|
"repugnant spectre",
|
||||||
|
"choke devil",
|
||||||
|
"king kurask",
|
||||||
|
"marble gargoyle",
|
||||||
|
"nechryarch",
|
||||||
|
"greater abyssal demon",
|
||||||
|
"night beast",
|
||||||
|
"nuclear smoke devil");
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private ClientToolbar clientToolbar;
|
private ClientToolbar clientToolbar;
|
||||||
|
|
||||||
@@ -575,6 +602,11 @@ public class SlayerPlugin extends Plugin
|
|||||||
cachedXp = slayerExp;
|
cachedXp = slayerExp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
boolean isSuperior(String name)
|
||||||
|
{
|
||||||
|
return SUPERIOR_SLAYER_MONSTERS.contains(name.toLowerCase());
|
||||||
|
}
|
||||||
|
|
||||||
@Subscribe
|
@Subscribe
|
||||||
private void onConfigChanged(ConfigChanged event)
|
private void onConfigChanged(ConfigChanged event)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -63,7 +63,13 @@ public class TargetClickboxOverlay extends Overlay
|
|||||||
List<NPC> targets = plugin.getHighlightedTargets();
|
List<NPC> targets = plugin.getHighlightedTargets();
|
||||||
for (NPC target : targets)
|
for (NPC target : targets)
|
||||||
{
|
{
|
||||||
renderTargetOverlay(graphics, target, config.getTargetColor());
|
Color coloration = config.getTargetColor();
|
||||||
|
if (plugin.isSuperior(target.getName()))
|
||||||
|
{
|
||||||
|
coloration = config.getSuperiorColor();
|
||||||
|
}
|
||||||
|
|
||||||
|
renderTargetOverlay(graphics, target, coloration);
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@@ -561,4 +561,13 @@ public class SlayerPluginTest
|
|||||||
|
|
||||||
verify(chatMessageManager, never()).update(any(MessageNode.class));
|
verify(chatMessageManager, never()).update(any(MessageNode.class));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testSuperiorsLowercase()
|
||||||
|
{
|
||||||
|
for (String name : SlayerPlugin.SUPERIOR_SLAYER_MONSTERS)
|
||||||
|
{
|
||||||
|
assertEquals(name, name.toLowerCase());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user