Skip to content

Commit

Permalink
Add option to highlight dungeon perm/vc parties (hannibal002#803)
Browse files Browse the repository at this point in the history
Add option to highlight dungeon perm/vc parties. hannibal002#803
  • Loading branch information
brandonwamboldt authored Dec 15, 2023
1 parent 8455628 commit c37a73f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ public class PartyFinderConfig {
@FeatureToggle
public boolean markPaidCarries = true;

@Expose
@ConfigOption(name = "Mark Perm/VC Parties", desc = "Highlight perm parties and parties that require a VC with a purple background to make them easier to find/skip.")
@ConfigEditorBoolean
@FeatureToggle
public boolean markNonPugs = true;

@Expose
@ConfigOption(name = "Mark Low Levels", desc = "Highlight groups with players at or below the specified class level to make them easier to find/skip.")
@ConfigEditorSlider(minValue = 0, maxValue = 50, minStep = 1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class DungeonFinderFeatures {

private val pricePattern = "([0-9]{2,3}K|[0-9]{1,3}M|[0-9]+\\.[0-9]M|[0-9] ?mil)".toRegex(RegexOption.IGNORE_CASE)
private val carryPattern = "(carry|cary|carries|caries|comp|to cata [0-9]{2})".toRegex(RegexOption.IGNORE_CASE)
private val nonPugPattern = "(perm|vc|discord)".toRegex(RegexOption.IGNORE_CASE)
private val memberPattern = "^ §.*?§.: §.([A-Z]+)§. \\(§.([0-9]+)§.\\)".toRegex(RegexOption.IGNORE_CASE)
private val ineligiblePattern =
"^§c(Requires .*$|You don't meet the requirement!|Complete previous floor first!$)".toRegex()
Expand Down Expand Up @@ -120,6 +121,15 @@ class DungeonFinderFeatures {
}
}

if (config.markNonPugs) {
val note = slot.stack.getLore().filter { notePattern.containsMatchIn(it) }.joinToString(" ")

if (nonPugPattern.containsMatchIn(note)) {
slot highlight LorenzColor.LIGHT_PURPLE
continue
}
}

val members = slot.stack.getLore().filter { memberPattern.matches(it) }
val memberLevels = members.map { memberPattern.matchEntire(it)?.groupValues?.get(2)?.toInt() ?: 0 }
val memberClasses = members.map { memberPattern.matchEntire(it)?.groupValues?.get(1) ?: "" }
Expand Down

0 comments on commit c37a73f

Please sign in to comment.