diff --git a/README.MD b/README.MD index 7a5f31c..4cfbe4b 100644 --- a/README.MD +++ b/README.MD @@ -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. diff --git a/mapvote.js b/mapvote.js index 751496a..9d436be 100644 --- a/mapvote.js +++ b/mapvote.js @@ -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++) {