From 4f9fe89aac7b97741f7079ab1ad5f7051e0fa7f7 Mon Sep 17 00:00:00 2001 From: Walker Selby Date: Wed, 11 Oct 2023 11:24:39 +0100 Subject: More Code Cleanup - When (#531) code cleanup #531 --- .../rift/area/mirrorverse/DanceRoomHelper.kt | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'src/main/java/at/hannibal2/skyhanni/features/rift') diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/area/mirrorverse/DanceRoomHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/area/mirrorverse/DanceRoomHelper.kt index 1c19cdef9..d66973cd3 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/rift/area/mirrorverse/DanceRoomHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/rift/area/mirrorverse/DanceRoomHelper.kt @@ -50,17 +50,22 @@ object DanceRoomHelper { val size = instructions.size val format = line.format() - if (index < size && index == lineIndex) { - val countdown = countdown?.let { "${color.countdown.formatColor()}$it" } ?: "" - "${now.formatColor()} $format $countdown" + when { + index < size && index == lineIndex -> { + val countdown = countdown?.let { "${color.countdown.formatColor()}$it" } ?: "" + "${now.formatColor()} $format $countdown" - } else if (index + 1 < size && index + 1 == lineIndex) { - "${next.formatColor()} $format" + } + index + 1 < size && index + 1 == lineIndex -> { + "${next.formatColor()} $format" - } else if (index + 2 < size && (index + 2..index + config.lineToShow).contains(lineIndex)) { - "${later.formatColor()} $format" + } + index + 2 < size && (index + 2..index + config.lineToShow).contains(lineIndex) -> { + "${later.formatColor()} $format" - } else null + } + else -> null + } } private fun String.formatColor() = replace("&", "ยง") -- cgit