-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make item pockets smarter #54812
Merged
Merged
Make item pockets smarter #54812
Conversation
This file contains 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
github-actions
bot
added
json-styled
JSON lint passed, label assigned by github actions
astyled
astyled PR, label is assigned by github actions
labels
Jan 26, 2022
NetSysFire
added
<Enhancement / Feature>
New features, or enhancements on existing
[C++]
Changes (can be) made in C++. Previously named `Code`
Items: Containers
Things that hold other things
labels
Jan 26, 2022
BrettDong
reviewed
Jan 27, 2022
BrettDong
reviewed
Jan 27, 2022
matshou
force-pushed
the
feat/pocket-fav
branch
from
January 27, 2022 18:04
fc475ff
to
3a62df0
Compare
github-actions
bot
added
the
BasicBuildPassed
This PR builds correctly, label assigned by github actions
label
Jan 27, 2022
Player should be able to mix whitelist and blacklist rules without having to choose only one mode of filtering.
matshou
force-pushed
the
feat/pocket-fav
branch
from
January 29, 2022 10:10
3a62df0
to
13706ac
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
astyled
astyled PR, label is assigned by github actions
BasicBuildPassed
This PR builds correctly, label assigned by github actions
[C++]
Changes (can be) made in C++. Previously named `Code`
<Enhancement / Feature>
New features, or enhancements on existing
Items: Containers
Things that hold other things
json-styled
JSON lint passed, label assigned by github actions
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.
Summary
Features "Made item pockets smarter"
Purpose of change
I was always bothered by the fact that pocket autopickup rules did not apply to container content. The inability of pockets to look inside containers when deciding whether an item can be stored inside makes the pocket autopickup feature much less useful.
I was also never happy with how the filtering system was limited to either using rules defined in whitelist or blacklist without being able to use both. Currently the most advanced way to filter is to either whitelist items and blacklist categories or the other way around. However without consideration for container content there is no need to expand the filtering functionality.
Resolves #54104
Describe the solution
This feature makes pocket smarter by making the pocket autopickup system recognize container content. Similar to the system being introduced with #54408 pockets will now factor in item content when deciding whether an item can be stored in them.
In addition to this, pocket favorite settings now allow mixed whitelist and blacklist rules for both items and categories. This means that players can include different items in whitelist and blacklist at the same time. Previously they had to choose whether they want to filter items with the use of a whitelist or blacklist.
The new system allows players to express: "In this pocket I only want these items and I also do not want to see any of these items". That second part might seem superfluous, however containers are now allowed to enter a pocket without expressly being included in the whitelist (even when the whitelist has been defined) as long as it's content is accepted by pocket autopickup settings. Now we can use the blacklist to filter containers and the whitelist to filter items.
Describe alternatives you've considered
No alternatives considered.
Testing
Unit tested with 118 assertions in 2 test cases.
Click on this line to reveal in-game test information.
Pocket 1:
Pocket 2:
Pocket 3:
Picking up the following items from the ground:
small cardboard box
small cardboard box
Contents of rucksack pockets after picking up items from the ground:
Pocket 1:
Pocket 2:
Pocket 3:
Additional context
Click on this line to reveal short in-game test videos.
cataclysm-tiles_LwyrHwK28x.mp4
cataclysm-tiles_B1N9445NlE.mp4
cataclysm-tiles_1TCCFOPnNW.mp4