-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Add weapon ammo to the weapon name #36474
Conversation
I'd much prefer this being behind an option. There's a lot more text in the list with this and that makes it harder for me to find what I want at a glance. |
This will be highly confusing and will cause all sorts of "Why does it shows X ammo when I loaded it with Y ammo?" questions. I'd prefer it showing the actual ammo loaded, and default ammo only when the gun is unloaded. |
I am trying to make it show the current ammo if any is loaded. There is some strange behaviour that I do not understand at all.
This works only if the weapon/magazine are loaded with certain types of ammo. For example it works with "9x19mm JHP" but not with "9x19mm +P+". It gives this kind of error:
I have a feeling that I am doing something completely wrong and this shouldn't work at all. |
The above was probably because the itype_id of the ammo was same as its ammotype. So the code just acted as if the itype_id was ammotype and worked. Got something working. But I have a feeling this is a bad way to do this.
As far as I understand this gets the itype_id of currently loaded ammo, creates item from that itype_id, gets the ammotype of the created item and then gets the name of that ammotype. The has to be a way to get the ammotype from a itype_id without creating an item. |
I think this is pretty much ready. |
Co-Authored-By: anothersimulacrum <[email protected]>
Summary
SUMMARY: Features "Add weapon ammo to weapon name"
Purpose of change
Quick quiz: What kind of ammo does RM216 SPIW use?
The game has so many guns, many of them are exotic or fictional with very non descriptive name. Having to check the item info to see what ammo they use is tiresome.
The solution is to add the used ammo to the weapon name.
Describe the solution
The default ammo is added to after the ammo count. If the weapon has no ammo count (no magazine) then the ammo is just at the end of the name.
Same is done to magazines. They will also have the ammo names on their name.
If the weapon/magazine is loaded with ammo then the type of the loaded ammo is used.
UPS usage is not added to the name.
The feature can be disabled/enabled in options. "Add ammo to weapon names" option in interface settings. Default enabled.
Screenshot:
Describe alternatives you've considered
The ammo is not technically in the name of the imtem. So you can not search for it.
I considered placing the ammo in the name properly but that would push the ammo count off screen and that would not be even worse.
Testing
It doesn't seem to crash.
It works on weapons that have had their ammo type changed by a gun mod.
Additional context