aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-05-01 17:24:47 +0200
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-05-01 17:24:47 +0200
commit390b674e5eaaeeacb4c804c606678b82d3594f64 (patch)
tree6a7ca845dfbc56a89c1bcb4529564bd76bc8de04 /src/main/java/at
parent2a9f8e6142238978c5aca09ed344f56bcc82162c (diff)
downloadskyhanni-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')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/features/Bingo.java6
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/bingo/BingoCardDisplay.kt15
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