diff options
author | Lorenz <ESs95s3P5z8Pheb> | 2022-07-15 22:24:21 +0200 |
---|---|---|
committer | Lorenz <ESs95s3P5z8Pheb> | 2022-07-15 22:24:21 +0200 |
commit | 4da572a66c5e8a9fc3b49621fc08141e1f669b8f (patch) | |
tree | 23cf94ae589f25fd8e3f126ed475d7468bd325f3 /src/main/java/at/hannibal2/skyhanni/utils | |
parent | e8f5def579ab921a95a918e6f3e8b1ec47ceb0da (diff) | |
download | skyhanni-4da572a66c5e8a9fc3b49621fc08141e1f669b8f.tar.gz skyhanni-4da572a66c5e8a9fc3b49621fc08141e1f669b8f.tar.bz2 skyhanni-4da572a66c5e8a9fc3b49621fc08141e1f669b8f.zip |
add hide player trade to repo
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/utils')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/utils/MultiFilter.kt | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/MultiFilter.kt b/src/main/java/at/hannibal2/skyhanni/utils/MultiFilter.kt index 39b2a012e..5786cb9e7 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/MultiFilter.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/MultiFilter.kt @@ -7,15 +7,18 @@ class MultiFilter { val equals = mutableListOf<String>() val startsWith = mutableListOf<String>() val endsWith = mutableListOf<String>() + val contains = mutableListOf<String>() fun load(hideNpcSell: JsonObject) { equals.clear() startsWith.clear() endsWith.clear() + contains.clear() fill(hideNpcSell, "equals", equals) fill(hideNpcSell, "startsWith", startsWith) fill(hideNpcSell, "endsWith", endsWith) + fill(hideNpcSell, "contains", contains) } private fun fill(jsonObject: JsonObject, key: String, list: MutableList<String>) { @@ -26,9 +29,9 @@ class MultiFilter { fun match(name: String): Boolean { if (equals.contains(name)) return true - if (startsWith.any { name.startsWith(it) }) return true if (endsWith.any { name.endsWith(it) }) return true + if (contains.any { name.contains(it) }) return true return false } |