aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-12-02 00:00:20 +0100
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-12-02 00:00:20 +0100
commitff80dcef15b0a3992e7ba3e7bb0ae34532b7078f (patch)
treed43be49686465a676e40e7f47359c20d2299847f /src/main/java/at/hannibal2/skyhanni
parenta1f2ec9438a2ddb5426874d319e04e2e30326cb9 (diff)
downloadskyhanni-ff80dcef15b0a3992e7ba3e7bb0ae34532b7078f.tar.gz
skyhanni-ff80dcef15b0a3992e7ba3e7bb0ae34532b7078f.tar.bz2
skyhanni-ff80dcef15b0a3992e7ba3e7bb0ae34532b7078f.zip
Show community goals in display.
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/bingo/BingoAPI.kt4
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/bingo/BingoCardDisplay.kt8
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/bingo/BingoCardTips.kt3
3 files changed, 8 insertions, 7 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/bingo/BingoAPI.kt b/src/main/java/at/hannibal2/skyhanni/features/bingo/BingoAPI.kt
index 6941e7f57..340cd7d17 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/bingo/BingoAPI.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/bingo/BingoAPI.kt
@@ -19,4 +19,8 @@ object BingoAPI {
fun getIcon(searchRank: Int) = ranks.entries.find { it.value == searchRank }?.key
+ // We added the suffix (Community Goal) so that older skyhanni versions don't crash with the new repo data.
+ fun getCommunityTip(itemName: String) =
+ tips.filter { itemName.startsWith(it.key.split(" (Community Goal)")[0]) }.values.firstOrNull()
+
}
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 183030790..f1bf2b5c3 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/bingo/BingoCardDisplay.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/bingo/BingoCardDisplay.kt
@@ -149,11 +149,9 @@ class BingoCardDisplay {
description: String,
done: Boolean
): CommunityGoal {
- if (!done) {
- if (description == "§7This goal will be revealed §7when it hits Tier IV.") {
- BingoAPI.tips[name]?.let {
- return CommunityGoal(name, it.getDescriptionLine(), false)
- }
+ if (description == "§7This goal will be revealed §7when it hits Tier IV.") {
+ BingoAPI.getCommunityTip(name)?.let {
+ return CommunityGoal(name, it.getDescriptionLine(), done)
}
}
return CommunityGoal(name, description, done)
diff --git a/src/main/java/at/hannibal2/skyhanni/features/bingo/BingoCardTips.kt b/src/main/java/at/hannibal2/skyhanni/features/bingo/BingoCardTips.kt
index 4ff74a309..54351750b 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/bingo/BingoCardTips.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/bingo/BingoCardTips.kt
@@ -27,8 +27,7 @@ class BingoCardTips {
val toolTip = event.toolTip
val communityGoal = toolTip.getOrNull(1) == "§5§o§8Community Goal"
val bingoTip: BingoTip = if (communityGoal) {
- // We added the suffix (Community Goal) so that older skyhanni versions don't crash with the new repo data.
- BingoAPI.tips.filter { itemName.startsWith(it.key.split(" (Community Goal)")[0]) }.values.firstOrNull() ?: return
+ BingoAPI.getCommunityTip(itemName) ?: return
} else {
BingoAPI.tips[itemName] ?: return
}