npc aggro timer: Add option to hide hint overlay (#46)
This commit is contained in:
@@ -37,6 +37,7 @@ public interface NpcAggroAreaConfig extends Config
|
||||
String CONFIG_CENTER2 = "center2";
|
||||
String CONFIG_LOCATION = "location";
|
||||
String CONFIG_DURATION = "duration";
|
||||
String CONFIG_NOT_WORKING_OVERLAY = "overlay";
|
||||
|
||||
@ConfigItem(
|
||||
keyName = "npcUnaggroAlwaysActive",
|
||||
@@ -92,4 +93,15 @@ public interface NpcAggroAreaConfig extends Config
|
||||
{
|
||||
return Color.YELLOW;
|
||||
}
|
||||
|
||||
@ConfigItem(
|
||||
keyName = "npcUnaggroShowNotWorkingOverlay",
|
||||
name = "Show not working hint",
|
||||
description = "Show hint if plugin is enabled in unsupported area",
|
||||
position = 6
|
||||
)
|
||||
default boolean showNotWorkingOverlay()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -128,6 +128,7 @@ public class NpcAggroAreaPlugin extends Plugin
|
||||
private WorldPoint previousUnknownCenter;
|
||||
private boolean loggingIn;
|
||||
private List<String> npcNamePatterns;
|
||||
private boolean notWorkingOverlayShown = false;
|
||||
|
||||
@Provides
|
||||
NpcAggroAreaConfig provideConfig(ConfigManager configManager)
|
||||
@@ -139,7 +140,12 @@ public class NpcAggroAreaPlugin extends Plugin
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
overlayManager.add(overlay);
|
||||
overlayManager.add(notWorkingOverlay);
|
||||
if (config.showNotWorkingOverlay())
|
||||
{
|
||||
overlayManager.add(notWorkingOverlay);
|
||||
notWorkingOverlayShown = true;
|
||||
}
|
||||
|
||||
npcNamePatterns = NAME_SPLITTER.splitToList(config.npcNamePatterns());
|
||||
recheckActive();
|
||||
}
|
||||
@@ -149,7 +155,11 @@ public class NpcAggroAreaPlugin extends Plugin
|
||||
{
|
||||
removeTimer();
|
||||
overlayManager.remove(overlay);
|
||||
overlayManager.remove(notWorkingOverlay);
|
||||
if (notWorkingOverlayShown)
|
||||
{
|
||||
overlayManager.remove(notWorkingOverlay);
|
||||
}
|
||||
|
||||
Arrays.fill(safeCenters, null);
|
||||
lastPlayerLocation = null;
|
||||
currentTimer = null;
|
||||
@@ -406,6 +416,7 @@ public class NpcAggroAreaPlugin extends Plugin
|
||||
configManager.unsetConfiguration(NpcAggroAreaConfig.CONFIG_GROUP, NpcAggroAreaConfig.CONFIG_CENTER2);
|
||||
configManager.unsetConfiguration(NpcAggroAreaConfig.CONFIG_GROUP, NpcAggroAreaConfig.CONFIG_LOCATION);
|
||||
configManager.unsetConfiguration(NpcAggroAreaConfig.CONFIG_GROUP, NpcAggroAreaConfig.CONFIG_DURATION);
|
||||
configManager.unsetConfiguration(NpcAggroAreaConfig.CONFIG_GROUP, NpcAggroAreaConfig.CONFIG_NOT_WORKING_OVERLAY);
|
||||
}
|
||||
|
||||
private void saveConfig()
|
||||
|
||||
Reference in New Issue
Block a user