From f566c3bcb58997e552b4e2caea24d244f71ff0ac Mon Sep 17 00:00:00 2001 From: Liam Date: Sun, 30 Jun 2024 08:34:59 +0100 Subject: [PATCH] add emojis to feature states --- .../base/commands/server/feature/ListSubCommand.java | 2 +- .../bat/features/base/profile/FeatureProfile.java | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/main/java/cc/fascinated/bat/features/base/commands/server/feature/ListSubCommand.java b/src/main/java/cc/fascinated/bat/features/base/commands/server/feature/ListSubCommand.java index d5190cb..a7124f4 100644 --- a/src/main/java/cc/fascinated/bat/features/base/commands/server/feature/ListSubCommand.java +++ b/src/main/java/cc/fascinated/bat/features/base/commands/server/feature/ListSubCommand.java @@ -26,7 +26,7 @@ public class ListSubCommand extends BatSubCommand { for (Feature feature : FeatureService.INSTANCE.getFeaturesSorted()) { FeatureProfile featureProfile = guild.getFeatureProfile(); featureStates.append("%s `%s`\n".formatted( - featureProfile.getFeatureState(feature) == FeatureProfile.FeatureState.ENABLED ? "✅" : "❌", + featureProfile.getFeatureState(feature).getEmoji(), feature.getName() )); } diff --git a/src/main/java/cc/fascinated/bat/features/base/profile/FeatureProfile.java b/src/main/java/cc/fascinated/bat/features/base/profile/FeatureProfile.java index 8bbad5f..7574208 100644 --- a/src/main/java/cc/fascinated/bat/features/base/profile/FeatureProfile.java +++ b/src/main/java/cc/fascinated/bat/features/base/profile/FeatureProfile.java @@ -2,6 +2,8 @@ package cc.fascinated.bat.features.base.profile; import cc.fascinated.bat.common.Profile; import cc.fascinated.bat.features.Feature; +import lombok.AllArgsConstructor; +import lombok.Getter; import java.util.HashMap; import java.util.Map; @@ -94,8 +96,14 @@ public class FeatureProfile extends Profile { this.featureStates = null; } + @AllArgsConstructor @Getter public enum FeatureState { - ENABLED, - DISABLED + ENABLED(":white_check_mark:"), + DISABLED(":x:"); + + /** + * The emoji for the feature state + */ + private String emoji; } }