From 8251b5a124d2bc567e3764964e5f451c4d4bd634 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Tue, 21 Feb 2023 14:19:20 +0100 Subject: Queue full support --- .../at/hannibal2/skyhanni/features/garden/GardenVisitorFeatures.kt | 2 ++ .../at/hannibal2/skyhanni/features/garden/GardenVisitorTimer.kt | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'src/main') diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenVisitorFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenVisitorFeatures.kt index c3d26c90f..6567397cc 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenVisitorFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenVisitorFeatures.kt @@ -66,6 +66,8 @@ class GardenVisitorFeatures { private fun update() { display.clear() + if (!SkyHanniMod.feature.garden.visitorNeedsDisplay) return + val requiredItems = mutableMapOf() val newVisitors = mutableListOf() for ((visitorName, visitor) in visitors) { diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenVisitorTimer.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenVisitorTimer.kt index 9ca5c4b13..6f39c3b63 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenVisitorTimer.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenVisitorTimer.kt @@ -23,11 +23,14 @@ class GardenVisitorTimer { var visitorsAmount = 0 var millis = 15 * 60_000L + var queueFull = false for (line in event.tabList) { var matcher = patternNextVisitor.matcher(line) if (matcher.matches()) { val rawTime = matcher.group(1) millis = TimeUtils.getMillis(rawTime) + } else if (line == " Next Visitor: §r§c§lQueue Full!") { + queueFull = true } matcher = patternVisitors.matcher(line) @@ -48,7 +51,8 @@ class GardenVisitorTimer { val visitorLabel = if (visitorsAmount == 1) "visitor" else "visitors" val formatDuration = TimeUtils.formatDuration(millis) - render = "§b$visitorsAmount $visitorLabel §f(Next in §e$formatDuration$extraSpeed§f)" + val next = if (queueFull) "§cQueue Full!" else "Next in §e$formatDuration$extraSpeed" + render = "§b$visitorsAmount $visitorLabel §f($next§f)" } @SubscribeEvent -- cgit