npc aggro timer: Add option to hide hint overlay (#8610)

Closes #8589
This commit is contained in:
BrianAllred
2019-04-24 07:42:52 -05:00
committed by Tomas Slusny
parent 50518ebe72
commit 1242a508bc
2 changed files with 15 additions and 2 deletions

View File

@@ -92,4 +92,15 @@ public interface NpcAggroAreaConfig extends Config
{
return Color.YELLOW;
}
@ConfigItem(
keyName = "npcUnaggroShowNotWorkingOverlay",
name = "Hide overlay hint",
description = "Hide overlay hint if plugin is enabled in unsupported area",
position = 6
)
default boolean hideOverlayHint()
{
return false;
}
}

View File

@@ -36,12 +36,14 @@ import net.runelite.client.ui.overlay.components.PanelComponent;
class NpcAggroAreaNotWorkingOverlay extends Overlay
{
private final NpcAggroAreaPlugin plugin;
private final NpcAggroAreaConfig config;
private final PanelComponent panelComponent;
@Inject
private NpcAggroAreaNotWorkingOverlay(NpcAggroAreaPlugin plugin)
private NpcAggroAreaNotWorkingOverlay(NpcAggroAreaPlugin plugin, NpcAggroAreaConfig config)
{
this.plugin = plugin;
this.config = config;
panelComponent = new PanelComponent();
panelComponent.setPreferredSize(new Dimension(150, 0));
@@ -56,7 +58,7 @@ class NpcAggroAreaNotWorkingOverlay extends Overlay
@Override
public Dimension render(Graphics2D graphics)
{
if (!plugin.isActive() || plugin.getSafeCenters()[1] != null)
if (!plugin.isActive() || plugin.getSafeCenters()[1] != null || config.hideOverlayHint())
{
return null;
}