From f02cea10acdaa98948fa33545db6d805852e334d Mon Sep 17 00:00:00 2001 From: J10a1n15 <45315647+j10a1n15@users.noreply.github.com> Date: Tue, 26 Mar 2024 20:19:52 +0100 Subject: Fix: Fixed Powder color in Custom Scoreboard (#1275) --- .../gui/customscoreboard/ScoreboardElements.kt | 30 ++++++++++++++-------- 1 file changed, 19 insertions(+), 11 deletions(-) (limited to 'src/main/java/at') 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 7129315db..4f9d64965 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 @@ -688,32 +688,40 @@ private fun getQuiverShowWhen(): Boolean { } private fun getPowderDisplayPair() = buildList { - val powderTypes = listOf( - "§2Mithril" to getGroupFromPattern( + val powderTypes: List> = listOf( + Triple("Mithril", "§2", getGroupFromPattern( TabListData.getTabList(), ScoreboardPattern.mithrilPowderPattern, "mithrilpowder" - ).formatNum(), - "§dGemstone" to getGroupFromPattern( + ).formatNum()), + Triple("Gemstone", "§d", getGroupFromPattern( TabListData.getTabList(), ScoreboardPattern.gemstonePowderPattern, "gemstonepowder" - ).formatNum(), - "§bGlacite" to getGroupFromPattern( + ).formatNum()), + Triple("Glacite", "§b", getGroupFromPattern( TabListData.getTabList(), ScoreboardPattern.glacitePowderPattern, "glacitepowder" - ).formatNum(), + ).formatNum()) ) - if (informationFilteringConfig.hideEmptyLines && powderTypes.all { it.second == "0" }) { + if (informationFilteringConfig.hideEmptyLines && powderTypes.all { it.third == "0" }) { add("" to HorizontalAlignment.LEFT) } else { add("§9§lPowder" to HorizontalAlignment.LEFT) - for ((type, value) in powderTypes) { - if (value != "0") { - add(" §7- §f$type: $value" to HorizontalAlignment.LEFT) + if (displayConfig.displayNumbersFirst) { + for ((type, color, value) in powderTypes) { + if (value != "0") { + add(" §7- $color$value $type" to HorizontalAlignment.LEFT) + } + } + } else { + for ((type, color, value) in powderTypes) { + if (value != "0") { + add(" §7- §f$type: $color$value" to HorizontalAlignment.LEFT) + } } } } -- cgit