Merge pull request #11645 from abextm/npcaggro-colorconfig

This commit is contained in:
Jordan
2020-05-25 16:54:07 -07:00
committed by GitHub
2 changed files with 22 additions and 12 deletions

View File

@@ -25,6 +25,7 @@
package net.runelite.client.plugins.npcunaggroarea; package net.runelite.client.plugins.npcunaggroarea;
import java.awt.Color; import java.awt.Color;
import net.runelite.client.config.Alpha;
import net.runelite.client.config.Config; import net.runelite.client.config.Config;
import net.runelite.client.config.ConfigGroup; import net.runelite.client.config.ConfigGroup;
import net.runelite.client.config.ConfigItem; import net.runelite.client.config.ConfigItem;
@@ -83,21 +84,34 @@ public interface NpcAggroAreaConfig extends Config
} }
@ConfigItem( @ConfigItem(
keyName = "npcUnaggroAreaColor", keyName = "npcAggroAreaColor",
name = "Area lines colour", name = "Aggressive colour",
description = "Choose colour to use for marking NPC unaggressive area", description = "Choose colour to use for marking NPC unaggressive area when NPCs are aggressive",
position = 5 position = 5
) )
@Alpha
default Color aggroAreaColor() default Color aggroAreaColor()
{ {
return Color.YELLOW; return new Color(0x64FFFF00, true);
}
@ConfigItem(
keyName = "npcUnaggroAreaColor",
name = "Unaggressive colour",
description = "Choose colour to use for marking NPC unaggressive area after NPCs have lost aggression",
position = 6
)
@Alpha
default Color unaggroAreaColor()
{
return new Color(0xFFFF00);
} }
@ConfigItem( @ConfigItem(
keyName = "notifyExpire", keyName = "notifyExpire",
name = "Notify Expiration", name = "Notify Expiration",
description = "Send a notifcation when the unaggressive timer expires", description = "Send a notifcation when the unaggressive timer expires",
position = 6 position = 7
) )
default boolean notifyExpire() default boolean notifyExpire()
{ {

View File

@@ -76,15 +76,11 @@ class NpcAggroAreaOverlay extends Overlay
return null; return null;
} }
Color outlineColor = config.aggroAreaColor(); Color outlineColor = config.unaggroAreaColor();
AggressionTimer timer = plugin.getCurrentTimer(); AggressionTimer timer = plugin.getCurrentTimer();
if (timer == null || Instant.now().compareTo(timer.getEndTime()) < 0) if (outlineColor == null || timer == null || Instant.now().compareTo(timer.getEndTime()) < 0)
{ {
outlineColor = new Color( outlineColor = config.aggroAreaColor();
outlineColor.getRed(),
outlineColor.getGreen(),
outlineColor.getBlue(),
100);
} }
renderPath(graphics, lines, outlineColor); renderPath(graphics, lines, outlineColor);