Skip to content
This repository has been archived by the owner on Apr 22, 2021. It is now read-only.

Commit

Permalink
enh: Option to only show Regular or Priority in Queue2b2t
Browse files Browse the repository at this point in the history
Signed-off-by: lv <[email protected]>
  • Loading branch information
5HT2 committed Apr 5, 2021
1 parent cd444fc commit cfa3545
Showing 1 changed file with 19 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@ internal object Queue2B2T : LabelHud(
private val dataUpdateTimer = TickTimer(TimeUnit.SECONDS)

private val hasShownWarning = setting("Has Shown Warning", false, { false })
private val show by setting("Show", Show.BOTH)

private enum class Show {
BOTH, PRIORITY, REGULAR
}

private val showPriority get() = show == Show.BOTH || show == Show.PRIORITY
private val showRegular get() = show == Show.BOTH || show == Show.REGULAR

init {
safeListener<TickEvent.ClientTickEvent> {
Expand All @@ -49,10 +57,17 @@ internal object Queue2B2T : LabelHud(
displayText.addLine("Cannot connect to 2bqueue.info", primaryColor)
displayText.add("Make sure your internet is working!", primaryColor)
} else {
displayText.add("Priority: ", primaryColor)
displayText.add("${queueData.priority}", secondaryColor)
displayText.add("Regular: ", primaryColor)
displayText.addLine("${queueData.regular}", secondaryColor)
if (showPriority) {
displayText.add("Priority: ", primaryColor)
displayText.add("${queueData.priority}", secondaryColor)
}

if (showRegular) {
displayText.add("Regular: ", primaryColor)
displayText.add("${queueData.regular}", secondaryColor)
}

displayText.addLine("", primaryColor)
displayText.add("Last updated ${queueData.getLastUpdate()} ago", primaryColor)
}
}
Expand Down

0 comments on commit cfa3545

Please sign in to comment.