Skip to content

Commit

Permalink
Added visibilty thingy
Browse files Browse the repository at this point in the history
  • Loading branch information
j10a1n15 committed Nov 1, 2023
1 parent e900407 commit 9cae4b4
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,16 @@ enum class CustomScoreboardElements (
fun getLine(): List<String> {
return displayLine?.get() ?: emptyList()
}

fun isVisible(): Boolean {
if (!config.hideIrrelevantLines) return true
if (islands.isEmpty()) return true
return when (visibilityOption) {
0 -> islands.contains(HypixelData.skyBlockIsland)
1 -> !islands.contains(HypixelData.skyBlockIsland)
else -> true
}
}
}

class CustomScoreboard {
Expand Down Expand Up @@ -336,7 +346,7 @@ class CustomScoreboard {
private fun drawScoreboard() = buildList<List<Any>> {
val lineMap = HashMap<Int, List<Any>>()
for (element in CustomScoreboardElements.entries) {
lineMap[element.index] = element.getLine()
lineMap[element.index] = if (element.isVisible()) element.getLine() else listOf("<hidden>")
}

return formatDisplay(lineMap)
Expand Down

0 comments on commit 9cae4b4

Please sign in to comment.