diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-05-01 17:24:47 +0200 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-05-01 17:24:47 +0200 |
commit | 390b674e5eaaeeacb4c804c606678b82d3594f64 (patch) | |
tree | 6a7ca845dfbc56a89c1bcb4529564bd76bc8de04 /src/main/java/at/hannibal2/skyhanni/features/bingo | |
parent | 2a9f8e6142238978c5aca09ed344f56bcc82162c (diff) | |
download | skyhanni-390b674e5eaaeeacb4c804c606678b82d3594f64.tar.gz skyhanni-390b674e5eaaeeacb4c804c606678b82d3594f64.tar.bz2 skyhanni-390b674e5eaaeeacb4c804c606678b82d3594f64.zip |
Added option to hide the community goals from the bingo card display
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features/bingo')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/bingo/BingoCardDisplay.kt | 15 |
1 files changed, 12 insertions, 3 deletions
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 |