aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/eu/olli/cowmoonication/config/MooConfig.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/eu/olli/cowmoonication/config/MooConfig.java')
-rw-r--r--src/main/java/eu/olli/cowmoonication/config/MooConfig.java36
1 files changed, 27 insertions, 9 deletions
diff --git a/src/main/java/eu/olli/cowmoonication/config/MooConfig.java b/src/main/java/eu/olli/cowmoonication/config/MooConfig.java
index 73e8bbc..a401dbb 100644
--- a/src/main/java/eu/olli/cowmoonication/config/MooConfig.java
+++ b/src/main/java/eu/olli/cowmoonication/config/MooConfig.java
@@ -14,7 +14,9 @@ import java.util.List;
public class MooConfig {
public static boolean doUpdateCheck;
- public static boolean filterFriendNotifications;
+ public static boolean showBestFriendNotifications;
+ public static boolean showFriendNotifications;
+ public static boolean showGuildNotifications;
public static String moo;
private static Configuration cfg = null;
@@ -70,8 +72,14 @@ public class MooConfig {
final boolean DO_UPDATE_CHECK = true;
Property propDoUpdateCheck = cfg.get(Configuration.CATEGORY_CLIENT, "doUpdateCheck", DO_UPDATE_CHECK, "Check for mod updates?");
- final boolean FILTER_FRIEND_NOTIFICATIONS = true;
- Property propFilterFriendNotify = cfg.get(Configuration.CATEGORY_CLIENT, "filterFriendNotifications", FILTER_FRIEND_NOTIFICATIONS, "Set to false to receive all login/logout messages, set to true to only get notifications of 'best friends' joining/leaving");
+ final boolean SHOW_BEST_FRIEND_NOTIFICATIONS = true;
+ Property propShowBestFriendNotifications = cfg.get(Configuration.CATEGORY_CLIENT, "showBestFriendNotifications", SHOW_BEST_FRIEND_NOTIFICATIONS, "Set to true to receive best friends' login/logout messages, set to false hide them.");
+
+ final boolean SHOW_FRIEND_NOTIFICATIONS = false;
+ Property propShowFriendNotifications = cfg.get(Configuration.CATEGORY_CLIENT, "showFriendNotifications", SHOW_FRIEND_NOTIFICATIONS, "Set to true to receive friends' login/logout messages, set to false hide them.");
+
+ final boolean SHOW_GUILD_NOTIFICATIONS = false;
+ Property propShowGuildNotifications = cfg.get(Configuration.CATEGORY_CLIENT, "showGuildNotifications", SHOW_GUILD_NOTIFICATIONS, "Set to true to receive guild members' login/logout messages, set to false hide them.");
final String MOO = "";
Property propMoo = cfg.get(Configuration.CATEGORY_CLIENT, "moo", MOO, "The answer to life the universe and everything. Don't edit this entry manually!", Utils.VALID_UUID_PATTERN);
@@ -79,18 +87,24 @@ public class MooConfig {
List<String> propOrderGeneral = new ArrayList<>();
propOrderGeneral.add(propDoUpdateCheck.getName());
- propOrderGeneral.add(propFilterFriendNotify.getName());
+ propOrderGeneral.add(propShowBestFriendNotifications.getName());
+ propOrderGeneral.add(propShowFriendNotifications.getName());
+ propOrderGeneral.add(propShowGuildNotifications.getName());
propOrderGeneral.add(propMoo.getName());
cfg.setCategoryPropertyOrder(Configuration.CATEGORY_CLIENT, propOrderGeneral);
if (readFieldsFromConfig) {
doUpdateCheck = propDoUpdateCheck.getBoolean(DO_UPDATE_CHECK);
- filterFriendNotifications = propFilterFriendNotify.getBoolean(FILTER_FRIEND_NOTIFICATIONS);
+ showBestFriendNotifications = propShowBestFriendNotifications.getBoolean(SHOW_BEST_FRIEND_NOTIFICATIONS);
+ showFriendNotifications = propShowFriendNotifications.getBoolean(SHOW_FRIEND_NOTIFICATIONS);
+ showGuildNotifications = propShowGuildNotifications.getBoolean(SHOW_GUILD_NOTIFICATIONS);
moo = propMoo.getString();
}
propDoUpdateCheck.set(doUpdateCheck);
- propFilterFriendNotify.set(filterFriendNotifications);
+ propShowBestFriendNotifications.set(showBestFriendNotifications);
+ propShowFriendNotifications.set(showFriendNotifications);
+ propShowGuildNotifications.set(showGuildNotifications);
propMoo.set(moo);
if (cfg.hasChanged()) {
@@ -98,9 +112,13 @@ public class MooConfig {
}
}
- public void toggleNotifications() {
- filterFriendNotifications = !filterFriendNotifications;
- syncFromFields();
+ /**
+ * Should login/logout notifications be modified and thus monitored?
+ *
+ * @return true if notifications should be monitored
+ */
+ public static boolean doMonitorNotifications() {
+ return showBestFriendNotifications || !showFriendNotifications || !showGuildNotifications;
}
public class ConfigEventHandler {