feat(notifications): use native runelite notifications
This commit is contained in:
@@ -6,6 +6,7 @@ import net.runelite.client.config.ConfigGroup;
|
|||||||
import net.runelite.client.config.ConfigItem;
|
import net.runelite.client.config.ConfigItem;
|
||||||
import net.runelite.client.config.ConfigSection;
|
import net.runelite.client.config.ConfigSection;
|
||||||
import net.runelite.client.config.Range;
|
import net.runelite.client.config.Range;
|
||||||
|
import net.runelite.client.config.Notification;
|
||||||
import net.runelite.client.ui.ColorScheme;
|
import net.runelite.client.ui.ColorScheme;
|
||||||
|
|
||||||
@ConfigGroup(EasyGiantsFoundryConfig.GROUP)
|
@ConfigGroup(EasyGiantsFoundryConfig.GROUP)
|
||||||
@@ -29,9 +30,9 @@ public interface EasyGiantsFoundryConfig extends Config
|
|||||||
position = 0,
|
position = 0,
|
||||||
section = notificationList
|
section = notificationList
|
||||||
)
|
)
|
||||||
default boolean showGiantsFoundryStageNotifications()
|
default Notification stageNotification()
|
||||||
{
|
{
|
||||||
return true;
|
return Notification.ON;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
@@ -41,9 +42,9 @@ public interface EasyGiantsFoundryConfig extends Config
|
|||||||
position = 1,
|
position = 1,
|
||||||
section = notificationList
|
section = notificationList
|
||||||
)
|
)
|
||||||
default boolean showGiantsFoundryHeatNotifications()
|
default Notification heatNotification()
|
||||||
{
|
{
|
||||||
return true;
|
return Notification.ON;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
@@ -77,9 +78,9 @@ public interface EasyGiantsFoundryConfig extends Config
|
|||||||
position = 4,
|
position = 4,
|
||||||
section = notificationList
|
section = notificationList
|
||||||
)
|
)
|
||||||
default boolean bonusNotification()
|
default Notification bonusNotification()
|
||||||
{
|
{
|
||||||
return false;
|
return Notification.OFF;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
|
|||||||
@@ -217,17 +217,17 @@ public class EasyGiantsFoundryPlugin extends Plugin
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config.showGiantsFoundryStageNotifications() &&
|
if (config.stageNotification().isEnabled() &&
|
||||||
state.getActionsLeftInStage() == config.StageNotificationsThreshold() &&
|
state.getActionsLeftInStage() == config.StageNotificationsThreshold() &&
|
||||||
(oldStage == null || oldStage != state.getCurrentStage()))
|
(oldStage == null || oldStage != state.getCurrentStage()))
|
||||||
{
|
{
|
||||||
notifier.notify("About to finish the current stage!");
|
notifier.notify(config.stageNotification(), "About to finish the current stage!");
|
||||||
oldStage = state.getCurrentStage();
|
oldStage = state.getCurrentStage();
|
||||||
}
|
}
|
||||||
else if (config.showGiantsFoundryHeatNotifications() &&
|
else if (config.heatNotification().isEnabled() &&
|
||||||
state.getActionsForHeatLevel() == config.HeatNotificationsThreshold())
|
state.getActionsForHeatLevel() == config.HeatNotificationsThreshold())
|
||||||
{
|
{
|
||||||
notifier.notify("About to run out of heat!");
|
notifier.notify(config.heatNotification(), "About to run out of heat!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -458,9 +458,9 @@ public class EasyGiantsFoundryPlugin extends Plugin
|
|||||||
|
|
||||||
state.addBonusActionReceived();
|
state.addBonusActionReceived();
|
||||||
|
|
||||||
if (config.bonusNotification())
|
if (config.bonusNotification().isEnabled())
|
||||||
{
|
{
|
||||||
notifier.notify("Bonus - Click tool");
|
notifier.notify(config.bonusNotification(), "Bonus - Click tool");
|
||||||
}
|
}
|
||||||
if (config.bonusSoundNotify())
|
if (config.bonusSoundNotify())
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user