aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/features/gui/customscoreboard/TitleAndFooterConfig.java8
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/ScoreboardElements.kt29
2 files changed, 23 insertions, 14 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/gui/customscoreboard/TitleAndFooterConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/gui/customscoreboard/TitleAndFooterConfig.java
index 4288e1a58..79c127c57 100644
--- a/src/main/java/at/hannibal2/skyhanni/config/features/gui/customscoreboard/TitleAndFooterConfig.java
+++ b/src/main/java/at/hannibal2/skyhanni/config/features/gui/customscoreboard/TitleAndFooterConfig.java
@@ -15,7 +15,9 @@ public class TitleAndFooterConfig {
public RenderUtils.HorizontalAlignment alignTitleAndFooter = RenderUtils.HorizontalAlignment.CENTER;
@Expose
- @ConfigOption(name = "Custom Title", desc = "What should be displayed as the title of the scoreboard.\nUse & for colors.")
+ @ConfigOption(name = "Custom Title", desc = "What should be displayed as the title of the scoreboard." +
+ "\nUse & for colors." +
+ "\nUse \"\\n\" for new line.")
@ConfigEditorText
public Property<String> customTitle = Property.of("&6&lSKYBLOCK");
@@ -26,7 +28,9 @@ public class TitleAndFooterConfig {
public boolean useHypixelTitleAnimation = false;
@Expose
- @ConfigOption(name = "Custom Footer", desc = "What should be displayed as the footer of the scoreboard.\nUse & for colors.")
+ @ConfigOption(name = "Custom Footer", desc = "What should be displayed as the footer of the scoreboard." +
+ "\nUse & for colors." +
+ "\nUse \"\\n\" for new line.")
@ConfigEditorText
public Property<String> customFooter = Property.of("&ewww.hypixel.net");
}
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)