feat: Show item kill count in the examine item menu, make the menu option red #5511
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.
Checklist
Required
main
so it won't cause conflict when updatingmain
branch later.Optional
Purpose of change
UI improvement for the kill counter added in #5394. @RoyalFox2140 asked me to recolor the Kills button in the examine item menu to make it a bit more visible. While looking through the menu code, I also figured out a way to add a kill counter in the menu, which I'd wanted to have since the beginning.
Describe the solution
The Kills menu option was given its own hint color (red). The
add_entry()
function inexamine_item_menu.cpp
was modified to optionally print a number in addition to menu text.Describe alternatives you've considered
I think dark red has the appropriate connotations of violence, but changing the color is easy if someone has a better idea. Light red is already used in the menu in a different context, but yellow for example might work.
Thought about adding a new
add_entry_with_number
function instead of overloading the existing one, but that would have meant copypasting the whole thing.Testing
Loaded save with items with recorded kills. Menu option appears correctly. Menu option does not appear for items with no kills. Counted list entries to double check number is correct.
Additional context
Before:
After: