From 9264432d57ec21586d0617f82e56b3b712c4ec8d Mon Sep 17 00:00:00 2001 From: Vanillj Date: Mon, 4 Jul 2022 23:44:29 +0200 Subject: [PATCH] Added heat threshold --- .../EasyGiantsFoundryConfig.java | 28 +++++++++++++++++-- .../EasyGiantsFoundryPlugin.java | 5 ++-- 2 files changed, 28 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/toofifty/easygiantsfoundry/EasyGiantsFoundryConfig.java b/src/main/java/com/toofifty/easygiantsfoundry/EasyGiantsFoundryConfig.java index 433cfdd..8011c85 100644 --- a/src/main/java/com/toofifty/easygiantsfoundry/EasyGiantsFoundryConfig.java +++ b/src/main/java/com/toofifty/easygiantsfoundry/EasyGiantsFoundryConfig.java @@ -39,11 +39,33 @@ public interface EasyGiantsFoundryConfig extends Config { return true; } + @ConfigItem( + keyName = "giantsFoundryStageThreshold", + name = "Stage threshold notification", + description = "The number of actions left required for the notification.", + position = 2, + section = notificationList + ) + default int StageNotificationsThreshold() { + return 1; + } + + @ConfigItem( + keyName = "giantsFoundryHeatThreshold", + name = "Heat threshold notification", + description = "The heat level left required for the notification.", + position = 3, + section = notificationList + ) + default int HeatNotificationsThreshold() { + return 1; + } + @ConfigItem( keyName = "bonusNotification", name = "Notify bonus", description = "Notifies when bonus appears", - position = 2, + position = 4, section = notificationList ) default boolean bonusNotification() { @@ -54,7 +76,7 @@ public interface EasyGiantsFoundryConfig extends Config { keyName = "bonusSound", name = "Bonus sound", description = "Plays a sound when bonus appears", - position = 3, + position = 5, section = notificationList ) default boolean bonusSoundNotify() { @@ -65,7 +87,7 @@ public interface EasyGiantsFoundryConfig extends Config { keyName = SOUND_ID, name = "Bonus sound ID", description = "Sound Effect ID to play when bonus appears", - position = 4, + position = 6, section = notificationList ) default int soundId() { diff --git a/src/main/java/com/toofifty/easygiantsfoundry/EasyGiantsFoundryPlugin.java b/src/main/java/com/toofifty/easygiantsfoundry/EasyGiantsFoundryPlugin.java index e1dd487..6cbbc07 100644 --- a/src/main/java/com/toofifty/easygiantsfoundry/EasyGiantsFoundryPlugin.java +++ b/src/main/java/com/toofifty/easygiantsfoundry/EasyGiantsFoundryPlugin.java @@ -154,13 +154,14 @@ public class EasyGiantsFoundryPlugin extends Plugin } if (config.showGiantsFoundryStageNotifications() && - helper.getActionsLeftInStage() == 1 && + helper.getActionsLeftInStage() == config.StageNotificationsThreshold() && (oldStage == null || oldStage != state.getCurrentStage())) { notifier.notify("About to finish the current stage!"); oldStage = state.getCurrentStage(); } - else if (config.showGiantsFoundryHeatNotifications() && helper.getActionsForHeatLevel() == 1) + else if (config.showGiantsFoundryHeatNotifications() && + helper.getActionsForHeatLevel() == config.HeatNotificationsThreshold()) { notifier.notify("About to run out of heat!"); }