diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-10-07 17:50:21 +0200 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-10-07 17:50:21 +0200 |
commit | 05e8064b26b9bb0dc7957532f8defb6f018deb54 (patch) | |
tree | cffd7d0b4d207c93e3f42dba52bd757062b08a6b /src/main/java | |
parent | 8f7e2334587f5f84bfbc0da74da3f099736d7193 (diff) | |
download | skyhanni-05e8064b26b9bb0dc7957532f8defb6f018deb54.tar.gz skyhanni-05e8064b26b9bb0dc7957532f8defb6f018deb54.tar.bz2 skyhanni-05e8064b26b9bb0dc7957532f8defb6f018deb54.zip |
using better bingo and ironman icons, better debug option to disable the custom player list better
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/misc/compacttablist/TabListReader.kt | 25 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/misc/compacttablist/TabListRenderer.kt | 5 |
2 files changed, 20 insertions, 10 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/compacttablist/TabListReader.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/compacttablist/TabListReader.kt index b9d4ffb53..2144c672e 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/compacttablist/TabListReader.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/compacttablist/TabListReader.kt @@ -84,7 +84,7 @@ object TabListReader { if (LorenzUtils.inKuudraFight) return original if (LorenzUtils.inDungeons) return original - if (LorenzUtils.isControlKeyDown()) return original + if (ignoreCustomTabList()) return original val pattern = ".*\\[(?<level>.*)] (?<name>.*)".toPattern() val newList = mutableListOf<String>() @@ -171,6 +171,10 @@ object TabListReader { return newList } + fun ignoreCustomTabList(): Boolean { + return LorenzUtils.isControlKeyDown() + } + private fun createCustomName(data: PlayerData): String { val playerName = if (config.useLevelColorForName) { val c = data.levelText[3] @@ -182,13 +186,7 @@ object TabListReader { } else "" val suffix = if (config.hideEmblem) { - if (data.ironman) { - "§8[§7Iron Man§8]" - } else { - if (data.bingoLevel > -1) { - "§rBingo ${data.bingoLevel}" - } else "" - } + if (data.ironman) "§7♲" else getBingoIcon(data.bingoLevel) } else data.nameSuffix return "$level $playerName $suffix" @@ -227,6 +225,17 @@ object TabListReader { else -> -1 } + private fun getBingoIcon(rank: Int) = when (rank) { + -1 -> "" // Not in Bingo + + 0 -> "§7Ⓑ" //No Rank + 1 -> "§aⒷ" //Rank 1 + 2 -> "§9Ⓑ" //Rank 2 + 3 -> "§5Ⓑ" //Rank 3 + 4 -> "§6Ⓑ" //Rank 4 + else -> "Bingo?" + } + class PlayerData(val sbLevel: Int) { var name: String = "?" var coloredName: String = "?" diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/compacttablist/TabListRenderer.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/compacttablist/TabListRenderer.kt index 57867b0dd..8d3c1fab7 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/compacttablist/TabListRenderer.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/compacttablist/TabListRenderer.kt @@ -120,16 +120,17 @@ object TabListRenderer { middleX += 8 + 2 } + val text = if (TabListReader.ignoreCustomTabList()) tabLine.text else tabLine.customName if (tabLine.type == TabStringType.TITLE) { minecraft.fontRendererObj.drawStringWithShadow( - tabLine.customName, + text, middleX + column.getMaxWidth() / 2f - tabLine.getWidth() / 2f, middleY.toFloat(), 0xFFFFFF ) } else { minecraft.fontRendererObj.drawStringWithShadow( - tabLine.customName, + text, middleX.toFloat(), middleY.toFloat(), 0xFFFFFF |