diff options
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 |