Gem Selection Improvements#9786
Open
Peechey wants to merge 2 commits intoPathOfBuildingCommunity:devfrom
Open
Conversation
…ean up imbued after fully backspacing
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.
Description of the problem being solved:
Fixing up the GemSelects to process only when the buffer matches a gem name rather than always running the code for the gem at index 1 in the search list for every single change to the buf. The gem will only be added if you: 1) click the gem 2) type the name out entirely or 3) use the arrows to select one from the list. If you have a gem and then backspace, we would now only run the cycle once to remove the gem as it doesn't match anymore. Simple rule is one cycle per match, not one cycle per changeFunc/buf change.
I would like to do this for the other GemSelects but the changeFunction and structure of those are not the same and it's proving difficult.Update 1: I've got it working for the slotGemSelects. Adding a before and after to show we are calling the buildFlag less often. The behavior is not exactly 1:1 between Imbued and Slot because the gemChangeFuncs are quite different. The main one I can think of is for imbued if you have a valid gem and backspace a character/make it an invalid name it will immediately process and remove the imbued. However, for the SlotGems it won't process with an invalid gem name until you click away from the dropdown. With the SlotGems, processing an invalid name means delete the gemInstance and I don't necessarily want to do that the moment the gem name doesn't match anymore.
Steps taken to verify a working solution:
There are a couple different states to keep in mind:
Link to a build that showcases this PR:
imbued before
imbued after
buildFlag calls for slotGemSelect before
buildFlag calls for slotGemSelect after