package at.hannibal2.skyhanni.data.model import at.hannibal2.skyhanni.events.RepositoryReloadEvent import at.hannibal2.skyhanni.events.TabListUpdateEvent import at.hannibal2.skyhanni.events.WidgetUpdateEvent import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule import at.hannibal2.skyhanni.utils.CollectionUtils.editCopy import at.hannibal2.skyhanni.utils.CollectionUtils.getOrNull import at.hannibal2.skyhanni.utils.ConditionalUtils.transformIf import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.RegexUtils.matchMatcher import at.hannibal2.skyhanni.utils.RegexUtils.matches import at.hannibal2.skyhanni.utils.repopatterns.RepoPattern import net.minecraftforge.fml.common.eventhandler.EventPriority import net.minecraftforge.fml.common.eventhandler.SubscribeEvent import java.util.regex.Matcher import java.util.regex.Pattern private val repoGroup by RepoPattern.exclusiveGroup("tab.widget.enum") /** * This class defines various widgets within the tab list, specifically focusing on the reading of the values. * Each enum value corresponds to a distinct widget in the tab list, ensuring no overlap between them. * The general info widget is broken up into multiple smaller ones. * The class facilitates access to the lines associated with each widget and triggers events when a widget undergoes changes or becomes invisible. */ enum class TabWidget( pattern0: String, ) { PLAYER_LIST( // language=RegExp "(?:§.)*Players (?:§.)*\\(\\d+\\)" ), /** This line holds no information, only here because every widget must be present */ INFO( // language=RegExp "(?:§.)*Info" ), AREA( // language=RegExp "(?:§.)*(Area|Dungeon): (?:§.)*(?.*)" ), SERVER( // language=RegExp "Server: (?:§.)*(?.*)" ), GEMS( // language=RegExp "Gems: (?:§.)*(?.*)" ), FAIRY_SOULS( // language=RegExp "Fairy Souls: (?:§.)*(?\\d+)(?:§.)*\\/(?:§.)*(?\\d+)" ), PROFILE( // language=RegExp "(?:§.)*Profile: (?:§.)*(?\\S+).*" ), SB_LEVEL( // language=RegExp "SB Level(?:§.)*: (?:§.)*\\[(?:§.)*(?\\d+)(?:§.)*\\] (?:§.)*(?\\d+).*" ), BANK( // language=RegExp "Bank: (?:§.)*(?[^§]+)(?:(?:§.)* \\/ (?:§.)*(?.*))?" ), INTEREST( // language=RegExp "Interest: (?:§.)*(?