You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-- Not sure why "-" is replaced by "%-" ?! - So we can still match group names with a dash in them
261
264
-- reason is that the string is interpreted as a pattern and "-" is a special character then. For interpreting it as a string, fourth parameter needs to be set to true.
262
265
Pattern=Pattern:gsub("-", "%%-")
@@ -265,6 +268,16 @@ do -- SET_BASE
265
268
returncontain
266
269
end
267
270
271
+
---Set Regex Options for FilterPrefix function.
272
+
-- @param #SET_BASE self
273
+
-- @param #boolean NoRegex If true, switch off Regex pattern matching for FilterPrefixes.
274
+
-- @param #boolean ReplaceDash If false, switch off dash "-" replacement in strings for FilterPrefixes.
-- @param #boolean NoRegex If true, switch off Regex pattern matching for FilterPrefixes.
1218
+
-- @param #boolean ReplaceDash If false, switch off dash "-" replacement in strings for FilterPrefixes.
1219
+
-- @return #SET_GROUP self
1220
+
1221
+
--- Builds a set of objects of same coalitions.
1222
+
-- Possible current coalitions are red, blue and neutral.
1223
+
-- @function [parent=#SET_GROUP] FilterCoalitions
1224
+
-- @param #SET_GROUP self
1225
+
-- @param #string Coalitions Can take the following values: "red", "blue", "neutral" and coalition.side.RED, coalition.side.BLUE,coalition.side.NEUTRAL
1226
+
-- @param #boolean Clear If `true`, clear any previously defined filters.
1227
+
-- @return #SET_GROUP self
1228
+
1202
1229
end
1203
1230
1204
1231
--- Get a *new* set table that only contains alive groups.
@@ -2116,7 +2143,7 @@ do
2116
2143
ifself.Filter.GroupPrefixesandMGroupIncludethen
2117
2144
localMGroupPrefix=false
2118
2145
forGroupPrefixId, GroupPrefixinpairs(self.Filter.GroupPrefixes) do
2119
-
ifself:_SearchPattern(MGroup:GetName(), GroupPrefix, false, true) then
2146
+
ifself:_SearchPattern(MGroup:GetName(), GroupPrefix, self.filterNoRegex, self.filterReplaceDash) then
2120
2147
MGroupPrefix=true
2121
2148
end
2122
2149
end
@@ -2337,6 +2364,26 @@ do -- SET_UNIT
2337
2364
-- @param #SET_UNIT self
2338
2365
-- @return #SET_UNIT self
2339
2366
2367
+
--- Filter the set once
2368
+
-- @function [parent=#SET_UNIT] FilterOnce
2369
+
-- @param #SET_UNIT self
2370
+
-- @return #SET_UNIT self
2371
+
2372
+
---Set Regex Options for FilterPrefix function.
2373
+
-- @function [parent=#SET_UNIT] FilterSetRegex
2374
+
-- @param #SET_UNIT self
2375
+
-- @param #boolean NoRegex If true, switch off Regex pattern matching for FilterPrefixes.
2376
+
-- @param #boolean ReplaceDash If false, switch off dash "-" replacement in strings for FilterPrefixes.
2377
+
-- @return #SET_UNIT self
2378
+
2379
+
--- Builds a set of objects of same coalitions.
2380
+
-- Possible current coalitions are red, blue and neutral.
2381
+
-- @function [parent=#SET_UNIT] FilterCoalitions
2382
+
-- @param #SET_UNIT self
2383
+
-- @param #string Coalitions Can take the following values: "red", "blue", "neutral" and coalition.side.RED, coalition.side.BLUE,coalition.side.NEUTRAL
2384
+
-- @param #boolean Clear If `true`, clear any previously defined filters.
2385
+
-- @return #SET_UNIT self
2386
+
2340
2387
returnself
2341
2388
end
2342
2389
@@ -3348,7 +3395,7 @@ do -- SET_UNIT
3348
3395
ifself.Filter.UnitPrefixesandMUnitIncludethen
3349
3396
localMUnitPrefix=false
3350
3397
forUnitPrefixId, UnitPrefixinpairs(self.Filter.UnitPrefixes) do
3351
-
ifself:_SearchPattern(MUnit:GetName(), UnitPrefix, false, true) then
3398
+
ifself:_SearchPattern(MUnit:GetName(), UnitPrefix, self.filterNoRegex, self.filterReplaceDash) then
-- @param #string Coalitions Can take the following values: "red", "blue", "neutral" and coalition.side.RED, coalition.side.BLUE,coalition.side.NEUTRAL
3612
+
-- @param #boolean Clear If `true`, clear any previously defined filters.
3613
+
-- @return #SET_STATIC self
3614
+
3548
3615
returnself
3549
3616
end
3550
3617
@@ -4119,7 +4186,7 @@ do -- SET_STATIC
4119
4186
ifself.Filter.StaticPrefixesthen
4120
4187
localMStaticPrefix=false
4121
4188
forStaticPrefixId, StaticPrefixinpairs(self.Filter.StaticPrefixes) do
4122
-
ifself:_SearchPattern(MStatic:GetName(), StaticPrefix, false, true) then
4189
+
ifself:_SearchPattern(MStatic:GetName(), StaticPrefix, self.filterNoRegex, self.filterReplaceDash) then
-- @param #string Coalitions Can take the following values: "red", "blue", "neutral" and coalition.side.RED, coalition.side.BLUE,coalition.side.NEUTRAL
4391
+
-- @param #boolean Clear If `true`, clear any previously defined filters.
4392
+
-- @return #SET_CLIENT self
4393
+
4307
4394
returnself
4308
4395
end
4309
4396
@@ -4902,7 +4989,7 @@ do -- SET_CLIENT
4902
4989
ifself.Filter.ClientPrefixesandMClientIncludethen
4903
4990
localMClientPrefix=false
4904
4991
forClientPrefixId, ClientPrefixinpairs(self.Filter.ClientPrefixes) do
4905
-
ifself:_SearchPattern(MClient.UnitName, ClientPrefix) then
4992
+
ifself:_SearchPattern(MClient.UnitName, ClientPrefix, self.filterNoRegex, self.filterReplaceDash) then
0 commit comments