Added heat threshold

This commit is contained in:
Vanillj
2022-07-04 23:44:29 +02:00
parent 7c87514ce8
commit 9264432d57
2 changed files with 28 additions and 5 deletions

View File

@@ -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() {

View File

@@ -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!");
}