Fix Excluded By Rarity to work with new Dynamic Rarity changes#2489
Open
trunksbomb wants to merge 3 commits intoRocketMap:developfrom
Open
Fix Excluded By Rarity to work with new Dynamic Rarity changes#2489trunksbomb wants to merge 3 commits intoRocketMap:developfrom
trunksbomb wants to merge 3 commits intoRocketMap:developfrom
Conversation
sebastienvercammen
requested changes
Feb 27, 2018
Member
sebastienvercammen
left a comment
There was a problem hiding this comment.
Failing Travis.
/home/travis/build/RocketMap/RocketMap/static/js/map.js
2844:29 error 'pokemonRarities' is not defined no-undef
2845:32 error 'pokemonRarities' is not defined no-undef
2846:50 error 'pokemonRarities' is not defined no-undef
2850:13 error Closing curly brace does not appear on the same line as the subsequent block brace-style
…m to excludedPokemonByRarity excludedPokemon is now used as a global list of excluded Pokemon, made up of any number of individual exclusion lists (rarity and hidden, for now) In accordance with the above two points, refactored all code that controls excluding Pokemon, including adding new functions to help add/remove from list Fixes Issue RocketMap#2470 Signed-off-by: trunksbomb <[email protected]>
Still says a curly bracket at line 2850 doesn't end on the same block, but it does. Also that pokemonRarities isn't defined, but it is, just in map.common.js Signed-off-by: trunksbomb <[email protected]>
efb3916 to
58092b2
Compare
Member
|
Author is unresponsive, so I rebased and pushed a fix for Travis. Note: this doesn't serve as my review or approval. |
Alderon86
approved these changes
Mar 7, 2018
Contributor
Alderon86
left a comment
There was a problem hiding this comment.
Working like it should.
Set rarity update to 1 minute and it execluded the updated mons like it should do. 👍
fosJoddie
approved these changes
Mar 9, 2018
Contributor
fosJoddie
left a comment
There was a problem hiding this comment.
Looks to do the job to me, I can mix exclude by rarity and exclude by pokemon filter
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
excludedPokemon is now used as a global list of excluded Pokemon, made up of any number of individual exclusion lists (rarity and hidden, for now)
In accordance with the above two points, refactored all code that controls excluding Pokemon, including adding new functions to help add/remove from list
Fixes Issue #2470
Description
Exclude By Rarity was introduced prior to the Dynamic Rarities change, which changed the way the excluded Pokemon list was sent to the server. This change broke Exclude By Rarity as described in Issue #2470 because the excluded Pokemon by rarity were not sent to the server and so the server sent back the entire list of nearby Pokemon.
Additionally, this PR sets the stage for additional exclusion lists to be easily implemented (such as by generation, or by weather boosted, etc).
Motivation and Context
Fixes issue #2470
New functions abstract excluding/including away from the main logic of decided what to exclude/include.
Moving forward, it should be easier to integrate new exclusion lists.
How Has This Been Tested?
Tested on my live city map. Can switch between all rarity tiers reliably (although reducing the rarity filter doesn't repopulate quickly, moving the map will cause an update to reinclude Pokemon) and exclude/include individual Pokemon.
Map still loads all visible Pokemon on initial load, which can be a lot if clustering is disabled, because the first fetch request goes out before the rarity filter is processed.
Screenshots (if appropriate):
Types of changes
Checklist: