Remove notification settings from NMZ

Remove notification settings from NMZ that are now contained in
RuneLiteConfig.

Signed-off-by: Tomas Slusny <slusnucky@gmail.com>
This commit is contained in:
Tomas Slusny
2018-02-28 10:55:35 +01:00
parent 5f0f0c6836
commit a386dab3f2
2 changed files with 11 additions and 49 deletions

View File

@@ -37,23 +37,12 @@ import net.runelite.client.config.ConfigItem;
public interface NightmareZoneConfig extends Config public interface NightmareZoneConfig extends Config
{ {
@ConfigItem( @ConfigItem(
keyName = "tray", keyName = "moveoverlay",
name = "Send Tray Notification", name = "Override NMZ overlay",
description = "Toggles tray notifications", description = "Overrides the overlay so it doesn't conflict with other RuneLite plugins",
position = 1 position = 1
) )
default boolean sendTrayNotification() default boolean moveOverlay()
{
return true;
}
@ConfigItem(
keyName = "request",
name = "Request Window Focus",
description = "Toggles window focus request",
position = 2
)
default boolean requestFocus()
{ {
return true; return true;
} }
@@ -62,29 +51,18 @@ public interface NightmareZoneConfig extends Config
keyName = "overloadnotification", keyName = "overloadnotification",
name = "Overload notification", name = "Overload notification",
description = "Toggles notifications when your overload runs out", description = "Toggles notifications when your overload runs out",
position = 3 position = 2
) )
default boolean overloadNotification() default boolean overloadNotification()
{ {
return true; return true;
} }
@ConfigItem(
keyName = "moveoverlay",
name = "Override NMZ overlay",
description = "Overrides the overlay so it doesn't conflict with other RuneLite plugins",
position = 4
)
default boolean moveOverlay()
{
return true;
}
@ConfigItem( @ConfigItem(
keyName = "absorptionnotification", keyName = "absorptionnotification",
name = "Absorption notification", name = "Absorption notification",
description = "Toggles notifications when your absorption points gets below your threshold", description = "Toggles notifications when your absorption points gets below your threshold",
position = 5 position = 3
) )
default boolean absorptionNotification() default boolean absorptionNotification()
{ {
@@ -95,7 +73,7 @@ public interface NightmareZoneConfig extends Config
keyName = "absorptionthreshold", keyName = "absorptionthreshold",
name = "Absorption Threshold", name = "Absorption Threshold",
description = "The amount of absorption points to send a notification at", description = "The amount of absorption points to send a notification at",
position = 6 position = 4
) )
default int absorptionThreshold() default int absorptionThreshold()
{ {
@@ -106,7 +84,7 @@ public interface NightmareZoneConfig extends Config
keyName = "absorptioncoloroverthreshold", keyName = "absorptioncoloroverthreshold",
name = "Color above threshold", name = "Color above threshold",
description = "Configures the color for the absorption widget when above the threshold", description = "Configures the color for the absorption widget when above the threshold",
position = 7 position = 5
) )
default Color absorptionColorAboveThreshold() default Color absorptionColorAboveThreshold()
{ {
@@ -117,7 +95,7 @@ public interface NightmareZoneConfig extends Config
keyName = "absorptioncolorbelowthreshold", keyName = "absorptioncolorbelowthreshold",
name = "Color below threshold", name = "Color below threshold",
description = "Configures the color for the absorption widget when below the threshold", description = "Configures the color for the absorption widget when below the threshold",
position = 8 position = 6
) )
default Color absorptionColorBelowThreshold() default Color absorptionColorBelowThreshold()
{ {

View File

@@ -38,7 +38,6 @@ import net.runelite.client.Notifier;
import net.runelite.client.config.ConfigManager; import net.runelite.client.config.ConfigManager;
import net.runelite.client.plugins.Plugin; import net.runelite.client.plugins.Plugin;
import net.runelite.client.plugins.PluginDescriptor; import net.runelite.client.plugins.PluginDescriptor;
import net.runelite.client.ui.ClientUI;
import net.runelite.client.ui.overlay.Overlay; import net.runelite.client.ui.overlay.Overlay;
@PluginDescriptor( @PluginDescriptor(
@@ -51,9 +50,6 @@ public class NightmareZonePlugin extends Plugin
@Inject @Inject
private Notifier notifier; private Notifier notifier;
@Inject
private ClientUI gui;
@Inject @Inject
private Client client; private Client client;
@@ -117,7 +113,7 @@ public class NightmareZonePlugin extends Plugin
String msg = event.getMessage().replaceAll("<[^>]*>", " "); //remove color and linebreaks String msg = event.getMessage().replaceAll("<[^>]*>", " "); //remove color and linebreaks
if (msg.contains("The effects of overload have worn off, and you feel normal again.")) if (msg.contains("The effects of overload have worn off, and you feel normal again."))
{ {
sendNotification("Your overload has worn off"); notifier.notify("Your overload has worn off");
} }
} }
@@ -129,7 +125,7 @@ public class NightmareZonePlugin extends Plugin
{ {
if (absorptionPoints < config.absorptionThreshold()) if (absorptionPoints < config.absorptionThreshold())
{ {
sendNotification("Absorption points below: " + config.absorptionThreshold()); notifier.notify("Absorption points below: " + config.absorptionThreshold());
absorptionNotificationSend = true; absorptionNotificationSend = true;
} }
} }
@@ -146,16 +142,4 @@ public class NightmareZonePlugin extends Plugin
{ {
return Arrays.equals(client.getMapRegions(), NMZ_MAP_REGION); return Arrays.equals(client.getMapRegions(), NMZ_MAP_REGION);
} }
private void sendNotification(String message)
{
if (!gui.isFocused() && config.requestFocus())
{
gui.requestFocus();
}
if (config.sendTrayNotification())
{
notifier.notify(message);
}
}
} }