From 58f1fec99d532c517aaf309772874ad5629ea39b Mon Sep 17 00:00:00 2001 From: J10a1n15 <45315647+j10a1n15@users.noreply.github.com> Date: Tue, 9 Apr 2024 20:49:52 +0200 Subject: Backend: Switch from LorenzUtils.inDungeons to DungeonAPI.inDungeon() (#1378) Co-authored-by: Cal --- .../skyhanni/features/gui/customscoreboard/ScoreboardElements.kt | 4 ++-- .../skyhanni/features/gui/customscoreboard/ScoreboardEvents.kt | 6 ++---- 2 files changed, 4 insertions(+), 6 deletions(-) (limited to 'src/main/java/at/hannibal2/skyhanni/features/gui') diff --git a/src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/ScoreboardElements.kt b/src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/ScoreboardElements.kt index e00ee2397..2bf173ab9 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/ScoreboardElements.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/ScoreboardElements.kt @@ -15,6 +15,7 @@ import at.hannibal2.skyhanni.data.QuiverAPI.NONE_ARROW_TYPE import at.hannibal2.skyhanni.data.QuiverAPI.asArrowPercentage import at.hannibal2.skyhanni.data.ScoreboardData import at.hannibal2.skyhanni.data.SlayerAPI +import at.hannibal2.skyhanni.features.dungeon.DungeonAPI import at.hannibal2.skyhanni.features.gui.customscoreboard.CustomScoreboard.Companion.arrowConfig import at.hannibal2.skyhanni.features.gui.customscoreboard.CustomScoreboard.Companion.devConfig import at.hannibal2.skyhanni.features.gui.customscoreboard.CustomScoreboard.Companion.displayConfig @@ -28,7 +29,6 @@ import at.hannibal2.skyhanni.test.command.ErrorManager import at.hannibal2.skyhanni.utils.CollectionUtils.nextAfter import at.hannibal2.skyhanni.utils.LorenzUtils.inAdvancedMiningIsland import at.hannibal2.skyhanni.utils.LorenzUtils.inAnyIsland -import at.hannibal2.skyhanni.utils.LorenzUtils.inDungeons import at.hannibal2.skyhanni.utils.NumberUtil.addSeparators import at.hannibal2.skyhanni.utils.NumberUtil.percentageColor import at.hannibal2.skyhanni.utils.RenderUtils.HorizontalAlignment @@ -754,7 +754,7 @@ private fun getPartyDisplayPair() = listOf(title, *partyList).map { it to HorizontalAlignment.LEFT } } -private fun getPartyShowWhen() = if (inDungeons) { +private fun getPartyShowWhen() = if (DungeonAPI.inDungeon()) { false // Hidden bc the scoreboard lines already exist } else { if (partyConfig.showPartyEverywhere) { diff --git a/src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/ScoreboardEvents.kt b/src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/ScoreboardEvents.kt index 1722cd431..6e21e7610 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/ScoreboardEvents.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/ScoreboardEvents.kt @@ -3,6 +3,7 @@ package at.hannibal2.skyhanni.features.gui.customscoreboard import at.hannibal2.skyhanni.data.HypixelData import at.hannibal2.skyhanni.data.IslandType import at.hannibal2.skyhanni.data.ScoreboardData +import at.hannibal2.skyhanni.features.dungeon.DungeonAPI import at.hannibal2.skyhanni.features.gui.customscoreboard.CustomScoreboard.Companion.eventsConfig import at.hannibal2.skyhanni.features.gui.customscoreboard.ScoreboardEvents.VOTING import at.hannibal2.skyhanni.features.gui.customscoreboard.ScoreboardPattern @@ -10,7 +11,6 @@ import at.hannibal2.skyhanni.features.misc.ServerRestartTitle import at.hannibal2.skyhanni.features.rift.area.stillgorechateau.RiftBloodEffigies import at.hannibal2.skyhanni.utils.CollectionUtils.nextAfter import at.hannibal2.skyhanni.utils.LorenzUtils.inAdvancedMiningIsland -import at.hannibal2.skyhanni.utils.LorenzUtils.inDungeons import at.hannibal2.skyhanni.utils.LorenzUtils.isInIsland import at.hannibal2.skyhanni.utils.StringUtils.anyMatches import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher @@ -260,9 +260,7 @@ private fun getDungeonsLines() = listOf( getSbLines().filter { line -> patterns.any { it.matches(line) } }.map { it.removePrefix("§r") } } -private fun getDungeonsShowWhen(): Boolean { - return IslandType.CATACOMBS.isInIsland() || inDungeons -} +private fun getDungeonsShowWhen(): Boolean = DungeonAPI.inDungeon() private fun getKuudraLines() = listOf( SbPattern.autoClosingPattern, -- cgit