diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-10-07 18:40:51 +0200 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-10-07 18:40:51 +0200 |
commit | 83f83be24b98518b9c34581958253ec423277174 (patch) | |
tree | f7a55ce80054fe423a9e81d66f995e19c0b9562a /src/main/java/at/hannibal2 | |
parent | b412558d0821cb7746d9409521c9be7390c29118 (diff) | |
download | skyhanni-83f83be24b98518b9c34581958253ec423277174.tar.gz skyhanni-83f83be24b98518b9c34581958253ec423277174.tar.bz2 skyhanni-83f83be24b98518b9c34581958253ec423277174.zip |
show bingo rank number next to bingo icon
Diffstat (limited to 'src/main/java/at/hannibal2')
3 files changed, 22 insertions, 10 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/MiscConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/MiscConfig.java index e1cbbf830..51c11c082 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/MiscConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/MiscConfig.java @@ -602,6 +602,10 @@ public class MiscConfig { @ConfigEditorBoolean public boolean useLevelColorForName = false; + @Expose + @ConfigOption(name = "Bingo Rank Number", desc = "Show the number of the bingo rank next to the icon. Useful if you are not so familar with bingo.") + @ConfigEditorBoolean + public boolean showBingoRankNumber = false; } } 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 1c3e41cb0..114acae06 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 @@ -165,15 +165,22 @@ object AdvancedPlayerList { 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?" + private fun getBingoIcon(rank: Int): String { + val rankIcon = 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?" + } + return if (config.showBingoRankNumber && rank != -1) { + "$rankIcon $rank" + } else { + rankIcon + } } class PlayerData(val sbLevel: Int) { 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 aeda16050..b653bd472 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 @@ -105,7 +105,8 @@ object TabListRenderer { for (tabLine in column.lines) { val savedX = middleX - if (tabLine.type == TabStringType.PLAYER && !config.advancedPlayerList.hidePlayerIcons) { + val isEnabled = !config.advancedPlayerList.hidePlayerIcons && !AdvancedPlayerList.ignoreCustomTabList() + if (tabLine.type == TabStringType.PLAYER && isEnabled) { val playerInfo = tabLine.getInfo() if (playerInfo != null) { minecraft.textureManager.bindTexture(playerInfo.locationSkin) |