diff options
author | J10a1n15 <45315647+j10a1n15@users.noreply.github.com> | 2024-04-15 20:11:21 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-15 20:11:21 +0200 |
commit | aaaf1b0f8765e76eac852051f3c939897fa5ce48 (patch) | |
tree | 84bd511cd390699efe15693488070bed014a2dea /src/main/java/at/hannibal2/skyhanni/features | |
parent | 8a97c06df5a9f59937709ffbbb717c242be5e8ec (diff) | |
download | skyhanni-aaaf1b0f8765e76eac852051f3c939897fa5ce48.tar.gz skyhanni-aaaf1b0f8765e76eac852051f3c939897fa5ce48.tar.bz2 skyhanni-aaaf1b0f8765e76eac852051f3c939897fa5ce48.zip |
Improvement: Added Linebreaks functionality for Custom Scoreboard Title/Footer (#1373)
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/ScoreboardElements.kt | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/ScoreboardElements.kt b/src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/ScoreboardElements.kt index d958c0c9c..e9b4df0a9 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/ScoreboardElements.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/ScoreboardElements.kt @@ -309,14 +309,16 @@ enum class ScoreboardElement( } } -private fun getTitleDisplayPair() = if (displayConfig.titleAndFooter.useHypixelTitleAnimation) { - listOf(ScoreboardData.objectiveTitle to displayConfig.titleAndFooter.alignTitleAndFooter) -} else { - listOf( - displayConfig.titleAndFooter.customTitle.get().toString() - .replace("&", "§") to displayConfig.titleAndFooter.alignTitleAndFooter - ) -} +private fun getTitleDisplayPair(): List<ScoreboardElementType> = + if (displayConfig.titleAndFooter.useHypixelTitleAnimation) { + listOf(ScoreboardData.objectiveTitle to displayConfig.titleAndFooter.alignTitleAndFooter) + } else { + listOf(displayConfig.titleAndFooter.customTitle.get().toString() + .replace("&", "§") + .split("\\n") + .map { it to displayConfig.titleAndFooter.alignTitleAndFooter } + ).flatten() + } private fun getProfileDisplayPair() = listOf(CustomScoreboardUtils.getProfileTypeSymbol() + HypixelData.profileName.firstLetterUppercase() to HorizontalAlignment.LEFT) @@ -764,10 +766,13 @@ private fun getPartyShowWhen() = if (DungeonAPI.inDungeon()) { } } -private fun getFooterDisplayPair() = listOf( - displayConfig.titleAndFooter.customFooter.get().toString() - .replace("&", "§") to displayConfig.titleAndFooter.alignTitleAndFooter -) +private fun getFooterDisplayPair(): List<ScoreboardElementType> = + listOf(displayConfig.titleAndFooter.customFooter.get().toString() + .replace("&", "§") + .split("\\n") + .map { it to displayConfig.titleAndFooter.alignTitleAndFooter } + ).flatten() + private fun getExtraDisplayPair(): List<ScoreboardElementType> { if (unknownLines.isEmpty()) return listOf("<hidden>" to HorizontalAlignment.LEFT) |