Remove duplicate options from IdleNotifier

Remove options that are now contained in RuneLiteConfig from idle
notifier.

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

View File

@@ -35,39 +35,6 @@ import net.runelite.client.config.ConfigItem;
)
public interface IdleNotifierConfig extends Config
{
@ConfigItem(
keyName = "tray",
name = "Send Tray Notification",
description = "Toggles tray notifications",
position = 2
)
default boolean sendTrayNotification()
{
return true;
}
@ConfigItem(
keyName = "focused",
name = "Notify When Focused",
description = "Toggles idle notifications for when the client is focused",
position = 3
)
default boolean alertWhenFocused()
{
return false;
}
@ConfigItem(
keyName = "request",
name = "Request Window Focus",
description = "Toggles window focus request",
position = 4
)
default boolean requestFocus()
{
return true;
}
@ConfigItem(
keyName = "timeout",
name = "Idle Timeout (ms)",

View File

@@ -25,6 +25,12 @@
*/
package net.runelite.client.plugins.idlenotifier;
import com.google.common.eventbus.Subscribe;
import com.google.inject.Provides;
import java.time.Duration;
import java.time.Instant;
import javax.inject.Inject;
import net.runelite.api.Actor;
import static net.runelite.api.AnimationID.COOKING_FIRE;
import static net.runelite.api.AnimationID.COOKING_RANGE;
import static net.runelite.api.AnimationID.CRAFTING_GLASSBLOWING;
@@ -90,12 +96,6 @@ import static net.runelite.api.AnimationID.WOODCUTTING_IRON;
import static net.runelite.api.AnimationID.WOODCUTTING_MITHRIL;
import static net.runelite.api.AnimationID.WOODCUTTING_RUNE;
import static net.runelite.api.AnimationID.WOODCUTTING_STEEL;
import com.google.common.eventbus.Subscribe;
import com.google.inject.Provides;
import java.time.Duration;
import java.time.Instant;
import javax.inject.Inject;
import net.runelite.api.Actor;
import net.runelite.api.Client;
import net.runelite.api.GameState;
import net.runelite.api.Player;
@@ -107,7 +107,6 @@ import net.runelite.client.Notifier;
import net.runelite.client.config.ConfigManager;
import net.runelite.client.plugins.Plugin;
import net.runelite.client.plugins.PluginDescriptor;
import net.runelite.client.ui.ClientUI;
@PluginDescriptor(
name = "Idle notifier"
@@ -120,9 +119,6 @@ public class IdleNotifierPlugin extends Plugin
@Inject
private Notifier notifier;
@Inject
private ClientUI gui;
@Inject
private Client client;
@@ -283,32 +279,32 @@ public class IdleNotifierPlugin extends Plugin
if (checkIdleLogout())
{
sendNotification("[" + local.getName() + "] is about to log out from idling too long!");
notifier.notify("[" + local.getName() + "] is about to log out from idling too long!");
}
if (check6hrLogout())
{
sendNotification("[" + local.getName() + "] is about to log out from being online for 6 hours!");
notifier.notify("[" + local.getName() + "] is about to log out from being online for 6 hours!");
}
if (checkAnimationIdle(waitDuration, local))
{
sendNotification("[" + local.getName() + "] is now idle!");
notifier.notify("[" + local.getName() + "] is now idle!");
}
if (checkOutOfCombat(waitDuration, local))
{
sendNotification("[" + local.getName() + "] is now out of combat!");
notifier.notify("[" + local.getName() + "] is now out of combat!");
}
if (checkLowHitpoints(waitDuration))
{
sendNotification("[" + local.getName() + "] has low hitpoints!");
notifier.notify("[" + local.getName() + "] has low hitpoints!");
}
if (checkLowPrayer(waitDuration))
{
sendNotification("[" + local.getName() + "] has low prayer!");
notifier.notify("[" + local.getName() + "] has low prayer!");
}
}
@@ -452,22 +448,6 @@ public class IdleNotifierPlugin extends Plugin
return false;
}
private void sendNotification(String message)
{
if (!config.alertWhenFocused() && gui.isFocused())
{
return;
}
if (config.requestFocus())
{
gui.requestFocus();
}
if (config.sendTrayNotification())
{
notifier.notify(message);
}
}
private void resetTimers()
{
// Reset animation idle timer