diff options
Diffstat (limited to 'src/main/java/at')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/config/features/Bingo.java | 6 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/bingo/BingoCardDisplay.kt | 15 |
2 files changed, 18 insertions, 3 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/Bingo.java b/src/main/java/at/hannibal2/skyhanni/config/features/Bingo.java index 2b04d895c..4e973d7f7 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/Bingo.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/Bingo.java @@ -5,6 +5,7 @@ import com.google.gson.annotations.Expose; import io.github.moulberry.moulconfig.annotations.Accordion; import io.github.moulberry.moulconfig.annotations.ConfigEditorBoolean; import io.github.moulberry.moulconfig.annotations.ConfigOption; +import io.github.moulberry.moulconfig.observer.Property; public class Bingo { @@ -26,6 +27,11 @@ public class Bingo { public boolean stepHelper = false; @Expose + @ConfigOption(name = "Hide Community Goals", desc = "Hide Community Goals from the Bingo Card display.") + @ConfigEditorBoolean + public Property<Boolean> hideCommunityGoals = Property.of(false); + + @Expose public Position bingoCardPos = new Position(10, 10, false, true); } diff --git a/src/main/java/at/hannibal2/skyhanni/features/bingo/BingoCardDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/bingo/BingoCardDisplay.kt index 1dc407bf1..8971cc3d3 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/bingo/BingoCardDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/bingo/BingoCardDisplay.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.bingo import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.events.ConfigLoadEvent import at.hannibal2.skyhanni.events.GuiRenderEvent import at.hannibal2.skyhanni.events.LorenzChatEvent import at.hannibal2.skyhanni.features.bingo.card.CommunityGoal @@ -127,15 +128,18 @@ class BingoCardDisplay { private fun drawDisplay(): MutableList<String> { val newList = mutableListOf<String>() - newList.add("§6Community Goals:") if (communityGoals.isEmpty()) { + newList.add("§6Bingo Goals:") newList.add("§cOpen the §e/bingo §ccard.") } else { - communityGoals.mapTo(newList) { " " + it.description + if (it.done) " §aDONE" else "" } + if (!config.hideCommunityGoals.get()) { + newList.add("§6Community Goals:") + communityGoals.mapTo(newList) { " " + it.description + if (it.done) " §aDONE" else "" } + newList.add(" ") + } val todo = personalGoals.filter { !it.done } val done = MAX_PERSONAL_GOALS - todo.size - newList.add(" ") newList.add("§6Personal Goals: ($done/$MAX_PERSONAL_GOALS done)") todo.mapTo(newList) { " " + it.description } } @@ -189,4 +193,9 @@ class BingoCardDisplay { } } } + + @SubscribeEvent + fun onConfigLoad(event: ConfigLoadEvent) { + config.hideCommunityGoals.whenChanged { _, _ -> update() } + } }
\ No newline at end of file |