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

Display name of loaded ammo instead of ammo type #51439

Merged
merged 1 commit into from
Sep 6, 2021

Conversation

eltank
Copy link
Contributor

@eltank eltank commented Sep 6, 2021

Summary

Interface "Display name of loaded ammo instead of ammo type"

Purpose of change

Magazines and guns loaded with different ammo variants are indistinguishable from each other in the inventory screen. The suffix displayed after the gun/magazine name shows the amount of ammo loaded but instead of ammo name it shows ammo type. This PR changes the suffix to show actual ammo loaded when there is ammo.

Describe the solution

Change item::display_name. When there is ammo loaded, use the name of the ammo as ammotext. Otherwise compute it as before.

Describe alternatives you've considered

Testing

Spawn a bunch off different weapons, magazines and ammo variants. Load magazines with different ammo variants.

Before:
image

After:
image

Additional context

The display of ammo type was introduced in #36474. The author did intend to show ammo loaded, but it didn't work, likely due to some problems with the ammo infrastructure, which seems to be working better now. Or maybe it did work at the time, but some later refactoring broke it?

I am trying to make it show the current ammo if any is loaded

@actual-nh actual-nh added <Enhancement / Feature> New features, or enhancements on existing [C++] Changes (can be) made in C++. Previously named `Code` Info / User Interface Game - player communication, menus, etc. Items: Ammo / Guns Ammunition for all kinds of weapons and these weapons themselves Quality of Life QoL: degree to which players are comfortable, and able to enjoy CDDA labels Sep 6, 2021
@esotericist esotericist self-requested a review September 6, 2021 22:40
Copy link
Contributor

@esotericist esotericist left a comment

Choose a reason for hiding this comment

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

works as described.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[C++] Changes (can be) made in C++. Previously named `Code` <Enhancement / Feature> New features, or enhancements on existing Info / User Interface Game - player communication, menus, etc. Items: Ammo / Guns Ammunition for all kinds of weapons and these weapons themselves Quality of Life QoL: degree to which players are comfortable, and able to enjoy CDDA
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants