Add NO_DISPLAY vitamin flag, show non-nutritional vitamins as 'Other contents' in food information menu #35942
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
SUMMARY: Infrastructure "Add vitamin flags"
Purpose of change
Addresses #35917 (comment)
I was in the area, and saw that it would be easy to add a
NO_DISPLAY
flag, and thought that would be beneficial for the protein barsbad_food
counter vitamin.Describe the solution
Add a
flags_
member to vitamins, of typestd::set<std::string>
.Add a
has_flag
function to vitamins, which searches that set, and looks for the flag argument passed to it.Add code to load flags from JSON into this set.
Add
FOOD_VIT_EFFECTS
iteminfo_part, which displays nonVITAMIN
type vitamins asOther contents
Also add a check when populating the string that will be output for both of those, and don't add vitamins with the flag
NO_DISPLAY
.Describe alternatives you've considered
Converting vitamins to use generic factory, but I decided that would be a bit out of scope.
Testing