diff options
author | Walker Selby <git@walkerselby.com> | 2023-11-11 11:47:12 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-11 12:47:12 +0100 |
commit | 18a1b1782d777326f72a3850b88a4286db32f796 (patch) | |
tree | 4d64d54b6cb3ac3bdd27f917666288962ee7880b /src/main/java/at/hannibal2 | |
parent | e914cabd155e0a7fded7b874cef219b904660ec1 (diff) | |
download | skyhanni-18a1b1782d777326f72a3850b88a4286db32f796.tar.gz skyhanni-18a1b1782d777326f72a3850b88a4286db32f796.tar.bz2 skyhanni-18a1b1782d777326f72a3850b88a4286db32f796.zip |
Fix for Players with Ranks in CompactTab (#701)
Fixed YouTuber and Admin getting lost in tab list. #701
Diffstat (limited to 'src/main/java/at/hannibal2')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/misc/compacttablist/AdvancedPlayerList.kt | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/compacttablist/AdvancedPlayerList.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/compacttablist/AdvancedPlayerList.kt index 05cb64605..382de8bc6 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/compacttablist/AdvancedPlayerList.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/compacttablist/AdvancedPlayerList.kt @@ -24,7 +24,7 @@ object AdvancedPlayerList { private val config get() = SkyHanniMod.feature.misc.compactTabList.advancedPlayerList // TODO USE SH-REPO - private val pattern = ".*\\[(?<level>.*)] (?<name>.*)".toPattern() + private val pattern = ".*\\[(?<level>.*)] §r(?<name>.*)".toPattern() private var playerDatas = mutableMapOf<String, PlayerData>() @@ -59,14 +59,21 @@ object AdvancedPlayerList { val playerData = PlayerData(removeColor.toInt()) currentData[line] = playerData + var index = 0 val fullName = group("name") + if (fullName.contains("[")) index++ val name = fullName.split(" ") - val coloredName = name[0] - playerData.coloredName = coloredName + val coloredName = name[index] + if (index == 1) { + playerData.coloredName = name[0] + coloredName + } else { + playerData.coloredName = coloredName + } playerData.name = coloredName.removeColor() playerData.levelText = levelText - if (name.size > 1) { - val nameSuffix = name.drop(1).joinToString(" ") + index++ + if (name.size > index) { + val nameSuffix = name.drop(index).joinToString(" ") playerData.nameSuffix = nameSuffix if (nameSuffix.contains("♲")) { playerData.ironman = true @@ -161,7 +168,7 @@ object AdvancedPlayerList { suffix += " " + getSocialScoreIcon(score) } if (config.markSkyHanniContributors && data.name in contributors) { - suffix += " §c:O" + suffix += "§c:O" } if (IslandType.CRIMSON_ISLE.isInIsland() && !config.hideFactions) { |