aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-12-04 11:56:56 +0100
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-12-04 11:56:56 +0100
commita8c3cc7979b35ca4061864dfa4e53a503a789042 (patch)
tree34a115a7e27f27ed79369fc7d4e9db32dfe169d0 /src
parent6d24f65c3a712ab992d098431a857c50fb6f8b9c (diff)
downloadskyhanni-a8c3cc7979b35ca4061864dfa4e53a503a789042.tar.gz
skyhanni-a8c3cc7979b35ca4061864dfa4e53a503a789042.tar.bz2
skyhanni-a8c3cc7979b35ca4061864dfa4e53a503a789042.zip
wording and code cleanup
Diffstat (limited to 'src')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/bingo/BingoAPI.kt1
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/bingo/BingoCardDisplay.kt4
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/StringUtils.kt5
3 files changed, 8 insertions, 2 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 517b6e418..951638df6 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/bingo/BingoAPI.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/bingo/BingoAPI.kt
@@ -10,6 +10,7 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
object BingoAPI {
private var ranks = mapOf<String, Int>()
var tips: Map<String, BingoJson.BingoTip> = emptyMap()
+ // TODO save into storage
val bingoGoals = mutableListOf<BingoGoal>()
val personalGoals get() = bingoGoals.filter { it.type == GoalType.PERSONAL }
val communityGoals get() = bingoGoals.filter { it.type == GoalType.COMMUNITY }
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 e0a2c7638..dc09ace95 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/bingo/BingoCardDisplay.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/bingo/BingoCardDisplay.kt
@@ -18,6 +18,7 @@ import at.hannibal2.skyhanni.utils.LorenzUtils
import at.hannibal2.skyhanni.utils.LorenzUtils.onToggle
import at.hannibal2.skyhanni.utils.RenderUtils.renderStrings
import at.hannibal2.skyhanni.utils.SimpleTimeMark
+import at.hannibal2.skyhanni.utils.StringUtils
import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher
import at.hannibal2.skyhanni.utils.StringUtils.removeColor
import at.hannibal2.skyhanni.utils.TimeUtils
@@ -219,7 +220,8 @@ class BingoCardDisplay {
todo.mapTo(this) { " " + it.description }
if (hiddenGoals > 0) {
- add("§7+ $hiddenGoals hidden personal goals.")
+ val name = StringUtils.canBePlural(hiddenGoals, "goal", "goals")
+ add("§7+ $hiddenGoals more unknown $name.")
}
hasHiddenPersonalGoals = config.nextTipDuration.get() && nextTip != 7.days
if (hasHiddenPersonalGoals) {
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/StringUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/StringUtils.kt
index b7b263a22..8c75475c9 100644
--- a/src/main/java/at/hannibal2/skyhanni/utils/StringUtils.kt
+++ b/src/main/java/at/hannibal2/skyhanni/utils/StringUtils.kt
@@ -146,7 +146,10 @@ object StringUtils {
}
fun optionalPlural(number: Int, singular: String, plural: String) =
- "${number.addSeparators()} " + if (number == 1) singular else plural
+ "${number.addSeparators()} " + canBePlural(number, singular, plural)
+
+ fun canBePlural(number: Int, singular: String, plural: String) =
+ if (number == 1) singular else plural
fun progressBar(percentage: Double, steps: Int = 24): Any {
//'§5§o§2§l§m §l§m §l§m §l§m §l§m §l§m §l§m §l§m §l§m §l§m §f§l§m §l§m §l§m §l§m §l§m §l§m §l§m §l§m §l§m §l§m §l§m §l§m §l§m §l§m §l§m §r §e348,144.3§6/§e936k'