aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal002@users.noreply.github.com>2024-09-07 07:29:48 +0200
committerGitHub <noreply@github.com>2024-09-07 07:29:48 +0200
commit36325afea7f476b18f18b19ef70d742f57c88cc6 (patch)
treece02988f13e47cca92b94d6e2d582015875974a4 /src/main/java/at/hannibal2/skyhanni
parent02c9ce15e053d5d0751c32ea3ef481c9eef7a904 (diff)
downloadskyhanni-36325afea7f476b18f18b19ef70d742f57c88cc6.tar.gz
skyhanni-36325afea7f476b18f18b19ef70d742f57c88cc6.tar.bz2
skyhanni-36325afea7f476b18f18b19ef70d742f57c88cc6.zip
Fix: Mod Compatilibty issues in Party Finder (#2470)
Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonFinderFeatures.kt68
1 files changed, 34 insertions, 34 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonFinderFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonFinderFeatures.kt
index fcaddf487..508296d49 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonFinderFeatures.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonFinderFeatures.kt
@@ -31,31 +31,31 @@ object DungeonFinderFeatures {
private val patternGroup = RepoPattern.group("dungeon.finder")
private val pricePattern by patternGroup.pattern(
"price",
- "(?i).*([0-9]{2,3}K|[0-9]{1,3}M|[0-9]+\\.[0-9]M|[0-9] ?MIL).*"
+ "(?i).*([0-9]{2,3}K|[0-9]{1,3}M|[0-9]+\\.[0-9]M|[0-9] ?MIL).*",
)
private val carryPattern by patternGroup.pattern(
"carry",
- "(?i).*(CARRY|CARY|CARRIES|CARIES|COMP|TO CATA [0-9]{2}).*"
+ "(?i).*(CARRY|CARY|CARRIES|CARIES|COMP|TO CATA [0-9]{2}).*",
)
private val nonPugPattern by patternGroup.pattern(
"nonpug",
- "(?i).*(PERM|VC|DISCORD).*"
+ "(?i).*(PERM|VC|DISCORD).*",
)
private val memberPattern by patternGroup.pattern(
"member",
- ".*§.(?<playerName>.*)§f: §e(?<className>.*)§b \\(§e(?<level>.*)§b\\)"
+ ".*§.(?<playerName>.*)§f: §e(?<className>.*)§b \\(§e(?<level>.*)§b\\)",
)
private val ineligiblePattern by patternGroup.pattern(
"ineligible",
- "§c(Requires .*$|You don't meet the requirement!|Complete previous floor first!$)"
+ "§c(Requires .*$|You don't meet the requirement!|Complete previous floor first!$)",
)
private val classLevelPattern by patternGroup.pattern(
"class.level",
- " §.(?<playerName>.*)§f: §e(?<className>.*)§b \\(§e(?<level>.*)§b\\)"
+ " §.(?<playerName>.*)§f: §e(?<className>.*)§b \\(§e(?<level>.*)§b\\)",
)
private val notePattern by patternGroup.pattern(
"note",
- "§7§7Note: §f(?<note>.*)"
+ "§7§7Note: §f(?<note>.*)",
)
/**
@@ -68,27 +68,27 @@ object DungeonFinderFeatures {
)
private val checkIfPartyPattern by patternGroup.pattern(
"check.if.party",
- ".*('s Party)"
+ ".*('s Party)",
)
private val partyFinderTitlePattern by patternGroup.pattern(
"party.finder.title",
- "(Party Finder)"
+ "(Party Finder)",
)
private val catacombsGatePattern by patternGroup.pattern(
"catacombs.gate",
- "(Catacombs Gate)"
+ "(Catacombs Gate)",
)
private val selectFloorPattern by patternGroup.pattern(
"select.floor",
- "(Select Floor)"
+ "(Select Floor)",
)
private val entranceFloorPattern by patternGroup.pattern(
"entrance",
- "(.*Entrance)"
+ "(.*Entrance)",
)
private val floorPattern by patternGroup.pattern(
"floor",
- "(Floor .*)"
+ "(Floor .*)",
)
private val anyFloorPattern by patternGroup.pattern(
"floor.any",
@@ -101,27 +101,27 @@ object DungeonFinderFeatures {
*/
private val masterModeFloorPattern by patternGroup.pattern(
"floor.mastermode",
- "(MM|.*Master Mode) The Catacombs.*"
+ "(MM|.*Master Mode) The Catacombs.*",
)
private val dungeonFloorPattern by patternGroup.pattern(
"floor.dungeon",
- "(Dungeon: .*)"
+ "(Dungeon: .*)",
)
private val floorFloorPattern by patternGroup.pattern(
"floor.pattern",
- "(Floor: .*)"
+ "(Floor: .*)",
)
private val floorNumberPattern by patternGroup.pattern(
"floor.number",
- ".* (?<floorNum>[IV\\d]+)"
+ ".* (?<floorNum>[IV\\d]+)",
)
private val getDungeonClassPattern by patternGroup.pattern(
"get.dungeon.class",
- ".* (?<class>.*)"
+ ".* (?<class>.*)",
)
private val detectDungeonClassPattern by patternGroup.pattern(
"detect.dungeon.class",
- "§7View and select a dungeon class."
+ "§7View and select a dungeon class.",
)
private val allowedSlots = (10..34).filter { it !in listOf(17, 18, 26, 27) }
@@ -205,14 +205,13 @@ object DungeonFinderFeatures {
}
}
- private fun getFloorName(floor: String, dungeon: String, floorNum: Int?): String =
- if (entranceFloorPattern.matches(floor)) {
- "E"
- } else if (masterModeFloorPattern.matches(dungeon)) {
- "M$floorNum"
- } else {
- "F$floorNum"
- }
+ private fun getFloorName(floor: String, dungeon: String, floorNum: Int?): String = if (entranceFloorPattern.matches(floor)) {
+ "E"
+ } else if (masterModeFloorPattern.matches(dungeon)) {
+ "M$floorNum"
+ } else {
+ "F$floorNum"
+ }
private fun highlightingHandler(event: InventoryOpenEvent): Map<Int, LorenzColor> {
val map = mutableMapOf<Int, LorenzColor>()
@@ -307,6 +306,10 @@ object DungeonFinderFeatures {
fun onTooltip(event: LorenzToolTipEvent) {
if (!isEnabled()) return
if (!inInventory) return
+
+ val featureActive = config.let { it.coloredClassLevel || it.showMissingClasses }
+ if (!featureActive) return
+
val toolTip = toolTipMap[event.slot.slotNumber]
if (toolTip.isNullOrEmpty()) return
// TODO @Thunderblade73 fix that to "event.toolTip = toolTip"
@@ -326,8 +329,7 @@ object DungeonFinderFeatures {
if (!config.floorAsStackSize) return
val slot = event.slot
if (slot.slotNumber != slot.slotIndex) return
- event.stackTip = (floorStackSize[slot.slotIndex]
- ?.takeIf { it.isNotEmpty() } ?: return)
+ event.stackTip = (floorStackSize[slot.slotIndex]?.takeIf { it.isNotEmpty() } ?: return)
}
@SubscribeEvent
@@ -335,11 +337,9 @@ object DungeonFinderFeatures {
if (!isEnabled()) return
if (!inInventory) return
- event.gui.inventorySlots.inventorySlots
- .associateWith { highlightParty[it.slotNumber] }
- .forEach { (slot, color) ->
- color?.let { slot.highlight(it) }
- }
+ event.gui.inventorySlots.inventorySlots.associateWith { highlightParty[it.slotNumber] }.forEach { (slot, color) ->
+ color?.let { slot.highlight(it) }
+ }
}
@SubscribeEvent