Skip to content

Commit

Permalink
Add Pufferfish counts
Browse files Browse the repository at this point in the history
  • Loading branch information
Oxyopiia committed Aug 12, 2024
1 parent fb16350 commit b6f9fbf
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,14 @@ object FishingDropsTracker : HudElement("Summer Fishing Drops Tracker", Vice.sto
list.add(text)
}

if (list.size == 1) {
list.add("No fish-ups yet!".toText(Colors.ChatColor.Red))
}
val counts = Pufferfish.entries.associateWith { Vice.storage.summer.pufferfishOpened[it.name] ?: 0 }
val text = counts
.map { (fish, count) -> count.toString().toText(fish.color) }
.reduceIndexed { index, acc, text ->
if (index == 0) acc.append(text) else acc.append("-".toText(Colors.ChatColor.Grey)).append(text)
}
list.add(Text.empty())
list.add("Pufferfish ".toText(Colors.ChatColor.Yellow).append(text))

return position.drawTexts(list, context)
}
Expand Down

0 comments on commit b6f9fbf

Please sign in to comment.