From 8eac8a1a23221590d6bfb2a8ff918d9318661ef6 Mon Sep 17 00:00:00 2001 From: CalMWolfs <94038482+CalMWolfs@users.noreply.github.com> Date: Sat, 24 Feb 2024 10:10:42 +1100 Subject: Cleanup some repo pattern formatting. #1038 --- .../java/at/hannibal2/skyhanni/api/GetFromSackAPI.kt | 9 +++++---- .../skyhanni/features/inventory/DojoRankDisplay.kt | 5 ++++- .../skyhanni/features/inventory/QuiverNotification.kt | 6 ++++-- .../features/inventory/SkyblockGuideHighlightFeature.kt | 16 ++++++++-------- .../features/misc/RestorePieceOfWizardPortalLore.kt | 5 ++++- 5 files changed, 25 insertions(+), 16 deletions(-) (limited to 'src/main') diff --git a/src/main/java/at/hannibal2/skyhanni/api/GetFromSackAPI.kt b/src/main/java/at/hannibal2/skyhanni/api/GetFromSackAPI.kt index 575534400..58d03a32f 100644 --- a/src/main/java/at/hannibal2/skyhanni/api/GetFromSackAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/api/GetFromSackAPI.kt @@ -33,12 +33,13 @@ object GetFromSackAPI { val commands = arrayOf("gfs", "getfromsacks") val commandsWithSlash = commands.map { "/$it" } - private val fromSacksChatPattern by RepoPattern.pattern( - "gfs.chat.from", + private val patternGroup = RepoPattern.group("gfs.chat") + private val fromSacksChatPattern by patternGroup.pattern( + "from", "§aMoved §r§e(?\\d+) (?.+)§r§a from your Sacks to your inventory." ) - private val missingChatPattern by RepoPattern.pattern( - "gfs.chat.missing", + private val missingChatPattern by patternGroup.pattern( + "missing", "§cYou have no (?.+) in your Sacks!" ) diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/DojoRankDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/DojoRankDisplay.kt index ae987a2f9..6b4e8a064 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/DojoRankDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/DojoRankDisplay.kt @@ -22,7 +22,10 @@ class DojoRankDisplay { private val config get() = SkyHanniMod.feature.crimsonIsle private var display = emptyList() private val patternGroup = RepoPattern.group("inventory.dojo.rankdisplay") - private val testNamePattern by patternGroup.pattern("name", "(?§\\w)Test of (?.*)") + private val testNamePattern by patternGroup.pattern( + "name", + "(?§\\w)Test of (?.*)" + ) private val testRankPattern by patternGroup.pattern( "rank", "(?:§\\w)+Your Rank: (?§\\w.) §8\\((?\\d+)\\)" diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/QuiverNotification.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/QuiverNotification.kt index 40e51c226..d80ef783c 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/QuiverNotification.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/QuiverNotification.kt @@ -5,13 +5,15 @@ import at.hannibal2.skyhanni.data.TitleManager import at.hannibal2.skyhanni.events.LorenzChatEvent import at.hannibal2.skyhanni.utils.SoundUtils import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher -import at.hannibal2.skyhanni.utils.StringUtils.removeColor import at.hannibal2.skyhanni.utils.repopatterns.RepoPattern import net.minecraftforge.fml.common.eventhandler.SubscribeEvent import kotlin.time.Duration.Companion.seconds object QuiverNotification { - private val quiverChatPattern by RepoPattern.pattern("inventory.quiver.chat.low", "§cYou only have (?.*) arrows left in your Quiver!") + private val quiverChatPattern by RepoPattern.pattern( + "inventory.quiver.chat.low", + "§cYou only have (?.*) arrows left in your Quiver!" + ) @SubscribeEvent fun onChatMessage(event: LorenzChatEvent) { if (!SkyHanniMod.configManager.features.inventory.quiverAlert) return diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/SkyblockGuideHighlightFeature.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/SkyblockGuideHighlightFeature.kt index 4cbaf896e..3de2803dc 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/SkyblockGuideHighlightFeature.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/SkyblockGuideHighlightFeature.kt @@ -17,7 +17,7 @@ import at.hannibal2.skyhanni.utils.repopatterns.RepoPattern import net.minecraftforge.fml.common.eventhandler.SubscribeEvent import org.intellij.lang.annotations.Language -val group = RepoPattern.group("skyblockguide.highlight") +val patternGroup = RepoPattern.group("skyblockguide.highlight") private const val keyPrefixInventory = "inventory" private const val keyPrefixCondition = "condition" @@ -42,8 +42,8 @@ class SkyblockGuideHighlightFeature private constructor( onTooltip: (LorenzToolTipEvent) -> Unit = {}, ) : this( config, - group.pattern("$key.$keyPrefixInventory", inventory), - group.pattern("$key.$keyPrefixCondition", loreCondition), + patternGroup.pattern("$key.$keyPrefixInventory", inventory), + patternGroup.pattern("$key.$keyPrefixCondition", loreCondition), onSlotClicked, onTooltip ) @@ -55,7 +55,7 @@ class SkyblockGuideHighlightFeature private constructor( loreCondition: RepoPattern, onSlotClicked: (GuiContainerEvent.SlotClickEvent) -> Unit = {}, onTooltip: (LorenzToolTipEvent) -> Unit = {}, - ) : this(config, group.pattern("$key.$keyPrefixInventory", inventory), loreCondition, onSlotClicked, onTooltip) + ) : this(config, patternGroup.pattern("$key.$keyPrefixInventory", inventory), loreCondition, onSlotClicked, onTooltip) init { objectList.add(this) @@ -125,12 +125,12 @@ class SkyblockGuideHighlightFeature private constructor( } private val taskOnlyCompleteOncePattern = - group.pattern("$keyPrefixCondition.once", "§7§eThis task can only be completed once!") - private val xPattern = group.pattern("$keyPrefixCondition.x", "§c ?✖.*") + patternGroup.pattern("$keyPrefixCondition.once", "§7§eThis task can only be completed once!") + private val xPattern = patternGroup.pattern("$keyPrefixCondition.x", "§c ?✖.*") private val totalProgressPattern = - group.pattern("$keyPrefixCondition.total", "§7Total Progress: §3\\d{1,2}(?:\\.\\d)?%") + patternGroup.pattern("$keyPrefixCondition.total", "§7Total Progress: §3\\d{1,2}(?:\\.\\d)?%") private val categoryProgressPattern = - group.pattern("$keyPrefixCondition.category", "§7Progress to Complete Category: §6\\d{1,2}(?:\\.\\d)?%") + patternGroup.pattern("$keyPrefixCondition.category", "§7Progress to Complete Category: §6\\d{1,2}(?:\\.\\d)?%") private val openWikiOnClick: (GuiContainerEvent.SlotClickEvent) -> Unit = { event -> val internalName = event.item?.getInternalName() diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/RestorePieceOfWizardPortalLore.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/RestorePieceOfWizardPortalLore.kt index deedd7f98..7532c8afe 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/RestorePieceOfWizardPortalLore.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/RestorePieceOfWizardPortalLore.kt @@ -16,7 +16,10 @@ class RestorePieceOfWizardPortalLore { private val item by lazy { "WIZARD_PORTAL_MEMENTO".asInternalName() } - private val earnedPattern by RepoPattern.pattern("misc.restore.wizard.portal.earned", "§7Earned by:.*") + private val earnedPattern by RepoPattern.pattern( + "misc.restore.wizard.portal.earned", + "§7Earned by:.*" + ) @SubscribeEvent fun onTooltip(event: LorenzToolTipEvent) { -- cgit