added apply blacklist to whitelist option

This commit is contained in:
Davide Fantino 2022-10-20 23:41:43 +02:00
parent c8370673d5
commit 9c753932aa
2 changed files with 17 additions and 1 deletions

View File

@ -98,6 +98,13 @@ The random layer list will NOT include the blacklisted layers or levels. (accept
```
[]
```
#### applyBlacklistToWhitelist
###### Description
If set to true the blacklisted layers will be filtered out also in whitelist mode.
###### Default
```json
true
```
#### hideVotesCount
###### Description
Hides the number of votes a layer received in broadcast message.

View File

@ -80,6 +80,11 @@ export default class MapVote extends DiscordBasePlugin {
description: 'random layer list will not include the blacklisted layers or levels. (acceptable formats: Gorodok/Gorodok_RAAS/Gorodok_AAS_v1)',
default: []
},
applyBlacklistToWhitelist: {
required: false,
description: 'if set to true the blacklisted layers won\'t be included also in whitelist mode',
default: true
},
hideVotesCount: {
required: false,
description: 'hides the number of votes a layer received in broadcast message',
@ -465,7 +470,11 @@ export default class MapVote extends DiscordBasePlugin {
![ this.server.currentLayer ? this.server.currentLayer.map.name : null, ...recentlyPlayedMaps ].includes(l.map.name) &&
(
(this.options.layerFilteringMode.toLowerCase() == "blacklist" && !this.options.layerLevelBlacklist.find((fl) => l.layerid.toLowerCase().startsWith(fl.toLowerCase()))) ||
(this.options.layerFilteringMode.toLowerCase() == "whitelist" && this.options.layerLevelWhitelist.find((fl) => l.layerid.toLowerCase().startsWith(fl.toLowerCase())))
(
this.options.layerFilteringMode.toLowerCase() == "whitelist"
&& this.options.layerLevelWhitelist.find((fl) => l.layerid.toLowerCase().startsWith(fl.toLowerCase()))
&& !(this.options.applyBlacklistToWhitelist && this.options.layerLevelBlacklist.find((fl) => l.layerid.toLowerCase().startsWith(fl.toLowerCase())))
)
)
);
for (let i = 1; i <= maxOptions; i++) {