Skip to content
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

feat: Show item kill count in the examine item menu, make the menu option red #5511

Merged
merged 3 commits into from
Oct 5, 2024

Conversation

Soadreqm
Copy link
Contributor

@Soadreqm Soadreqm commented Oct 5, 2024

Checklist

Required

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 in examine_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:
cata-2024-10-05-09-59-53

After:
cata-2024-10-05-11-10-57

@github-actions github-actions bot added the src changes related to source code. label Oct 5, 2024
RoyalFox2140
RoyalFox2140 previously approved these changes Oct 5, 2024
Copy link
Collaborator

@RoyalFox2140 RoyalFox2140 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it looks good and the new hint rating is a good color.

@chaosvolt
Copy link
Member

chaosvolt commented Oct 5, 2024

Error: /home/runner/work/Cataclysm-BN/Cataclysm-BN/src/examine_item_menu.cpp:415:17: error: enumeration value 'blood' not handled in switch [clang-diagnostic-switch,-warnings-as-errors]
        switch( rate_action_reload( you, *mod ) ) {
                ^

o.O

EDIT: Heh, commit to fix that was made pretty much right as I commented on it, nice.

@chaosvolt chaosvolt merged commit 0d3b37f into cataclysmbnteam:main Oct 5, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
src changes related to source code.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants