Display current firemode on sidebar #55377
Merged
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
Interface "Display current firemode on sidebar"
Purpose of change
If you have gun with fireable gunmod (for example underslung shotgun) the sidebar would always show the name of the gun even when you were firing the gunmod.
Describe the solution
Show the active gunmod.
Cycling firemodes on M27 assault rifle with underslung shotgun:

Before:
After:

The name shown on the sidebar is now also a bit more cut down. For example the ammo name doesn't show up in it anymore (it usually doesn't fit in the narrow sidebar anyways). Things like rotten status and frozen status are also not shown anymore, probably they don't matter much in this context. Basically most things that were handled by
item::display_name()
are left out since that function is not used anymore.Describe alternatives you've considered
Testing
M27 assault rifle with and without underslung shotgun shows up fine.
A7 laser rifle with and without underslung shotgun shows up fine.
Additional context
weapon.gun_current_mode()->tname()
returns the name of the thing (for example "underslung shotgun").weapon.gun_current_mode().tname()
returns firemode of the thing (for example "semi-auto").That is pretty weird.